code stringlengths 1 1.72M | language stringclasses 1 value |
|---|---|
from header_factions import *
####################################################################################################################
# Each faction record contains the following fields:
# 1) Faction id: used for referencing factions in other files.
# The prefix fac_ is automatically added before each faction id.
# 2) Faction name.
# 3) Faction flags. See header_factions.py for a list of available flags
# 4) Faction coherence. Relation between members of this faction.
# 5) Relations. This is a list of relation records.
# Each relation record is a tuple that contains the following fields:
# 5.1) Faction. Which other faction this relation is referring to
# 5.2) Value: Relation value between the two factions.
# Values range between -1 and 1.
# 6) Ranks
# 7) Faction color (default is gray)
####################################################################################################################
default_kingdom_relations = [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.05),("mountain_bandits", -0.02),("forest_bandits", -0.02)]
factions = [
("no_faction","No Faction",0, 0.9, [], []),
("commoners","Commoners",0, 0.1,[("player_faction",0.1)], []),
("outlaws","Outlaws", max_player_rating(-30), 0.5,[("commoners",-0.6),("player_faction",-0.15)], [], 0x888888),
# Factions before this point are hardwired into the game end their order should not be changed.
("neutral","Neutral",0, 0.1,[("player_faction",0.0)], [],0xFFFFFF),
("innocents","Innocents", ff_always_hide_label, 0.5,[("outlaws",-0.05)], []),
("merchants","Merchants", ff_always_hide_label, 0.5,[("outlaws",-0.5),], []),
("dark_knights","Dark Knights", 0, 0.5,[("innocents",-0.9),("player_faction",-0.4)], []),
("culture_1", "culture_1", 0, 0.9, [], []),
("culture_2", "culture_2", 0, 0.9, [], []),
("culture_3", "culture_3", 0, 0.9, [], []),
("culture_4", "culture_4", 0, 0.9, [], []),
("culture_5", "culture_5", 0, 0.9, [], []),
# ("swadian_caravans","Swadian Caravans", 0, 0.5,[("outlaws",-0.8), ("dark_knights",-0.2)], []),
# ("vaegir_caravans","Vaegir Caravans", 0, 0.5,[("outlaws",-0.8), ("dark_knights",-0.2)], []),
("player_faction","Player Faction",0, 0.9, [], []),
("player_supporters_faction","Player Faction",0, 0.9, [("player_faction",1.00),("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], []),
("kingdom_1", "Kingdom of Swadia", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDD8844),
("kingdom_2", "Kingdom of Vaegirs", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DD33),
("kingdom_3", "Khergit Khanate", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC99FF),
("kingdom_4", "Kingdom of Nords", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDDDD33),
("kingdom_5", "Kingdom of Rhodoks", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DDDD),
## ("kingdom_1_rebels", "Swadian rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
## ("kingdom_2_rebels", "Vaegir rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
## ("kingdom_3_rebels", "Khergit rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
## ("kingdom_4_rebels", "Nord rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
## ("kingdom_5_rebels", "Rhodok rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
("kingdoms_end","kingdoms_end", 0, 0,[], []),
("robber_knights", "robber_knights", 0, 0.1, [], []),
("khergits","Khergits", 0, 0.5,[("player_faction",0.0)], []),
("black_khergits","Black Khergits", 0, 0.5,[("player_faction",-0.3),("kingdom_1",-0.02),("kingdom_2",-0.02)], []),
## ("rebel_peasants","Rebel Peasants", 0, 0.5,[("vaegirs",-0.5),("player_faction",0.0)], []),
("manhunters","Manhunters", 0, 0.5,[("outlaws",-0.6),("player_faction",0.1)], []),
("deserters","Deserters", 0, 0.5,[("manhunters",-0.6),("merchants",-0.5),("player_faction",-0.1)], [], 0x888888),
("mountain_bandits","Mountain Bandits", 0, 0.5,[("commoners",-0.2),("merchants",-0.5),("manhunters",-0.6),("player_faction",-0.15)], [], 0x888888),
("forest_bandits","Forest Bandits", 0, 0.5,[("commoners",-0.2),("merchants",-0.5),("manhunters",-0.6),("player_faction",-0.15)], [], 0x888888),
("undeads","Undeads", max_player_rating(-30), 0.5,[("commoners",-0.7),("player_faction",-0.5)], []),
("slavers","Slavers", 0, 0.1, [], []),
("peasant_rebels","Peasant Rebels", 0, 1.0,[("noble_refugees",-1.0),("player_faction",-0.4)], []),
("noble_refugees","Noble Refugees", 0, 0.5,[], []),
]
| Python |
from module_info import *
from module_factions import *
from process_common import *
faction_name_pos = 0
faction_flags_pos = 2
faction_coherence_pos = 3
faction_relations_pos = 4
faction_ranks_pos = 5
def compile_relations():
relations = []
for i in xrange(len(factions)):
r = [0.0 for j in range(len(factions))]
relations.append(r)
for i_faction in xrange(len(factions)):
relations[i_faction][i_faction] = factions[i_faction][faction_coherence_pos]
rels = factions[i_faction][faction_relations_pos]
for rel in rels:
rel_name = rel[0]
other_pos = -1
for j_f in xrange(len(factions)):
if factions[j_f][faction_name_pos] == rel_name:
other_pos = j_f
if other_pos == -1:
print "ERROR faction not found: "+ rel_name
else:
relations[other_pos][i_faction] = rel[1]
relations[i_faction][other_pos] = rel[1]
return relations
def save_factions(relations):
file = open(export_dir + "factions.txt","w")
file.write("factionsfile version 1\n")
file.write("%d\n"%len(factions))
for i_faction in xrange(len(factions)):
faction = factions[i_faction]
fac_color = 0xAAAAAA
if len(faction) == 7:
fac_color = faction[6]
file.write("fac_%s %s %d %d \n"%(convert_to_identifier(faction[0]), replace_spaces(faction[1]), faction[2], fac_color))
for reln in relations[i_faction]:
file.write(" %f "%reln)
file.write("\n")
ranks = []
if (len(faction) > (faction_ranks_pos)):
ranks = faction[faction_ranks_pos]
file.write("%d "%(len(ranks)))
for rank in ranks:
file.write(" %s "%(replace_spaces(rank)))
file.close()
def two_to_pow(x):
result = 1
for i in xrange(x):
result = result * 2
return result
def save_python_header():
file = open("./ID_factions.py","w")
for i_faction in xrange(len(factions)):
file.write("fac_%s = %d\n"%(factions[i_faction][0],i_faction))
file.write("\n\n")
file.close()
print "Exporting faction data..."
save_python_header()
relations = compile_relations()
save_factions(relations)
| Python |
from header_common import *
from header_parties import *
from ID_troops import *
from ID_factions import *
from ID_map_icons import *
pmf_is_prisoner = 0x0001
####################################################################################################################
# Each party template record contains the following fields:
# 1) Party-template id: used for referencing party-templates in other files.
# The prefix pt_ is automatically added before each party-template id.
# 2) Party-template name.
# 3) Party flags. See header_parties.py for a list of available flags
# 4) Menu. ID of the menu to use when this party is met. The value 0 uses the default party encounter system.
# 5) Faction
# 6) Personality. See header_parties.py for an explanation of personality flags.
# 7) List of stacks. Each stack record is a tuple that contains the following fields:
# 7.1) Troop-id.
# 7.2) Minimum number of troops in the stack.
# 7.3) Maximum number of troops in the stack.
# 7.4) Member flags(optional). Use pmf_is_prisoner to note that this member is a prisoner.
# Note: There can be at most 6 stacks.
####################################################################################################################
party_templates = [
("none","none",icon_gray_knight,0,fac_commoners,merchant_personality,[]),
("rescued_prisoners","Rescued Prisoners",icon_gray_knight,0,fac_commoners,merchant_personality,[]),
("enemy","Enemy",icon_gray_knight,0,fac_undeads,merchant_personality,[]),
("hero_party","Hero Party",icon_gray_knight,0,fac_commoners,merchant_personality,[]),
####################################################################################################################
# Party templates before this point are hard-wired into the game and should not be changed.
####################################################################################################################
## ("old_garrison","Old Garrison",icon_vaegir_knight,0,fac_neutral,merchant_personality,[]),
("village_defenders","Village Defenders",icon_peasant,0,fac_commoners,merchant_personality,[(trp_farmer,10,20),(trp_peasant_woman,0,4)]),
("cattle_herd","Cattle Herd",icon_cattle|carries_goods(10),0,fac_neutral,merchant_personality,[(trp_cattle,80,120)]),
## ("vaegir_nobleman","Vaegir Nobleman",icon_vaegir_knight|carries_goods(10)|pf_quest_party,0,fac_commoners,merchant_personality,[(trp_nobleman,1,1),(trp_vaegir_knight,2,6),(trp_vaegir_horseman,4,12)]),
## ("swadian_nobleman","Swadian Nobleman",icon_gray_knight|carries_goods(10)|pf_quest_party,0,fac_commoners,merchant_personality,[(trp_nobleman,1,1),(trp_swadian_knight,2,6),(trp_swadian_man_at_arms,4,12)]),
# Ryan BEGIN
("looters","Looters",icon_axeman|carries_goods(8),0,fac_outlaws,bandit_personality,[(trp_looter,4,25)]),
# Ryan END
("manhunters","Manhunters",icon_gray_knight,0,fac_manhunters,soldier_personality,[(trp_manhunter,9,40)]),
## ("peasant","Peasant",icon_peasant,0,fac_commoners,merchant_personality,[(trp_farmer,1,6),(trp_peasant_woman,0,7)]),
# ("black_khergit_raiders","Black Khergit Raiders",icon_khergit_horseman_b|carries_goods(2),0,fac_black_khergits,bandit_personality,[(trp_black_khergit_guard,1,10),(trp_black_khergit_horseman,5,5)]),
("steppe_bandits","Steppe Bandits",icon_khergit|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_steppe_bandit,5,58)]),
("forest_bandits","Forest Bandits",icon_axeman|carries_goods(2),0,fac_forest_bandits,bandit_personality,[(trp_forest_bandit,5,52)]),
("mountain_bandits","Mountain Bandits",icon_axeman|carries_goods(2),0,fac_mountain_bandits,bandit_personality,[(trp_mountain_bandit,5,60)]),
("sea_raiders","Sea Raiders",icon_axeman|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_sea_raider,5,50)]),
("deserters","Deserters",icon_vaegir_knight|carries_goods(3),0,fac_deserters,bandit_personality,[]),
("merchant_caravan","Merchant Caravan",icon_gray_knight|carries_goods(20)|pf_auto_remove_in_town|pf_quest_party,0,fac_commoners,escorted_merchant_personality,[(trp_caravan_master,1,1),(trp_caravan_guard,5,25)]),
("troublesome_bandits","Troublesome Bandits",icon_axeman|carries_goods(9)|pf_quest_party,0,fac_outlaws,bandit_personality,[(trp_bandit,14,55)]),
("bandits_awaiting_ransom","Bandits Awaiting Ransom",icon_axeman|carries_goods(9)|pf_auto_remove_in_town|pf_quest_party,0,fac_neutral,bandit_personality,[(trp_bandit,24,58),(trp_kidnapped_girl,1,1,pmf_is_prisoner)]),
("kidnapped_girl","Kidnapped Girl",icon_woman|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_kidnapped_girl,1,1)]),
## ("farmers","Farmers",icon_peasant,0,fac_innocents,merchant_personality,[(trp_farmer,11,22),(trp_peasant_woman,16,44)]),
("village_farmers","Village Farmers",icon_peasant,0,fac_innocents,merchant_personality,[(trp_farmer,5,10),(trp_peasant_woman,3,8)]),
## ("refugees","Refugees",icon_woman_b,0,fac_innocents,merchant_personality,[(trp_refugee,19,48)]),
## ("dark_hunters","Dark Hunters",icon_gray_knight,0,fac_dark_knights,soldier_personality,[(trp_dark_knight,4,42),(trp_dark_hunter,13,25)]),
("spy_partners", "Unremarkable Travellers", icon_gray_knight|carries_goods(3)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_spy_partner,1,1),(trp_caravan_guard,5,11)]),
("runaway_serfs","Runaway Serfs",icon_peasant|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_farmer,6,7), (trp_peasant_woman,3,3)]),
("spy", "Ordinary Townsman", icon_gray_knight|carries_goods(3)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_spy,1,1)]),
("sacrificed_messenger", "Sacrificed Messenger", icon_gray_knight|carries_goods(3)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[]),
## ("conspirator", "Conspirators", icon_gray_knight|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_conspirator,3,4)]),
## ("conspirator_leader", "Conspirator Leader", icon_gray_knight|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_conspirator_leader,1,1)]),
## ("peasant_rebels", "Peasant Rebels", icon_peasant,0,fac_peasant_rebels,bandit_personality,[(trp_peasant_rebel,33,97)]),
## ("noble_refugees", "Noble Refugees", icon_gray_knight|carries_goods(12)|pf_quest_party,0,fac_noble_refugees,merchant_personality,[(trp_noble_refugee,3,5),(trp_noble_refugee_woman,5,7)]),
("forager_party","Foraging Party",icon_gray_knight|carries_goods(5)|pf_show_faction,0,fac_commoners,merchant_personality,[]),
("scout_party","Scouts",icon_gray_knight|carries_goods(1)|pf_show_faction,0,fac_commoners,bandit_personality,[]),
("patrol_party","Patrol",icon_gray_knight|carries_goods(2)|pf_show_faction,0,fac_commoners,soldier_personality,[]),
# ("war_party", "War Party",icon_gray_knight|carries_goods(3),0,fac_commoners,soldier_personality,[]),
("messenger_party","Messenger",icon_gray_knight|pf_show_faction,0,fac_commoners,merchant_personality,[]),
("raider_party","Raiders",icon_gray_knight|carries_goods(16)|pf_quest_party,0,fac_commoners,bandit_personality,[]),
("raider_captives","Raider Captives",0,0,fac_commoners,0,[(trp_peasant_woman,6,30,pmf_is_prisoner)]),
("kingdom_caravan_party","Caravan",icon_mule|carries_goods(25)|pf_show_faction,0,fac_commoners,merchant_personality,[(trp_caravan_master,1,1),(trp_caravan_guard,12,40)]),
("prisoner_train_party","Prisoner Train",icon_gray_knight|carries_goods(5)|pf_show_faction,0,fac_commoners,merchant_personality,[]),
("default_prisoners","Default Prisoners",0,0,fac_commoners,0,[(trp_bandit,5,10,pmf_is_prisoner)]),
## ("merchant_party","Merchant",icon_mule|carries_goods(25)|pf_show_faction,0,fac_merchants,merchant_personality,[(trp_caravan_guard,12,40)]),
## ("merchant_party_reinforcement","Merchant Party Reinforcement",icon_mule|carries_goods(25),0,fac_merchants,merchant_personality,[(trp_caravan_guard,6,20)]),
# Caravans
("center_reinforcements","Reinforcements",icon_axeman|carries_goods(16),0,fac_commoners,soldier_personality,[(trp_townsman,5,30),(trp_watchman,4,20)]),
("kingdom_hero_party","War Party",icon_flagbearer_a|pf_show_faction|pf_default_behavior,0,fac_commoners,soldier_personality,[]),
# Reinforcements
# ("default_reinforcements_a","default_reinforcements_a",0,0,fac_commoners,0,[(trp_caravan_guard,1,10),(trp_watchman,3,16),(trp_farmer,9,24)]),
# ("default_reinforcements_b","default_reinforcements_b",0,0,fac_commoners,0,[(trp_mercenary,1,7),(trp_caravan_guard,3,10),(trp_watchman,3,15)]),
# ("default_reinforcements_c","default_reinforcements_c",0,0,fac_commoners,0,[(trp_hired_blade,1,7),(trp_mercenary,3,10),(trp_caravan_guard,3,15)]),
("kingdom_1_reinforcements_a", "kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_swadian_militia,2,6),(trp_swadian_recruit,4,7)]),
("kingdom_1_reinforcements_b", "kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_swadian_crossbowman,2,6),(trp_swadian_skirmisher,4,7)]),
("kingdom_1_reinforcements_c", "kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_swadian_man_at_arms,3,6)]),
("kingdom_2_reinforcements_a", "kingdom_2_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_vaegir_footman,2,6),(trp_vaegir_recruit,4,7)]),
("kingdom_2_reinforcements_b", "kingdom_2_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_vaegir_archer,2,6),(trp_vaegir_skirmisher,3,5),(trp_vaegir_footman,1,3)]),
("kingdom_2_reinforcements_c", "kingdom_2_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_vaegir_horseman,3,6)]),
("kingdom_3_reinforcements_a", "kingdom_3_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_khergit_skirmisher,2,6),(trp_khergit_tribesman,4,7)]),
("kingdom_3_reinforcements_b", "kingdom_3_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_khergit_horse_archer,2,6),(trp_khergit_skirmisher,4,7)]),
("kingdom_3_reinforcements_c", "kingdom_3_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_khergit_lancer,3,6)]),
("kingdom_4_reinforcements_a", "kingdom_4_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_nord_footman,4,8),(trp_nord_recruit,2,4)]),
("kingdom_4_reinforcements_b", "kingdom_4_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_nord_archer,1,3),(trp_nord_huntsman,3,5),(trp_nord_footman,2,5)]),
("kingdom_4_reinforcements_c", "kingdom_4_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_nord_warrior,3,6)]),
("kingdom_5_reinforcements_a", "kingdom_5_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_spearman,3,7),(trp_rhodok_tribesman,3,6)]),
("kingdom_5_reinforcements_b", "kingdom_5_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_trained_crossbowman,2,6),(trp_rhodok_crossbowman,4,7)]),
("kingdom_5_reinforcements_c", "kingdom_5_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rhodok_sergeant,3,6)]),
## ("kingdom_1_reinforcements_a", "kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_swadian_footman,3,7),(trp_swadian_skirmisher,5,10),(trp_swadian_militia,11,26)]),
## ("kingdom_1_reinforcements_b", "kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_swadian_man_at_arms,5,10),(trp_swadian_infantry,5,10),(trp_swadian_crossbowman,3,8)]),
## ("kingdom_1_reinforcements_c", "kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_swadian_knight,2,6),(trp_swadian_sergeant,2,5),(trp_swadian_sharpshooter,2,5)]),
##
## ("kingdom_2_reinforcements_a", "kingdom_2_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_vaegir_veteran,3,7),(trp_vaegir_skirmisher,5,10),(trp_vaegir_footman,11,26)]),
## ("kingdom_2_reinforcements_b", "kingdom_2_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_vaegir_horseman,4,9),(trp_vaegir_infantry,5,10),(trp_vaegir_archer,3,8)]),
## ("kingdom_2_reinforcements_c", "kingdom_2_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_vaegir_knight,3,7),(trp_vaegir_guard,2,5),(trp_vaegir_marksman,2,5)]),
##
## ("kingdom_3_reinforcements_a", "kingdom_3_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_khergit_horseman,3,7),(trp_khergit_skirmisher,5,10),(trp_khergit_tribesman,11,26)]),
## ("kingdom_3_reinforcements_b", "kingdom_3_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_khergit_veteran_horse_archer,4,9),(trp_khergit_horse_archer,5,10),(trp_khergit_horseman,3,8)]),
## ("kingdom_3_reinforcements_c", "kingdom_3_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_khergit_lancer,3,7),(trp_khergit_veteran_horse_archer,2,5),(trp_khergit_horse_archer,2,5)]),
##
## ("kingdom_4_reinforcements_a", "kingdom_4_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_nord_trained_footman,3,7),(trp_nord_footman,5,10),(trp_nord_recruit,11,26)]),
## ("kingdom_4_reinforcements_b", "kingdom_4_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_nord_veteran,4,9),(trp_nord_warrior,5,10),(trp_nord_footman,3,8)]),
## ("kingdom_4_reinforcements_c", "kingdom_4_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_nord_champion,1,3),(trp_nord_veteran,2,5),(trp_nord_warrior,2,5)]),
##
## ("kingdom_5_reinforcements_a", "kingdom_5_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_spearman,3,7),(trp_rhodok_crossbowman,5,10),(trp_rhodok_tribesman,11,26)]),
## ("kingdom_5_reinforcements_b", "kingdom_5_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_trained_spearman,4,9),(trp_rhodok_spearman,5,10),(trp_rhodok_crossbowman,3,8)]),
## ("kingdom_5_reinforcements_c", "kingdom_5_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rhodok_sergeant,3,7),(trp_rhodok_veteran_spearman,2,5),(trp_rhodok_veteran_crossbowman,2,5)]),
#("array", "Battle array", icon_gray_knight|pf_limit_members, no_menu, fac_player_faction, 0, []),
]
| Python |
prsnt_game_credits = 0
prsnt_banner_selection = 1
prsnt_custom_banner = 2
prsnt_banner_charge_positioning = 3
prsnt_banner_charge_selection = 4
prsnt_banner_background_selection = 5
prsnt_banner_flag_type_selection = 6
prsnt_banner_flag_map_type_selection = 7
prsnt_color_selection = 8
prsnt_marshall_selection = 9
prsnt_battle = 10
prsnt_sliders = 11
prsnt_arena_training = 12
prsnt_retirement = 13
prsnt_key_config = 14
prsnt_battle_formations = 15
prsnt_orientation_debug = 16
| Python |
import string
from header_common import *
from module_info import *
from module_skills import *
from process_common import *
skill_name_pos = 1
skill_attribute_pos = 2
skill_max_level_pos= 3
skill_desc_pos = 4
def save_skills():
ofile = open(export_dir + "skills.txt","w")
ofile.write("%d\n"%(len(skills)))
for i_skill in xrange(len(skills)):
skill = skills[i_skill]
ofile.write("skl_%s %s "%(skill[0], replace_spaces(skill[1])))
ofile.write("%d %d %s\n"%(skill[skill_attribute_pos],skill[skill_max_level_pos],(string.replace(skill[skill_desc_pos]," ","_"))))
ofile.close()
def save_python_header():
ofile = open("./ID_skills.py","w")
for i_skill in xrange(len(skills)):
ofile.write("skl_%s = %d\n"%(skills[i_skill][0],i_skill))
ofile.write("\n\n")
ofile.close()
print "Exporting skills..."
save_python_header()
save_skills()
| Python |
from module_info import *
from module_particle_systems import *
from process_common import *
id_pos = 0
flags_pos = 1
mesh_name_pos = 2
num_particles_pos = 3
life_pos = 4
damping_pos = 5
gravity_pos = 6
turb_size_pos = 7
turb_wt_pos = 8
alpha_key_pos = 9
red_key_pos = alpha_key_pos + 2
green_key_pos = red_key_pos + 2
blue_key_pos = green_key_pos + 2
scale_key_pos = blue_key_pos + 2
emit_box_size_pos = scale_key_pos + 2
emit_velocity_pos = emit_box_size_pos + 1
emit_rndmness_pos = emit_velocity_pos + 1
angular_speed_pos = emit_rndmness_pos + 1
angular_damping_pos = angular_speed_pos + 1
def save_psys_keys(ofile, keys1, keys2):
ofile.write("%f %f %f %f\n"%(keys1[0], keys1[1], keys2[0], keys2[1]))
def save_particle_systems():
ofile = open(export_dir + "particle_systems.txt","w")
ofile.write("particle_systemsfile version 1\n")
ofile.write("%d\n"%len(particle_systems))
for psys in particle_systems:
ofile.write("psys_%s %d %s "%(psys[0], psys[1], psys[2]))
ofile.write("%d %f %f %f %f %f \n"%(psys[num_particles_pos], psys[life_pos], psys[damping_pos], psys[gravity_pos], psys[turb_size_pos], psys[turb_wt_pos]))
save_psys_keys(ofile,psys[alpha_key_pos],psys[alpha_key_pos+1])
save_psys_keys(ofile,psys[red_key_pos],psys[red_key_pos+1])
save_psys_keys(ofile,psys[green_key_pos],psys[green_key_pos+1])
save_psys_keys(ofile,psys[blue_key_pos],psys[blue_key_pos+1])
save_psys_keys(ofile,psys[scale_key_pos],psys[scale_key_pos+1])
ofile.write("%f %f %f "%(psys[emit_box_size_pos][0],psys[emit_box_size_pos][1],psys[emit_box_size_pos][2]))
ofile.write("%f %f %f "%(psys[emit_velocity_pos][0],psys[emit_velocity_pos][1],psys[emit_velocity_pos][2]))
ofile.write("%f \n"%(psys[emit_rndmness_pos]))
if (len(psys) >= (angular_speed_pos + 1)):
ofile.write("%f "%(psys[angular_speed_pos]))
else:
ofile.write("0.0 ")
if (len(psys) >= (angular_damping_pos + 1)):
ofile.write("%f "%(psys[angular_damping_pos]))
else:
ofile.write("0.0 ")
ofile.write("\n")
ofile.close()
def save_python_header():
ofile = open("./ID_particle_systems.py","w")
for i_particle_system in xrange(len(particle_systems)):
ofile.write("psys_%s = %d\n"%(particle_systems[i_particle_system][0],i_particle_system))
ofile.close()
print "Exporting particle data..."
save_particle_systems()
save_python_header()
| Python |
pt_none = 0
pt_rescued_prisoners = 1
pt_enemy = 2
pt_hero_party = 3
pt_village_defenders = 4
pt_cattle_herd = 5
pt_looters = 6
pt_manhunters = 7
pt_steppe_bandits = 8
pt_forest_bandits = 9
pt_mountain_bandits = 10
pt_sea_raiders = 11
pt_deserters = 12
pt_merchant_caravan = 13
pt_troublesome_bandits = 14
pt_bandits_awaiting_ransom = 15
pt_kidnapped_girl = 16
pt_village_farmers = 17
pt_spy_partners = 18
pt_runaway_serfs = 19
pt_spy = 20
pt_sacrificed_messenger = 21
pt_forager_party = 22
pt_scout_party = 23
pt_patrol_party = 24
pt_messenger_party = 25
pt_raider_party = 26
pt_raider_captives = 27
pt_kingdom_caravan_party = 28
pt_prisoner_train_party = 29
pt_default_prisoners = 30
pt_center_reinforcements = 31
pt_kingdom_hero_party = 32
pt_kingdom_1_reinforcements_a = 33
pt_kingdom_1_reinforcements_b = 34
pt_kingdom_1_reinforcements_c = 35
pt_kingdom_2_reinforcements_a = 36
pt_kingdom_2_reinforcements_b = 37
pt_kingdom_2_reinforcements_c = 38
pt_kingdom_3_reinforcements_a = 39
pt_kingdom_3_reinforcements_b = 40
pt_kingdom_3_reinforcements_c = 41
pt_kingdom_4_reinforcements_a = 42
pt_kingdom_4_reinforcements_b = 43
pt_kingdom_4_reinforcements_c = 44
pt_kingdom_5_reinforcements_a = 45
pt_kingdom_5_reinforcements_b = 46
pt_kingdom_5_reinforcements_c = 47
| Python |
from header_map_icons import *
from module_constants import *
from header_operations import *
from header_triggers import *
from ID_sounds import *
####################################################################################################################
# Each map icon record contains the following fields:
# 1) Map icon id: used for referencing map icons in other files.
# The prefix icon_ is automatically added before each map icon id.
# 2) Map icon flags. See header_map icons.py for a list of available flags
# 3) Mesh name.
# 4) Scale.
# 5) Sound.
# 6) Offset x position for the flag icon.
# 7) Offset y position for the flag icon.
# 8) Offset z position for the flag icon.
####################################################################################################################
banner_scale = 0.3
avatar_scale = 0.15
map_icons = [
("player",0,"player", avatar_scale, snd_footstep_grass, 0.15, 0.173, 0),
("player_horseman",0,"player_horseman", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("gray_knight",0,"knight_a", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("vaegir_knight",0,"knight_b", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("flagbearer_a",0,"flagbearer_a", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("flagbearer_b",0,"flagbearer_b", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("peasant",0,"peasant_a", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0),
("khergit",0,"khergit_horseman", avatar_scale,snd_gallop, 0.15, 0.173, 0),
("khergit_horseman_b",0,"khergit_horseman_b", avatar_scale,snd_gallop, 0.15, 0.173, 0),
("axeman",0,"bandit_a", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0),
("woman",0,"woman_a", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0),
("woman_b",0,"woman_b", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0),
("town",mcn_no_shadow,"map_town_a", 0.35,0),
("town_steppe",mcn_no_shadow,"map_town_steppe_a", 0.35,0),
("village_a",mcn_no_shadow,"map_village_a", 0.45, 0),
("village_burnt_a",mcn_no_shadow,"map_village_burnt_a", 0.45, 0),
("village_deserted_a",mcn_no_shadow,"map_village_deserted_a", 0.45, 0),
("camp",mcn_no_shadow,"camp_tent", 0.13, 0),
("ship",mcn_no_shadow,"boat_sail_on", 0.23, snd_footstep_grass, 0.0, 0.05, 0),
("ship_on_land",mcn_no_shadow,"boat_sail_off", 0.23, 0),
("castle_a",mcn_no_shadow,"map_castle_a", 0.35,0),
("castle_b",mcn_no_shadow,"map_castle_b", 0.35,0),
("castle_c",mcn_no_shadow,"map_castle_c", 0.35,0),
("castle_d",mcn_no_shadow,"map_castle_d", 0.35,0),
("town_snow",mcn_no_shadow,"map_town_snow_a", 0.35,0),
("village_snow_a",mcn_no_shadow,"map_village_snow_a", 0.45, 0),
("village_snow_burnt_a",mcn_no_shadow,"map_village_snow_burnt_a", 0.45, 0),
("village_snow_deserted_a",mcn_no_shadow,"map_village_snow_deserted_a", 0.45, 0),
("castle_snow_a",mcn_no_shadow,"map_castle_snow_a", 0.35,0),
("castle_snow_b",mcn_no_shadow,"map_castle_snow_b", 0.35,0),
("mule",0,"icon_mule", 0.2,snd_footstep_grass, 0.15, 0.173, 0),
("cattle",0,"icon_cow", 0.2,snd_footstep_grass, 0.15, 0.173, 0),
("training_ground",mcn_no_shadow,"training", 0.35,0),
("bridge_a",mcn_no_shadow,"map_river_bridge_a", 1.27,0),
("bridge_b",mcn_no_shadow,"map_river_bridge_b", 0.7,0),
("bridge_snow_a",mcn_no_shadow,"map_river_bridge_snow_a", 1.27,0),
("custom_banner_01",0,"custom_map_banner_01", banner_scale, 0,
[
(ti_on_init_map_icon,
[
(store_trigger_param_1, ":party_no"),
(party_get_slot, ":leader_troop", ":party_no", slot_town_lord),
(try_begin),
(ge, ":leader_troop", 0),
(cur_map_icon_set_tableau_material, "tableau_custom_banner_square", ":leader_troop"),
(try_end),
]),
]),
("custom_banner_02",0,"custom_map_banner_02", banner_scale, 0,
[
(ti_on_init_map_icon,
[
(store_trigger_param_1, ":party_no"),
(party_get_slot, ":leader_troop", ":party_no", slot_town_lord),
(try_begin),
(ge, ":leader_troop", 0),
(cur_map_icon_set_tableau_material, "tableau_custom_banner_short", ":leader_troop"),
(try_end),
]),
]),
("custom_banner_03",0,"custom_map_banner_03", banner_scale, 0,
[
(ti_on_init_map_icon,
[
(store_trigger_param_1, ":party_no"),
(party_get_slot, ":leader_troop", ":party_no", slot_town_lord),
(try_begin),
(ge, ":leader_troop", 0),
(cur_map_icon_set_tableau_material, "tableau_custom_banner_tall", ":leader_troop"),
(try_end),
]),
]),
# Banners
("banner_01",0,"map_flag_01", banner_scale,0),
("banner_02",0,"map_flag_02", banner_scale,0),
("banner_03",0,"map_flag_03", banner_scale,0),
("banner_04",0,"map_flag_04", banner_scale,0),
("banner_05",0,"map_flag_05", banner_scale,0),
("banner_06",0,"map_flag_06", banner_scale,0),
("banner_07",0,"map_flag_07", banner_scale,0),
("banner_08",0,"map_flag_08", banner_scale,0),
("banner_09",0,"map_flag_09", banner_scale,0),
("banner_10",0,"map_flag_10", banner_scale,0),
("banner_11",0,"map_flag_11", banner_scale,0),
("banner_12",0,"map_flag_12", banner_scale,0),
("banner_13",0,"map_flag_13", banner_scale,0),
("banner_14",0,"map_flag_14", banner_scale,0),
("banner_15",0,"map_flag_f21", banner_scale,0),
("banner_16",0,"map_flag_16", banner_scale,0),
("banner_17",0,"map_flag_17", banner_scale,0),
("banner_18",0,"map_flag_18", banner_scale,0),
("banner_19",0,"map_flag_19", banner_scale,0),
("banner_20",0,"map_flag_20", banner_scale,0),
("banner_21",0,"map_flag_21", banner_scale,0),
("banner_22",0,"map_flag_22", banner_scale,0),
("banner_23",0,"map_flag_23", banner_scale,0),
("banner_24",0,"map_flag_24", banner_scale,0),
("banner_25",0,"map_flag_25", banner_scale,0),
("banner_26",0,"map_flag_26", banner_scale,0),
("banner_27",0,"map_flag_27", banner_scale,0),
("banner_28",0,"map_flag_28", banner_scale,0),
("banner_29",0,"map_flag_29", banner_scale,0),
("banner_30",0,"map_flag_30", banner_scale,0),
("banner_31",0,"map_flag_31", banner_scale,0),
("banner_32",0,"map_flag_32", banner_scale,0),
("banner_33",0,"map_flag_33", banner_scale,0),
("banner_34",0,"map_flag_34", banner_scale,0),
("banner_35",0,"map_flag_35", banner_scale,0),
("banner_36",0,"map_flag_36", banner_scale,0),
("banner_37",0,"map_flag_37", banner_scale,0),
("banner_38",0,"map_flag_38", banner_scale,0),
("banner_39",0,"map_flag_39", banner_scale,0),
("banner_40",0,"map_flag_40", banner_scale,0),
("banner_41",0,"map_flag_41", banner_scale,0),
("banner_42",0,"map_flag_42", banner_scale,0),
("banner_43",0,"map_flag_43", banner_scale,0),
("banner_44",0,"map_flag_44", banner_scale,0),
("banner_45",0,"map_flag_45", banner_scale,0),
("banner_46",0,"map_flag_46", banner_scale,0),
("banner_47",0,"map_flag_47", banner_scale,0),
("banner_48",0,"map_flag_48", banner_scale,0),
("banner_49",0,"map_flag_49", banner_scale,0),
("banner_50",0,"map_flag_50", banner_scale,0),
("banner_51",0,"map_flag_51", banner_scale,0),
("banner_52",0,"map_flag_52", banner_scale,0),
("banner_53",0,"map_flag_53", banner_scale,0),
("banner_54",0,"map_flag_54", banner_scale,0),
("banner_55",0,"map_flag_55", banner_scale,0),
("banner_56",0,"map_flag_56", banner_scale,0),
("banner_57",0,"map_flag_57", banner_scale,0),
("banner_58",0,"map_flag_58", banner_scale,0),
("banner_59",0,"map_flag_59", banner_scale,0),
("banner_60",0,"map_flag_60", banner_scale,0),
("banner_61",0,"map_flag_61", banner_scale,0),
("banner_62",0,"map_flag_62", banner_scale,0),
("banner_63",0,"map_flag_63", banner_scale,0),
("banner_64",0,"map_flag_d01", banner_scale,0),
("banner_65",0,"map_flag_d02", banner_scale,0),
("banner_66",0,"map_flag_d03", banner_scale,0),
("banner_67",0,"map_flag_d04", banner_scale,0),
("banner_68",0,"map_flag_d05", banner_scale,0),
("banner_69",0,"map_flag_d06", banner_scale,0),
("banner_70",0,"map_flag_d07", banner_scale,0),
("banner_71",0,"map_flag_d08", banner_scale,0),
("banner_72",0,"map_flag_d09", banner_scale,0),
("banner_73",0,"map_flag_d10", banner_scale,0),
("banner_74",0,"map_flag_d11", banner_scale,0),
("banner_75",0,"map_flag_d12", banner_scale,0),
("banner_76",0,"map_flag_d13", banner_scale,0),
("banner_77",0,"map_flag_d14", banner_scale,0),
("banner_78",0,"map_flag_d15", banner_scale,0),
("banner_79",0,"map_flag_d16", banner_scale,0),
("banner_80",0,"map_flag_d17", banner_scale,0),
("banner_81",0,"map_flag_d18", banner_scale,0),
("banner_82",0,"map_flag_d19", banner_scale,0),
("banner_83",0,"map_flag_d20", banner_scale,0),
("banner_84",0,"map_flag_d21", banner_scale,0),
("banner_85",0,"map_flag_e01", banner_scale,0),
("banner_86",0,"map_flag_e02", banner_scale,0),
("banner_87",0,"map_flag_e03", banner_scale,0),
("banner_88",0,"map_flag_e04", banner_scale,0),
("banner_89",0,"map_flag_e05", banner_scale,0),
("banner_90",0,"map_flag_e06", banner_scale,0),
("banner_91",0,"map_flag_e07", banner_scale,0),
("banner_92",0,"map_flag_e08", banner_scale,0),
("banner_93",0,"map_flag_e09", banner_scale,0),
("banner_94",0,"map_flag_e10", banner_scale,0),
("banner_95",0,"map_flag_e11", banner_scale,0),
("banner_96",0,"map_flag_e12", banner_scale,0),
("banner_97",0,"map_flag_e13", banner_scale,0),
("banner_98",0,"map_flag_e14", banner_scale,0),
("banner_99",0,"map_flag_e15", banner_scale,0),
("banner_100",0,"map_flag_e16", banner_scale,0),
("banner_101",0,"map_flag_e17", banner_scale,0),
("banner_102",0,"map_flag_e18", banner_scale,0),
("banner_103",0,"map_flag_e19", banner_scale,0),
("banner_104",0,"map_flag_e20", banner_scale,0),
("banner_105",0,"map_flag_e21", banner_scale,0),
("banner_106",0,"map_flag_f01", banner_scale,0),
("banner_107",0,"map_flag_f02", banner_scale,0),
("banner_108",0,"map_flag_f03", banner_scale,0),
("banner_109",0,"map_flag_f04", banner_scale,0),
("banner_110",0,"map_flag_f05", banner_scale,0),
("banner_111",0,"map_flag_f06", banner_scale,0),
("banner_112",0,"map_flag_f07", banner_scale,0),
("banner_113",0,"map_flag_f08", banner_scale,0),
("banner_114",0,"map_flag_f09", banner_scale,0),
("banner_115",0,"map_flag_f10", banner_scale,0),
("banner_116",0,"map_flag_f11", banner_scale,0),
("banner_117",0,"map_flag_f12", banner_scale,0),
("banner_118",0,"map_flag_f13", banner_scale,0),
("banner_119",0,"map_flag_f14", banner_scale,0),
("banner_120",0,"map_flag_f15", banner_scale,0),
("banner_121",0,"map_flag_f16", banner_scale,0),
("banner_122",0,"map_flag_f17", banner_scale,0),
("banner_123",0,"map_flag_f18", banner_scale,0),
("banner_124",0,"map_flag_f19", banner_scale,0),
("banner_125",0,"map_flag_f20", banner_scale,0),
("banner_126",0,"map_flag_15", banner_scale,0),
]
| Python |
trp_player = 0
trp_temp_troop = 1
trp_game = 2
trp_unarmed_troop = 3
trp_random_town_sequence = 4
trp_tournament_participants = 5
trp_tutorial_maceman = 6
trp_tutorial_archer = 7
trp_tutorial_swordsman = 8
trp_novice_fighter = 9
trp_regular_fighter = 10
trp_veteran_fighter = 11
trp_champion_fighter = 12
trp_arena_training_fighter_1 = 13
trp_arena_training_fighter_2 = 14
trp_arena_training_fighter_3 = 15
trp_arena_training_fighter_4 = 16
trp_arena_training_fighter_5 = 17
trp_arena_training_fighter_6 = 18
trp_arena_training_fighter_7 = 19
trp_arena_training_fighter_8 = 20
trp_arena_training_fighter_9 = 21
trp_arena_training_fighter_10 = 22
trp_cattle = 23
trp_farmer = 24
trp_townsman = 25
trp_watchman = 26
trp_caravan_guard = 27
trp_mercenary_swordsman = 28
trp_hired_blade = 29
trp_mercenary_crossbowman = 30
trp_mercenary_horseman = 31
trp_mercenary_cavalry = 32
trp_mercenaries_end = 33
trp_swadian_recruit = 34
trp_swadian_militia = 35
trp_swadian_footman = 36
trp_swadian_infantry = 37
trp_swadian_sergeant = 38
trp_swadian_skirmisher = 39
trp_swadian_crossbowman = 40
trp_swadian_sharpshooter = 41
trp_swadian_man_at_arms = 42
trp_swadian_knight = 43
trp_swadian_messenger = 44
trp_swadian_deserter = 45
trp_swadian_prison_guard = 46
trp_swadian_castle_guard = 47
trp_vaegir_recruit = 48
trp_vaegir_footman = 49
trp_vaegir_skirmisher = 50
trp_vaegir_archer = 51
trp_vaegir_marksman = 52
trp_vaegir_veteran = 53
trp_vaegir_infantry = 54
trp_vaegir_guard = 55
trp_vaegir_horseman = 56
trp_vaegir_knight = 57
trp_vaegir_messenger = 58
trp_vaegir_deserter = 59
trp_vaegir_prison_guard = 60
trp_vaegir_castle_guard = 61
trp_khergit_tribesman = 62
trp_khergit_skirmisher = 63
trp_khergit_horseman = 64
trp_khergit_horse_archer = 65
trp_khergit_veteran_horse_archer = 66
trp_khergit_lancer = 67
trp_khergit_messenger = 68
trp_khergit_deserter = 69
trp_khergit_prison_guard = 70
trp_khergit_castle_guard = 71
trp_nord_recruit = 72
trp_nord_footman = 73
trp_nord_trained_footman = 74
trp_nord_warrior = 75
trp_nord_veteran = 76
trp_nord_champion = 77
trp_nord_huntsman = 78
trp_nord_archer = 79
trp_nord_veteran_archer = 80
trp_nord_messenger = 81
trp_nord_deserter = 82
trp_nord_prison_guard = 83
trp_nord_castle_guard = 84
trp_rhodok_tribesman = 85
trp_rhodok_spearman = 86
trp_rhodok_trained_spearman = 87
trp_rhodok_veteran_spearman = 88
trp_rhodok_sergeant = 89
trp_rhodok_crossbowman = 90
trp_rhodok_trained_crossbowman = 91
trp_rhodok_veteran_crossbowman = 92
trp_rhodok_sharpshooter = 93
trp_rhodok_messenger = 94
trp_rhodok_deserter = 95
trp_rhodok_prison_guard = 96
trp_rhodok_castle_guard = 97
trp_looter = 98
trp_bandit = 99
trp_brigand = 100
trp_mountain_bandit = 101
trp_forest_bandit = 102
trp_sea_raider = 103
trp_steppe_bandit = 104
trp_black_khergit_horseman = 105
trp_manhunter = 106
trp_slave_driver = 107
trp_slave_hunter = 108
trp_slave_crusher = 109
trp_slaver_chief = 110
trp_follower_woman = 111
trp_hunter_woman = 112
trp_fighter_woman = 113
trp_sword_sister = 114
trp_refugee = 115
trp_peasant_woman = 116
trp_caravan_master = 117
trp_kidnapped_girl = 118
trp_town_walker_1 = 119
trp_town_walker_2 = 120
trp_village_walker_1 = 121
trp_village_walker_2 = 122
trp_spy_walker_1 = 123
trp_spy_walker_2 = 124
trp_tournament_master = 125
trp_trainer = 126
trp_constable_hareck = 127
trp_ramun_the_slave_trader = 128
trp_guide = 129
trp_xerina = 130
trp_dranton = 131
trp_kradus = 132
trp_tutorial_trainer = 133
trp_galeas = 134
trp_farmer_from_bandit_village = 135
trp_trainer_1 = 136
trp_trainer_2 = 137
trp_trainer_3 = 138
trp_trainer_4 = 139
trp_trainer_5 = 140
trp_ransom_broker_1 = 141
trp_ransom_broker_2 = 142
trp_ransom_broker_3 = 143
trp_ransom_broker_4 = 144
trp_ransom_broker_5 = 145
trp_ransom_broker_6 = 146
trp_ransom_broker_7 = 147
trp_ransom_broker_8 = 148
trp_ransom_broker_9 = 149
trp_ransom_broker_10 = 150
trp_tavern_traveler_1 = 151
trp_tavern_traveler_2 = 152
trp_tavern_traveler_3 = 153
trp_tavern_traveler_4 = 154
trp_tavern_traveler_5 = 155
trp_tavern_traveler_6 = 156
trp_tavern_traveler_7 = 157
trp_tavern_traveler_8 = 158
trp_tavern_traveler_9 = 159
trp_tavern_traveler_10 = 160
trp_tavern_bookseller_1 = 161
trp_tavern_bookseller_2 = 162
trp_tavern_minstrel_1 = 163
trp_npc1 = 164
trp_npc2 = 165
trp_npc3 = 166
trp_npc4 = 167
trp_npc5 = 168
trp_npc6 = 169
trp_npc7 = 170
trp_npc8 = 171
trp_npc9 = 172
trp_npc10 = 173
trp_npc11 = 174
trp_npc12 = 175
trp_npc13 = 176
trp_npc14 = 177
trp_npc15 = 178
trp_npc16 = 179
trp_kingdom_heroes_including_player_begin = 180
trp_kingdom_1_lord = 181
trp_kingdom_2_lord = 182
trp_kingdom_3_lord = 183
trp_kingdom_4_lord = 184
trp_kingdom_5_lord = 185
trp_knight_1_1 = 186
trp_knight_1_2 = 187
trp_knight_1_3 = 188
trp_knight_1_4 = 189
trp_knight_1_5 = 190
trp_knight_1_6 = 191
trp_knight_1_7 = 192
trp_knight_1_8 = 193
trp_knight_1_9 = 194
trp_knight_1_10 = 195
trp_knight_1_11 = 196
trp_knight_1_12 = 197
trp_knight_1_13 = 198
trp_knight_1_14 = 199
trp_knight_1_15 = 200
trp_knight_1_16 = 201
trp_knight_1_17 = 202
trp_knight_1_18 = 203
trp_knight_1_19 = 204
trp_knight_1_20 = 205
trp_knight_2_1 = 206
trp_knight_2_2 = 207
trp_knight_2_3 = 208
trp_knight_2_4 = 209
trp_knight_2_5 = 210
trp_knight_2_6 = 211
trp_knight_2_7 = 212
trp_knight_2_8 = 213
trp_knight_2_9 = 214
trp_knight_2_10 = 215
trp_knight_2_11 = 216
trp_knight_2_12 = 217
trp_knight_2_13 = 218
trp_knight_2_14 = 219
trp_knight_2_15 = 220
trp_knight_2_16 = 221
trp_knight_2_17 = 222
trp_knight_2_18 = 223
trp_knight_2_19 = 224
trp_knight_2_20 = 225
trp_knight_3_1 = 226
trp_knight_3_2 = 227
trp_knight_3_3 = 228
trp_knight_3_4 = 229
trp_knight_3_5 = 230
trp_knight_3_6 = 231
trp_knight_3_7 = 232
trp_knight_3_8 = 233
trp_knight_3_9 = 234
trp_knight_3_10 = 235
trp_knight_3_11 = 236
trp_knight_3_12 = 237
trp_knight_3_13 = 238
trp_knight_3_14 = 239
trp_knight_3_15 = 240
trp_knight_3_16 = 241
trp_knight_3_17 = 242
trp_knight_3_18 = 243
trp_knight_3_19 = 244
trp_knight_3_20 = 245
trp_knight_4_1 = 246
trp_knight_4_2 = 247
trp_knight_4_3 = 248
trp_knight_4_4 = 249
trp_knight_4_5 = 250
trp_knight_4_6 = 251
trp_knight_4_7 = 252
trp_knight_4_8 = 253
trp_knight_4_9 = 254
trp_knight_4_10 = 255
trp_knight_4_11 = 256
trp_knight_4_12 = 257
trp_knight_4_13 = 258
trp_knight_4_14 = 259
trp_knight_4_15 = 260
trp_knight_4_16 = 261
trp_knight_4_17 = 262
trp_knight_4_18 = 263
trp_knight_4_19 = 264
trp_knight_4_20 = 265
trp_knight_5_1 = 266
trp_knight_5_2 = 267
trp_knight_5_3 = 268
trp_knight_5_4 = 269
trp_knight_5_5 = 270
trp_knight_5_6 = 271
trp_knight_5_7 = 272
trp_knight_5_8 = 273
trp_knight_5_9 = 274
trp_knight_5_10 = 275
trp_knight_5_11 = 276
trp_knight_5_12 = 277
trp_knight_5_13 = 278
trp_knight_5_14 = 279
trp_knight_5_15 = 280
trp_knight_5_16 = 281
trp_knight_5_17 = 282
trp_knight_5_18 = 283
trp_knight_5_19 = 284
trp_knight_5_20 = 285
trp_kingdom_1_pretender = 286
trp_kingdom_2_pretender = 287
trp_kingdom_3_pretender = 288
trp_kingdom_4_pretender = 289
trp_kingdom_5_pretender = 290
trp_knight_1_1_wife = 291
trp_knight_2_1_wife = 292
trp_knight_3_1_wife = 293
trp_knight_4_1_wife = 294
trp_knight_5_1_wife = 295
trp_knight_1_2_wife = 296
trp_knight_2_2_wife = 297
trp_knight_3_2_wife = 298
trp_knight_4_2_wife = 299
trp_knight_5_2_wife = 300
trp_knight_1_1_daughter = 301
trp_knight_2_1_daughter = 302
trp_knight_3_1_daughter = 303
trp_knight_4_1_daughter = 304
trp_knight_5_1_daughter = 305
trp_knight_1_2_daughter = 306
trp_knight_2_2_daughter = 307
trp_knight_3_2_daughter = 308
trp_knight_4_2_daughter = 309
trp_knight_5_2_daughter = 310
trp_heroes_end = 311
trp_town_1_seneschal = 312
trp_town_2_seneschal = 313
trp_town_3_seneschal = 314
trp_town_4_seneschal = 315
trp_town_5_seneschal = 316
trp_town_6_seneschal = 317
trp_town_7_seneschal = 318
trp_town_8_seneschal = 319
trp_town_9_seneschal = 320
trp_town_10_seneschal = 321
trp_town_11_seneschal = 322
trp_town_12_seneschal = 323
trp_town_13_seneschal = 324
trp_town_14_seneschal = 325
trp_town_15_seneschal = 326
trp_town_16_seneschal = 327
trp_town_17_seneschal = 328
trp_town_18_seneschal = 329
trp_castle_1_seneschal = 330
trp_castle_2_seneschal = 331
trp_castle_3_seneschal = 332
trp_castle_4_seneschal = 333
trp_castle_5_seneschal = 334
trp_castle_6_seneschal = 335
trp_castle_7_seneschal = 336
trp_castle_8_seneschal = 337
trp_castle_9_seneschal = 338
trp_castle_10_seneschal = 339
trp_castle_11_seneschal = 340
trp_castle_12_seneschal = 341
trp_castle_13_seneschal = 342
trp_castle_14_seneschal = 343
trp_castle_15_seneschal = 344
trp_castle_16_seneschal = 345
trp_castle_17_seneschal = 346
trp_castle_18_seneschal = 347
trp_castle_19_seneschal = 348
trp_castle_20_seneschal = 349
trp_castle_21_seneschal = 350
trp_castle_22_seneschal = 351
trp_castle_23_seneschal = 352
trp_castle_24_seneschal = 353
trp_castle_25_seneschal = 354
trp_castle_26_seneschal = 355
trp_castle_27_seneschal = 356
trp_castle_28_seneschal = 357
trp_castle_29_seneschal = 358
trp_castle_30_seneschal = 359
trp_castle_31_seneschal = 360
trp_castle_32_seneschal = 361
trp_castle_33_seneschal = 362
trp_castle_34_seneschal = 363
trp_castle_35_seneschal = 364
trp_castle_36_seneschal = 365
trp_castle_37_seneschal = 366
trp_castle_38_seneschal = 367
trp_castle_39_seneschal = 368
trp_castle_40_seneschal = 369
trp_town_1_arena_master = 370
trp_town_2_arena_master = 371
trp_town_3_arena_master = 372
trp_town_4_arena_master = 373
trp_town_5_arena_master = 374
trp_town_6_arena_master = 375
trp_town_7_arena_master = 376
trp_town_8_arena_master = 377
trp_town_9_arena_master = 378
trp_town_10_arena_master = 379
trp_town_11_arena_master = 380
trp_town_12_arena_master = 381
trp_town_13_arena_master = 382
trp_town_14_arena_master = 383
trp_town_15_arena_master = 384
trp_town_16_arena_master = 385
trp_town_17_arena_master = 386
trp_town_18_arena_master = 387
trp_town_1_armorer = 388
trp_town_2_armorer = 389
trp_town_3_armorer = 390
trp_town_4_armorer = 391
trp_town_5_armorer = 392
trp_town_6_armorer = 393
trp_town_7_armorer = 394
trp_town_8_armorer = 395
trp_town_9_armorer = 396
trp_town_10_armorer = 397
trp_town_11_armorer = 398
trp_town_12_armorer = 399
trp_town_13_armorer = 400
trp_town_14_armorer = 401
trp_town_15_armorer = 402
trp_town_16_armorer = 403
trp_town_17_armorer = 404
trp_town_18_armorer = 405
trp_town_1_weaponsmith = 406
trp_town_2_weaponsmith = 407
trp_town_3_weaponsmith = 408
trp_town_4_weaponsmith = 409
trp_town_5_weaponsmith = 410
trp_town_6_weaponsmith = 411
trp_town_7_weaponsmith = 412
trp_town_8_weaponsmith = 413
trp_town_9_weaponsmith = 414
trp_town_10_weaponsmith = 415
trp_town_11_weaponsmith = 416
trp_town_12_weaponsmith = 417
trp_town_13_weaponsmith = 418
trp_town_14_weaponsmith = 419
trp_town_15_weaponsmith = 420
trp_town_16_weaponsmith = 421
trp_town_17_weaponsmith = 422
trp_town_18_weaponsmith = 423
trp_town_1_tavernkeeper = 424
trp_town_2_tavernkeeper = 425
trp_town_3_tavernkeeper = 426
trp_town_4_tavernkeeper = 427
trp_town_5_tavernkeeper = 428
trp_town_6_tavernkeeper = 429
trp_town_7_tavernkeeper = 430
trp_town_8_tavernkeeper = 431
trp_town_9_tavernkeeper = 432
trp_town_10_tavernkeeper = 433
trp_town_11_tavernkeeper = 434
trp_town_12_tavernkeeper = 435
trp_town_13_tavernkeeper = 436
trp_town_14_tavernkeeper = 437
trp_town_15_tavernkeeper = 438
trp_town_16_tavernkeeper = 439
trp_town_17_tavernkeeper = 440
trp_town_18_tavernkeeper = 441
trp_town_1_merchant = 442
trp_town_2_merchant = 443
trp_town_3_merchant = 444
trp_town_4_merchant = 445
trp_town_5_merchant = 446
trp_town_6_merchant = 447
trp_town_7_merchant = 448
trp_town_8_merchant = 449
trp_town_9_merchant = 450
trp_town_10_merchant = 451
trp_town_11_merchant = 452
trp_town_12_merchant = 453
trp_town_13_merchant = 454
trp_town_14_merchant = 455
trp_town_15_merchant = 456
trp_town_16_merchant = 457
trp_town_17_merchant = 458
trp_town_18_merchant = 459
trp_salt_mine_merchant = 460
trp_town_1_horse_merchant = 461
trp_town_2_horse_merchant = 462
trp_town_3_horse_merchant = 463
trp_town_4_horse_merchant = 464
trp_town_5_horse_merchant = 465
trp_town_6_horse_merchant = 466
trp_town_7_horse_merchant = 467
trp_town_8_horse_merchant = 468
trp_town_9_horse_merchant = 469
trp_town_10_horse_merchant = 470
trp_town_11_horse_merchant = 471
trp_town_12_horse_merchant = 472
trp_town_13_horse_merchant = 473
trp_town_14_horse_merchant = 474
trp_town_15_horse_merchant = 475
trp_town_16_horse_merchant = 476
trp_town_17_horse_merchant = 477
trp_town_18_horse_merchant = 478
trp_town_1_mayor = 479
trp_town_2_mayor = 480
trp_town_3_mayor = 481
trp_town_4_mayor = 482
trp_town_5_mayor = 483
trp_town_6_mayor = 484
trp_town_7_mayor = 485
trp_town_8_mayor = 486
trp_town_9_mayor = 487
trp_town_10_mayor = 488
trp_town_11_mayor = 489
trp_town_12_mayor = 490
trp_town_13_mayor = 491
trp_town_14_mayor = 492
trp_town_15_mayor = 493
trp_town_16_mayor = 494
trp_town_17_mayor = 495
trp_town_18_mayor = 496
trp_village_1_elder = 497
trp_village_2_elder = 498
trp_village_3_elder = 499
trp_village_4_elder = 500
trp_village_5_elder = 501
trp_village_6_elder = 502
trp_village_7_elder = 503
trp_village_8_elder = 504
trp_village_9_elder = 505
trp_village_10_elder = 506
trp_village_11_elder = 507
trp_village_12_elder = 508
trp_village_13_elder = 509
trp_village_14_elder = 510
trp_village_15_elder = 511
trp_village_16_elder = 512
trp_village_17_elder = 513
trp_village_18_elder = 514
trp_village_19_elder = 515
trp_village_20_elder = 516
trp_village_21_elder = 517
trp_village_22_elder = 518
trp_village_23_elder = 519
trp_village_24_elder = 520
trp_village_25_elder = 521
trp_village_26_elder = 522
trp_village_27_elder = 523
trp_village_28_elder = 524
trp_village_29_elder = 525
trp_village_30_elder = 526
trp_village_31_elder = 527
trp_village_32_elder = 528
trp_village_33_elder = 529
trp_village_34_elder = 530
trp_village_35_elder = 531
trp_village_36_elder = 532
trp_village_37_elder = 533
trp_village_38_elder = 534
trp_village_39_elder = 535
trp_village_40_elder = 536
trp_village_41_elder = 537
trp_village_42_elder = 538
trp_village_43_elder = 539
trp_village_44_elder = 540
trp_village_45_elder = 541
trp_village_46_elder = 542
trp_village_47_elder = 543
trp_village_48_elder = 544
trp_village_49_elder = 545
trp_village_50_elder = 546
trp_village_51_elder = 547
trp_village_52_elder = 548
trp_village_53_elder = 549
trp_village_54_elder = 550
trp_village_55_elder = 551
trp_village_56_elder = 552
trp_village_57_elder = 553
trp_village_58_elder = 554
trp_village_59_elder = 555
trp_village_60_elder = 556
trp_village_61_elder = 557
trp_village_62_elder = 558
trp_village_63_elder = 559
trp_village_64_elder = 560
trp_village_65_elder = 561
trp_village_66_elder = 562
trp_village_67_elder = 563
trp_village_68_elder = 564
trp_village_69_elder = 565
trp_village_70_elder = 566
trp_village_71_elder = 567
trp_village_72_elder = 568
trp_village_73_elder = 569
trp_village_74_elder = 570
trp_village_75_elder = 571
trp_village_76_elder = 572
trp_village_77_elder = 573
trp_village_78_elder = 574
trp_village_79_elder = 575
trp_village_80_elder = 576
trp_village_81_elder = 577
trp_village_82_elder = 578
trp_village_83_elder = 579
trp_village_84_elder = 580
trp_village_85_elder = 581
trp_village_86_elder = 582
trp_village_87_elder = 583
trp_village_88_elder = 584
trp_village_89_elder = 585
trp_village_90_elder = 586
trp_merchants_end = 587
trp_zendar_chest = 588
trp_tutorial_chest_1 = 589
trp_tutorial_chest_2 = 590
trp_bonus_chest_1 = 591
trp_bonus_chest_2 = 592
trp_bonus_chest_3 = 593
trp_temp_array_a = 594
trp_temp_array_b = 595
trp_temp_array_c = 596
trp_stack_selection_amounts = 597
trp_stack_selection_ids = 598
trp_notification_menu_types = 599
trp_notification_menu_var1 = 600
trp_notification_menu_var2 = 601
trp_banner_background_color_array = 602
trp_local_merchant = 603
trp_tax_rebel = 604
trp_trainee_peasant = 605
trp_fugitive = 606
trp_spy = 607
trp_spy_partner = 608
trp_quick_battle_6_player = 609
trp_log_array_entry_type = 610
trp_log_array_entry_time = 611
trp_log_array_actor = 612
trp_log_array_center_object = 613
trp_log_array_center_object_lord = 614
trp_log_array_center_object_faction = 615
trp_log_array_troop_object = 616
trp_log_array_troop_object_faction = 617
trp_log_array_faction_object = 618
| Python |
from header_common import *
from ID_animations import *
from header_mission_templates import *
from header_tableau_materials import *
from header_items import *
from module_constants import *
####################################################################################################################
# Each tableau material contains the following fields:
# 1) Tableau id (string): used for referencing tableaux in other files. The prefix tab_ is automatically added before each tableau-id.
# 2) Tableau flags (int). See header_tableau_materials.py for a list of available flags
# 3) Tableau sample material name (string).
# 4) Tableau width (int).
# 5) Tableau height (int).
# 6) Tableau mesh min x (int): divided by 1000 and used when a mesh is auto-generated using the tableau material
# 7) Tableau mesh min y (int): divided by 1000 and used when a mesh is auto-generated using the tableau material
# 8) Tableau mesh max x (int): divided by 1000 and used when a mesh is auto-generated using the tableau material
# 9) Tableau mesh max y (int): divided by 1000 and used when a mesh is auto-generated using the tableau material
# 10) Operations block (list): A list of operations. See header_operations.py for reference.
# The operations block is executed when the tableau is activated.
#
####################################################################################################################
#banner height = 200, width = 85 with wood, 75 without wood
tableaus = [
("game_character_sheet", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 266, 532,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_troop_character_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_troop_character_alpha_mask", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 300),
]),
("game_inventory_window", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 180, 270,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_troop_inventory_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_troop_inventory_alpha_mask", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 300),
]),
("game_party_window", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 300, 300,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_troop_party_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_troop_party_alpha_mask", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 300),
]),
("round_shield_1", 0, "sample_shield_round_1", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 125),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 120, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("round_shield_2", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("round_shield_3", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_3", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("round_shield_4", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 125),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 123, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_4", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("round_shield_5", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 125),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 122, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_5", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("small_round_shield_1", 0, "sample_shield_small_round_1", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 127, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_small_round_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("small_round_shield_2", 0, "sample_shield_small_round_2", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 127, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_small_round_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("small_round_shield_3", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 127, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_small_round_3", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("kite_shield_1", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -60),
(position_set_y, pos1, 140),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("kite_shield_2", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -57),
(position_set_y, pos1, 140),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("kite_shield_3", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -57),
(position_set_y, pos1, 140),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_3", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("kite_shield_4", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 160),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 120, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_4", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heater_shield_1", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -60),
(position_set_y, pos1, 151),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_heater_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heater_shield_2", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 150),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_heater_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("pavise_shield_1", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -54),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 118, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("pavise_shield_2", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -54),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heraldic_armor_a", 0, "sample_heraldic_armor_a", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin),
(troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"),
(cur_tableau_set_background_color, ":background_color"),
(init_position, pos1),
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"),
# (cur_tableau_add_mesh, "mesh_heraldic_armor_bg", pos1, 200, 0),
(init_position, pos1),
(position_set_z, pos1, 50),
(position_set_x, pos1, -25),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 103, 0),
# (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_a", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heraldic_armor_b", 0, "sample_heraldic_armor_b", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin),
(troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"),
(cur_tableau_set_background_color, ":background_color"),
(init_position, pos1),
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"),
(init_position, pos1),
(position_set_x, pos1, -5),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 113, 0),
# (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_b", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heraldic_armor_c", 0, "sample_heraldic_armor_c", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin),
(troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"),
(cur_tableau_set_background_color, ":background_color"),
(init_position, pos1),
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"),
(init_position, pos1),
(position_set_x, pos1, -0),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 115, 0),
# (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_c", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heraldic_armor_d", 0, "sample_heraldic_armor_d", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin),
(troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"),
(cur_tableau_set_background_color, ":background_color"),
(init_position, pos1),
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"),
(init_position, pos1),
(position_set_x, pos1, -0),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 113, 0),
# (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_d", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("troop_note_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau", ":troop_no"),
]),
("troop_note_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFFC6BB94),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau", ":troop_no"),
]),
("troop_character_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau_for_character", ":troop_no"),
]),
("troop_character_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFFE0CFB1),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau_for_character", ":troop_no"),
]),
("troop_inventory_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau_for_inventory", ":troop_no"),
]),
("troop_inventory_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF6A583A),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau_for_inventory", ":troop_no"),
]),
("troop_party_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau_for_party", ":troop_no"),
]),
("troop_party_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFFBE9C72),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau_for_party", ":troop_no"),
]),
("troop_note_mesh", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 350, 350,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_troop_note_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_troop_note_alpha_mask", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 300),
(cur_tableau_add_mesh, "mesh_portrait_blend_out", pos1, 0, 0),
]),
("center_note_mesh", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 200, 200,
[
(store_script_param, ":center_no", 1),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(init_position, pos8),
(position_set_x, pos8, -210),
(position_set_y, pos8, 200),
(position_set_z, pos8, 300),
(cur_tableau_add_point_light, pos8, 550,500,450),
## (party_get_slot, ":troop_no", ":center_no", slot_town_lord),
## (try_begin),
## (ge, ":troop_no", 0),
## (troop_get_slot, ":banner_spr", ":troop_no", slot_troop_banner_scene_prop),
## (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
## (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
## (val_sub, ":banner_spr", banner_scene_props_begin),
## (store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin),
## (try_end),
##
## (init_position, pos1),
## (position_set_x, pos1, -60),
## (position_set_y, pos1, -100),
## (position_set_z, pos1, 230),
## (position_rotate_x, pos1, 90),
## (assign, ":banner_scale", 105),
(cur_tableau_set_camera_parameters, 1, 10, 10, 10, 10000),
## (position_set_x, pos1, -100),
(init_position, pos1),
(position_set_z, pos1, 0),
(position_set_z, pos1, -500),
(init_position, pos1),
(position_set_y, pos1, -100),
(position_set_x, pos1, -100),
(position_set_z, pos1, 100),
(position_rotate_z, pos1, 200),
## (cur_tableau_add_mesh, ":banner_mesh", pos1, ":banner_scale", 0),
(party_get_icon, ":map_icon", ":center_no"),
(try_begin),
(ge, ":map_icon", 0),
(cur_tableau_add_map_icon, ":map_icon", pos1, 0),
(try_end),
(init_position, pos5),
(position_set_x, pos5, -90),
(position_set_z, pos5, 500),
(position_set_y, pos5, 480),
(position_rotate_x, pos5, -90),
(position_rotate_z, pos5, 180),
(position_rotate_x, pos5, -35),
(cur_tableau_set_camera_position, pos5),
]),
("faction_note_mesh_for_menu", 0, "pic_arms_swadian", 1024, 512, 0, 0, 450, 225,
[
(store_script_param, ":faction_no", 1),
(cur_tableau_set_background_color, 0xFFFFFFFF),
(set_fixed_point_multiplier, 100),
(try_begin),
(is_between, ":faction_no", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
(store_add, ":banner_mesh", "mesh_pic_arms_swadian", ":faction_no"),
(val_sub, ":banner_mesh", "fac_kingdom_1"),
(init_position, pos1),
(position_set_y, pos1, -5),
(position_set_x, pos1, -45),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 160, 80, 0, 100000),
(try_end),
]),
("faction_note_mesh", 0, "pic_arms_swadian", 1024, 512, 0, 0, 500, 250,
[
(store_script_param, ":faction_no", 1),
(cur_tableau_set_background_color, 0xFFFFFFFF),
(set_fixed_point_multiplier, 100),
(try_begin),
(is_between, ":faction_no", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
(store_add, ":banner_mesh", "mesh_pic_arms_swadian", ":faction_no"),
(val_sub, ":banner_mesh", "fac_kingdom_1"),
(init_position, pos1),
(position_set_y, pos1, -5),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 50, 0, 100000),
(try_end),
]),
("faction_note_mesh_banner", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 200, 200,
[
(store_script_param, ":faction_no", 1),
(set_fixed_point_multiplier, 100),
(try_begin),
(faction_get_slot, ":leader_troop", ":faction_no", slot_faction_leader),
(ge, ":leader_troop", 0),
(troop_get_slot, ":banner_spr", ":leader_troop", slot_troop_banner_scene_prop),
(store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
(is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
(val_sub, ":banner_spr", banner_scene_props_begin),
(store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin),
(init_position, pos1),
(position_set_y, pos1, 100),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 210, 210, 0, 100000),
(try_end),
]),
("2_factions_mesh", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 200, 200,
[
(store_script_param, ":faction_no", 1),
(store_mod, ":faction_no_2", ":faction_no", 128),
(val_div, ":faction_no", 128),
(val_add, ":faction_no", kingdoms_begin),
(val_add, ":faction_no_2", kingdoms_begin),
(set_fixed_point_multiplier, 100),
(try_begin),
(faction_get_slot, ":leader_troop", ":faction_no", slot_faction_leader),
(ge, ":leader_troop", 0),
(troop_get_slot, ":banner_spr", ":leader_troop", slot_troop_banner_scene_prop),
(store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
(is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
(val_sub, ":banner_spr", banner_scene_props_begin),
(store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 100),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(try_end),
(try_begin),
(faction_get_slot, ":leader_troop", ":faction_no_2", slot_faction_leader),
(ge, ":leader_troop", 0),
(troop_get_slot, ":banner_spr", ":leader_troop", slot_troop_banner_scene_prop),
(store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
(is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
(val_sub, ":banner_spr", banner_scene_props_begin),
(store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin),
(init_position, pos1),
(position_set_x, pos1, 50),
(position_set_y, pos1, 100),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(try_end),
(cur_tableau_set_camera_parameters, 0, 210, 210, 0, 100000),
]),
("color_picker", 0, "missiles", 32, 32, 0, 0, 0, 0,
[
(store_script_param, ":color", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(cur_tableau_add_mesh, "mesh_color_picker", pos1, 0, 0),
(position_move_z, pos1, 1),
(position_move_x, pos1, -2),
(position_move_y, pos1, -2),
(cur_tableau_add_mesh_with_vertex_color, "mesh_white_plane", pos1, 200, 0, ":color"),
(cur_tableau_set_camera_parameters, 0, 20, 20, 0, 100000),
]),
("custom_banner_square_no_mesh", 0, "missiles", 512, 512, 0, 0, 300, 300,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", 0, 0, 10000, 10000, 9800, 9800, 10000, 10000, 0),
(cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000),
]),
("custom_banner_default", 0, "missiles", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", -9, -2, 7450, 19400, 7200, 18000, 9000, 10000, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000),
]),
("custom_banner_tall", 0, "missiles", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", -9, 12, 8250, 18000, 8000, 21000, 10000, 10000, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000),
]),
("custom_banner_square", 0, "missiles", 256, 256, 0, 0, 0, 0,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", -11, 10, 7700, 7700, 7500, 7500, 8300, 10000, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner_square", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000),
]),
("custom_banner_short", 0, "missiles", 256, 512, 0, 0, 0, 0,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", -10, 0, 8050, 5000, 4200, 4800, 6600, 10000, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner_short", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 50, 0, 100000),
]),
## ("custom_banner", 0, "missiles", 256, 512, 0, 0, 0, 0,
## [
## (store_script_param, ":troop_no", 1),
##
## (set_fixed_point_multiplier, 100),
## (troop_get_slot, ":bg_type", ":troop_no", slot_troop_custom_banner_bg_type),
## (val_add, ":bg_type", custom_banner_backgrounds_begin),
## (troop_get_slot, ":bg_color_1", ":troop_no", slot_troop_custom_banner_bg_color_1),
## (troop_get_slot, ":bg_color_2", ":troop_no", slot_troop_custom_banner_bg_color_2),
## (troop_get_slot, ":num_charges", ":troop_no", slot_troop_custom_banner_num_charges),
## (troop_get_slot, ":positioning", ":troop_no", slot_troop_custom_banner_positioning),
## (call_script, "script_get_troop_custom_banner_num_positionings", ":troop_no"),
## (assign, ":num_positionings", reg0),
## (val_mod, ":positioning", ":num_positionings"),
##
## (init_position, pos1),
##
## (position_move_z, pos1, -10),
## (cur_tableau_add_mesh_with_vertex_color, ":bg_type", pos1, 0, 0, ":bg_color_1"),
## (position_move_z, pos1, -10),
## (cur_tableau_add_mesh_with_vertex_color, "mesh_custom_banner_bg", pos1, 0, 0, ":bg_color_2"),
## (init_position, pos1),
## (position_move_z, pos1, -50),
## (cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0),
##
## (call_script, "script_get_custom_banner_charge_type_position_scale_color", "trp_player", ":positioning"),
## (try_begin),
## (ge, ":num_charges", 1),
## (cur_tableau_add_mesh_with_vertex_color, reg0, pos0, reg1, 0, reg2),
## (try_end),
## (try_begin),
## (ge, ":num_charges", 2),
## (cur_tableau_add_mesh_with_vertex_color, reg3, pos1, reg4, 0, reg5),
## (try_end),
## (try_begin),
## (ge, ":num_charges", 3),
## (cur_tableau_add_mesh_with_vertex_color, reg6, pos2, reg7, 0, reg8),
## (try_end),
## (try_begin),
## (ge, ":num_charges", 4),
## (cur_tableau_add_mesh_with_vertex_color, reg9, pos3, reg10, 0, reg11),
## (try_end),
##
## (cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000),
## ]),
("background_selection", 0, "missiles", 512, 512, 0, 0, 100, 100,
[
(store_script_param, ":banner_bg", 1),
(troop_get_slot, ":old_bg", "trp_player", slot_troop_custom_banner_bg_type),
(troop_set_slot, "trp_player", slot_troop_custom_banner_bg_type, ":banner_bg"),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", "trp_player", 0, 0, 10000, 10000, 9800, 9800, 10000, 10000, 0),
(cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000),
(troop_set_slot, "trp_player", slot_troop_custom_banner_bg_type, ":old_bg"),
]),
("positioning_selection", 0, "missiles", 512, 512, 0, 0, 100, 100,
[
(store_script_param, ":positioning", 1),
(troop_get_slot, ":old_positioning", "trp_player", slot_troop_custom_banner_positioning),
(troop_set_slot, "trp_player", slot_troop_custom_banner_positioning, ":positioning"),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", "trp_player", 0, 0, 10000, 10000, 9800, 9800, 10000, 10000, 0),
(cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000),
(troop_set_slot, "trp_player", slot_troop_custom_banner_positioning, ":old_positioning"),
]),
("retirement_troop", 0, "troop_portrait", 1024, 1024, 0, 0, 600, 600,
[
(store_script_param, ":type", 1),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_background_color, 0x00000000),
(cur_tableau_set_ambient_light, 10,11,15),
(init_position, pos8),
(position_set_x, pos8, -210),
(position_set_y, pos8, 200),
(position_set_z, pos8, 300),
(cur_tableau_add_point_light, pos8, 550,500,450),
(cur_tableau_set_override_flags, af_override_all),
(try_begin),
(eq, ":type", 0),
(cur_tableau_add_override_item, "itm_pilgrim_hood"),
(cur_tableau_add_override_item, "itm_pilgrim_disguise"),
(cur_tableau_add_override_item, "itm_wrapping_boots"),
(assign, ":animation", "anim_pose_1"),
(else_try),
(eq, ":type", 1),
(cur_tableau_add_override_item, "itm_black_hood"),
(cur_tableau_add_override_item, "itm_shirt"),
(cur_tableau_add_override_item, "itm_wrapping_boots"),
(assign, ":animation", "anim_pose_1"),
(else_try),
(eq, ":type", 2),
(cur_tableau_add_override_item, "itm_coarse_tunic"),
(cur_tableau_add_override_item, "itm_wrapping_boots"),
(assign, ":animation", "anim_pose_2"),
(else_try),
(eq, ":type", 3),
(cur_tableau_add_override_item, "itm_linen_tunic"),
(cur_tableau_add_override_item, "itm_woolen_hose"),
(assign, ":animation", "anim_pose_2"),
(else_try),
(eq, ":type", 4),
(cur_tableau_add_override_item, "itm_leather_apron"),
(cur_tableau_add_override_item, "itm_leather_boots"),
(assign, ":animation", "anim_pose_3"),
(else_try),
(eq, ":type", 5),
(cur_tableau_add_override_item, "itm_short_tunic"),
(cur_tableau_add_override_item, "itm_leather_boots"),
(assign, ":animation", "anim_pose_3"),
(else_try),
(eq, ":type", 6),
(cur_tableau_add_override_item, "itm_tabard"),
(cur_tableau_add_override_item, "itm_leather_boots"),
(assign, ":animation", "anim_pose_4"),
(else_try),
(eq, ":type", 7),
(cur_tableau_add_override_item, "itm_courtly_outfit"),
(cur_tableau_add_override_item, "itm_mail_boots"),
(assign, ":animation", "anim_pose_4"),
(else_try),
(eq, ":type", 8),
(cur_tableau_add_override_item, "itm_nobleman_outfit"),
(cur_tableau_add_override_item, "itm_woolen_hose"),
(assign, ":animation", "anim_pose_4"),
(else_try),
(eq, ":type", 9),
(cur_tableau_add_override_item, "itm_heraldic_mail_with_surcoat"),
(cur_tableau_add_override_item, "itm_mail_boots"),
(assign, ":animation", "anim_pose_5"),
(else_try),
(cur_tableau_add_override_item, "itm_heraldic_mail_with_tabard"),
(cur_tableau_add_override_item, "itm_iron_greaves"),
(assign, ":animation", "anim_pose_5"),
(try_end),
(init_position, pos2),
(cur_tableau_set_camera_parameters, 1, 6, 6, 10, 10000),
(init_position, pos5),
(position_set_z, pos5, 96),
(position_set_y, pos5, 350),
## (troop_get_inventory_slot, ":horse_item", "trp_player", ek_horse),
## (try_begin),
## (gt, ":horse_item", 0),
## (position_rotate_z, pos2, -40),
## (cur_tableau_add_horse, ":horse_item", pos2, anim_horse_stand, 0),
## (assign, ":animation", anim_ride_0),
## (position_set_z, pos5, 125),
## (position_set_y, pos5, 480),
## (try_end),
(cur_tableau_add_troop, "trp_player", pos2, ":animation" , 0),
(position_rotate_x, pos5, -90),
(position_rotate_z, pos5, 180),
(cur_tableau_set_camera_position, pos5),
]),
("retired_troop_alpha_mask", 0, "mat_troop_portrait_mask", 512, 512, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau", ":troop_no"),
]),
("retired_troop_color", 0, "mat_troop_portrait_color", 512, 512, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFFe7d399),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau", ":troop_no"),
]),
("retired_troop", 0, "tableau_with_transparency", 512, 512, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_retired_troop_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_retired_troop_alpha_mask", ":troop_no", pos1, 0, 0),
]),
]
| Python |
import string
from module_info import *
from module_presentations import *
from ID_meshes import *
from process_common import *
from process_operations import *
def save_presentations(variable_list,variable_uses,tag_uses,quick_strings):
ofile = open(export_dir + "presentations.txt","w")
ofile.write("presentationsfile version 1\n")
ofile.write(" %d\n"%(len(presentations)))
for presentation in presentations:
ofile.write("prsnt_%s %d %d "%(presentation[0], presentation[1], presentation[2]))
save_simple_triggers(ofile,presentation[3], variable_list,variable_uses,tag_uses,quick_strings)
ofile.write("\n")
ofile.close()
def save_python_header():
file = open("./ID_presentations.py","w")
for i_presentation in xrange(len(presentations)):
file.write("prsnt_%s = %d\n"%(presentations[i_presentation][0],i_presentation))
file.close()
print "Exporting presentations..."
save_python_header()
variable_uses = []
variables = load_variables(export_dir,variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_presentations(variables,variable_uses,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir,tag_uses)
save_quick_strings(export_dir,quick_strings)
| Python |
#import string
#import types
from module_info import *
from module_triggers import *
from module_dialogs import *
from module_simple_triggers import *
from module_presentations import *
from process_common import *
from process_operations import *
#-------------------------------------------------------
def compile_all_global_vars(variable_list,variable_uses, triggers, sentences, game_menus, mission_templates, scripts, simple_triggers):
temp_list = []
list_type = type(temp_list)
print "#Triggers begin"
for trigger in triggers:
try:
compile_global_vars(trigger[3], variable_list,variable_uses),
compile_global_vars(trigger[4], variable_list,variable_uses),
except:
print "Error in trigger:"
print trigger
print "#Triggers end"
print "#Dialogs begin"
for sentence in sentences:
try:
compile_global_vars(sentence[2], variable_list,variable_uses),
compile_global_vars(sentence[5], variable_list,variable_uses),
except:
print "Error in dialog line:"
print sentence
print "#Dialogs end"
print "#Game menus begin"
for game_menu in game_menus:
try:
compile_global_vars(game_menu[4], variable_list,variable_uses)
menu_items = game_menu[5]
for menu_item in menu_items:
compile_global_vars(menu_item[1], variable_list,variable_uses)
compile_global_vars(menu_item[3], variable_list,variable_uses)
except:
print "Error in game menu:"
print game_menu
print "#Game menus end"
print "#Mission templates begin"
for mission_template in mission_templates:
try:
mt_triggers = mission_template[5]
for mt_trigger in mt_triggers:
compile_global_vars(mt_trigger[3], variable_list,variable_uses)
compile_global_vars(mt_trigger[4], variable_list,variable_uses)
except:
print "Error in mission template:"
print mission_template
print "#Mission templates end"
print "#Presentations begin"
for presentation in presentations:
try:
prsnt_triggers = presentation[3]
for prsnt_trigger in prsnt_triggers:
compile_global_vars(prsnt_trigger[1], variable_list,variable_uses)
except:
print "Error in presentation:"
print presentation
print "#Presentations end"
print "#Scripts begin"
for i_script in xrange(len(scripts)):
try:
func = scripts[i_script]
if (type(func[1]) == list_type):
compile_global_vars(func[1], variable_list,variable_uses)
else:
compile_global_vars(func[2], variable_list,variable_uses)
except:
print "Error in script:"
print func
print "#Scripts end"
print "#Simple triggers begin"
for simple_trigger in simple_triggers:
try:
compile_global_vars(simple_trigger[1] , variable_list,variable_uses)
except:
print "Error in simple trigger:"
print simple_trigger
print "#Simple triggers end"
print "Compiling all global variables..."
variables = []
variable_uses = []
compile_all_global_vars(variables, variable_uses,triggers, dialogs, game_menus, mission_templates, scripts, simple_triggers)
save_variables(export_dir, variables,variable_uses)
| Python |
# Point export_dir to the folder you will be keeping your module
# Make sure you use forward slashes (/) and NOT backward slashes (\)
export_dir = "D:/Game/Mount&Blade/Modules/Test/"
| Python |
import string
from header_common import *
from module_info import *
from module_meshes import *
from process_common import *
def save_meshes():
ofile = open(export_dir + "meshes.txt","w")
ofile.write("%d\n"%len(meshes))
for i_mesh in xrange(len(meshes)):
mesh = meshes[i_mesh]
ofile.write("mesh_%s %d %s %f %f %f %f %f %f %f %f %f\n"%(mesh[0],mesh[1],replace_spaces(mesh[2]),mesh[3],mesh[4],mesh[5],mesh[6],mesh[7],mesh[8],mesh[9],mesh[10],mesh[11]))
ofile.close()
def save_python_header():
ofile = open("./ID_meshes.py","w")
for i_mesh in xrange(len(meshes)):
ofile.write("mesh_%s = %d\n"%(meshes[i_mesh][0],i_mesh))
ofile.write("\n\n")
ofile.close()
print "Exporting meshes..."
save_python_header()
save_meshes()
| Python |
from header_common import *
from header_skills import *
####################################################################################################################
# Each skill contains the following fields:
# 1) Skill id (string): used for referencing skills in other files. The prefix skl_ is automatically added before each skill-id .
# 2) Skill name (string).
# 3) Skill flags (int). See header_skills.py for a list of available flags
# 4) Maximum level of the skill (int).
# 5) Skill description (string): used in character window for explaining the skills.
#
####################################################################################################################
#Hardcoded skills are {names (indexes, beginning with 0)}:
# Trade (1)
# Leadership (2)
# Prisoner Management (3)
# First Aid (9)
# Surgery (10)
# Wound Treatment (11)
# Inventory Management (12)
# Spotting (13)
# Pathfinding (14)
# Tactics (15)
# Tracking (16)
# Trainer (17)
# Engineer (18)
# Horse Archery (24)
# Riding (25)
# Athletics (26)
# Shield (27)
# Weapon Master (28)
# Power Draw (34)
# Power Throw (35)
# Power Strike (36)
# Ironflesh (37)
#
# The effects of these skills can only be removed if the skill is disabled with sf_inactive flag.
# If you want to add a new skill, use the reserved skills or use non-hardcoded skills.
skills = [
("trade","Trade",sf_base_att_cha|sf_effects_party,10,"Every level of this skill reduces your trade penalty by 5%%. (Party skill)"),
("leadership","Leadership",sf_base_att_cha,10,"Every point increases maximum number of troops you can command by 5, increases your party morale and reduces troop wages by 5%%. (Leader skill)"),
("prisoner_management", "Prisoner Management",sf_base_att_cha,10,"Every level of this skill increases maximum number of prisoners by %d. (Leader skill)"),
("reserved_1","Reserved Skill 1",sf_base_att_cha|sf_inactive,10,"This is a reserved skill."),
("reserved_2","Reserved Skill 2",sf_base_att_cha|sf_inactive,10,"This is a reserved skill."),
("reserved_3","Reserved Skill 3",sf_base_att_cha|sf_inactive,10,"This is a reserved skill."),
("reserved_4","Reserved Skill 4",sf_base_att_cha|sf_inactive,10,"This is a reserved skill."),
("persuasion","Persuasion", sf_base_att_int,10, "This skill helps you make other people accept your point of view. (Personal skill)"),
("engineer","Engineer",sf_base_att_int|sf_effects_party,10,"This skill allows you to construct siege equipment and fief improvements more efficiently. (Party skill)"),
("first_aid", "First Aid",sf_base_att_int|sf_effects_party,10,"Heroes regain 5%% per skill level of hit-points lost during mission. (Party skill)"),
("surgery","Surgery",sf_base_att_int|sf_effects_party,10,"Each point to this skill gives a 4%% chance that a mortally struck party member will be wounded rather than killed. (Party skill)"),
("wound_treatment","Wound Treatment",sf_base_att_int|sf_effects_party,10,"Party healing speed is increased by 20%% per level of this skill. (Party skill)"),
("inventory_management","Inventory Management",sf_base_att_int,10,"Increases inventory capacity by +6 per skill level. (Leader skill)"),
("spotting","Spotting",sf_base_att_int|sf_effects_party,10,"Party seeing range is increased by 10%% per skill level. (Party skill)"),
("pathfinding","Path-finding",sf_base_att_int|sf_effects_party,10,"Party map speed is increased by 3%% per skill level. (Party skill)"),
("tactics","Tactics",sf_base_att_int|sf_effects_party,10,"Every two levels of this skill increases starting battle advantage by 1. (Party skill)"),
("tracking","Tracking",sf_base_att_int|sf_effects_party,10,"Tracks become more informative. (Party skill)"),
("trainer","Trainer",sf_base_att_int,10,"Every day, each hero with this skill adds some experience to every other member of the party whose level is lower than his/hers. Experience gained goes as: {0,4,10,16,23,30,38,46,55,65,80}. (Personal skill)"),
("reserved_5","Reserved Skill 5",sf_base_att_int|sf_inactive,10,"This is a reserved skill."),
("reserved_6","Reserved Skill 6",sf_base_att_int|sf_inactive,10,"This is a reserved skill."),
("reserved_7","Reserved Skill 7",sf_base_att_int|sf_inactive,10,"This is a reserved skill."),
("reserved_8","Reserved Skill 8",sf_base_att_int|sf_inactive,10,"This is a reserved skill."),
("looting","Looting",sf_base_att_agi|sf_effects_party,10,"This skill increases the amount of loot obtained by 10%% per skill level. (Party skill)"),
("horse_archery","Horse Archery",sf_base_att_agi,10,"Reduces damage and accuracy penalties for archery and throwing from horseback. (Personal skill)"),
("riding","Riding",sf_base_att_agi,10,"Enables you to ride horses of higher difficulty levels and increases your riding speed and manuever. (Personal skill)"),
("athletics","Athletics",sf_base_att_agi,10,"Improves your running speed. (Personal skill)"),
("shield","Shield",sf_base_att_agi,10,"Reduces damage to shields (by 8%% per skill level) and improves shield speed and coverage. (Personal skill)"),
("weapon_master","Weapon Master",sf_base_att_agi,10,"Makes it easier to learn weapon proficiencies and increases the proficiency limits. Limits go as: 60, 100, 140, 180, 220, 260, 300, 340, 380, 420. (Personal skill)"),
("reserved_9","Reserved Skill 9",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."),
("reserved_10","Reserved Skill 10",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."),
("reserved_11","Reserved Skill 11",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."),
("reserved_12","Reserved Skill 12",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."),
("reserved_13","Reserved Skill 13",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."),
("power_draw","Power Draw",sf_base_att_str,10,"Lets character use more powerful bows. Each point to this skill (up to four plus power-draw requirement of the bow) increases bow damage by 14%%. (Personal skill)"),
("power_throw","Power Throw",sf_base_att_str,10,"Each point to this skill increases throwing damage by 10%%. (Personal skill)"),
("power_strike","Power Strike",sf_base_att_str,10,"Each point to this skill increases melee damage by 8%%. (Personal skill)"),
("ironflesh","Ironflesh",sf_base_att_str,10,"Each point to this skill increases hit points by +2. (Personal skill)"),
("reserved_14","Reserved Skill 14",sf_base_att_str|sf_inactive,10,"This is a reserved skill."),
("reserved_15","Reserved Skill 15",sf_base_att_str|sf_inactive,10,"This is a reserved skill."),
("reserved_16","Reserved Skill 16",sf_base_att_str|sf_inactive,10,"This is a reserved skill."),
("reserved_17","Reserved Skill 17",sf_base_att_str|sf_inactive,10,"This is a reserved skill."),
("reserved_18","Reserved Skill 18",sf_base_att_str|sf_inactive,10,"This is a reserved skill."),
]
| Python |
strings = [
("no_string", "NO STRING!"),
("empty_string", " "),
("yes", "Yes."),
("no", "No."),
# Strings before this point are hardwired.
("blank_string", " "),
("error_string", "ERROR!!!ERROR!!!!ERROR!!!ERROR!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!!"),
## ("none", "none"),
("noone", "no one"),
## ("nothing", "nothing"),
("s0", "{s0}"),
("blank_s1", " {s1}"),
("reg1", "{reg1}"),
("s50_comma_s51", "{s50}, {s51}"),
("s50_and_s51", "{s50} and {s51}"),
("s5_s_party", "{s5}'s Party"),
("given_by_s1_at_s2", "Given by {s1} at {s2}"),
("given_by_s1_in_wilderness", "Given by {s1} whilst in the field"),
("s7_raiders", "{s7} Raiders"),
("bandits_eliminated_by_another", "The troublesome bandits have been eliminated by another party."),
("msg_battle_won","Battle won! Press tab key to leave..."),
("tutorial_map1","You are now viewing the overland map. Left-click on the map to move your party to that location, enter the selected town, or pursue the selected party. Time will pause on the overland map if your party is not moving, waiting or resting. To wait anywhere simply press and hold down the space bar."),
("change_color_1", "Change Color 1"),
("change_color_2", "Change Color 2"),
("change_background", "Change Background Pattern"),
("change_flag_type", "Change Flag Type"),
("change_map_flag_type", "Change Map Flag Type"),
("randomize", "Randomize"),
("sample_banner", "Sample banner:"),
("sample_map_banner", "Sample map banner:"),
("number_of_charges", "Number of charges:"),
("change_charge_1", "Change Charge 1"),
("change_charge_1_color", "Change Charge 1 Color"),
("change_charge_2", "Change Charge 2"),
("change_charge_2_color", "Change Charge 2 Color"),
("change_charge_3", "Change Charge 3"),
("change_charge_3_color", "Change Charge 3 Color"),
("change_charge_4", "Change Charge 4"),
("change_charge_4_color", "Change Charge 4 Color"),
("change_charge_position", "Change Charge Position"),
("choose_position", "Choose position:"),
("choose_charge", "Choose a charge:"),
("choose_background", "Choose background pattern:"),
("choose_flag_type", "Choose flag type:"),
("choose_map_flag_type", "Choose map flag type:"),
("choose_color", "Choose color:"),
("accept", "Accept"),
("charge_no_1", "Charge #1:"),
("charge_no_2", "Charge #2:"),
("charge_no_3", "Charge #3:"),
("charge_no_4", "Charge #4:"),
("change", "Change"),
("plus", "+"),
("minus", "-"),
("color_no_1", "Color #1:"),
("color_no_2", "Color #2:"),
("charge", "Charge"),
("color", "Color"),
("flip_horizontal", "Flip Horizontal"),
("flip_vertical", "Flip Vertical"),
("hold_fire", "Hold Fire"),
("blunt_hold_fire", "Blunt / Hold Fire"),
## ("tutorial_camp1","This is training ground where you can learn the basics of the game. Use A, S, D, W keys to move and the mouse to look around."),
## ("tutorial_camp2","F is the action key. You can open doors, talk to people and pick up objects with F key. If you wish to leave a town or retreat from a battle, press the TAB key."),
## ("tutorial_camp3","Training Ground Master wishes to speak with you about your training. Go near him, look at him and press F when you see the word 'Talk' under his name. "),
## ("tutorial_camp4","To see the in-game menu, press the Escape key. If you select Options, and then Controls from the in-game menu, you can see a complete list of key bindings."),
## ("tutorial_camp6","You've received your first quest! You can take a look at your current quests by pressing the Q key. Do it now and check the details of your quest."),
## ("tutorial_camp7","You've completed your quest! Go near Training Ground Master and speak with him about your reward."),
## ("tutorial_camp8","You've gained some experience and weapon points! Press C key to view your character and increase your weapon proficiencies."),
## ("tutorial_camp9","Congratulations! You've finished the tutorial of Mount&Blade. Press TAB key to leave the training ground."),
## ("tutorial_enter_melee", "You are entering the melee weapon training area. The chest nearby contains various weapons which you can experiment with. If you wish to quit this tutorial, press TAB key."),
## ("tutorial_enter_ranged", "You are entering the ranged weapon training area. The chest nearby contains various ranged weapons which you can experiment with. If you wish to quit this tutorial, press TAB key."),
## ("tutorial_enter_mounted", "You are entering the mounted training area. Here, you can try different kinds of weapons while riding a horse. If you wish to quit this tutorial, press TAB key."),
# ("tutorial_usage_sword", "Sword is a very versatile weapon which is very fast in both attack and defense. Usage of one handed swords are affected by your one handed weapon proficiency. Focus on the sword and press F key to pick it up."),
# ("tutorial_usage_axe", "Axe is a heavy (and therefore slow) weapon which can deal high damage to the opponent. Usage of one handed axes are affected by your one handed weapon proficiency. Focus on the axe and press F key to pick it up."),
# ("tutorial_usage_club", "Club is a blunt weapon which deals less damage to the opponent than any other one handed weapon, but it knocks you opponents unconscious so that you can take them as a prisoner. Usage of clubs are affected by your one handed weapon proficiency. Focus on the club and press F key to pick it up."),
# ("tutorial_usage_battle_axe", "Battle axe is a long weapon and it can deal high damage to the opponent. Usage of battle axes are affected by your two handed weapon proficiency. Focus on the battle axe and press F key to pick it up."),
# ("tutorial_usage_spear", "Spear is a very long weapon which lets the wielder to strike the opponent earlier. Usage of the spears are affected by your polearm proficiency. Focus on the spear and press F key to pick it up."),
# ("tutorial_usage_short_bow", "Short bow is a common ranged weapon which is easy to reload but hard to master at. Usage of short bows are affected by your archery proficiency. Focus on the short bow and arrows and press F key to pick them up."),
# ("tutorial_usage_crossbow", "Crossbow is a heavy ranged weapon which is easy to use and deals high amount of damage to the opponent. Usage of crossbows are affected by your crossbow proficiency. Focus on the crossbow and bolts and press F key to pick them up."),
# ("tutorial_usage_throwing_daggers", "Throwing daggers are easy to use and throwing them takes a very short time. But they deal light damage to the opponent. Usage of throwing daggers are affected byyour throwing weapon proficiency. Focus on the throwing daggers and press F key to pick it up."),
# ("tutorial_usage_mounted", "You can use your weapons while you're mounted. Polearms like the lance here can be used for couched damage against opponents. In order to do that, ride your horse at a good speed and aim at your enemy. But do not press the attack button."),
## ("tutorial_melee_chest", "The chest near you contains some of the melee weapons that can be used throughout the game. Look at the chest now and press F key to view its contents. Click on the weapons and move them to your Arms slots to be able to use them."),
## ("tutorial_ranged_chest", "The chest near you contains some of the ranged weapons that can be used throughout the game. Look at the chest now and press F key to view its contents. Click on the weapons and move them to your Arms slots to be able to use them."),
##
## ("tutorial_item_equipped", "You have equipped a weapon. Move your mouse scroll wheel up to wield your weapon. You can also switch between your weapons using your mouse scroll wheel."),
("tutorial_ammo_refilled", "Ammo refilled."),
("tutorial_failed", "You have been beaten this time, but don't worry. Follow the instructions carefully and you'll do better next time.\
Press the Tab key to return to to the menu where you can retry this tutorial."),
("tutorial_1_msg_1","In this tutorial you will learn the basics of movement and combat.\
In Mount&Blade you use the mouse to control where you are looking, and the WASD keys of your keyboard to move.\
Your first task in the training is to locate the yellow flag in the room and move over it.\
You can press the Tab key at any time to quit this tutorial or to exit any other area in the game.\
Go to the yellow flag now."),
("tutorial_1_msg_2","Well done. Next we will cover attacking with weapons.\
For the purposes of this tutorial you have been equipped with bow and arrows, a sword and a shield.\
You can draw different weapons from your weapon slots by using the scroll wheel of your mouse.\
In the default configuration, scrolling up pulls out your next weapon, and scrolling down pulls out your shield.\
If you are already holding a shield, scrolling down will put your shield away instead.\
Try changing your wielded equipment with the scroll wheel now. When you are ready,\
go to the yellow flag to move on to your next task."),
("tutorial_1_msg_3","Excellent. The next part of this tutorial covers attacking with melee weapons.\
You attack with your currently wielded weapon by using your left mouse button.\
Press and hold the button to ready an attack, then release the button to strike.\
If you hold down the left mouse button for a while before releasing, your attack will be more powerful.\
Now draw your sword and destroy the four dummies in the room."),
("tutorial_1_msg_4","Nice work! You've destroyed all four dummies. You can now move on to the next room."),
("tutorial_1_msg_5","As you see, there is an archery target on the far side of the room.\
Your next task is to use your bow to put three arrows into that target. Press and hold down the left mouse button to notch an arrow.\
You can then fire the arrow by releasing the left mouse button. Note the targeting reticule in the centre of your screen,\
which shows you the accuracy of your shot.\
In order to achieve optimal accuracy, let fly your arrow when the reticule is at its smallest.\
Try to shoot the target now."),
("tutorial_1_msg_6","Well done! You've learned the basics of moving and attacking.\
With a little bit of practice you will soon master them.\
In the second tutorial you can learn more advanced combat skills and face armed opponents.\
You can press the Tab key at any time to return to the tutorial menu."),
("tutorial_2_msg_1","This tutorial will teach you how to defend yourself with a shield and how to battle armed opponents.\
For the moment you are armed with nothing but a shield.\
Your task is not to attack, but to successfully protect yourself from harm with your shield.\
There is an armed opponent waiting for you in the next room.\
He will try his best to knock you unconscious, while you must protect yourself with your shield\
by pressing and holding the right mouse button.\
Go into the next room now to face your opponent.\
Remember that you can press the Tab key at any time to quit this tutorial or to exit any other area in the game."),
("tutorial_2_msg_2","Press and hold down the right mouse button to raise your shield. Try to remain standing for thirty seconds. You have {reg3} seconds to go."),
("tutorial_2_msg_3","Well done, you've succeeded in defending against an armed opponent.\
The next phase of this tutorial will pit you and your shield against a force of enemy archers.\
Move on to the next room when you're ready to face the archers."),
("tutorial_2_msg_4","Defend yourself from arrows by raising your shield with the right mouse button. Try to remain standing for thirty seconds. You have {reg3} seconds to go."),
("tutorial_2_msg_5","Excellent, you've put up a succesful defence against archers.\
There is a reward waiting for you in the next room."),
("tutorial_2_msg_6","In the default configuration,\
the F key on your keyboard is used for non-violent interaction with objects and humans in the gameworld.\
To pick up the sword on the altar, look at it and press F when you see the word 'Equip'."),
("tutorial_2_msg_7","A fine weapon! Now you can use it to deliver a bit of payback.\
Go back through the door and dispose of the archers you faced earlier."),
("tutorial_2_msg_8","Very good. Your last task before finishing this tutorial is to face the maceman.\
Go through the door now and show him your steel!"),
("tutorial_2_msg_9","Congratulations! You have now learned how to defend yourself with a shield and even had your first taste of combat with armed opponents.\
Give it a bit more practice and you'll soon be a renowned swordsman.\
The next tutorial covers directional defence, which is one of the most important elements of Mount&Blade combat.\
You can press the Tab key at any time to return to the tutorial menu."),
("tutorial_3_msg_1","This tutorial is intended to give you an overview of parrying and defence without a shield.\
Parrying attacks with your weapon is a little bit more difficult than blocking them with a shield.\
When you are defending with a weapon, you are only protected from one direction, the direction in which your weapon is set.\
If you are blocking upwards, you will parry any overhead swings coming against you, but you will not stop thrusts or attacks to your sides.\
Either of these attacks would still be able to hit you.\
That's why, in order to survive without a shield, you must learn directional defence.\
Go pick up up the quarterstaff now to begin practice."),
("tutorial_3_msg_2","By default, the direction in which you defend (by clicking and holding your right mouse button) is determined by the attack direction of your closest opponent.\
For example, if your opponent is readying a thrust attack, pressing and holding the right mouse button will parry thrust attacks, but not side or overhead attacks.\
You must watch your opponent carefully and only initiate your parry AFTER the enemy starts to attack.\
If you start BEFORE he readies an attack, you may parry the wrong way altogether!\
Now it's time for you to move on to the next room, where you'll have to defend yourself against an armed opponent.\
Your task is to defend yourself successfully for thirty seconds with no equipment other than a simple quarterstaff.\
Your quarterstaff's attacks are disabled for this tutorial, so don't worry about attacking and focus on your defence instead.\
Move on to the next room when you are ready to initiate the fight."),
("tutorial_3_msg_3","Press and hold down the right mouse button to defend yourself with your staff after your opponent starts his attack.\
Try to remain standing for thirty seconds. You have {reg3} seconds to go."),
("tutorial_3_msg_4","Well done, you've succeeded this trial!\
Now you will be pitted against a more challenging opponent that will make things more difficult for you.\
Move on to the next room when you're ready to face him."),
("tutorial_3_msg_5","Press and hold down the right mouse button to defend yourself with your staff after your opponent starts his attack.\
Try to remain standing for thirty seconds. You have {reg3} seconds to go."),
("tutorial_3_msg_6","Congratulations, you still stand despite the enemy's best efforts.\
The time has now come to attack as well as defend.\
Approach the door and press the F key when you see the word 'Go'."),
("tutorial_3_2_msg_1","Your staff's attacks have been enabled again. Your first opponent is waiting in the next room.\
Defeat him by a combination of attack and defence."),
("tutorial_3_2_msg_2","Defeat your opponent with your quarterstaff."),
("tutorial_3_2_msg_3","Excellent. Now the only thing standing in your way is one last opponent.\
He is in the next room. Move in and knock him down."),
("tutorial_3_2_msg_4","Defeat your opponent with your quarterstaff."),
("tutorial_3_2_msg_5","Well done! In this tutorial you have learned how to fight ably without a shield.\
Train hard and train well, and no one shall be able to lay a stroke on you.\
In the next tutorial you may learn horseback riding and cavalry combat.\
You can press the Tab key at any time to return to the tutorial menu."),
("tutorial_4_msg_1","Welcome to the fourth tutorial.\
In this sequence you'll learn about riding a horse and how to perform various martial exercises on horseback.\
We'll start by getting you mounted up.\
Approach the horse, and press the 'F' key when you see the word 'Mount'."),
("tutorial_4_msg_2","While on horseback, the WASD keys control your horse's movement, not your own.\
Ride your horse and try to follow the yellow flag around the course.\
When you reach the flag, it will move to the next waypoint on the course until you reach the finish."),
("tutorial_4_msg_3","Very good. Next we'll cover attacking enemies from horseback. Approach the yellow flag now."),
("tutorial_4_msg_4","Draw your sword (using the mouse wheel) and destroy the four targets.\
Try hitting the dummies as you pass them at full gallop -- this provides an extra challenge,\
but the additional speed added to your blow will allow you to do more damage.\
The easiest way of doing this is by pressing and holding the left mouse button until the right moment,\
releasing it just before you pass the target."),
("tutorial_4_msg_5","Excellent work. Now let us try some target shooting from horseback. Go near the yellow flag now."),
("tutorial_4_msg_6","Locate the archery target beside the riding course and shoot it three times with your bow.\
Although you are not required to ride while shooting, it's recommended that you try to hit the target at various speeds and angles\
to get a feel for how your horse's speed and course affects your aim."),
("tutorial_4_msg_7","Congratulations, you have finished this tutorial.\
You can press the Tab key at any time to return to the tutorial menu."),
# Ryan END
("tutorial_5_msg_1","TODO: Follow order to the flag"),
("tutorial_5_msg_2","TODO: Move to the flag, keep your units at this position"),
("tutorial_5_msg_3","TODO: Move to the flag to get the archers"),
("tutorial_5_msg_4","TODO: Move archers to flag1, infantry to flag2"),
("tutorial_5_msg_5","TODO: Enemy is charging. Fight!"),
("tutorial_5_msg_6","TODO: End of battle."),
("trainer_help_1", "This is a training ground where you can learn the basics of the game. Use A, S, D, W keys to move and the mouse to look around."),
("trainer_help_2", "To speak with the trainer, go near him, look at him and press the 'F' key when you see the word 'Talk' under his name.\
When you wish to leave this or any other area or retreat from a battle, you can press the TAB key."),
("custom_battle_1", "Lord Haringoth of Swadia is travelling with his household knights when he spots a group of raiders preparing to attack a small hamlet.\
Shouting out his warcry, he spurs his horse forward, and leads his loyal men to a fierce battle."),
("custom_battle_2", "Lord Mleza is leading a patrol of horsemen and archers\
in search of a group of bandits who plundered a caravan and ran away to the hills.\
Unfortunately the bandits have recently met two other large groups who want a share of their booty,\
and spotting the new threat, they decide to combine their forces."),
("custom_battle_3", "Lady Brina is leading the defense of her castle against a Swadian army.\
Now, as the besiegers prepare for a final assault on the walls, she must make sure the attack does not succeed."),
("custom_battle_4", "When the scouts inform Lord Grainwad of the presence of an enemy war band,\
he decides to act quickly and use the element of surprise against superior numbers."),
("custom_battle_5", "Lord Haeda has brought his fierce huscarls into the south with the promise of plunder.\
If he can make this castle fall to him today, he will settle in these lands and become the ruler of this valley."),
("finished", "(Finished)"),
("delivered_damage", "Delivered {reg60} damage."),
("archery_target_hit", "Distance: {reg61} yards. Score: {reg60}"),
("use_baggage_for_inventory","Use your baggage to access your inventory during battle (it's at your starting position)."),
## ("cant_leave_now","Can't leave the area now."),
("cant_use_inventory_now","Can't access inventory now."),
("cant_use_inventory_arena","Can't access inventory in the arena."),
("cant_use_inventory_disguised","Can't access inventory while you're disguised."),
("cant_use_inventory_tutorial","Can't access inventory in the training camp."),
("1_denar", "1 denar"),
("reg1_denars", "{reg1} denars"),
("january_reg1_reg2", "January {reg1}, {reg2}"),
("february_reg1_reg2", "February {reg1}, {reg2}"),
("march_reg1_reg2", "March {reg1}, {reg2}"),
("april_reg1_reg2", "April {reg1}, {reg2}"),
("may_reg1_reg2", "May {reg1}, {reg2}"),
("june_reg1_reg2", "June {reg1}, {reg2}"),
("july_reg1_reg2", "July {reg1}, {reg2}"),
("august_reg1_reg2", "August {reg1}, {reg2}"),
("september_reg1_reg2", "September {reg1}, {reg2}"),
("october_reg1_reg2", "October {reg1}, {reg2}"),
("november_reg1_reg2", "November {reg1}, {reg2}"),
("december_reg1_reg2", "December {reg1}, {reg2}"),
## ("you_approach_town","You approach the town of "),
## ("you_are_in_town","You are in the town of "),
## ("you_are_in_castle","You are at the castle of "),
## ("you_sneaked_into_town","You have sneaked into the town of "),
("town_nighttime"," It is late at night and honest folk have abandoned the streets."),
("door_locked","The door is locked."),
("castle_is_abondened","The castle seems to be unoccupied."),
("town_is_abondened","The town has no garrison defending it."),
("place_is_occupied_by_player","The place is held by your own troops."),
("place_is_occupied_by_enemy", "The place is held by hostile troops."),
("place_is_occupied_by_friendly", "The place is held by friendly troops."),
("do_you_want_to_retreat", "Are you sure you want to retreat?"),
("give_up_fight", "Give up the fight?"),
("do_you_wish_to_leave_tutorial", "Do you wish to leave the tutorial?"),
("do_you_wish_to_surrender", "Do you wish to surrender?"),
("can_not_retreat", "Can't retreat, there are enemies nearby!"),
## ("can_not_leave", "Can't leave. There are enemies nearby!"),
("s1_joined_battle_enemy", "{s1} has joined the battle on the enemy side."),
("s1_joined_battle_friend", "{s1} has joined the battle on your side."),
# ("entrance_to_town_forbidden","It seems that the town guards have been warned of your presence and you won't be able to enter the town unchallenged."),
("entrance_to_town_forbidden","The town guards are on the lookout for intruders and it seems that you won't be able to pass through the gates unchallenged."),
("sneaking_to_town_impossible","The town guards are alarmed. You wouldn't be able to sneak through that gate no matter how well you disguised yourself."),
("battle_won", "You have won the battle!"),
("battle_lost", "You have lost the battle!"),
("attack_walls_success", "After a bloody fight, your brave soldiers manage to claim the walls from the enemy."),
("attack_walls_failure", "Your soldiers fall in waves as they charge the walls, and the few who remain alive soon rout and run away, never to be seen again."),
("attack_walls_continue", "A bloody battle ensues and both sides fight with equal valour. Despite the efforts of your troops, the castle remains in enemy hands."),
("order_attack_success", "Your men fight bravely and defeat the enemy."),
("order_attack_failure", "You watch the battle in despair as the enemy cuts your soldiers down, then easily drives off the few ragged survivors."),
("order_attack_continue", "Despite an extended skirmish, your troops were unable to win a decisive victory."),
("join_order_attack_success", "Your men fight well alongside your allies, sharing in the glory as your enemies are beaten."),
("join_order_attack_failure", "You watch the battle in despair as the enemy cuts your soldiers down, then easily drives off the few ragged survivors."),
("join_order_attack_continue", "Despite an extended skirmish, neither your troops nor your allies were able to win a decisive victory over the enemy."),
("siege_defender_order_attack_success", "The men of the garrison hold their walls with skill and courage, breaking the enemy assault and skillfully turning the defeat into a full-fledged rout."),
("siege_defender_order_attack_failure", "The assault quickly turns into a bloodbath. Valiant efforts are for naught; the overmatched garrison cannot hold the walls, and the enemy puts every last defender to the sword."),
("siege_defender_order_attack_continue", "Repeated, bloody attempts on the walls fail to gain any ground, but too many enemies remain for the defenders to claim a true victory. The siege continues."),
("hero_taken_prisoner", "{s1} of {s3} has been taken prisoner by {s2}."),
("hero_freed", "{s1} of {s3} has been freed from captivity by {s2}."),
("center_captured", "{s2} have taken {s1} from {s3}."),
("troop_relation_increased", "Your relation with {s1} has increased from {reg1} to {reg2}."),
("troop_relation_detoriated", "Your relation with {s1} has deteriorated from {reg1} to {reg2}."),
("faction_relation_increased", "Your relation with {s1} has increased from {reg1} to {reg2}."),
("faction_relation_detoriated", "Your relation with {s1} has deteriorated from {reg1} to {reg2}."),
("party_gained_morale", "Your party gains {reg1} morale."),
("party_lost_morale", "Your party loses {reg1} morale."),
("qst_follow_spy_noticed_you", "The spy has spotted you! He's making a run for it!"),
("father", "father"),
("husband", "husband"),
("wife", "wife"),
("daughter", "daughter"),
("mother", "mother"),
("son", "son"),
("brother", "brother"),
("sister", "sister"),
("he", "He"),
("she", "She"),
("s3s_s2", "{s3}'s {s2}"),
("s5_is_s51", "{s5} is {s51}."),
("s5_is_the_ruler_of_s51", "{s5} is the ruler of {s51}. "),
("s5_is_a_nobleman_of_s6", "{s5} is a nobleman of {s6}. "),
## ("your_debt_to_s1_is_changed_from_reg1_to_reg2", "Your debt to {s1} is changed from {reg1} to {reg2}."),
("relation_mnus_100", "Vengeful"), # -100..-94
("relation_mnus_90", "Vengeful"), # -95..-84
("relation_mnus_80", "Vengeful"),
("relation_mnus_70", "Hateful"),
("relation_mnus_60", "Hateful"),
("relation_mnus_50", " Hostile"),
("relation_mnus_40", " Angry"),
("relation_mnus_30", " Resentful"),
("relation_mnus_20", " Grumbling"),
("relation_mnus_10", " Suspicious"),
("relation_plus_0", " Indifferent"),# -5...4
("relation_plus_10", " Cooperative"), # 5..14
("relation_plus_20", " Welcoming"),
("relation_plus_30", " Favorable"),
("relation_plus_40", " Supportive"),
("relation_plus_50", " Friendly"),
("relation_plus_60", " Gracious"),
("relation_plus_70", " Fond"),
("relation_plus_80", " Loyal"),
("relation_plus_90", " Devoted"),
("relation_mnus_100_ns", "{s60} is vengeful towards you."), # -100..-94
("relation_mnus_90_ns", "{s60} is vengeful towards you."), # -95..-84
("relation_mnus_80_ns", "{s60} is vengeful towards you."),
("relation_mnus_70_ns", "{s60} is hateful towards you."),
("relation_mnus_60_ns", "{s60} is hateful towards you."),
("relation_mnus_50_ns", "{s60} is hostile towards you."),
("relation_mnus_40_ns", "{s60} is angry towards you."),
("relation_mnus_30_ns", "{s60} is resentful against you."),
("relation_mnus_20_ns", "{s60} is grumbling against you."),
("relation_mnus_10_ns", "{s60} is suspicious towards you."),
("relation_plus_0_ns", "{s60} is indifferent against you."),# -5...4
("relation_plus_10_ns", "{s60} is cooperative towards you."), # 5..14
("relation_plus_20_ns", "{s60} is welcoming towards you."),
("relation_plus_30_ns", "{s60} is favorable to you."),
("relation_plus_40_ns", "{s60} is supportive to you."),
("relation_plus_50_ns", "{s60} is friendly to you."),
("relation_plus_60_ns", "{s60} is gracious to you."),
("relation_plus_70_ns", "{s60} is fond of you."),
("relation_plus_80_ns", "{s60} is loyal to you."),
("relation_plus_90_ns", "{s60} is devoted to you."),
("relation_reg1", " Relation: {reg1}"),
("center_relation_mnus_100", "The populace hates you with a passion"), # -100..-94
("center_relation_mnus_90", "The populace hates you intensely"), # -95..-84
("center_relation_mnus_80", "The populace hates you strongly"),
("center_relation_mnus_70", "The populace hates you"),
("center_relation_mnus_60", "The populace is hateful to you"),
("center_relation_mnus_50", "The populace is extremely hostile to you"),
("center_relation_mnus_40", "The populace is very hostile to you"),
("center_relation_mnus_30", "The populace is hostile to you"),
("center_relation_mnus_20", "The populace is against you"),
("center_relation_mnus_10", "The populace is opposed to you"),
("center_relation_plus_0", "The populace is indifferent to you"),
("center_relation_plus_10", "The populace is acceptive to you"),
("center_relation_plus_20", "The populace is cooperative to you"),
("center_relation_plus_30", "The populace is somewhat supportive to you"),
("center_relation_plus_40", "The populace is supportive to you"),
("center_relation_plus_50", "The populace is very supportive to you"),
("center_relation_plus_60", "The populace is loyal to you"),
("center_relation_plus_70", "The populace is highly loyal to you"),
("center_relation_plus_80", "The populace is devoted to you"),
("center_relation_plus_90", "The populace is fiercely devoted to you"),
("town_prosperity_0", "The poverty of the town of {s60} is unbearable"),
("town_prosperity_10", "The squalorous town of {s60} is all but deserted."),
("town_prosperity_20", "The town of {s60} looks a wretched, desolate place."),
("town_prosperity_30", "The town of {s60} looks poor and neglected."),
("town_prosperity_40", "The town of {s60} appears to be struggling."),
("town_prosperity_50", "The town of {s60} seems unremarkable."),
("town_prosperity_60", "The town of {s60} seems to be flourishing."),
("town_prosperity_70", "The prosperous town of {s60} is bustling with activity."),
("town_prosperity_80", "The town of {s60} looks rich and well-maintained."),
("town_prosperity_90", "The town of {s60} is opulent and crowded with well-to-do people."),
("town_prosperity_100", "The glittering town of {s60} openly flaunts its great wealth."),
("village_prosperity_0", "The poverty of the village of {s60} is unbearable."),
("village_prosperity_10", "The village of {s60} looks wretchedly poor and miserable."),
("village_prosperity_20", "The village of {s60} looks very poor and desolate."),
("village_prosperity_30", "The village of {s60} looks poor and neglected."),
("village_prosperity_40", "The village of {s60} appears to be somewhat poor and struggling."),
("village_prosperity_50", "The village of {s60} seems unremarkable."),
("village_prosperity_60", "The village of {s60} seems to be flourishing."),
("village_prosperity_70", "The village of {s60} appears to be thriving."),
("village_prosperity_80", "The village of {s60} looks rich and well-maintained."),
("village_prosperity_90", "The village of {s60} looks very rich and prosperous."),
("village_prosperity_100", "The village of {s60}, surrounded by vast, fertile fields, looks immensely rich."),
("war_report_minus_4", "we are about to lose the war"),
("war_report_minus_3", "the situation looks bleak"),
("war_report_minus_2", "things aren't going too well for us"),
("war_report_minus_1", "we can still win the war if we rally"),
("war_report_0", "we are evenly matched with the enemy"),
("war_report_plus_1", "we have a fair chance of winning the war"),
("war_report_plus_2", "things are going quite well"),
("war_report_plus_3", "we should have no difficulty defeating them"),
("war_report_plus_4", "we are about to win the war"),
("persuasion_summary_very_bad", "You try your best to persuade {s50},\
but none of your arguments seem to come out right. Every time you start to make sense,\
you seem to say something entirely wrong that puts you off track.\
By the time you finish speaking you've failed to form a single coherent point in your own favour,\
and you realise that all you've done was dig yourself deeper into a hole.\
Unsurprisingly, {s50} does not look impressed."),
("persuasion_summary_bad", "You try to persuade {s50}, but {reg51?she:he} outmanoeuvres you from the very start.\
Even your best arguments sound hollow to your own ears. {s50}, likewise,\
has not formed a very high opinion of what you had to say."),
("persuasion_summary_average", "{s50} turns out to be a skilled speaker with a keen mind,\
and you can't seem to bring forth anything concrete that {reg51?she:he} cannot counter with a rational point.\
In the end, neither of you manage to gain any ground in this discussion."),
("persuasion_summary_good", "Through quick thinking and smooth argumentation, you manage to state your case well,\
forcing {s50} to concede on several points. However, {reg51?she:he} still expresses doubts about your request."),
("persuasion_summary_very_good","You deliver an impassioned speech that echoes through all listening ears like poetry.\
The world itself seems to quiet down in order to hear you better .\
The inspiring words have moved {s50} deeply, and {reg51?she:he} looks much more well-disposed towards helping you."),
# meet_spy_in_enemy_town quest secret sentences
("secret_sign_1", "The armoire dances at midnight..."),
("secret_sign_2", "I am selling these fine Khergit tapestries. Would you like to buy some?"),
("secret_sign_3", "The friend of a friend sent me..."),
("secret_sign_4", "The wind blows hard from the east and the river runs red..."),
("countersign_1", "But does he dance for the dresser or the candlestick?"),
("countersign_2", "Yes I would, do you have any in blue?"),
("countersign_3", "But, my friend, your friend's friend will never have a friend like me."),
("countersign_4", "Have you been sick?"),
# Names
("name_1", "Albard"),
("name_2", "Euscarl"),
("name_3", "Sigmar"),
("name_4", "Talesqe"),
("name_5", "Ritmand"),
("name_6", "Aels"),
("name_7", "Raurqe"),
("name_8", "Bragamus"),
("name_9", "Taarl"),
("name_10", "Ramin"),
("name_11", "Shulk"),
("name_12", "Putar"),
("name_13", "Tamus"),
("name_14", "Reichad"),
("name_15", "Walcheas"),
("name_16", "Rulkh"),
("name_17", "Marlund"),
("name_18", "Auguryn"),
("name_19", "Daynad"),
("name_20", "Joayah"),
("name_21", "Ramar"),
("name_22", "Caldaran"),
("name_23", "Brabas"),
("name_24", "Kundrin"),
("name_25", "Pechnak"),
# Surname
("surname_1", "{s50} of Uxhal"),
("surname_2", "{s50} of Wercheg"),
("surname_3", "{s50} of Reyvadin"),
("surname_4", "{s50} of Suno"),
("surname_5", "{s50} of Jelkala"),
("surname_6", "{s50} of Veluca"),
("surname_7", "{s50} of Halmar"),
("surname_8", "{s50} of Curaw"),
("surname_9", "{s50} of Sargoth"),
("surname_10", "{s50} of Tihr"),
("surname_11", "{s50} of Zendar"),
("surname_12", "{s50} of Rivacheg"),
("surname_13", "{s50} of Wercheg"),
("surname_14", "{s50} of Ehlerdag"),
("surname_15", "{s50} of Yaragar"),
("surname_16", "{s50} of Burglen"),
("surname_17", "{s50} of Shapeshte"),
("surname_18", "{s50} of Hanun"),
("surname_19", "{s50} of Saren"),
("surname_20", "{s50} of Tosdhar"),
("surname_21", "{s50} the Long"),
("surname_22", "{s50} the Gaunt"),
("surname_23", "{s50} Silkybeard"),
("surname_24", "{s50} the Sparrow"),
("surname_25", "{s50} the Pauper"),
("surname_26", "{s50} the Scarred"),
("surname_27", "{s50} the Fair"),
("surname_28", "{s50} the Grim"),
("surname_29", "{s50} the Red"),
("surname_30", "{s50} the Black"),
("surname_31", "{s50} the Tall"),
("surname_32", "{s50} Star-Eyed"),
("surname_33", "{s50} the Fearless"),
("surname_34", "{s50} the Valorous"),
("surname_35", "{s50} the Cunning"),
("surname_36", "{s50} the Coward"),
("surname_37", "{s50} Bright"),
("surname_38", "{s50} the Quick"),
("surname_39", "{s50} the Minstrel"),
("surname_40", "{s50} the Bold"),
("surname_41", "{s50} Hot-Head"),
("surnames_end", "surnames_end"),
("number_of_troops_killed_reg1", "Number of troops killed: {reg1}"),
("number_of_troops_wounded_reg1", "Number of troops wounded: {reg1}"),
("number_of_own_troops_killed_reg1", "Number of friendly troops killed: {reg1}"),
("number_of_own_troops_wounded_reg1", "Number of friendly troops wounded: {reg1}"),
("retreat", "Retreat!"),
("siege_continues", "Fighting Continues..."),
("casualty_display", "Your casualties: {s10}^Enemy casualties: {s11}{s12}"),
("casualty_display_hp", "^You were wounded for {reg1} hit points."),
# Quest log texts
("quest_log_updated", "Quest log has been updated..."),
("banner_selection_text", "You have been awarded the right to carry a banner.\
Your banner will signify your status and bring you honour. Which banner do you want to choose?"),
# Retirement Texts: s7=village name; s8=castle name; s9=town name
("retirement_text_1", "Only too late do you realise that your money won't last.\
It doesn't take you long to fritter away what little you bothered to save,\
and you fare poorly in several desperate attempts to start adventuring again.\
You end up a beggar in {s9}, living on alms and the charity of the church."),
("retirement_text_2", "Only too late do you realise that your money won't last.\
It doesn't take you long to fritter away what little you bothered to save.\
Once every denar has evaporated in your hands you are forced to start a life of crime in the backstreets of {s9},\
using your skills to eke out a living robbing coppers from women and poor townsmen."),
("retirement_text_3", "Only too late do you realise that your money won't last.\
It doesn't take you long to fritter away what little you bothered to save,\
and you end up a penniless drifter, going from tavern to tavern\
blagging drinks from indulgent patrons by regaling them with war stories that no one ever believes."),
("retirement_text_4", "The silver you've saved doesn't last long,\
but you manage to put together enough to buy some land near the village of {s7}.\
There you become a free farmer, and you soon begin to attract potential {wives/husbands}.\
In time the villagers come to treat you as their local hero.\
You always receive a place of honour at feasts, and your exploits are told and retold in the pubs and taverns\
so that the children may keep a memory of you for ever and ever."),
("retirement_text_5", "The silver you've saved doesn't last long,\
but it's enough to buy a small tavern in {s9}. Although the locals are wary of you at first,\
they soon accept you into their midst. In time your growing tavern becomes a popular feasthall and meeting place.\
People come for miles to eat or stay there due to your sheer renown and the epic stories you tell of your adventuring days."),
("retirement_text_6", "You've saved wisely throughout your career,\
and now your silver and your intelligence allow you to make some excellent investments to cement your future.\
After buying several shops and warehouses in {s9}, your shrewdness turns you into one of the most prominent merchants in town,\
and you soon become a wealthy {man/woman} known as much for your trading empire as your exploits in battle."),
("retirement_text_7", "As a landed noble, however minor, your future is all but assured.\
You settle in your holdfast at {s7}, administrating the village and fields,\
adjudicating the local courts and fulfilling your obligations to your liege lord.\
Occasionally your liege calls you to muster and command in his campaigns, but these stints are brief,\
and you never truly return to the adventuring of your younger days. You have already made your fortune.\
With your own hall and holdings, you've few wants that your personal wealth and the income of your lands cannot afford you."),
("retirement_text_8", "There is no question that you've done very well for yourself.\
Your extensive holdings and adventuring wealth are enough to guarantee you a rich and easy life for the rest of your days.\
Retiring to your noble seat in {s8}, you exchange adventure for politics,\
and you soon establish yourself as a considerable power in your liege lord's kingdom.\
With intrigue to busy yourself with, your own forests to hunt, a hall to feast in and a hundred fine war stories to tell,\
you have little trouble making the best of the years that follow."),
("retirement_text_9", "As a reward for your competent and loyal service,\
your liege lord decrees that you be given a hereditary title, joining the major nobility of the realm.\
Soon you complete your investitute as baron of {s7}, and you become one of your liege's close advisors\
and adjutants. Your renown garners you much subtle pull and influence as well as overt political power.\
Now you spend your days playing the games of power, administering your great fiefs,\
and recounting the old times of adventure and glory."),
("retirement_text_10", "Though you started from humble beginnings, your liege lord holds you in high esteem,\
and a ripple of shock passes through the realm when he names you to the hereditary title of {count/countess} of {s9}.\
Vast fiefs and fortunes are now yours to rule. You quickly become your liege's most trusted advisor,\
almost his equal and charged with much of the running of his realm,\
and you sit a throne in your own splendourous palace as one of the most powerful figures in Calradia."),
#NPC companion changes begin
# Objectionable actions
# humanitarian
("loot_village", "attack innocent villagers"),
("steal_from_villagers", "steal from poor villagers"),
("rob_caravan", "rob a merchant caravan"), # possibly remove
("sell_slavery", "sell people into slavery"),
# egalitarian
("men_hungry", "run out of food"), ##Done - simple triggers
("men_unpaid", "not be able to pay the men"),
# ("party_crushed", "get ourselves slaughtered"), ##Done - game menus
("excessive_casualties", "turn every battle into a bloodbath for our side"),
# chivalric
("surrender", "surrender to the enemy"), ##Done - game menus
("flee_battle", "run from battle"), ##Done - game menus
("pay_bandits", "pay off common bandits"),
# honest
("fail_quest", "fail a quest which we undertook on word of honour"),
# quest-related strings
("squander_money", "squander money given to us in trust"),
("murder_merchant", "involve ourselves in cold-blooded murder"),
("round_up_serfs", "round up serfs on behalf of some noble"),
# Fates suffered by companions in battle
("battle_fate_1", "We were separated in the heat of battle"),
("battle_fate_2", "I was wounded and left for dead"),
("battle_fate_3", "I was knocked senseless by the enemy"),
("battle_fate_4", "I was taken and held for ransom"),
("battle_fate_5", "I got captured, but later managed to escape"),
# strings for opinion
("npc_morale_report", "I'm {s6} your choice of companions, {s7} your style of leadership, and {s8} the general state of affairs"),
("happy", "happy about"),
("content", "content with"),
("concerned", "concerned about"),
("not_happy", "not at all happy about"),
("miserable", "downright appalled at"),
("morale_reg1", " Morale: {reg1}"),
("bar_enthusiastic", " Enthusiastic"),
("bar_content", " Content"),
("bar_weary", " Weary"),
("bar_disgruntled", " Disgruntled"),
("bar_miserable", " Miserable"),
#other strings
("here_plus_space", "here "),
#NPC strings
#npc1 = borcha
#npc2 = marnid
#npc3 = ymira
#npc4 = rolf
#npc5 = baheshtur
#npc6 = firentis
#npc7 = deshavi
#npc8 = matheld
#npc9 = alayen
#npc10 = bunduk
#npc11 = katrin
#npc12 = jeremus
#npc13 = nizar
#npc14 = lazalit
#npc15 = artimenner
#npc16 = klethi
("npc1_intro", "Ho there, traveller. You wouldn't by chance be in the market for a tracker, would you?"),
("npc2_intro", "Hello. Would you be so kind as to have a cup with me? I'm down to my last five denars and I'd rather not drink alone."),
("npc3_intro", "Good day to you!"),
("npc4_intro", "Greetings. I am Rolf, son of Rolf, of the most ancient and puissant House of Rolf."),
("npc5_intro", "Greetings, traveller. Would you join me for a drink?"),
("npc6_intro", "I am lost... Lost..."),
("npc7_intro", "Yes? Keep your distance, by the way."),
("npc8_intro", "What do you want?"),
("npc9_intro", "You there, good {man/woman}, be so kind as to fetch me another drink, eh?"),
("npc10_intro", "Greetings there, {Brother/Sister}! Here's to the doom and downfall of all high-born lords and ladies!"),
("npc11_intro", "Hello there, {laddie/lassie}. Have a drink on me."),
("npc12_intro", "Greetings, fellow traveller. Perhaps you can help me."),
("npc13_intro", "Greetings, traveller. I am Nizar. No doubt you will have heard of me."),
("npc14_intro", "Yes? What is it you wish?"),
("npc15_intro", "Oh! Say, friend, are you by chance heading out of town anytime soon?"),
("npc16_intro", "Hello there. I couldn't help noticing that you came into town at the head of a company of soldiers. Are you by any chance looking for new hands?"),
("npc1_intro_response_1", "Perhaps. What's the urgency?"),
("npc2_intro_response_1", "Your last five denars? What happened to you?"),
("npc3_intro_response_1", "Hello. What's a clearly well-brought up young lady like you doing in a place like this?"),
("npc4_intro_response_1", "Hmm... I have never heard of the House of Rolf."),
("npc5_intro_response_1", "Certainly. With whom do I have the pleasure of drinking?"),
("npc6_intro_response_1", "Why so gloomy, friend?"),
("npc7_intro_response_1", "My apologies. I was merely going to say that you look a bit down on your luck."),
("npc8_intro_response_1", "Merely to pass the time of day, ma'am, if you're not otherwise engaged."),
("npc9_intro_response_1", "You must have me confused with the tavernkeep, sir."),
("npc10_intro_response_1", "Why do you say that, sir?"),
("npc11_intro_response_1", "What's the occasion?"),
("npc12_intro_response_1", "How is that?"),
("npc13_intro_response_1", "Um... I don't think so."),
("npc14_intro_response_1", "To pass the time of day with a fellow traveller, if you permit."),
("npc15_intro_response_1", "I am. What concern is it of your, may I ask?"),
("npc16_intro_response_1", "I could be. What's your story?"),
("npc1_intro_response_2", "Step back, sir, and keep your hand away from my purse."),
("npc2_intro_response_2", "I have better things to do."),
("npc3_intro_response_2", "Run along now, girl. I have work to do."),
("npc4_intro_response_2", "Eh? No thanks, we don't want any."),
("npc5_intro_response_2", "I have no time for that."),
("npc6_intro_response_2", "No doubt. Well, good luck getting found."),
("npc7_intro_response_2", "Right. I'll not bother you, then."),
("npc8_intro_response_2", "Nothing at all, from one so clearly disinclined to pleasantries. Good day to you."),
("npc9_intro_response_2", "Fetch it yourself!"),
("npc10_intro_response_2", "That's rebel talk, and I'll hear none of it. Good day to you."),
("npc11_intro_response_2", "I think not, madame."),
("npc12_intro_response_2", "Sorry, I am afraid that I am otherwise engaged right now."),
("npc13_intro_response_2", "No, and I can't say that I much want to make your acquaintance."),
("npc14_intro_response_2", "Nothing at all. My apologies."),
("npc15_intro_response_2", "I'd be obliged if you minded your own business, sir."),
("npc16_intro_response_2", "Mind your own business, lass."),
#backstory intro
("npc1_backstory_a", "Well, {sir/madame}, it's a long story..."),
("npc2_backstory_a", "It's a tragic tale, sir."),
("npc3_backstory_a", "A good question, and I shall tell you!"),
("npc4_backstory_a", "Really? Well, perhaps your ignorance can be forgiven. Our ancestral lands are far away, over the mountains."),
("npc5_backstory_a", "I am Baheshtur, son of Azabei, grandson of Badzan. Were you not a barbarian, you would likely know from my lineage that I am a Roan Horse Khergit of the highlands, of the tribe of Shamir, of the clan of Dulam, of the family of Ubayn, from the Pantash valley, and you might be able to guess why I am so far from home."),
("npc6_backstory_a", "I have commited the greatest of sins, {sir/madame}, and it is to my shame that I must appoint you my confessor, if you should like to hear it."),
("npc7_backstory_a", "My luck? You could say that."),
("npc8_backstory_a", "Ah. Well, if you must know, I shall tell you."),
("npc9_backstory_a", "My most humble apologies. It is sometimes hard to recognize folk amid the smoke and gloom here. I still cannot believe that I must make my home in such a place."),
("npc10_backstory_a", "It's a long story, but if you get yourself a drink, I'll be glad to tell it."),
("npc11_backstory_a", "Why, I managed to sell my wagon and pots, {lad/lass}. For once I've got money to spend and I intend to make the best of it."),
("npc12_backstory_a", "I shall tell you -- but know that it is a tale of gross iniquity. I warn you in advance, lest you are of a choleric temperament, and so become incensed at the injustice done unto me that you do yourself a mischief."),
("npc13_backstory_a", "You have not? Then perhaps you will have heard of my steed, who cuts across the Calradian plains like a beam of moonlight? Or of my sword, a connoisseur of the blood of the highest-born princes of the land?"),
("npc14_backstory_a", "Very well. I do not mind. My name is Lazalet."),
("npc15_backstory_a", "I'm an engineer, specialized in the art of fortification. If you need a wall knocked down, I can do that, given enough time. If you need a wall built back up, I can do that too, although it will take longer and cost you more. And you can't cut costs, either, unless you want your new edifice coming down underneath you, as someone around here has just found out."),
("npc16_backstory_a", "Well, {sir/madame}, as long as I can remember I've had a weakness for pretty things, and it's gotten me into trouble, you see."),
#backstory main body
("npc1_backstory_b", "I had a bit of a misunderstanding {s19}in {s20} about a horse that I found tied up outside the inn. It was the spitting image of a beast that threw me a few days back and ran off. Naturally I untied it for a closer look. As it turns out, the horse belonged to a merchant, a pinch-faced old goat who wouldn't accept that it all was a simple misunderstanding, and went off to get the guard."),
("npc2_backstory_b", "A while back, I left Geroia with a caravan of goods. I was hoping to sell it all in Sargoth and make a hefty sum. But, what do you know... we were ambushed by a party of Khergit raiders who rode away with most of the horses and goods. And two days later, my own caravan guards ran away with the rest of what I had."),
("npc3_backstory_b", "My father, a well-known merchant {s19}in {s20}, decided that I should be married to one of his business partners, a man well past the age of 30. I have been an obedient daughter all of my life, but it was a ridiculous and horrid proposition. So I ran away!"),
("npc4_backstory_b", "Like all the men of my family, I have come to a foreign land to make a name for myself in the profession of arms before returning home to take over custodianship of my estates. Unfortunately, the authorities in these lands have little understanding of the warrior code, and have chosen to call me a bandit and brigand, and put a price on my head -- a most unfair libel to throw at a gentleman adventurer, you will surely agree."),
("npc5_backstory_b", "For as long as any one can remember, our people have feuded with the tribe of Humyan, many of whom have settled in the next valley over. Many men have died in this feud, on both sides, including two of my brothers. The Khan himself has ordered us to cease, to save men for the wars in Calradia. But I know my rights, and my brothers' blood cries out for vengeance. I waylaid and killed a Humyan on a track over the mountains, and I rode out of our village the same night, without even having had the chance to bid farewell to my father. I will bide my time in Calradia, for a year or two, then return home when the Khan's men have forgotten. The Humyan will not forget, of course, but such is the price of honour."),
("npc6_backstory_b", "I was a captain of horse in the service of the lord {s19}in {s20}, and my brother served with me. But we were both in love with the same woman, a courtesan -- a temptress, who played upon our jealousies! My brother and I quarreled. I had drunk too much. He slapped me with his glove, and I spit him upon my sword... My own brother! My sword-arm was stained with the blood of my kin!"),
("npc7_backstory_b", "It was my bad luck to be born to a weak father who married me off to a drunken layabout, who beat me. It was my bad luck, when I ran away from my husband, to be taken by a group of bandits. It was my bad luck that the only one among them who was kind to me, who taught me to hunt and to fight, inspired the jealousy of the others, who knifed him and forced me to run away again."),
("npc8_backstory_b", "I am from an old family in the northern lands, the daughter of a thane and also wife to one. I fought by my husband's side, his partner both in war and in peace. But my husband died of the plague, when I was still childless. My husband had decreed that I should inherit his lands, in the absence of an heir. My brother-in-law, cursed be his name, said that it was not our custom that women could inherit a thanedom. That was nonsense, but his gold bought the loyalties of enough of my husband's faithless servants for him to install himself in my hall. So I fled, something I was raised never to do, and something I hope never to do again."),
("npc9_backstory_b", "I was my father's first son, and his heir. But my mother died, and my father remarried. His new wife thought that her son should inherit. She could not move against me openly, but the other day I fed a pot of suet that had been left out for me to one of my hounds, and it keeled over. I accused my stepmother, but my father, befuddled by her witchcraft, refused to believe me and ordered me to leave his sight."),
("npc10_backstory_b", "A sergeant I was, in the garrison {s19} at {s20}. Twenty years I stood guard for the city, taking many a hard knock in many a tough fight, until they appointed a snot-nosed, downy-lipped princeling, barely out of his mother's cradle, as commander of the garrison. He came upon me standing watch atop the tower, with my crossbow unstrung -- on account of the rain, you see... Can't have the cord loosen... But Little Prince Snot-Nose tells me that an unstrung bow is dereliction of duty. Says he'll have me horsewhipped. And something in me snapped. So I walked off my post."),
("npc11_backstory_b", "For 30 years I followed the armies of this land, selling them victuals and drink, watching their games of dice and finding them girls, and nary a denar was left in my purse at the end."),
("npc12_backstory_b", "I am by training a natural philosopher, but condemned by the jealousy of the thick-headed doctors of my university to make my living as an itinerant surgeon. I was hired by a merchant of this city to cure his son, who fell into a coma after a fall from his balcony. I successfully trepanned the patient's skull to reduce the cranial swelling, but the family ignored my advice to treat the ensuing fevers with a tincture of willow bark, and the boy died. The father, rather than reward me for my efforts, charged me with sorcery -- me, a philosopher of nature! Such is the ignorance and ingratitude of mankind."),
("npc13_backstory_b", "I am a warrior by profession. But perhaps you may also have heard of my prowess as a poet, who can move the iciest of maidens to swoon. Or of my prowess in the art of the bedchamber, in which I must confess a modest degree of skill. I confess a modest affection for Calradia, and for the past several years have visited its towns, castles, and villages, making the most of my talents."),
("npc14_backstory_b", "I am the second son of the count of Geroia, of whom you have no doubt heard. Having no inheritance of my own, I came here to seek my fortune in Calradia, training men in the art of battle. Unfortunately, the lords here in {s20} has no taste for the disciplinary methods needed to turn rabble into soldiers. I told him it was wiser to flog them now, then bury them later. But he would not listen, and I was told to take my services elsewhere."),
("npc15_backstory_b", "The castellan {s19}in {s20} wanted a new tower added to the wall. Trouble is, he ran out of cash halfway through the process, before I could complete the supports. I told him that it would collapse, and it did. Unfortunately he was standing on it, at the time. The new castellan didn't feel like honouring his predecessor's debts and implied that I might find myself charged with murder if I push the point."),
("npc16_backstory_b", "I grew up in Malayurg castle as a bonded servant, working alongside my mother in the kitchens. I would amuse myself by hunting mice through the pantries and sculleries. I was so good at it that I put the castle cats out of a job, and eventually the lord realized that I might also be employed to track down bigger game, on certain errands of a type perhaps better left unsaid. Needless to say, I found a number of opportunities to avail myself of trinkets that had formerly belonged to my lord's enemies. So I was able to buy myself out of bondage, and find hire as a free agent. My last job was {s19}in {s20}."),
#backstory recruit pitch
("npc1_backstory_c", "But if I was with a larger group who could vouch for me, they might let it pass. I'd be very grateful to you."),
("npc2_backstory_c", "So here I am, no money and no way home."),
("npc3_backstory_c", "I shall marry whom I want, when I want. Moreover, regardless of what my father might think, I am perfectly capable of taking care of myself. I was thinking that I should perhaps join a band of gypsies, or perhaps a troop of mercenaries!"),
("npc4_backstory_c", "But I am anxious to avoid any further trouble, so if you knew of any company of fighting men where I might enlist, I would be most grateful."),
("npc5_backstory_c", "In the meantime, any opportunities to earn a living with my sword would be most welcome."),
("npc6_backstory_c", "Do you believe there is hope for a man like me? Can I find the path of righteousness, or am I doomed to follow the demons that dwell inside of me?"),
("npc7_backstory_c", "But I do not count myself unlucky, stranger, no more than any other woman of Calradia, this fetid backwater, this dungheap among the nations, populated by apes and jackals."),
("npc8_backstory_c", "When I have enough gold to raise an army I shall go back and take what it is mine."),
("npc9_backstory_c", "I hope to offer my sword to some worthy captain, as it is the only honourable profession for a man of my birth apart from owning land, but in the meantime I am condemned to make my bed among thieves, vagabonds, merchants, and the other riff-raff of the road."),
("npc10_backstory_c", "Now I'm here getting drunk, and the Devil take tomorrow."),
("npc11_backstory_c", "It's no kind of life, victualling the armies. You earn a bit here and a bit there as the soldiers spend their money, and then along comes one defeat and you have to start over, endebting yourself to buy a new wagon and new oxen. So I've decided to get out of the business, but army life is all I know."),
("npc12_backstory_c", "The lord of this castle is reluctant to place me under arrest, but I am anxious to move on elsewhere."),
("npc13_backstory_c", "Which reminds me -- somewhere out there in the city is a rather irate husband. I don't suppose you might consider helping me leave town?"),
("npc14_backstory_c", "So, if you know of any commander who believes that his purpose is to win battles, rather than pamper his soldiers, I would be pleased if you directed me to him ."),
("npc15_backstory_c", "More fool me for having taken the contract without an advance, I suppose, but the end of it all is that I'm in a difficult spot, with the roads full of bandits and no money to pay for an escort. So I'd be much obliged if a well-armed party heading out in the next few days could take me along."),
("npc16_backstory_c", "Unfortunately, my last employer's wife had a lovely amulet, of a kind I simply could not resist. She doesn't know it's missing, yet, but she might soon. So tell me, are you looking for helpers?"),
### use these if there is a short period of time between the last meeting
("npc1_backstory_later", "I've been here and about, you know, doing my best to keep out of trouble. I'm desperately in need of work, however."),
("npc2_backstory_later", "I sold my boots and have managed to make a few denars peddling goods from town to town, but it's a hard living."),
("npc3_backstory_later", "I hired myself on as a cook for some passing caravans, and that at least keeps me fed. But it is rough company on the road, and I grow weary of fighting off guards and others who would try to take liberties. I was thinking that if I could find work as a warrior, men would know to leave me alone."),
("npc4_backstory_later", "I went back to my ancestral barony, to inspect my lands. But we had locusts, you see, and bad rains, and other things, so here I am again, looking for work."),
("npc5_backstory_later", "I've been wandering through this war-torn land, looking for a leader who is worth following."),
("npc6_backstory_later", "I have been wandering Calradia, but have yet to find redemption."),
("npc7_backstory_later", "I have been wandering, looking for work as a tracker, but it has not been easy. Calradians are mostly ill-bred, lice-ridden, and ignorant, and it is not easy to work with such people."),
("npc8_backstory_later", "I am still seeking a war leader in whose shield wall I would fight. But I need gold, and fast, and the lords of this land as often as not prefer to stay behind the walls of their fortresses, rather march out to where glory and riches can be won."),
("npc9_backstory_later", "I've offered my sword to a few lords in these parts. But I find as often as not they'll ask me to run messages, or train peasants, or some other job not fit for a gentleman."),
("npc10_backstory_later", "I don't know if I told you or not, but I deserted my unit after I struck a young noble who had ordered me to be horsewhipped without cause. Since then I've been laying low. Thankfully I had the wit to pilfer my captain's purse before heading out, but the money is running low."),
("npc11_backstory_later", "I've been around and about. But it's a rare captain who'll take on an old bag of bones like me as a fighter, even if I could whip half the boys in his outfit."),
("npc12_backstory_later", "I have been here and about, tending to the sick and taking what reward I can. But the people of these parts are ignorant, and have little respect for my craft. The few denars I make are barely enough for me to replenish my stock of medicine. I should be grateful for the chance to find other work."),
("npc13_backstory_later", "I have been wandering through the cities of Calradia, leaving a string of love-sick women and cuckolded husbands in my wake. But I grow weary of such simple challenges, and had been thinking of turning myself to more martial pastimes."),
("npc14_backstory_later", "I have gone from court to court, but I have not yet found a lord who is to my liking."),
("npc15_backstory_later", "I've been going from castle to castle, looking to see if walls or towers need repair. But either the lord's away, or he's got other things on his mind, or I run into his creditors on the street, begging for change, and I realize that here's one job not to take. So if you hear of anything, let me know."),
("npc16_backstory_later", "I do the odd job from time to time. But there's naught like steady employment, and a regular run of corpses to loot."),
("npc1_backstory_response_1", "Perhaps. But how do I know that there won't be a 'misunderstanding' about one of my horses?"),
("npc2_backstory_response_1", "Well, perhaps I could offer you work. Can you fight?"),
("npc3_backstory_response_1", "Well, as it happens I run a company of mercenaries."),
("npc4_backstory_response_1", "I run such a company, and might be able to hire an extra hand."),
("npc5_backstory_response_1", "That's the spirit! I might be able to offer you something."),
("npc6_backstory_response_1", "Hmm. You might consider joining us. Right wrongs, fight oppressors, redeem yourself, that kind of thing."),
("npc7_backstory_response_1", "Hmm... Are you by any chance looking for work?"),
("npc8_backstory_response_1", "I can offer you opportunities to make money through good honest fighting and pillaging."),
("npc9_backstory_response_1", "Perhaps you would like to join my company for a while."),
("npc10_backstory_response_1", "If you're looking for work, I can use experienced fighters."),
("npc11_backstory_response_1", "What will you do now?"),
("npc12_backstory_response_1", "Well, you could travel with us, but you'd have to be able to fight in our battle line."),
("npc13_backstory_response_1", "I might be able to use an extra sword in my company."),
("npc14_backstory_response_1", "I might be able to use you in my company."),
("npc15_backstory_response_1", "Where do you need to go?"),
("npc16_backstory_response_1", "I might be. What can you do?"),
("npc1_backstory_response_2", "I'll do no such thing. I have better things to do then to help thieves avoid justice."),
("npc2_backstory_response_2", "Hard luck, friend. Good day to you."),
("npc3_backstory_response_2", "Go back to your family, lass. Fathers must always be obeyed."),
("npc4_backstory_response_2", "No, sorry, I haven't heard of one."),
("npc5_backstory_response_2", "Sigh.. So long as you hill clans fight tribe against tribe, you will remain a silly, weak people."),
("npc6_backstory_response_2", "Away with you, accursed fraticide!"),
("npc7_backstory_response_2", "Actually, I'm rather fond of the place. Good day to you."),
("npc8_backstory_response_2", "Your brother-in-law was right -- women should not rule. Go back home and tend your hearth."),
("npc9_backstory_response_2", "Some of my best friends are riff-raff. Good day to you, sir."),
("npc10_backstory_response_2", "No doubt you'll wake up with your head in a noose, and you'll deserve it. Good day."),
("npc11_backstory_response_2", "Very interesting, madame, but I have work to do."),
("npc12_backstory_response_2", "Sorry. I can't take on any new hands."),
("npc13_backstory_response_2", "No, sorry. Nothing I can do for you."),
("npc14_backstory_response_2", "I'll let you know if I hear of anything. Good day."),
("npc15_backstory_response_2", "Sorry. I've got all the men that I can manage right now."),
("npc16_backstory_response_2", "Sorry, lass. You sound like you might be trouble."),
("npc1_signup", "{Sir/Madame} -- I'm offended that you would even think such a thing. I'd be most indebted to you, and you'll see that I show my gratitude."),
("npc2_signup", "Well, I will confess that I am not a warrior by trade."),
("npc3_signup", "Do you? Well, I am in no position to be picky! I would be pleased to join you."),
("npc4_signup", "Good! I look forward to vanquishing your enemies."),
("npc5_signup", "Why, that is a most generous offer."),
("npc6_signup", "Yes! You must have been sent by divine providence! Lead me -- lead me away from darkness!"),
("npc7_signup", "I might be. I could certainly use the money."),
("npc8_signup", "Can you? I shall accept your offer."),
("npc9_signup", "I would very much like that, sir"),
("npc10_signup", "Are you, now? Well, that's a sight better than swinging from a gibbet for desertion."),
("npc11_signup", "Why, I'll be a soldier myself! Help my old hands to a bit of loot to comfort me in my retirement. Two boys I bore, both soldiers' brats, and they became soldiers themselves. One had his head split by a Khergit war club, the other died of the pox, but at least they didn't die hungry."),
("npc12_signup", "As I told you, I am a surgeon, not some silk-robed university physician who has never touched a body. I can get my hands dirty."),
("npc13_signup", "Indeed? You would do well to enlist me."),
("npc14_signup", "I would be pleased to ride with you, at least for a little while, for pay and a share of any loot."),
("npc15_signup", "Geroia, eventually, but I'd welcome the opportunity to get a few denars in my pocket, first, so I don't come home empty handed. So if you promise me food and a share of the loot, I'd be happy to fight with you for a while."),
("npc16_signup", "Well, {sir/madame}, let me tell you. I may not know how to read and write, but I know the quickest way to a man's heart is between his fourth and fifth rib, if you understand me. "),
("npc1_signup_2", "I've ridden over a fair amount of rough country in my time, more often than not in a hurry. I'm a good tracker and I've got a good eye for terrain. So what do you say?"),
("npc2_signup_2", "I'm a fast learner. I can ride, and know a fair bit about trade, prices and such."),
("npc3_signup_2", "I think you would find I would be a most valuable addition to your ranks. I am well versed in the classics of literature and can declaim several of the epic poems of my people. I play the lute and am a skilled manager of household servants."),
("npc4_signup_2", "Note however that as a gentleman and the holder of a barony, I expect to be in a position of command, and not be treated as one of the common soldiers."),
("npc5_signup_2", "I shall not betray you -- so long, of course, as you do your duty to me by feeding me, paying me, and not dragging my miserable hide into a battle where there is no chance of winning. Hand me some salt, if you will -- it is the custom of our people to take salt from our captains, as a token of their concern for our well-being."),
("npc6_signup_2", "I am well practiced in the arts of war -- but I beg you, sir, I wish to use my skills to defend the innocent, the pure, and the defenseless, not to be a common brigand and wreak more misery than I have already wrought."),
("npc7_signup_2", "But let your followers know that I do not suffer louts and brutes. Anyone who misbehaves around me will quickly find an arrow in their gullet."),
("npc8_signup_2", "I shall be pleased to fight in your shield wall. But I warn you -- if you ask me to gather the firewood, or cook a meal, you will not like the consequences."),
("npc9_signup_2", "I am a gentleman, and prefer to fight with sword and lance. I recognize that you are of lower birth than I, there is no shame for me to serve under an experienced captain -- presuming, of course, that your followers do not become too familiar with me. I assume that will not be a problem?"),
("npc10_signup_2", "You won't regret taking me on, {Brother/Sister}. I'm a dead eye with a crossbow -- a beautiful weapon, it can right punch through a nobleman's armour and spill his blue blood upon the ground. And I've trained more raw recruits than you've had hot dinners, begging your pardon. I don't toadie to the high-born."),
("npc11_signup_2", "I know how to swing a blade, staunch a wound, and feed an army on the march. It would be a foolish captain who passed up the opportunity to hire an experienced campaigner like me! Say, {laddie/lassie}, don't you command a war party of your own, now?"),
("npc12_signup_2", "I have treated every variety of wound that can be inflicted by the hand of man. Before I was a surgeon, I was a student, so you may be sure that I have inflicted wounds as well as healed them."),
("npc13_signup_2", "Sword, lance, the bow -- my skill in all such martial pursuits is the stuff of epic verse. Together we will perform such feats as will be recounted in festivals and campfires, in filthy taverns and in the halls of kings, for many generations to come."),
("npc14_signup_2", "I am a skilled swordsman, and I can also instruct your men in fighting. But I warn you that I do not care to fight for a leader who is lax in discipline with {his/her} men, for in the long run they will not respect a soft hand. "),
("npc15_signup_2", "Siegework is my speciality, although I reckon can handle myself well enough in an open battle, if need be."),
("npc16_signup_2", "I can throw knives, in addition to stabbing with them, and I'm slippery as quicksilver. You'll find me useful in a fight, I'll warrant."),
("npc1_signup_response_1", "Good. You can be useful to us."),
("npc2_signup_response_1", "That will do."),
("npc3_signup_response_1", "Um, that's a start. We can teach you the rest."),
("npc4_signup_response_1", "Very well. I'll be glad to have you with us, um, 'Baron.'"),
("npc5_signup_response_1", "Certainly. Here, have some salt."),
("npc6_signup_response_1", "Happy to be of service! Get your things together, and we shall be on our way."),
("npc7_signup_response_1", "I will hire you. Try not to shoot anyone on your first day."),
("npc8_signup_response_1", "No fear, ma'am. You're the widow and the daughter of a thane, and you'll be treated as such."),
("npc9_signup_response_1", "Well, it shouldn't be. I'll have a talk with them."),
("npc10_signup_response_1", "Good man. We'll treat you with the respect you deserve."),
("npc11_signup_response_1", "It sounds like you'll be useful. You are hired."),
("npc12_signup_response_1", "Then welcome to our company, doctor"),
("npc13_signup_response_1", "Good. Make yourself ready, and we'll be on our way. "),
("npc14_signup_response_1", "Good. I'll be happy to hire someone like you."),
("npc15_signup_response_1", "That works for me. I will be pleased to hire you."),
("npc16_signup_response_1", "It sounds like you can do the job. I will hire you."),
#11
("npc1_signup_response_2", "I'd prefer not to take the risk. Good day, sir."),
("npc2_signup_response_2", "I'm afraid I'm only looking for men with some experience. Good day to you."),
("npc3_signup_response_2", "Actually, we were looking for a slightly different skill-set."),
("npc4_signup_response_2", "Actually, we are not in the habit of hiring bandits with invented pedigrees. Good day, sir."),
("npc5_signup_response_2", "Actually, on second thought, I prefer to keep more civilized company."),
("npc6_signup_response_2", "On second thought, maybe a mercenary company is not what you need right now."),
("npc7_signup_response_2", "Actually, on second thought, you sound like you might be trouble. Good day to you. "),
("npc8_signup_response_2", "Ah. Actually, if you don't do whatever I order you to do, you'd best seek your fortune elsewhere."),
("npc9_signup_response_2", "You assume wrong, sir. In my company we respect courage and skill, rather than noble birth."),
("npc10_signup_response_2", "On second thought, we value discipline pretty highly in our company. Good day to you."),
("npc11_signup_response_2", "Sorry, madame. We've already got as many in our company as we can handle."),
("npc12_signup_response_2", "A battle is not the same thing as a tavern brawl. Perhaps you should look elsewhere for work."),
("npc13_signup_response_2", "Actually, on second thought, a fighter overeager for glory is dangerous to have in one's company."),
("npc14_signup_response_2", "Actually, I have no wish to provoke a mutiny in my ranks. Good day, sir."),
("npc15_signup_response_2", "Actually, I need a different kind of expertise. My apologies."),
("npc16_signup_response_2", "To be honest, I'd prefer someone who was a little less tempted to larceny."),
("npc1_payment", "I will be very useful to you, {sir/madame}, you can bet on that. Just one more thing before we leave, would you mind lending me {reg3} denars? I am ashamed to say it, but I have made myself a bit of debt here, staying in this tavern over the last few weeks and the tavern owners no longer believe that I am loaded with gold as I used to tell them. You know, things could get ugly here if they see me leaving with you before paying them."),
("npc2_payment", "."),
("npc3_payment", "."),
("npc4_payment", "Excellent. Before we depart, would you be so kind to lend me {reg3} denars? I had to pawn a family heirloom at a pawnbroker here in {s20}, and I would like to retrieve it before we leave."),
("npc5_payment", "Thank you. Now, to seal off our agreement, I ask for {reg3} denars from you. It's an advice my father gave me. He told me 'Baheshtur, never fight for a barbarian before {he/she} pays you your worth of gold first'."),
("npc6_payment", "."),
("npc7_payment", "All right then. I will come with you. But I want a payment of {reg3} denars first. You aren't expecting me to work for free, do you?"),
("npc8_payment", "Then I will fight your enemies for you. But first I want a bounty of {reg3} denars. If you are a worthy captain who can lead {his/her} company to riches and plunder, you should have no trouble paying. I cannot afford to follow a pauper."),
("npc9_payment", "That's very good of you. And before I join, can you lend me {reg3} denars, so that I can buy some proper clothing that befits a gentleman of noble birth such as myself. The coat on me has been worn down badly due to my recent bad fortune, and I cannot let common soldiers mistake me as one of their own."),
("npc10_payment", "That's good news. But I'll ask for one last thing, captain. I have a woman here in {s20}, a tavern wench, and she says she has my child in her belly. I want to give her some money before I leave... for the child, you know. Do you think you can spare {reg3} denars?"),
("npc11_payment", "Hey thank you captain. But before joining up with you, I would ask for a payment of {reg3} denars. I know that in war parties soldiers can go on for weeks without seeing any wages. I am wise enough not to sign anywhere without having myself covered."),
("npc12_payment", "."),
("npc13_payment", "Before I sign up, there is the small matter of some expenses I have incurred while staying here -- {reg3} denars. Do you think that you could cover those for me, as a gesture of friendship?"),
("npc14_payment", "Ah, one last thing. I would ask for an initial bounty of {reg3} denars before I join your command. It's my principle never to enter someone's service without receiving the payment I deserve."),
("npc15_payment", "Good. By the way, as a skilled engineer I would expect a payment for my services. A signing bonus of {reg3} denars would be fair, I think."),
("npc16_payment", "Now, that's good news, captain. So, how about paying me a little something to seal off our agreement? A mere {reg3} would be enough. Please don't take this the wrong way, but I've had some bad luck with employers in the past. "),
("npc1_payment_response", "Very well, here's {reg3} denars. Now, fall in with the rest."),
("npc2_payment_response", "."),
("npc3_payment_response", "."),
("npc4_payment_response", "Certainly. Here's {reg3} denars."),
("npc5_payment_response", "Well... here's {reg3} denars, then. Your first payment."),
("npc6_payment_response", "."),
("npc7_payment_response", "No, of course not. Here's {reg3} denars."),
("npc8_payment_response", "Oh, I am no pauper, madame. Here's {reg3} denars for you."),
("npc9_payment_response", "Very well, here's {reg3} denars."),
("npc10_payment_response", "Of course. Here, {reg3} denars."),
("npc11_payment_response", "Very well, here's {reg3} denars. Make yourself ready. We leave soon."),
("npc12_payment_response", "."),
("npc13_payment_response", "Of course, here's {reg3} denars. Make ready to leave soon."),
("npc14_payment_response", "All right, here's {reg3} denars. You are most welcome in our company."),
("npc15_payment_response", "All right, here's {reg3} denars. Glad to have you with us."),
("npc16_payment_response", "All right, here's {reg3} denars for you. Make yourself ready."),
("npc1_morality_speech", "Oy -- boss. Please don't take this the wrong way, but it's a hard life and it's a bit much that we {s21}. Take a little more care in the future, captain, if you don't mind my saying."),
("npc2_morality_speech", "I hope you don't mind my saying so, but it's a bit hard for me to see us {s21}. Maybe I ought to try to be more of a hardened soldier, but if we could try to exercise a little mercy from time to time, I'd sleep better."),
("npc3_morality_speech", "Perhaps it is not my place to say so, {sir/madame}, but I confess that I am somewhat shocked that we {s21}. Of course I realize that war is cruel, but there is no need to make it more cruel than necessary."),
("npc4_morality_speech", "Your pardon -- just so you know, the men of the House of Rolf do not care to {s21}. I will not be pleased if you continue to take this course."),
("npc5_morality_speech", "Pardon me, captain. It is not good to {s21}. Your first duty is to the men who have taken your salt. The least they can expect is food, pay, the opportunity to loot, and that you not waste their lives needlessly."),
("npc6_morality_speech", "Excuse me, {sir/madame}. As you know, I joined with you to right wrongs, protect the innocent, and make amends for my sin. I did not expect to {s21}."),
("npc7_morality_speech", "Captain -- I do not like to see us {s21}. Such are the actions of a common bandit chief, with no regard for his followers."),
("npc8_morality_speech", "I was not pleased that you decided to {s21}. To fall in battle is an honour, but to fight in a warband led by a coward is a disgrace."),
("npc9_morality_speech", "{Sir/Madame} -- it is not my way to {s21}. Men of my house will accept death but not dishonour. Please do not make me ashamed to serve under you."),
("npc10_morality_speech", "Begging your pardon, captain. I can't say that I'm happy to see us {s21}. Those are just simple people, trying to make a living. If we could try to go easy on the poor wretches, captain, I'd feel much better."),
("npc11_morality_speech", "Excuse me, captain. It's not good that we {s21}. I've followed armies and warbands for 30 years, and the least the soldiers expect of a leader is to feed them, pay them, and do {his/her} best to keep their sorry skins intact as best {he/she} can."),
("npc12_morality_speech", "Captain -- I do not like to see us {s21}. I am prepared to be a warrior, but not a brigand. Pray let us try to show a little more compassion."),
("npc13_morality_speech", "Captain, if we can avoid it, I'd prefer not to {s21}. Calradia is a small place, and one's reputation is precious. I would not care for one of my rivals to include this latest unfortunate incident in a satirical verse."),
("npc14_morality_speech", "I do not care to {s21}. No one with a reputation for cowardice will be properly feared by his men."),
("npc15_morality_speech", "{Sir/Madame} -- just so you know my opinion, any commander with sense will not let his company {s21}.I hope you don't mind me speaking so bluntly."),
("npc16_morality_speech", "Captain. I don't like to {s21}. So many throats left uncut, and so many purses left unexplored..."),
("npc1_2ary_morality_speech", "Boss -- just so you know, I've got no problem if we {s21}. Living to fight another day makes good sense to me."),
("npc2_2ary_morality_speech", "{Sir/Madame} -- I'm not altogether happy that we {s21}. I'm a merchant, and in our business one is bonded by one's word. I don't want a reputation for dishonesty -- that would spell my end as a trader, {sir/madame}."),
("npc3_2ary_morality_speech", "{Sir/Madame} -- I think it was a brave decision you took to {s21}. There is no shame in finding a way to avoid the spilling of blood."),
("npc4_2ary_morality_speech", "Your pardon -- whatever anyone else says, I think nothing of it that you {s21}. You should adopt whatever ruse you need to survive in these troubled times."),
("npc5_2ary_morality_speech", "[No secondary moral code]"),
("npc6_2ary_morality_speech", "{Sir/Madame} -- you may choose to {s21}, but would prefer to have no part in it. Such is not the path to my redemption."),
("npc7_2ary_morality_speech", "[No secondary moral code]"),
("npc8_2ary_morality_speech", "[No secondary moral code]"),
("npc9_2ary_morality_speech", "Captain, I am dismayed that you {s21}. A {gentleman/gentlewoman} such as yourself should exhibit the highest standards of honour at all times."),
("npc10_2ary_morality_speech", "{Brother/Sister} -- I can't say I like to see us {s21}. You should treat your men well, and they'll repay with interest."),
("npc11_2ary_morality_speech", "[No secondary moral code]"),
("npc12_2ary_morality_speech", "[No secondary moral code]"),
("npc13_2ary_morality_speech", "[No secondary moral code]"),
("npc14_2ary_morality_speech", "Captain -- you should not let it bother you that you {s21}. Armies are made to do their leaders' bidding, and hardships are part of a soldier's life."),
("npc15_2ary_morality_speech", "You know, friend {playername}, it's none too reassuring to see how you just {s21}. If you can break your word to them, you can break your word to me, is how I figure it."),
("npc16_2ary_morality_speech", "Captain -- just so you know, it's no problem by me that we {s21}. We do what we need to do to live, and they'd do the same to us if they were in our shoes."),
("npc1_personalityclash_speech", "Captain -- no offense, but I'm a bit tired of {s11}, who puts on airs like she's something better than your humble servant Borcha."),
("npc2_personalityclash_speech", "{Sir/Madame} -- as you recall I was a merchant before I signed on with you. I respect men who make their living peacefully, risking all to bring goods for far away lands."),
("npc3_personalityclash_speech", "Captain -- in my opinion, {s11} is a hard and cruel man. He speaks of nothing but the need to flog, beat, and hang his fellow soldiers."),
("npc4_personalityclash_speech", "{Sir/Madame}. The House of Rolf is one of the most ancient and respected families in this part of the world, with a provenance dating back to the Old Calradic Empire. Yet {s11} openly shows me disrespect, and casts doubt on the provenance of my house."),
("npc5_personalityclash_speech", "A moment of your time, captain. {s11} seems to think me a common bandit, just because I have rewarded myself in the past to the legitimate spoils of war from caravans passing through my family's lands."),
("npc6_personalityclash_speech", "Your pardon, {sir/madame}, but I cannot keep my tongue stilled any longer. That harlot, {s11} -- every time she sees me she points the five fingers of her hand at me -- a peasant's sign to ward off evil."),
("npc7_personalityclash_speech", "Captain, I have done my best to put up with your followers' rude talk and filthy habits. But that one who calls himself {s11} is beyond tolerance."),
("npc8_personalityclash_speech", "Just so you know, I cannot abide that insolent mountebank {s11}. Some minutes ago, I was remarking to our companions how the peasants of this region were more than usually slack-jawed and beetle-browed, and speculated that perhaps they had bred with apes."),
("npc9_personalityclash_speech", "Sir -- {s11} is a base braggart, a man with no respect for the honour of women. I am tired of hearing how he conquered this or that damsel."),
("npc10_personalityclash_speech", "Excuse me, captain. I hate to trouble you with such things, but I just wanted to let you know that I can't abide that fellow Rolf, the one who calls himself a baron."),
("npc11_personalityclash_speech", "Begging your pardon, captain, but I can't keep silent. That man, {s11} -- he killed his own brother."),
("npc12_personalityclash_speech", "My lord. The barbarian woman, {s11}, complained of headaches -- a possible symptom of excess of sanguinity. I thought to apply my leeches."),
("npc13_personalityclash_speech", "Captain, I weary of {s11}, who talks of nothing but chivalry and feats of arms."),
("npc14_personalityclash_speech", "Excuse me, captain. A few minutes ago, I had expressed the opinion that liberal use of the lash and occasional use of the gallows is essential to keep soldiers in line. Men without a healthy fear of their commanders are more likely to run from battle."),
("npc15_personalityclash_speech", "Excuse me. I hope you don't mind me telling you that in my opinion, that girl {s11} is a danger to the party. She's a feral brat, disrespectful of authority and the basic principles of the military art."),
("npc16_personalityclash_speech", "Oy, captain. Just so you know -- there's something funny about {s11}. He makes strange scrawlings in the dirt, and mutters to himself."),
("npc1_personalityclash_speech_b", "She's a common bandit, just like myself, and she has no right to tell me to keep my distance from her, as she did just now."),
("npc2_personalityclash_speech_b", "I don't much care to hear {s11} gloat about the caravans he has looted, or he plans to loot, like he has no respect for good honest trade."),
("npc3_personalityclash_speech_b", "I know that an army is not a nursery, and that strong discipline is important, but I do believe that man enjoys cruelty for cruelty's sake. I hope you do not mind me saying so."),
("npc4_personalityclash_speech_b", "{Sir/madame}, these are indeed sorry days if common folk are allowed to mock their betters. That is all."),
("npc5_personalityclash_speech_b", "I told him that if the warrior's way bothers him so much, that he become a priest or a beggar and so not have to worry about such things. I hope you do not mind that I said such things."),
("npc6_personalityclash_speech_b", "I know the crime I committed was an abomination, but I am seeking repentance, and I deserve better than to be the object of some witch's superstition. I just thought you should know."),
("npc7_personalityclash_speech_b", "I do not care for how he stares at me around the campfire after a meal, as he picks his teeth. I believe I recognize him from my days as a bandit. He is base and ignorant. I do not care to travel with such people."),
("npc8_personalityclash_speech_b", "{s11}, that font of impudence, overheard me, and called me ignorant, and a savage, and other words I do not care to repeat. It was only out of respect for you that I refrained from cutting his throat then and there. I thought it only fit that I should warn you."),
("npc9_personalityclash_speech_b", "If he persists, I shall tell him that he is a base varlot, and if it comes to blows I will not apologize. That is all, {sir/madame}."),
("npc10_personalityclash_speech_b", "He's just a simple brigand, as far as I can tell. House of Rolf, my arse. Genuine blue-bloods are bad enough, but those who pretend to be blue-bloods are bloody intolerable. Anyway, I might have said something a bit sharp to him a minute ago. He seemed to take offense, anyway. I just thought you should know."),
("npc11_personalityclash_speech_b", "He's a kinslayer, cursed by heaven, and he'll bring misfortune and sorrow upon us, that's for certain. I don't like being around him and I don't think he should be with us. That's all. Sorry for troubling you."),
("npc12_personalityclash_speech_b", "But when I tried to afix them, she recoiled and struck me, and accused me of witchcraft. Captain, I am deeply tired of attending to the complaints of such an ungrateful and ignorant lot."),
("npc13_personalityclash_speech_b", "Valorous deeds are all very well, but they are not the only goals worth pursuing in life. Personally, I never trust any man who has not at least once woken up drunk in a ditch, or been beaten by the slipper of his lover."),
("npc14_personalityclash_speech_b", "That chit {s11} saw fit to admonish me for this. I will not have my methods questioned in front of the men, and I will not serve any commander who tolerates such insubordination in his company. Thank you for allowing me to speak my peace."),
("npc15_personalityclash_speech_b", "What's more, I suspect she's a thief. I found her going through my baggage and pawing some of my schematics, and she pulled a knife on me when I thought fit to object. A wise captain would not allow her in his company."),
("npc16_personalityclash_speech_b", "Fearing witchcraft, I asked him about it, and he told me that a chit of a girl like myself should mind her own business. So I had a look in his baggage, and found strange plans and diagrams. I think he's a sorceror, {sir/madame}, and if I catch him trying to hex me he'll have a knife in his throat."),
### set off by behavior after victorious battle
("npc1_personalityclash2_speech", "Oy -- boss, I don't fancy myself a sensitive soul, but I don't particularly like how {s11} went about cutting the throats of the enemy wounded, back there."),
("npc2_personalityclash2_speech", "{Sir/Madame}. If you don't mind, I'd prefer not to be deployed anywhere near {s11}, after what he said to me during that last battle."),
("npc3_personalityclash2_speech", "{Sir/Madame}. Since I have joined your company, I have tried hard to learn how to live like a soldier, and how to honour the warrior's code. If I occasionally make mistakes, I would hope to be forgiven."),
("npc4_personalityclash2_speech", "{Sir/Madame}. I happened to exchange a few words with {s11} as we were dividing up the spoils of battle. Please inform her that when she speaks to me, she should call me 'Baron' or perhaps 'Baron Rolf,' or 'Your Grace,' but certainly not just 'Rolf.'"),
("npc5_personalityclash2_speech", "Captain. {s11} needs to have her tongue cut out."),
("npc6_personalityclash2_speech", "My lord. Did you see {s11} during that last battle? He taunts the fallen foe as they lay stricken and helpless on the battlefield, mocking their parentage, their foolishness for having fought us."),
("npc7_personalityclash2_speech", "Captain -- I have been searching my mind trying to remember where I have seen {s11}, the one who calls himself a baron. As I watched him in action during that last battle, I suddenly remembered. He is a good fighter, but also a vicious one."),
("npc8_personalityclash2_speech", "Captain. {s11} is a most insolent girl. I have tried to be polite, even friendly, only to have her rebuff me."),
("npc9_personalityclash2_speech", "{Sir/My lady}, I hope you do not mind me telling you this, but in my opinion {s11}, the merchant, does not know his place. During that last battle, he cut in front of me to engage a foe whom I had marked for my own."),
("npc10_personalityclash2_speech", "{Brother/Sister} -- a question for you. Are you in charge of this company, or is it {s11}?"),
("npc11_personalityclash2_speech", "Captain. I don't much care for that {s11}. After that last battle, he went around muttering some heathen incantation, as he went through the slain looking for loot."),
("npc12_personalityclash2_speech", "Captain. I can no longer abide the rank ignorance of {s11}. As I was treating the wounded during our last battle, he saw fit to disparage my use of laudanum in relieving the pain while I conducted surgery, and of treating wounds with a poultice of honey."),
("npc13_personalityclash2_speech", "Hello, captain! {s11} is a temperamental one, isn't he? During that last battle, I was merely having a friendly chat with our foes about their mothers as we exchanged swordblows, and it caused him to throw a fit!"),
("npc14_personalityclash2_speech", "Sir. {s11} is incorrigibly indisciplined. During that skirmish, I called out to him that he should hold ranks with the rest of our battle array. He called back to me that I should 'get stuffed.'"),
("npc15_personalityclash2_speech", "Captain -- I must tell you that I question {s11}'s medical credentials. As he was tending to our wounded after that last battle, I saw fit to remind him that the peerless Galerian often advocated administering a distillation of beetroot, to restore the humor imbalance brought by loss of sanguinity."),
("npc16_personalityclash2_speech", "Beg your pardon, sir. {s11} might have been a very good thief, but he's not got the stomach to be a warrior, if you ask me."),
("npc1_personalityclash2_speech_b", "The way she whistles cheerfully as she does it -- it puts a chill down my spine, it does."),#borcha - klethi
("npc2_personalityclash2_speech_b", "The enemy was bearing down on us, and he says, 'Step aside, merchant, this is knight's work.' Next time I will step aside, and let him take a spear in the gut."), #marnid - alayen
("npc3_personalityclash2_speech_b", "After our last victory I was picking through the slain, and availed myself of one of our foe's purses. No sooner had I done so then {s11} came up behind me and struck it from my hands, saying that it was she who had made the kill, and thus she deserved the spoils. My lord, I could not tell in the heat of battle who had struck whom. If {s11} had simply told me that she deserved the purse, I would gladly have given it to her."),#Ymira - matheld
("npc4_personalityclash2_speech_b", "I am of noble blood, and she is of the basest birth. She must remember her place."),#Rolf - deshavi
("npc5_personalityclash2_speech_b", "When the loot was piled up after the last battle, I found among the enemy's baggage a very decent cooking pot. Often I had wished to find such a pot, so I could boil some of the stews that my people use to warm their bellies during the winter months. But {s11} grabs the pot, and tells me that I will not be allowed to 'taint' it with heathen food, and that it should properly belong to her. I yielded the pot to her, but I will not tolerate such disrespect in the future."), #beheshtur- katrin
("npc6_personalityclash2_speech_b", "My lord -- such hubris will not be overlooked by Heaven, and I fear we shall all of us pay the price."), #firentis - nizar
("npc7_personalityclash2_speech_b", "Back when I lived in the ravines, we would sometimes fight with a rival band called the Brethen of the Woods. Captain -- I would not trust any man who hides his origins, and particularly would not trust a common bandit who calls himself a lord."),#deshavi - rolf
("npc8_personalityclash2_speech_b", "As we were cleaning our weapons after that last battle, I remarked that I thought her a handsome girl, and after I regained my lands I would happily find her a match with one of my warriors. I thought it was a very generous offer, as a woman disinherited by her father is hardly going to find herself awash in prospects. But rather than thank me, she simply turned her back without a word. It was only out of respect for your leadership that I did not immediately try to teach her some manners."), #matheld - ymira
("npc9_personalityclash2_speech_b", "I appreciate that he is willing to risk his life in battle, but that alone does not make a gentleman. He is not of noble birth, and his family's wealth comes from commerce and usury. He may fight with us as an auxiliary, but should not attempt to steal glory from his betters."),# alayen - marnid
("npc10_personalityclash2_speech_b", "In that last battle he was shouting at me: 'Go forward, go back, hold the line.' When I told him to mind his own trimming he said he'd have me flogged. Captain, that man is looking for a crossbow bolt in his chest, begging your pardon."),
("npc11_personalityclash2_speech_b", "He said it was a prayer of thanksgiving for victory, but it didn't sound like that to me. Captain, I don't want him raising up the ghosts of the dead to make trouble for us on our travels. I think you had best be rid of him"),
("npc12_personalityclash2_speech_b", "Captain, if that man knew the slightest thing about medical matters, he would know that one should never undermine a patient's confidence in his doctor, particularly not during a complicated operation. If you would be kind enough to dismiss him from this company, you would be doing all of us a great service."), # jeremenus - artimenner
("npc13_personalityclash2_speech_b", "When all the dust settled, {s11} turned on me and told me not to 'tempt the wrath of the Heavens' with my 'hubris.' I responded that at least I hadn't killed my own brother, which I think bothers the Heavens a lot more than battlefield small talk. {s11} turns red like a baboon's arse and would have struck me had I not artfully dodged out of his away. Tell him to lighten up, will you?"), #nizar - firentis
("npc14_personalityclash2_speech_b", "{Sir/Madame}, such defiance of proper authority is a corrosive influence on our company, and I shall have him flogged if he does so again."), #lazalit - bunduk
("npc15_personalityclash2_speech_b", "{s11} responded that Galenian was an 'antiquated know-nothing.' Captain, no true doctor would have such disrespect for the great masters of the past. I do not believe you should employ such an obvious impostor."), #artimenner - jeremus
("npc16_personalityclash2_speech_b", "After our last scrap, I was slicing open the guts of some our foes to check for hidden gold, as a girl who counts her pennies ought. He gagged and muttered that I was an 'animal.' I'll inspect his innards for contraband if he doesn't keep a civil tongue in his head."), #klethi - borcha
("npc1_personalitymatch_speech", "Boss. {s11} back there didn't do badly in that last fight at all. He's a good egg, too."),
("npc2_personalitymatch_speech", "{Sir/Madame}. I just wanted to tell you that {s11} may be a rough sort, and I'll venture a thoroughgoing rogue as well, but I'm proud to call him my companion."),
("npc3_personalitymatch_speech", "Hello, {sir/madame}! I had just wanted to tell you that {s11} is a most gallant knight. Did you see him in our last battle?"),
("npc4_personalitymatch_speech", "Excuse me, {sir/madame}. I just wanted to say a word in praise of {s11}. He did well in that last battle."),
("npc5_personalitymatch_speech", "That was a fine battle, {playername} Bahadur! {s11} is a good man to have by our side in a fight."),
("npc6_personalitymatch_speech", "Captain. Sometimes I am troubled by all this bloodshed, although I know that proud warlords must be humbled, and cruel bandits tamed, if we are to restore peace to Calradia."),
("npc7_personalitymatch_speech", "Captain. I was just talking to {s11}. She may be a bit savage, but I believe that she is a faithful friend."),
("npc8_personalitymatch_speech", "A fine battle that was, captain. And I have to say, I admire the taunts that {s11} hurled at our enemy."),
("npc9_personalitymatch_speech", "Captain. {s11} acquitted herself well in that fight back there. A fine, modest maiden she is, if I dare say so myself."),
("npc10_personalitymatch_speech", "Ahoy, Brother! I wish you joy of your victory! Say, old Mother {s11}'s not bad in a scrap, is she, for a woman of her years? Although I'm getting to be a bit of an old dog myself, now."),
("npc11_personalitymatch_speech", "Ach, captain! A fight like that one sets my old joints a-creaking. Still, we licked them pretty good, didn't we?"),
("npc12_personalitymatch_speech", "A bloody business, captain, a bloody business -- although a necessary one, of course. {s11}, I believe, shares my ambivalence about this constant fighting."),
("npc13_personalitymatch_speech", "You have earned your name today, oh valorous one! And {s11}, too! I like that one. She sings the songs of her people as she goes into battle, which appeals to an artistic soul like my own."),
("npc14_personalityclash_speech", "Captain. It is a pleasure going into battle with men like {s11} by my side."),
("npc15_personalitymatch_speech", "Captain. I was just having a word with {s11} after our last battle, and it strikes me that the man has got a good head on his shoulders."),
("npc16_personalitymatch_speech", "Oy -- captain. I was just having a chat with {s11}, as we picked through the bodies after our last little scrap."),
("npc1_personalitymatch_speech_b", "Without good honest souls like him to bring silver into Calradia, scoundrels like me would have a hard time in life, I'll warrant. I'm glad to have him with us."),
("npc2_personalitymatch_speech_b", "Based on how he did in that last fight, I'd say that I'd trust my back to him any day, although I'd still keep a hand on my purse."),
("npc3_personalitymatch_speech_b", "I also confess that I find him a truly delightful companion, a man of both wit and manners. Perhaps, perhaps... Ah, but I say too much. Good day, {sir/madame}."),
("npc4_personalitymatch_speech_b", "You chose well to enlist him in our company. He knows a thing or two about a fight, and also knows the importance of respecting his comrades-in-arms, unlike some others I might mention."),
("npc5_personalitymatch_speech_b", "As for his other attributes, I doubt that he is any more a Baron than I am, but I have to admire the brazen way he makes that claim."),
("npc6_personalitymatch_speech_b", "I must say that {s11} is a source of great comfort to me. I have told him of my sin, and he said to me that Heaven will forgive my transgression, if I truly repent and truly desire such forgiveness. He is wise, and I am glad that he is with us."),
("npc7_personalitymatch_speech_b", "At some point in the future, if you have no need of our services, she has promised to go back to the ravines with me and find the bandits who murdered my lover, and help me take my revenge. It was a kind offer. I am glad that she is with us."),
("npc8_personalitymatch_speech_b", "He managed to include their geneology, their appearance, and their eating habits in a well-framed Old Calradic quatrain. I personally prefer the saga, but we Nords respect poetic craftwork when we hear it."),
("npc9_personalitymatch_speech_b", "Were she of noble blood, I might ask for her hand. It is a pity that she is a merchant's daughter. But speaking with her is a pleasant way to pass time on the march."),
("npc10_personalitymatch_speech_b", "Heh. It just goes to show that youth ain't everything, that experience also wins battles. I reckon she and I could teach the young puppies of the world a thing or two, couldn't we?"),
("npc11_personalitymatch_speech_b", "Old {s11} in particular showed them a thing or two, I thought. Not bad for the pair of us, I thought, given that between us we've probably seen close to a hundred winters."),
("npc12_personalitymatch_speech_b", "It saddens him deeply to take the lives of his fellow men, however just the cause. He and I have talked together of a brighter future, of the need to unite these petty warring kingdoms of Calradia, so that we may bring this time of troubles to an end."),
("npc13_personalitymatch_speech_b", "Also, although I normally prefer the coy to the Amazonesque, I confess that I have also noticed the femininity she tries to hide beneath her martial demeanour. True, she is a bit aloof on the march and in camp, but perhaps my fair words can melt the Nordic ice around her heart."),
("npc14_personalityclash_speech_b", "He is a professional soldier, and though he may not be as fast on his feet as some others, he knows the wisdom of holding together in a disciplined battle-line. You showed good sense in bringing him into this company."),
("npc15_personalitymatch_speech_b", "War, like any other affair, requires careful planning and preparation, and a firm grasp of strategic principals. All other things being equal, the best trained army will win the battle, an observation that I think our last fight bears out. The men may curse him now, but they'll learn to thank him, I'll warrant."),
("npc16_personalitymatch_speech_b", "Have you heard her story? Can you believe the wrongs done to her? I tell you, it makes my blood boil. I want to cut off all the little bits of those bastards who mistreated her -- and I'll do it, too, if we ever run into them in our travels."),
("npc1_retirement_speech", "I'm a bit tired of marching up and down the land, shedding my blood for someone else's cause. The loot is good, but I think I've got enough of that, now. I'm going to head back to my village, take a wife, settle down, maybe raise horses if I can afford it."),
("npc2_retirement_speech", "I'm getting a bit tired of the warrior's life. I'm going to invest my share of our loot into a cargo of goods -- furs, linens, velvets, probably -- and take them back over the mountains. I would like to thank you again for taking me on, and wish you the best of luck."),
("npc3_retirement_speech", "I am afraid I have something to tell you. I have decided that the warrior's life is not for me. I think it is probably too late for me to find a good marriage -- no one of my people would take a wife who had served with a company of soldiers -- but I may have enough money to start myself up as a merchant. I hope you will not be angry, {sir/madame}."),
("npc4_retirement_speech", "I have fought with you honourably, as befits a son of the House of Rolf, but I am not altogether satisfied with your leadership. I will go home to my ancestral estates, which are much in need of my services."),
("npc5_retirement_speech", "Bahadur -- since I have taken your salt, I have fought for you fiercely, and loyally. But you have not always repayed my service with the kind of leadership that I deserve. So I am going home, in the hope that the Khan's men have forgotten me, to see my father and brothers again."),
("npc6_retirement_speech", "I joined this company in the hope that you would lead me out of darkness, and indeed I have found a measure of peace here. But I have some qualms about your leadership, and have begun to suspect that the path to redemption can be found elsewhere."),
("npc7_retirement_speech", "I am tired of this squalid life of endless warfare, seeing men debased by fear, greed, lust, and a hundred other sins. I have money in my purse. I am going overseas to look for a better land than Calradia. I assume that you will fare well without me."),
("npc8_retirement_speech", "I have fought in your shield wall, and done well by it. But your leadership is not always to my liking, and anyways I have another task. I will take what plunder I have won and raise a warband of my own and sail to Nordland to take back my husband's hall from my treacherous brother-in-law. I wish you well."),
("npc9_retirement_speech", "We have fought well together, and earned ourselves much glory. But I have some reservations about your leadership, and at any rate have my patrimony to reclaim. I will be leaving you. Perhaps we will meet again."),
("npc10_retirement_speech", "I've had enough of tromping up and down the length and breadth of Calradia. I've got enough to buy a small bit of land somewhere, so I think I'll give that a try. So long, and best of luck to you."),
("npc11_retirement_speech", "You did an old woman a great service by taking her into your company. But I'm afraid I'm finding this life no more to my liking than driving a wagon. Too much cold, too much hunger, and at the end all I see in front of me is a hole in the ground. So I'll be off, although I don't know where."),
("npc12_retirement_speech", "I've done all right in your company. I filled my belly, put some gold in my purse, and broadened my knowledge of wounds and injury -- I can't complain about that! But I think right now that service in this company is holding me back. I have a duty to share my findings with other surgeons, and for that I need to hire scribes, who are rare in Calradia. I shall be going home"),
("npc13_retirement_speech", "As the luster of your name grows ever brighter, I fear that my own reputation will seem pale in comparison, as the moon is outshined by the sun. I have decided to strike out on my own. The very best of luck to you!"),
("npc14_retirement_speech", "I would like to inform you that I wish to sever our relationship. I intend to seek alternative employment."),
("npc15_retirement_speech", "I appreciate that you took me on, but I'm not altogether happy about how things have worked out. I'm going to head off elsewhere -- maybe go home, maybe find another job, I haven't quite decided yet."),
("npc16_retirement_speech", "I've had good times in this company, and I've found myself a pretty trinket or two on the battlefield, but right now it isn't working out. I'm leaving you to go offer my talents to someone else."),
("npc1_rehire_speech", "Boss -- it's good to see you again. I know we had our differences in the past, but to tell you the truth, those were some of the best days I've known. And, to tell you the truth, I've had a bit of difficulty finding work. Listen, if you'd be willing to have me back, I'd be willing to sign up with your company again."),
("npc2_rehire_speech", "{Sir/Madame}! It's good to see you again. But I'll confess -- I've been looking for you. I bought a load of goods like I told you I would, loaded them up, and took them back across the steppe -- but wouldn't you know it, I was hit again by Khergits, and lost it all. I guess I'm just destined to fight for my fortune. Also, people tell me that you've done very well for yourself. So tell me, {sir/madame}, would you have me back?"),
("npc3_rehire_speech", "Well, hello {sir/madame}! It is very good to see you again. I have not fared so well since we parted, I am afraid. My mother's family. whom I hoped would give me a start in trading, have not been as welcoming as I have hoped. I receive nothing but lectures from my aunts, on how I have ruined my prospects for marriage by taking service in a mercenary company. Perhaps I am better suited to war than to commerce, to share a meal over a campfire with rough fellows than to drink wine with the burghers of Veluca. {Sir/Madame}, I must ask you -- will you take me back?"),
("npc4_rehire_speech", "Why hello, captain. It's been a while. You've done well for yourself, I hear. For my part, I've been having some difficulties coaxing a living from my estates -- locusts, bad rains, unruly serfs, that sort of thing. I thought I might take up the sword once more. I know there's been some bad blood between us, but I'd be honoured to fight in your ranks once again."),
("npc5_rehire_speech", "{playername} Bahadur! Your fame grows ever greater -- even as far as my homeland, beyond the mountains. I'd returned there, hoping that the Khan's men had forgotten. Well, they had not -- even before I set foot in my valley, I had word from my family that both the Khan and the Humyan were looking for me. So I came back again, hoping you might forget any harsh words I had spoken, to see if I could fight with you once again."),
("npc6_rehire_speech", "It is good to see you, {sir/madame}. Everywhere I go, men are in awe of your deeds. I have not had it so well since I left. Wherever I go, I feel my demons returning. My soul is in turmoil. For reasons that I cannot fully explain, I had found peace in your company, even if I had questions about your leadership. Will you allow me to serve with you once again?"),
("npc7_rehire_speech", "Captain! It is good to see you. Forgive what I may have said when we parted. I took a ship out of Wercheg, bound for the east, but it was taken by pirates and after my ransom I was set ashore back here. There may be better places in the world than Calradia, but I have yet to see them. So I think, if it is my lot to live here, then your company is as good a livelihood as any. Will you have me back?"),
("npc8_rehire_speech", "Greetings to you, {playername}. I was wondering if the harsh words spoken between us in the past could be forgotten. I have been hunting among the Nords here, to see if I could find enough men to take back my husband's hall. But I could not find enough men to crew a longship, and those whom I gathered quickly got bored and wandered off -- not, I will add, before they drank away such gold as I had accumulated. So I thought back to the battles we fought together. Those were good days, and profitable ones too."),
("npc9_rehire_speech", "My dear, dear {man/lady}! So good it is to see you! I have sought service with the lords of this land, but have been most grieviously disappointed. Half of them ask me to collect debts from fellow lords, as though I were a banker's errand boy, or chase down his serfs, as though I were a farm overseer. One even asked me to murder one of his creditors! I have looked for you, to see if you would wish me to join you again."), #Alayen
("npc10_rehire_speech", "Captain! It's good to see you. You see, it turns out I'm not much of a farmer. Too soft on the hired hands, I figure. I let them rob me blind. I guess fighting is what I know best. So tell me, captain, are you still looking for good men?"),
("npc11_rehire_speech", "Captain! So good to see you! People say that you've been making gold hand over foot. I'm a fidgety old bag of bones, I'll admit. I left you because I wasn't satisfied with the warrior's life, but I spend a bit of time in town and I realize that there's worse things in life than a full belly, honest companions, and the joy of seeing the enemy run before you. So, would you be hiring again"),
("npc12_rehire_speech", "Captain! It's a fine thing to see an honest face like yours. This world is full of lies. I went home to publish my findings, hired some scribes and made a handful of codices, and waited for the commissions. But it turns out that the universities don't care about real medical knowledge rather than warmed-over Galerian. And publishers -- let me tell you, you never saw anyone so unscrupulous. They rent the books out chapter to by chapter to students to copy, but half of them aren't returned, and those that are have pages soaked in wine, and there's no longer a complete copy of my work anywhere. I'll keep trying, but first I need a bit of money in my pocket, first. Are you looking for a surgeon?"),
("npc13_rehire_speech", "Well hello there, oh valorous one. I had been hoping to see you again. Everywhere I go, I hear tales and songs of your deeds. I will admit that I felt a twinge of regret that we had parted ways, and, I'll confess, a twinge of jealousy as well at your reputation. I thought that once again I might fight by your side, and thus bask in the reflection of your glory. Perhaps we might ride together again, for a little while?"),
("npc14_rehire_speech", "Captain. It is good to see you. When last we parted, I was ready to swear that I would not serve you again, but perhaps I judged you too harshly. All over Calradia, men sing your praises. I have tried serving in other lords' armies, and believe me, what I have seen of them restores my opinion of your leadership. If you would have me in your company, I would fight for you again."),
("npc15_rehire_speech", "Why hello, {playername}. I can't say I'm entirely displeased to see you. You see, I took on another contract before I left, and sure enough, when it came time to collect the pay, the lord had nothing but talk and excuses and petty little complaints about my handiwork. I can't say I was always happy in your company, but at least I put gold directly into my purse after every battle. You still offering work?"),
("npc16_rehire_speech", "Captain! They say that you've done well for yourself since we last met. I'll come out and admit that I cursed your name when we parted ways, but thinking back on it you weren't all that bad. All these lords, they're glad enough to send me on little side errands, but they don't much care to have me in their main battle-line. Apparently I spook the men. I've heard it muttered that I'm a witch, or that I eat men's hearts after killing them, or other rot. Not that I mind stabbing a man while he's asleep, but it's a lot more gratifying when he's awake and kicking. So I thought I'd try to find you again, see if you'll take me on."),
#local color strings
("npc1_home_intro", "Boss -- did you know that I was born around here, in the high steppe? This is where I got my eye for horseflesh, because this is good land for horses, although a hard land for men. I suppose that's why the Khergits like it."),
("npc2_home_intro", "We're approaching Sargoth. That's where I was headed when the Khergits got me."),
("npc3_home_intro", "Can you smell that? Lemon trees, apples and crocus flowers, it's the scent of Veluca. I spent many a happy summer here when I was a girl, playing in the gardens of my mother's family while my father was away trading."),
("npc4_home_intro", "The Woods of Ehlerdah. Bah. This place is thick with bandits and outlaws."),
("npc5_home_intro", "Bahadur, we are nearing Halmar, largest town in the lower steppe. My mother's sister went here to marry a townsman and I thought to seek service with the lord here. That is when I ran into you."),
("npc6_home_intro", "I can see by the vines and terraces on the hillside that I am near home. I have no wish to see my family, so I will linger outside the walls if you go into town. I am sure that you will understand."),
("npc7_home_intro", "Do you smell that? Salt fish, rotting flax and river mud. The smells of my childhood. I want to retch."),
("npc8_home_intro", "Hmf. Do you hear that? It must be the crash of waves on the headland. We must be near Gundig's Point."),
("npc9_home_intro", "Behold the Rock of Rivacheg! The strongest fortress in Calradia. My father was one of those who held the line here against the Nords, when they first tried to push inland from the coast."),
("npc10_home_intro", "D'you smell that fresh air, Brother? This was my home, before I went abroad in search of coin. It's good to be up in the hills again. It's the smell of freedom. This is the cradle of Rhodok liberty, here under Grunwalder Castle"),
("npc11_home_intro", "I see the mountains. We must be getting near home."),
("npc12_home_intro", "We're passing by the site of one of my greatest medical triumphs, if that interests you."),
("npc13_home_intro", "Ah, Castle Ergellon! Such a lovely spot, by the deep lake. Such happy days I spent here, the summer before last."),
("npc14_home_intro", "Do you see that fortress up there, on the spur over the valley? Ismirala? I spent a winter there some years back, trying to train the lord's men."),
("npc15_home_intro", "You see that castle up on the hill? Culmarr Castle, it's called. I did some work there, not long ago. It's not as showy as some of the other castles in this land, but it's the finest stonework you ever saw."),
("npc16_home_intro", "Aye, captain, do you see those? Those are hare tracks in the snow. We must be getting near to my birthplace."),
("npc1_home_description", "Well, Khergits always lived here, even back in the old days, as the Emperor gave them gold and lands to keep out the other tribes. I'm told my grandfather was a Khergit chieftain, although my mother didn't know him, any more than I knew my father. When my mother was a lass, the Khergit started coming over the mountains in larger numbers, and now there's a Khergit Khan in Tulga."),
("npc2_home_description", "People say that the Nords are a bunch of bloodthirsty barbarians, but they have a good head for trade, if you ask me. They make the people up and down the coast grow flax, which they weave here into linen. It can't compete with Jelkala silks and velvets as a luxury fabric, but it makes good summertime wear and you can use it for the sails of ships. More importantly, linen was one of the few goods that someone else in Calradia wasn't already making."),
("npc3_home_description", "Veluca has wet winters and hot summers, but the people here build great cisterns to water their crops. They grow grapes -- Velucan wine is famous, {sir/madame} -- and those who can afford it make walled gardens, where fruit trees grow in abundance, and we sit at night listening to music, or playing chess, or merely sniff the night air."),
("npc4_home_description", "Well, you see, the King of Swadia declared this to be his personal hunting preserve, and said he'd kill any man who as much as strung his bow here. So what happens? Some family goes hungry, and succumbs to the temptation to poach, and the king's sheriff comes along and strings him up and takes his land. His sons, rather than starve, go bandit. And so naturally anyone in the whole valley who feels the need to run away from a debt or a nagging wife or a vengeful noble comes up here to join them, living on wild pigs and berries and the purses of unwary travellers."),
("npc5_home_description", "Khergits had always come here, to trade and raid, and in the last days of the Empire we began to settle. Just like the Vaegirs, Swadians, Rhodoks and Nords, we took the Emperor's coin to keep the other tribes at bay. But when the Great Horde attacked our homeland in my grandfather's day, we moved into this region in force. We pushed the Vaegirs back, and made their fortresses our own."),
("npc6_home_description", "Here in the Vale of Suno, our dialect and customs are closer than anywhere else in Calradia to those of the old Calrad Empire. We grow olives and wine, both crops brought to this land from overseas by the emperors, and also follow the old Calradic ways. We keep our pledges and pay our debts."),
("npc7_home_description", "Before I was married off, and before I was taken by bandits, I lived here. I was born in a hovel and spent my childhood in the fields. Our landlords were Nord, but we never saw them, merely their cursed minions and overseers. My father, coward that he was, cringed before them."),
("npc8_home_description", "You haven't heard the story? When Gundig Hairy-Breeks came to Calradia from Nordland, he planted his banner on the headland and said that it would remain there until he recaptured his 'inheritance.' His 'inheritance', he called it. Gundig believed the skalds who told him that the Emperor had bequeathed Calradia to the Nords, when in fact he just gave us a small strip of land along the coast, so that we would crew his galleys."),
("npc9_home_description", "The Nords would sail up the river in their longships. The townsmen of the coast could have stopped them, but they were cowards then, as they are today, and paid them a yearly stipend, known as the Nordgeld, to be let in peace. But the Vaegir king would not pay. My father decided to come over the mountains, to fight with the Vaegir hosts. Three summers in a row they tried to take the Rock, and each time the Vaegir lords held them back."),
("npc10_home_description", "In my father's day the Swadians would come calling, thinking to make us knuckle our foreheads and call them their overlords. But Grunwalder, an old veteran of the wars from the hills, showed us how to form a battleline with spear and crossbow that could break a Swadian charge. He fell in battle, but the people gave his name to the castle that was built here, where he fell, so that we would remember, and always stand firm against the horsemens' onslaught."),
("npc11_home_description", "I'm from Praven. You know the saying, {sir/madame} -- 'Barley grown in Uxkhal is made into ale in Praven, and we're all the better for it.' Not sure what that means, {sir/madame}, but it's true about the barley. And wheat, and oats. We grow more grain here in the Vale of Uxkhall then all the rest of Calradia put together, and our ale is the best, too. You can see it in the soil here -- rich and black, and smells of good harvests and full bellies."),
("npc12_home_description", "The lord over there in Almerra Castle had the dropsy, and had requested a doctor from Uxkhal to treat him. Like a typical university-educated doctor, he went right to Galerian for a cure. Galerian commends sun-metal for dropsy. Now most of Galerian's writings were useless back in the days of the Calradic emperors when they were first written down, and they're doubly worthless today, but he sometimes he hits upon the right cure by chance: sun-metal does cure some kinds of dropsy in small doses. However, sun-metal in large doses is poison, something that the Galerian-worshippers never grasped."),
("npc13_home_description", "I had come up here with a small Swadian force, but they were caught by the Rhodoks in the woods and their horsemen cut down amid the trees. I fled and found shelter by the lake, in the arms of the comeliest cowherd you ever saw. She took me to a cave near the high pastures, and would bring me cheese and berries, and tell me the tale from the hills. They say the lake is a gateway to the underworld, and sometimes on the fringes you can the noxious fumes beneath bubbling up to the surface. Such rustics they are!"),
("npc14_home_description", "I say 'trying' because in my opinion, Vaegirs don't take well to discipline. Finest archers you ever saw, and good riders too, but they have no stomach for fighting in ranks. Their skills serve them well enough against Khergits and Nords, particularly when they can hide behind walls, but I've seen Swadian knights cut through Vaegirs like a knife through butter. Now, a Rhodok spear-wall is designed to stop a Swadian charge in its tracks, and usually does."),
("npc15_home_description", "Like most castles that last around here, it's got foundations that are old Imperial Calradic. You can't see them any more with all the rebuilding, but the slabs are the size of a house. They must have been real sorcerors back in those days, because I don't see how they moved those things otherwise. Beautiful location, too -- Culmarr sits right in front of the pass leading out of Calradia, which allows the lord to charge a pretty penny in tolls during the three months of the year that it's not snowed in."),
("npc16_home_description", "The snows in these valleys don't melt until late in the year, and the land is hard to plough. You can grow a bit of barley, but not much else. But there's wealth here in the woods: deer, rabbit and lynx, meat and furs, and the mountains have iron, and traders would ship enough saltfish up the river from the coast to keep the people fed for the winter."),
("npc1_home_description_2", "They go easy on us Old Calradians, and don't ask for much in tax -- not that we would be able to pay in any case. The land isn't good enough for most crops. Frankly, it's only good for horse-rearing, and that only for half of the year, in the winter after the rains. In the summer they take their herds back into the mountains. Caravans come over the hills and bring spice to Tulga, but we don't see much of that money down in the villages."),
("npc2_home_description_2", "I had loaded up on saffron, cinnamon, cloves, pepper and other spices and a chest full of denars. I estimated that I could buy linens, furs, velvet, iron and wool, and the extra horses to carry them back, and I'd still make a profit. I just hadn't figured in the Khergits, who apparently don't care for others cutting in on their monopoly."),
("npc3_home_description_2", "The poets call Veluca a paradise, and I think for once that they do not exaggerate."),
("npc4_home_description_2", "How do I know this, you ask? Well... I was taken by them, and held for ransom, but I got away. That's really all there is to tell."),
("npc5_home_description_2", "Of course, you know how things go. My father's generation were hard warriors from the cold lands across the mountains, but this generation all has houses in the town and great estates and spend time as much trading as they do practicing archery. The next generation will grow soft on Velucan wine and will lose their lands to the next batch of illiterate hill-raiders to come over the mountains, just you watch. It's how things always were, and how things always will be."),
("npc6_home_description_2", "We men of Suno also never forget an insult, and avenge any wrong done unto us. Old-fashioned Calradic honour, I dare say, has brought me to my current fallen state. But despite that, I am proud to be from this region. Our lord is a vassal of the Swadian king in Praven, but as far as we are concerned his is just yet another barbarian chieftain, and we are the Empire's true heirs."),
("npc7_home_description_2", "We were allowed to fish the river, raise pigs amid the reedbeds, and grow whatever we could in our private plots, but in the open fields we were only permitted to grow flax, to be taken to Sargoth and woven into linen. So we were always hungry, and weak, and never had the courage to rebel."),
("npc8_home_description_2", "The skalds' tales at least gave Gundig an excuse to raise a warband -- not that we Nords ever need an excuse, mind. He sailed across the sea, rallied the Calradian Nords to his banner, and marched on the Rock of Rivacheg. The Vaegirs killed him, and threw his banner into the surf. But the Nords keep coming, and some day all of Calradia will be ours."),
("npc9_home_description_2", "Just as the Nords can call on their kinfolk overseas, so does the Vaegir king call on his kinfolk from over the mountains. Had my father not disinherited me, I would also have taken an oath of fealty to the lord of Reyvadin. But just as I was shorn of my inheritance, so also was I shown of my obligations, and it is the Vaegir king's loss."),
("npc10_home_description_2", "We grow mulberry trees here for silk and kermes too for the dye. We take it to Jelkala where they weave it into the finest velvet -- not that I have ever had enough denars in my pocket to buy velvet, mind. But the craftsmen of Jelkala also make good crossbows, and for that I'll not begrudge them their little luxuries"),
("npc11_home_description_2", "The Swadian king will tell you that Praven was the biggest city in Calradia back under the Empire, and that's why he should rule the whole land today. Mind you, I don't care much about politics, {sir/madame} -- I've sold provisions to every army that ever marched in Calradia, and I tell you that I wouldn't give a single one of them a single biscuit unless I had the cold, hard denars in my hand first. Why these high and mighty kings and nobles can't pay their bills, I'll never know. But I prattle on a bit, there, don't I?"),
("npc12_home_description_2", "The difference between poison and cure is the dose. You tell that to everyone you meet, and tell them you heard it first from Jeremus the Great. People think that all the wisdom worth knowing was written in Old Calradic, but I say you can learn twice as much from village midwives and careful examination of nature than from the entire imperial corpus. That's why they threw me out of the university, although in retrospect that was a blessing. Anyway, I put that lord back on his feet, and he availed me of a sack of gold and the corpse of a freshly hanged criminal to dissect. Ha! To think of the lengths I had to go to get specimens back in those days."),
("npc13_home_description_2", "Eventually I had to leave, and sometimes I wonder if there is a little herdsboy swaddled on her back, as she takes the cows up to pasture each morning. I'd be tempted to try to find her -- but no, no, one should never look back."),
("npc14_home_description_2", "If anyone were ever to unify this little land of ours, I'd sign up to serve them, free of charge. I'd put together an army of Rhodok spears with Nord footmen on the flanks and Vaegir archers in front, take along some Khergit scouts to find and fix the enemy, and some Swadian lancers to finish them off. I'd take that army over the mountains and make the whole world kneel to Calradia.... Of course, that's what the Emperors thought, and in the end the tribes took away their Empire."),
("npc15_home_description_2", "And here's the funny thing -- when the Rhodok lands first rebelled against the Swadians, they all said they weren't going to have any noble lords ruling over them. You can guess how long that lasted. One Rhodok hill chieftain sets himself up in Culmarr, calls himself 'Count', and the good burghers of Jelkala and Veluca have to lick his boots if they want to sell their wine and velvet outside Calradia. And if you want to keep the counts under control, and the peasants providing the towns with food rather than selling to the highest bidder, then you need a King too, don't you? The Rhodok lands are no different than anyone else, whatever guff they talk about 'ancient liberties' and 'freedom.'"),
("npc16_home_description_2", "Still, it was a thin living, and there were always too many mouths around to feed. The Vaegir king and the Khergit khan don't make life any easier for us, squeezing for tax money the villages they control, and raiding for plunder the villages they don't. Of course, I can't say I'd do any differently do the same if I had a castle and an army all of my own. The mighty do whatever the can, and the humble do whatever they must."),
("npc1_home_recap", "I'm from the high steppe, near {s21}."),
("npc2_home_recap", "I was born over the mountains. I'm a merchant, the son of a merchant, and the grandson of a merchant."),
("npc3_home_recap", "I used to live in my father's house in {s20}, but I spent much of my childhood in {s21}."),
("npc4_home_recap", "Our ancestral barony is over the mountains, across the Culdarr pass."),
("npc5_home_recap", "I was born in the highlands on the other side of the mountains, past Tulga, but I have relatives in {s21}."),
("npc6_home_recap", "My family lives in {s21}, but I cannot bear to face them."),
("npc7_home_recap", "I was born in a hovel in the fens, not far from {s21}."),
("npc8_home_recap", "I was born overseas, in Nordland, and my husband's hall also was in Nordland."),
("npc9_home_recap", "I am from the Vaegir homeland over the mountains, where the Vaegir lords lived before the Emperor brought them in Calradia."),
("npc10_home_recap", "Born and raised in Jelkala, {Brother/Sister}, and I hope some day to buy land there. But I had a mind to see a bit of the world first, so I took my crossbow and went off to the wars."),
("npc11_home_recap", "I was born in the train of an army, and lived all my days in the train of an army. My folk are from Praven, however, so I guess that's as much home to me as anywhere."),
("npc12_home_recap", "I come from overseas. I travel the world in search of medical lore."),
("npc13_home_recap", "Oh, far away from here, my {lord/lady}, else you would already have heard about me, and would not need to ask such things."),
("npc14_home_recap", "I am the younger son of the Count of Geroia."),
("npc15_home_recap", "I'm from over the hills. But Calradia is where the money is to be made, these days, if your trade is siegecraft."),
("npc16_home_recap", "Why, captain, I was born in Uslum village, but my mother lost her land to a scheming relative and had to put herself in bond to a nearby lord."),
("npc1_honorific", "boss"), #Borcha
("npc2_honorific", "{sir/madame}"), #marnid
("npc3_honorific", "{sir/madame}"),
("npc4_honorific", "{sir/madame}"),
("npc5_honorific", "{playername} Bahadur"), #beheshtur
("npc6_honorific", "captain"), #firentis
("npc7_honorific", "captain"), #deshavi
("npc8_honorific", "{playername}"), #matheld
("npc9_honorific", "{my good sir/my good lady}"), #Alayen
("npc10_honorific", "{Brother/Sister}"), #Bunduk
("npc11_honorific", "{laddie/lassie} -- I mean Captain"), #katrin
("npc12_honorific", "captain"),
("npc13_honorific", "oh valorous one"), #nizar
("npc14_honorific", "commander"), #lazalit
("npc15_honorific", "captain"), #artimenner
("npc16_honorific", "captain"), #klethi
#NPC companion changes end
#Troop Commentaries begin
#Tags for comments are = allied/enemy, friendly/unfriendly, and then those related to specific reputations
#Also, there are four other tags which refer to groups of two or more reputations (spiteful, benevolent, chivalrous, and coldblooded)
#The game will select the first comment in each block which meets all the tag requirements
#Beginning of game comments
("comment_intro_liege_affiliated", "I am told that you are pledged to one of the pretenders who disputes my claim to the crown of Calradia. But we may still talk."),
("comment_intro_famous_liege", "Your fame runs before you! Perhaps it is time that you sought a liege worthy of your valor."),
("comment_intro_famous_martial", "Your fame runs before you! Perhaps we shall test each other's valor in a tournament, or on the battlefield!"),
("comment_intro_famous_badtempered", "I've heard of you. Well, I'm not one for bandying words, so if you have anything to say, out with it."),
("comment_intro_famous_pitiless", "I know your name. It strikes fear in men's hearts. That is good. Perhaps we should speak together, some time."),
("comment_intro_famous_cunning", "Ah, yes. At last we meet. You sound like a good {man/woman} to know. Let us speak together, from time to time."),
("comment_intro_famous_sadistic", "I know your name -- and from what I hear, I'll warrant that many a grieving widow knows too. But that is no concern of mine."),
("comment_intro_famous_goodnatured", "I've heard of you! It's very good to finally make your acquaintance."),
("comment_intro_famous_upstanding", "I know your name. They say you are a most valiant warrior. I can only hope that your honour and mercy matches your valor."),
("comment_intro_noble_liege", "I see that you carry a nobleman's banner, although I do not recognize the device. Know that I am always looking for good men to fight for me, once they prove themselves to be worthy of my trust."),
("comment_intro_noble_martial", "I see that you carry a nobleman's banner, but I do not recognize the device. Perhaps one day we shall test each other's valor in a tournament, or on the battlefield!"),
("comment_intro_noble_badtempered", "I don't recognize the device on your banner. No doubt another foreigner come to our lands, as if we didn't have so many here already."),
("comment_intro_noble_pitiless", "I see that you carry a nobleman's banner, but I do not recognize the device. Another vulture come to grow fat on the leftovers of war, no doubt!"),
("comment_intro_noble_cunning", "I see that you carry a nobleman's banner, but I do not recognize the device. Still, it is always worthwhile to make the acquaintance of {men/women} who may one day prove themselves to be great warriors."),
("comment_intro_noble_sadistic", "I see that you carry a nobleman's banner, but I do not recognize the device. Perhaps you are the bastard {son/daughter} of a puffed-up cattle thief? Or perhaps you stole it?"),
("comment_intro_noble_goodnatured", "I see that you carry a nobleman's banner, but I do not recognize the device. Forgive my ignorance, {sir/madame}! It is good to make your acquaitance."),
("comment_intro_noble_upstanding", "I see that you carry a nobleman's banner, but I do not recognize the device. No doubt you have come to Calradia in search of wealth and glory. If this indeed is the case, then I only ask that you show mercy to those poor souls caught in the path of war."),
("comment_intro_common_liege", "You may be of common birth, but know that I am always looking for good men to fight for me, if they can prove themselves to be worthy of my trust."),
("comment_intro_common_martial", "Perhaps you are not of gentle birth, but if you prove yourself a {man/woman} of valor, then I would be pleased to try my strength against yours in the tournament or on the battlefield."),
("comment_intro_common_badtempered", "Speak quickly, if you have anything to say, for I have no time to be bandying words with common soldiers of fortune."),
("comment_intro_common_pitiless", "You have the look of a mercenary, another vulture come to grow fat on the misery of this land."),
("comment_intro_common_cunning", "Well... I have not heard of you, but you have the look of a {man/woman} who might make something of {himself/herself}, some day."),
("comment_intro_common_sadistic", "Normally I cut the throats of impudent commoners who barge into my presence uninvited, but I am in a good mood today."),
("comment_intro_common_goodnatured", "Well, you look like a good enough sort."),
("comment_intro_common_upstanding", "Peace to you, and always remember to temper your valor with mercy, your courage with honour."),
#Actions vis-a-vis civilians
("comment_you_raided_my_village_enemy_benevolent", "You have attacked innocent farmers under my protection in the village of {s51}. I will punish you for your misdeeds!"),
("comment_you_raided_my_village_enemy_spiteful", "You have raided my village of {s51}, destroying my property and killing the tenants. I will take my compensation in blood!"),
("comment_you_raided_my_village_enemy_coldblooded", "You have raided my village of {s51}, destroying my property and killing the tenants. I will make you think twice before you disrupt my revenues like that again."),
("comment_you_raided_my_village_enemy", "You have raided my village of {s51}, destroying my property and killing tenants under my protection. You will pay the price for your crime!"),
("comment_you_raided_my_village_unfriendly_spiteful", "You have raided my village of {s51}. Do it again and I'll gut you like a fish."),
("comment_you_raided_my_village_friendly", "You have raided my village of {s51}. This will place a grave strain on our friendship."),
("comment_you_raided_my_village_default", "You have raided my village of {s51}. If you continue to behave this way, we may soon come to blows."),
("comment_you_robbed_my_village_enemy_coldblooded", "You have robbed my tenants in the village of {s51}. I take that as a personal insult."),
("comment_you_robbed_my_village_enemy", "You have robbed innocent farmers under my protection in the village of {s51}. I will punish you for your misdeeds!"),
("comment_you_robbed_my_village_friendly_spiteful", "I have heard that you pinched some food from my tenants at {s51}. Well, I'll not begrudge you a scrap or two, but keep in mind that I'm the one who must listen to their whining afterward."),
("comment_you_robbed_my_village_friendly", "I have heard that you requisitioned supplies from my tenants at {s51}. I am sure that you would not have done so were you not desperately in need."),
("comment_you_robbed_my_village_default", "You have robbed my tenants in the village of {s51}. If you continue to behave this way, we may soon come to blows."),
("comment_you_accosted_my_caravan_enemy", "You have been accosting caravans under my protection. But your trail of brigandage will soon come to an end."),
("comment_you_accosted_my_caravan_default", "You have been accosting caravans under my protection. This sort of behavior must stop."),
("comment_you_helped_villagers_benevolent", "I heard that you gave charity to my tenants in the village of {s51}. I had been neglectful in my duties as lord and protector, and I appreciate what you have done."),
("comment_you_helped_villagers_friendly_cruel", "I heard that you gave charity to my tenants in the village of {s51}. I appreciate that you meant well, but I'd rather you not undercut my authority like that."),
("comment_you_helped_villagers_friendly", "I heard that you gave charity to my tenants in the village of {s51}. Times are hard, and I know that you mean well, so I will not object to you providing them with assistance."),
("comment_you_helped_villagers_unfriendly_spiteful", "I heard that you gave charity to my tenants in the village of {s51}. As amusing as it is to see you grubbing for favor among my vassals, I would ask you to mind your own business."),
("comment_you_helped_villagers_cruel", "I heard that you gave charity to my tenants in the village of {s51}. As the peasants' lord and protector, it is most properly my duty to assist them in times of hardship. You may mean well, but your actions still undercut my authority. I would thank you to leave them alone."),
("comment_you_helped_villagers_default", "I heard that you gave charity to my tenants in the village of {s51}. Times are hard, and I know that you mean well, but try not to make a habit of it. I am their lord and protector, and I would rather not have them go looking to strangers for assistance."),
#Combat-related events
("comment_you_captured_a_castle_allied_friendly", "I heard that you have besieged and taken {s51}. That was a great dead, and I am proud to call you my friend!"),
("comment_you_captured_a_castle_allied_spiteful", "I heard that you have besieged and taken {s51}. Good work! Soon, we will have all their fortresses to despoil, their treasuries to ransack, their grieving widows to serve us our wine."),
("comment_you_captured_a_castle_allied_unfriendly_spiteful", "I heard that you have besieged and taken {s51}. Well, every dog has his day, or so they say. Enjoy it while you can, until your betters kick you back out in the cold where you belong."),
("comment_you_captured_a_castle_allied_unfriendly", "I heard that you have besieged and taken {s51}. Whatever our differences in the past, I must offer you my congratulations."),
("comment_you_captured_a_castle_allied", "I heard that you have besieged and taken {s51}. We have them on the run!"),
("comment_you_captured_my_castle_enemy_spiteful", "I hear that you have broken into my home at {s51}. I hope the dungeon is to your liking, as you will be spending much time there in the years to come."),
("comment_you_captured_my_castle_enemy_chivalrous", "You hold {s51}, my rightful fief. I hope you will give me the chance to win it back!"),
("comment_you_captured_my_castle_enemy", "You have something that belongs to me -- {s51}. I will make you relinquish it."),
###Add some variation to these
("comment_we_defeated_a_lord_unfriendly_spiteful", "I suppose you will want to drink to the memory of our victory over {s54}. Well, save your wine -- it will take more than that to wipe out the stain of your earlier disgraces."),
("comment_we_defeated_a_lord_unfriendly", "I will not forget how we fought together against {s54}, but I can also not forget the other matters that lie between us."),
("comment_we_defeated_a_lord_cruel", "That was a great victory over {s54}, wasn't it? We made of his army a feast for the crows!"),
("comment_we_defeated_a_lord_quarrelsome", "I won't forget how we whipped {s54}? I enjoyed that."),
("comment_we_defeated_a_lord_upstanding", "I will not forget our victory over {s54}. Let us once again give thanks to heaven, and pray that we not grow too proud."),
("comment_we_defeated_a_lord_default", "That was a great victory over {s54}, wasn't it? I am honoured to have fought by your side."),
("comment_we_fought_in_siege_unfriendly_spiteful", "I suppose you will want to drink to the memory of our capture of {s51}. Well, save your wine -- it will take more than that to wipe out the stain of your earlier disgraces."),
("comment_we_fought_in_siege_unfriendly", "I will not forget how we together we stormed {s51}, but I can also not forget the other matters that lie between us."),
("comment_we_fought_in_siege_cruel", "I won't forget how we broke through the walls of {s51} and put its defenders to the sword. It is a sweet memory."),
("comment_we_fought_in_siege_quarrelsome", "Remember how the enemy squealed when we came over the walls of {s51}? They had thought they were safe! We wiped the smug smiles of their faces!"),
("comment_we_fought_in_siege_upstanding", "I will not forget our capture of {s51}. Let us once again give thanks to heaven, and pray that we not grow too proud."),
("comment_we_fought_in_siege_default", "I will not forget how together we captured {s51}. I am honoured to have fought by your side."),
("comment_we_fought_in_major_battle_unfriendly_spiteful", "I suppose you will want to drink to the memory of our great victory near {s51}. Well, save your wine -- it will take more than that to wipe out the stain of your earlier disgraces."),
("comment_we_fought_in_major_battle_unfriendly", "I will not forget how we fought together in the great battle near {s51}, but I can also not forget the other matters that lie between us."),
("comment_we_fought_in_major_battle_cruel", "I won't forget the great battle near {s51}, when we broke through the enemy lines and they ran screaming before us. It is a sweet memory."),
("comment_we_fought_in_major_battle_quarrelsome", "That was a fine fight near {s51}, when we made those bastards run!"),
("comment_we_fought_in_major_battle_upstanding", "I will not forget how we fought side by side at the great battle near {s51}. Let us once again give thanks to heaven, and pray that we not grow too proud."),
("comment_we_fought_in_major_battle_default", "I will not forget how we fought side by side at the great battle near {s51}. I am honoured to have fought by your side."),
("comment_you_defeated_a_lord_allied_liege", "So, you crossed swords with that rascal they call {s54}, and emerged victorious. I am very happy to hear that."),
("comment_you_defeated_a_lord_allied_unfriendly_spiteful", "I heard that you fought and defeated {s54}. Every dog has its day, I suppose."),
("comment_you_defeated_a_lord_allied_spiteful", "I heard that you fought and defeated that dog {s54}. Ah, if only I could have heard him whimpering for mercy."),
("comment_you_defeated_a_lord_allied_unfriendly_chivalrous", "I heard that you fought and defeated {s54}. I hope that you did not use dishonourable means to do so."),
("comment_you_defeated_a_lord_allied", "I heard that you fought and defeated {s54}. I wish you joy of your victory."),
("comment_you_defeated_me_enemy_chivalrous", "I will not begrudge you your victory the last time that we met, but I am anxious for another round!"),
("comment_you_defeated_me_enemy_spiteful", "I have been looking forward to meeting you again. Your tricks will not deceive me a second time, and I will relish hearing your cries for mercy."),
("comment_you_defeated_me_enemy", "When last we met, {playername}, you had the better of me. But I assure you that it will not happen again!"),
("comment_I_defeated_you_enemy_spiteful", "Back for more? Make me fight you again, and I'll feed your bowels to my hounds."),
("comment_I_defeated_you_enemy_chivalrous", "Come to test your valor against me again, {playername}?"),
("comment_I_defeated_you_enemy_benevolent", "So once again you come at me? Will you ever learn?"),
("comment_I_defeated_you_enemy_coldblooded", "You are persistent, but a nuisance."),
("comment_I_defeated_you_enemy", "How many times must I chastise you before you learn to keep your distance?"),
("comment_we_were_defeated_unfriendly_spiteful", "Last I saw you, you had been struck down by the men of {s54}. I blame you for that disaster. What a pity to see that you survived."),
("comment_we_were_defeated_unfriendly", "Last I saw you, you had been struck down by the men of {s54}. Well, I see that you survived."),
("comment_we_were_defeated_cruel", "Last I saw you, you had been struck down by the men of {s54}. Don't worry -- we'll find him, and make him choke on his victory."),
("comment_we_were_defeated_default", "Last I saw you, you had been struck down by the men of {s54}. It is good to see you alive and well."),
("comment_you_were_defeated_allied_friendly_spiteful", "I heard that {s54} gave you a hard time. Don't worry, friend -- I'll find him for you, and make you a gift of his head."),
("comment_you_were_defeated_allied_unfriendly_cruel", "I had heard that {s54} slaughtered your men like sheep. But here you are, alive. Such a disappointment!"),
("comment_you_were_defeated_allied_spiteful", "I heard that {s54} crushed you underfoot like an ant. Hah! Children should not play games made for grown-ups, little {boy/girl}!"),
("comment_you_were_defeated_allied_pitiless", "I heard that {s54} defeated you, and scattered your forces. That is most disappointing..."),
("comment_you_were_defeated_allied_unfriendly_upstanding", "I heard that {s54} defeated you. Perhaps you should consider if you have considered any misdeeds, that might cause heaven to rebuke you in this way."),
("comment_you_were_defeated_allied_unfriendly", "I heard that {s54} defeated you. Look, try not to get too many of our men killed, will you?"),
("comment_you_were_defeated_allied", "I heard that {s54} defeated you. But take heart -- the tables will soon be turned!"),
("comment_you_helped_my_ally_unfriendly_chivalrous", "I heard that you saved {s54} from likely defeat. Whatever else I may think of you, I must at least commend you for that."),
("comment_you_helped_my_ally_unfriendly", "[revelance should be zero, and this message should not appear]"),
("comment_you_helped_my_ally_liege", "I heard that you saved my vassal {s54} from likely defeat. "),
("comment_you_helped_my_ally_unfriendly_spiteful", "I heard that you rode to the rescue of our poor {s54}. Did you think him a damsel in distress? No matter -- it's a common mistake."),
("comment_you_helped_my_ally_spiteful", "I heard that you saved {s54} from a whipping. You should have let him learn his lesson, in my opinion."),
("comment_you_helped_my_ally_chivalrous", "I heard that you got {s54} out of a tight spot. That was a noble deed."),
("comment_you_helped_my_ally_default", "I heard that you got {s54} out of a tight spot. Good work!"),
("comment_you_were_defeated_allied_unfriendly", "I heard that {s54} defeated you. Look, try not to get too many of our men killed, will you?"),
("comment_you_were_defeated_allied", "I heard that {s54} defeated you. But take heart -- the tables will soon be turned!"),
("comment_you_abandoned_us_unfriendly_spiteful", "You worm! You left us alone to face {s54}, didn't you? I spit at you."),
("comment_you_abandoned_us_unfriendly_pitiless", "Well... You abandoned me in the middle of a battle with {s54}, didn't you? I'll see you buried in a traitor's grave."),
("comment_you_abandoned_us_spiteful", "You disappeared in the middle of that battle with {s54}... I hope you have a good explanation. Did your bowels give out? Were you shaking too hard with fear to hold your weapon?"),
("comment_you_abandoned_us_chivalrous", "What happened? You disappeared in the middle of that battle against {s54}. I can only hope that you were too badly wounded to stand, for I would be ashamed to have gone into battle alongside a coward."),
("comment_you_abandoned_us_benefitofdoubt", "What happened? You disappeared in the middle of that battle against {s54}. I assume that you must have been wounded, but it did look suspicious."),
("comment_you_abandoned_us_default", "What happened? One moment you were fighting with us against {s54}, the next moment you were nowhere to be found?"),
("comment_you_ran_from_me_enemy_spiteful", "Last time we met, you ran from me like a whipped dog. Have you come back to bark at me again, or to whine for mercy?"),
("comment_you_ran_from_me_enemy_chivalrous", "Last time we met, you fled from me. Learn to stand and fight like a gentleman!"),
("comment_you_ran_from_me_enemy_benevolent", "When I saw you flee the last time that we met, I had hoped that I would not have to fight you again."),
("comment_you_ran_from_me_enemy_coldblooded", "Last time we met, you fled from me. That was a wise decision"),
("comment_you_ran_from_me_enemy", "You may have been able to escape the last time we crossed paths, but the next time I doubt that you be so lucky."),
("comment_you_ran_from_foe_allied_chivalrous", "They say that you fled from {s54}, leaving your men behind. I pray that this is not true, for such conduct does dishonour to us all."),
("comment_you_ran_from_foe_allied_upstanding", "They say that you fled from {s54}, leaving your men behind. I do not always believe such rumors, and I also know that desperate straits call for desperate measures. But I beg you to take more care of your good name, for men will not fight in our armies if they hear that we abandon them on the field of battle."),
("comment_you_ran_from_foe_allied_spiteful", "By the way, they said that you ran away from {s54} like a quaking little rabbit, leaving your men behind to be butchered. Ha! What a sight that would have been to see!"),
("comment_you_defeated_my_friend_enemy_pragmatic", "You may have bested {s54}, but you cannot defeat us all."),
("comment_you_defeated_my_friend_enemy_chivalrous", "I have heard that you defeated {s54}, and ever since have been anxious to cross swords with you."),
("comment_you_defeated_my_friend_enemy_spiteful", "Your fame runs before you, {playername}. {s54} may have fallen for your tricks, but if you fight me, you'll find a me a much more slippery foe."),
("comment_you_defeated_my_friend_enemy", "They say that you have defeated {s54}. But I will be a truer test of your skill at arms."),
("comment_you_captured_a_lord_allied_friendly_spiteful", "I heard that you captured {s54}. I hope that you squeezed him for every denar."),
("comment_you_captured_a_lord_allied_unfriendly_spiteful", "I heard that you captured {s54}. Your coffers must be well-bloated with ransom by now. Such a pity that money cannot transform a low-born cur into a gentleman!"),
("comment_you_captured_a_lord_allied_chivalrous", "I heard that you captured {s54}. Well done. I assume, of course, that he has been been treated with the honours due his rank."),
("comment_you_captured_a_lord_allied", "I heard that you captured {s54}. Well done. His ransom must be worth quite something."),
("comment_you_let_go_a_lord_allied_chivalrous", "I heard that you captured {s54}, but then let him go. Such chivalry does a credit to our cause."),
("comment_you_let_go_a_lord_allied_upstanding", "I heard that you captured {s54}, but then let him go. Well, that was an honourable course of action, if possibly also a dangerous one."),
("comment_you_let_go_a_lord_allied_coldblooded", "I heard that you captured {s54}, but then let him go. That was most chivalrous of you, but chivalry does not win wars."),
("comment_you_let_go_a_lord_allied_unfriendly_spiteful", "I heard that you captured {s54}, but then let him go. How very chivalrous of you! No doubt the widows and orphans he leaves in his wake will want to commend you in person."),
("comment_you_let_go_a_lord_allied", "I heard that you captured {s54}, but then let him go. Well, I will not tell you what to do with your own prisoners."),
("comment_you_let_me_go_spiteful", "When last we met, you had me at your mercy and allowed me to go free. I hope you enjoyed toying with me, like a cat with a mouse, because soon I will have you at my mercy, to slay or humiliate according to my fancy."),
("comment_you_let_me_go_enemy_chivalrous", "When last we met, you had me at your mercy and allowed me to go free. That was most chivalrous of you, and I will not forget. But I also must remember my oath to my liege, and our kingdoms are still at war."),
("comment_you_let_me_go_enemy_coldblooded", "When last we met, you had me at your mercy and allowed me to go free. But we are still enemies, and I cannot promise to repay your mercy in kind."),
("comment_you_let_me_go_enemy", "When last we met, you had me at your mercy and allowed me to go free. That was kind of you. But we are still at war."),
("comment_you_let_me_go_default", "When last we met, you had me at your mercy and allowed me to go free. That was kind of you, and I am glad that our kingdoms are no longer at war."),
#Internal faction events
("comment_pledged_allegiance_allied_martial_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. Pray do not disgrace us by behaving in a cowardly fashion."),
("comment_pledged_allegiance_allied_martial", "I heard that you have pledged allegiance to our lord, {s54}. I look forward to fighting alongside you against our foes."),
("comment_pledged_allegiance_allied_quarrelsome_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. Bah. Do yourself a favor, and stay out of my way."),
("comment_pledged_allegiance_allied_quarrelsome", "I heard that you have pledged allegiance to our lord, {s54}. Fight hard against our foes, respect your betters, and don't cross me, and we'll get along fine."),
("comment_pledged_allegiance_allied_selfrighteous_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. If I were he, I would not trust you to clean the sculleries."),
("comment_pledged_allegiance_allied_selfrighteous", "I heard that you have pledged allegiance to our lord, {s54}. Fight bravely and you will be well-rewarded. Betray us, and we shall make of you the kind of example that will not soon be forgotten."),
("comment_pledged_allegiance_allied_cunning_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. I do not pretend to be happy about his decision, but perhaps it is better to have you inside our tent pissing out, than the other way around."),
("comment_pledged_allegiance_allied_cunning", "I heard that you have pledged allegiance to our lord, {s54}. That is good. The more skilled fighters we have with us in these troubled times, the better. I shall be watching your progress."),
("comment_pledged_allegiance_allied_debauched_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. No doubt you will soon betray him, and I will have the pleasure of watching you die a traitor's death."),
("comment_pledged_allegiance_allied_debauched", "I heard that you have pledged allegiance to our lord, {s54}. Excellent... I am sure that you and I will become very good friends. But remember -- if you betray us, it will be the biggest mistake you will ever make."),
("comment_pledged_allegiance_allied_goodnatured_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. Well, I can't say that I would have trusted you, but perhaps you deserve the benefit of the doubt."),
("comment_pledged_allegiance_allied_goodnatured", "I heard that you have pledged allegiance to our lord, {s54}. Good {man/woman}! Our lord is a noble soul, and rewards loyalty and valor with kindness and generosity."),
("comment_pledged_allegiance_allied_upstanding_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. Alas, from what I know of you I fear that you will disgrace us, but I will be happy if you prove me wrong."),
("comment_pledged_allegiance_allied_upstanding", "I heard that you have pledged allegiance to our lord, {s54}. Fight against our foes with valor, but also with honour and compassion. A good name is as valuable as a sharp sword or a swift horse in affairs of arms."),
("comment_our_king_granted_you_a_fief_allied_friendly_cruel", "I heard that {s54} granted you {s51} as a fief. Don't forget -- spare the whip and spoil the peasant!"),
("comment_our_king_granted_you_a_fief_allied_friendly_cynical", "I heard that {s54} granted you {s51} as a fief. I am glad to see you prosper -- but be careful. Men are vipers, envious and covetous of their neighbours' wealth. Stay close to me, and I'll watch your back."),
("comment_our_king_granted_you_a_fief_allied_friendly", "I heard that {s54} granted you {s51} as a fief. May your new lands prosper."),
("comment_our_king_granted_you_a_fief_allied_unfriendly_upstanding", "I heard that {s54} granted you {s51} as a fief. But keep in mind that pride goes before a fall."),
("comment_our_king_granted_you_a_fief_allied_unfriendly_spiteful", "I heard that {s54} granted you {s51} as a fief. I suspect, however, that fortune is only raising you up so as to humble you even more, when it casts you back into the dung from whence you came."),
("comment_our_king_granted_you_a_fief_allied_spiteful", "I heard that {s54} granted you {s51} as a fief. Let's hope you are indeed deserving of our lord's favor."),
("comment_our_king_granted_you_a_fief_allied", "I heard that {s54} granted you {s51} as a fief. You seem to be doing very well for yourself."),
("comment_you_renounced_your_alliegance_enemy_friendly", "I heard that you renounced your allegiance to our lord, {s54}. It grieves me that we must now meet on the field of battle."),
("comment_you_renounced_your_alliegance_friendly", "I heard that you renounced your allegiance to our lord, {s54}. Let us pray that we may not come to blows."),
("comment_you_renounced_your_alliegance_unfriendly_spiteful", "I always had you figured for a traitor to {s54}, and now it seems I was proven right. I hope you are prepared to die a traitor's death!"),
("comment_you_renounced_your_alliegance_unfriendly_moralizing", "I heard that you renounced your allegiance to our lord, {s54}. I am forced to consider you a traitor."),
("comment_you_renounced_your_alliegance_enemy", "I heard that you renounced your allegiance to our lord, {s54}. Well, it is the way of the world for old comrades to become enemies."),
("comment_you_renounced_your_alliegance_default", "I heard that you renounced your allegiance to our lord, {s54}. Well, that is your decision, but do not expect me to go easy on you when we meet on the battlefield."),
("personality_archetypes", "liege"),
("martial", "martial"),
("quarrelsome", "bad-tempered"),
("selfrighteous", "pitiless"),
("cunning", "cunning"),
("debauched", "sadistic"),
("goodnatured", "good-natured"),
("upstanding", "upstanding"),
("surrender_demand_default", "Yield or die!"),
("surrender_demand_martial", "The odds are not in your favor today. You may fight us, but there is also no shame if you yield now."),
("surrender_demand_quarrelsome", "I've got you cornered. Give up, or I'll ride you down like a dog."),
("surrender_demand_pitiless", "You cannot defeat me, and I'll teach you a painful lesson if you try. Yield!"),
("surrender_demand_cunning", "You are outmatched today. Give up -- if not for your own sake, then think of your men!"),
("surrender_demand_sadistic", "Surrender or I'll gut you like a fish!"),
("surrender_demand_goodnatured", "We have the advantage of you. Yield, and you will be well-treated."),
("surrender_demand_upstanding", "You may fight us, but many of your men will be killed, and you will probably lose. Yield, and spare us both the unnecessary bloodshed."),
("surrender_offer_default", "Stop! I yield!"),
("surrender_offer_martial", "Stop! I yield!"),
("surrender_offer_quarrelsome", "Enough! You win today, you dog! Ach, the shame of it!"),
("surrender_offer_pitiless", "I yield! You have won. Cursed be this day!"),
("surrender_offer_cunning", "Stop! I yield to you!"),
("surrender_offer_sadistic", "I give up! I give up! Call back your dogs!"),
("surrender_offer_goodnatured", "I yield! Congratulations on your victory, {sir/madame}!"),
("surrender_offer_upstanding", "I yield! Grant me the honours of war, and do yourself credit!"),
("prisoner_released_default", "You have my gratitude, {sir/madame}. I shall not forget your kindness."),
("prisoner_released_martial", "You are indeed a {man/woman} of honour, {sir/madame}. I shall not forget this!"),
("prisoner_released_quarrelsome", "I'm free? Well... Good bye, then."),
("prisoner_released_pitiless", "Thank you. When you are finally defeated, I will request for your death to be swift and merciful. Unless, that is, you care to join us... Good bye, for now."),
("prisoner_released_cunning", "Am I? You are a good {man/woman}. I will try to find a way to repay you."),
("prisoner_released_sadistic", "Am I? So refined is your cruelty, that you would rather see me free and humiliated, than in chains. Enjoy your triumph!"),
("prisoner_released_goodnatured", "You are indeed a {man/woman} of honour, {sir/madame}. I shall not forget this!"),
("prisoner_released_upstanding", "You are indeed a {man/woman} of honour, {sir/madame}. I shall not forget this!"),
#Post 0907 changes begin
("enemy_meet_default", "Who are you, that comes in arms against me?"),
("enemy_meet_martial", "What is your name, {sir/madame}? If we come to blows, I would know whom I fight."),
("enemy_meet_quarrelsome", "Who the hell are you?"),
("enemy_meet_pitiless", "Who are you? Speak, so that I may know whom I slay."),
("enemy_meet_cunning", "Tell me your name. It is always good to know your enemy."),
("enemy_meet_sadistic", "Who are you? Speak quick, before I cut your tongue out."),
("enemy_meet_goodnatured", "What is your name, {sir/madame}? If we come to blows, I would know whom I fight."),
("enemy_meet_upstanding", "Who are you, who would come in arms to dispute our righteous cause?"),
("battle_won_default", "You have proven yourself a most valued ally, today."),
("battle_won_martial", "There is no greater fortune than the chance to show one's valor on the field of arms!"),
("battle_won_quarrelsome", "Hah! We showed those bastards a thing or two, there, didn't we?"),
("battle_won_pitiless", "Together, we will make the foe learn to fear our names, and to quail at our coming!"),
("battle_won_cunning", "Now, we must be sure to press our advantage, so that the blood shed today is not wasted."),
("battle_won_sadistic", "Now let us strip their dead and leave them for the crows, so that all will know the fate of those who come against us."),
("battle_won_goodnatured", "That was a good scrap! No joy like the joy of victory, eh?"),
("battle_won_upstanding", "Now, let us give thanks to the heavens for our victory, and mourn the many fine men who have fallen today."),
("battle_won_grudging_default", "You helped turn the tide on the field, today. Whatever I may think of you, I cannot fault you for your valor."),
("battle_won_grudging_martial", "{playername} -- you have shown yourself a worthy {man/woman} today, whatever your misdeeds in the past."),
("battle_won_grudging_quarrelsome", "Hmf. Yours is not a face which I normally like to see, but I suppose today I should thank you for your help."),
("battle_won_grudging_pitiless", "Your help was most valuable today. I would not imagine that you came to help me out of kindness, but I nonetheless thank you."),
("battle_won_grudging_cunning", "It would be unwise of me not to thank you for coming to help me in my hour of need. So... You have my gratitude."),
("battle_won_grudging_sadistic", "Well! How touching! {playername} has come to rescue me."),
("battle_won_grudging_goodnatured", "{playername}! I can't say that we've always gotten along in the past, but you fought well today. My thanks to you!"),
("battle_won_grudging_upstanding", "Perhaps I was wrong about you. Your arrival was most timely. You have my gratitude."),
("battle_won_unfriendly_default", "So you're here. Well, better late than never, I suppose."),
("battle_won_unfriendly_martial", "We have hard harsh words in the past, but for now let us simply enjoy our victory."),
("battle_won_unfriendly_quarrelsome", "If you're standing there waiting for thanks, you can keep waiting. Your help wasn't really needed, but I guess you had nothing better to do, right?"),
("battle_won_unfriendly_pitiless", "You have come here, like a jackal to a lion's kill. Very well then, help yourself to the spoils. I shall not stop you."),
("battle_won_unfriendly_cunning", "{playername}... Well, I suppose your arrival didn't hurt, although I won't pretend that I'm happy to see you."),
("battle_won_unfriendly_sadistic", "Back off, carrion fowl! This was my victory, however hard you try to steal the glory for yourself."),
("battle_won_unfriendly_goodnatured", "Oh, it's you. Well, I suppose I should thank you for your help."),
("battle_won_unfriendly_upstanding", "Thank you for coming to my support. Now I will be off, before I say something that I regret."),
("troop_train_request_default", "I need someone like you to knock them into shape."),
("troop_train_request_martial", "They need someone to show them the meaning of valor."),
("troop_train_request_quarrelsome", "Fat lazy bastards. They make me puke."),
("troop_train_request_pitiless", "They are more afraid of the enemy than they are of me, and this will not do."),
("troop_train_request_cunning", "But men, like swords, are tempered and hardened by fire."),
("troop_train_request_sadistic", "They need someone with steel in his back to flog some courage into them, or kill them trying."),
("troop_train_request_goodnatured", "They're good enough lads, but I am afraid that they are not quite ready for a battle just yet."),
("troop_train_request_upstanding", "It would be tantamount to murder for me to lead them into combat in their current state."),
("unprovoked_attack_default", "What? Why do you attack us? Speak, you rascal!"),
("unprovoked_attack_martial", "I have no objection to a trial of arms, but I would ask you for what reason you attack us?"),
("unprovoked_attack_quarrelsome", "You're making a big mistake, {boy/girl}. What do you think you're doing?"),
("unprovoked_attack_pitiless", "Indeed? If you really want to die today, I'd be more than happy to oblige you, but I am curious as to what you hope to accomplish."),
("unprovoked_attack_cunning", "Really? I think that you are acting most unwisely. What do you hope to gain by this?"),
("unprovoked_attack_sadistic", "What's this? Do you enjoy having your eyes put out?"),
("unprovoked_attack_goodnatured", "Why do you do this? We've got no quarrel, {sir/madame}."),
("unprovoked_attack_upstanding", "I consider this an unprovoked assault, and will protest to your king. Why do you do this?"),
("unnecessary_attack_default", "I will not hesitate to cut you down if pressed, but I will offer you the chance to ride away from this."),
("unnecessary_attack_martial", "I am eager to take you up on your challenge, {sir/madame}, although I will give you a minute to reconsider."),
("unnecessary_attack_quarrelsome", "Bah! I'm in no mood for this nonsense today. Get out of my way."),
("unnecessary_attack_pitiless", "I am in a merciful mood today. I will pretend that I did not hear you."),
("unnecessary_attack_cunning", "I don't see what you have to gain by making an enemy of me. Maybe you should just ride away."),
("unnecessary_attack_sadistic", "I have no time to waste on a worm like you. Get out of my way."),
("unnecessary_attack_goodnatured", "I don't see what you have to gain by picking a fight, {sir/madame}. You can still ride away."),
("unnecessary_attack_upstanding", "If a fight is what you wish, {sir/madame}, then you will have one, but I will yet offer you the chance to back down."),
("lord_challenged_default", "As you wish. Prepare to die!"),
("lord_challenged_martial", "So be it. Defend yourself!"),
("lord_challenged_quarrelsome", "You impudent whelp! I'll crush you!"),
("lord_challenged_pitiless", "If you so badly wish to die, then I have no choice but to oblige you."),
("lord_challenged_cunning", "Well, if you leave me no choice..."),
("lord_challenged_sadistic", "You heap of filth! I'll make you wish you'd never been born."),
("lord_challenged_goodnatured", "Very well. I had hoped that we might avoid coming to blows, but I see that have no choice."),
("lord_challenged_upstanding", "So be it. It saddens me that you cannot be made to see reason."),
("lord_mission_failed_default", "Well, I am disappointed, but I am sure that you will have many chances to redeem yourself."),
("lord_mission_failed_martial", "There is no honour in failing a quest which you endeavoured to take, but I will accept your word on it."),
("lord_mission_failed_quarrelsome", "You failed? Bah. I should have expected as much from the likes of you."),
("lord_mission_failed_pitiless", "You failed? Well. You disappoint me. That is a most unwise thing to do."),
("lord_mission_failed_cunning", "Well, I am disappointed, but no one can guarantee that the winds of fortune will always blow their way."),
("lord_mission_failed_sadistic", "Indeed? Those who fail me do not always live to regret it."),
("lord_mission_failed_goodnatured", "Oh well. It was a long shot, anyway. Thank you for making an effort."),
("lord_mission_failed_upstanding", "Very well. I am sure that you gave it your best effort."),
("lord_follow_refusal_default", "Follow you? You forget your station, {sir/madame}."),
("lord_follow_refusal_martial", "Perhaps if you one day prove yourself a valorous and honourable warrior, then I would follow you. But not today."),
("lord_follow_refusal_quarrelsome", "Follow someone like you? I don't think so."),
("lord_follow_refusal_pitiless", "Lords like me do not follow people like you, {sir/madame}."),
("lord_follow_refusal_cunning", "First show me that you are the type of {man/woman} who will not lead me into disaster, and then perhaps I will follow you."),
("lord_follow_refusal_sadistic", "I think not! Rather, you should follow me, as a whipped cur follows {his/her} master."),
("lord_follow_refusal_goodnatured", "Um, I am a bit pressed with errands right now. Perhaps at a later date."),
("lord_follow_refusal_upstanding", "First show me that you are worthy to lead, and then perhaps I will follow."),
("lord_insult_default", "base varlot"),
("lord_insult_martial", "dishonourable knave"),
("lord_insult_quarrelsome", "filth-swilling bastard"),
("lord_insult_pitiless", "low-born worm"),
("lord_insult_cunning", "careless oaf"),
("lord_insult_sadistic", "sniveling cur"),
("lord_insult_goodnatured", "unpleasant fellow"),
("lord_insult_upstanding", "disgraceful scoundrel"),
("rebellion_dilemma_default", "[liege]"),
("rebellion_dilemma_martial", "{s45} was clearly wronged. Although I gave an oath to {s46}, it does not bind me to support him if he usurped his throne illegally."),
("rebellion_dilemma_quarrelsome", "Hmm. {s46} has never given me my due, so I don't figure I owe him much. However, maybe {s45} will be no better, and {s46} has at least shown himself ."),
("rebellion_dilemma_pitiless", "Hmm. {s45} says {reg3?she:he} is the rightful heir to the throne. That is good -- it absolves me of my oath to {s46}. But still I must weight my decision carefully."),
("rebellion_dilemma_cunning", "Hmm. I gave an oath of homage to {s46}, yet the powerful are not bound by their oaths as our ordinary people. Our duty is to our own ability to rule, to impose order and prevent the war of all against all."),
("rebellion_dilemma_sadistic", "Hmm. In this vile world, a wise man must think of himself, for no one else will. So -- what's in it for me?"),
("rebellion_dilemma_goodnatured", "I do not know what to say. I gave an oath to {s46} as the lawful ruler, but if he is not the lawful ruler, I don't know if I am still bound."),
("rebellion_dilemma_upstanding", "This is troublesome. It is a grave thing to declare my homage to {s46} to be null and void, and dissolve the bonds which keep our land from sinking into anarchy. Yet I am also pledged to support the legitimacy of the succession, and {s45} also has a valid claim to the throne."),
("rebellion_dilemma_2_default", "[liege]"),
("rebellion_dilemma_2_martial", "On the other hand, {s46} has led us in war and peace, and I am loathe to renounce my allegiance."),
("rebellion_dilemma_2_quarrelsome", "So tell me, why should I turn my back on the bastard I know, in favor of {reg3?a woman:the bastard} I don't know?"),
("rebellion_dilemma_2_pitiless", "It is a most perilous position to be in, to be asked whom I would make {reg3?ruler:king} of this land. Yet it is also a time of opportunity, for me to reap the rewards that have always been my due!"),
("rebellion_dilemma_2_cunning", "{s46} has been challenged, and thus he will never be able to rule as strongly as one whose claim has never been questioned. Yet if {s45} takes the throne by force, {reg3?she:he} will not be as strong as one who succeeded peacefully."),
("rebellion_dilemma_2_sadistic", "Perhaps if I join {s45} while {reg3?she:he} is still weak {reg3?she:he} will enrich me, but perhaps if I bring {s46} your head he will give me an even greater reward."),
("rebellion_dilemma_2_goodnatured", "{s46} has always treated me decently, yet it's true that he did wrong to {s45}. I hesitate to renounce my homage to {s46}, yet I also don't think it's right to support injustice."),
("rebellion_dilemma_2_upstanding", "I feel that I must do whatever is best for the realm, to avoid it being laid waste by civil war and ravaged by its enemies."),
("rebellion_prior_argument_very_favorable", "I have already heard some arguments for supporting your candidate for the throne, and I tend to agree with them."),
("rebellion_prior_argument_favorable", "I have already heard some arguments for supporting your candidate for the throne, and I tend to agree with them."),
("rebellion_prior_argument_unfavorable", "I have already heard some arguments for supporting your candidate for the throne, but I do not find them convincing."),
("rebellion_prior_argument_very_unfavorable", "I have already heard some arguments for supporting your candidate for the throne, but I disagree with most of them."),
("rebellion_rival_default", "[liege]"),
("rebellion_rival_martial", "{s49} your ally {s44} once questioned my honour and my bravery. It's not often I get the chance to face him in battle, and make him retract his statement."),
("rebellion_rival_quarrelsome", "{s49} you're working with {s44}. He's a crafty weasel, and I don't trust him one bit."),
("rebellion_rival_pitiless", "{s49} you seem to have enlisted the support of {s44} -- who is soft, and weak, and not fit to govern a fief, and whom I have always detested."),
("rebellion_rival_cunning", "{s49} {s44}, who has already joined you, is headstrong and quarrelsome, and a bit of liability."),
("rebellion_rival_sadistic", "{s49} I have no desire to fight alongside your ally {s44}, who puts on such a nauseating display of virtue."),
("rebellion_rival_goodnatured", "{s49} I'd be reluctant to be on the same side as {s44}, who has quite a reputation for cruelty."),
("rebellion_rival_upstanding", "{s49} your ally {s44} is in my opinion a dangerous, unreliable, and highly unprincipled man."),
("rebellion_argument_favorable", "I respect your line of argument"),
("rebellion_argument_neutral", "I find your line of argument only moderately compelling"),
("rebellion_argument_unfavorable", "I do not find your line of argument compelling"),
("rebellion_persuasion_favorable", "you state your case eloquently"),
("rebellion_persuasion_neutral", "you make a reasonable case"),
("rebellion_persuasion_unfavorable", "you make an unconvincing case"),
("rebellion_relation_very_favorable", "I have the greatest respect for you personally."),
("rebellion_relation_favorable", "I know and respect you personally."),
("rebellion_relation_neutral", "I do not know you as well as I might like."),
("rebellion_relation_unfavorable", "I do not trust you."),
("and_comma_3", "Furthermore, "),
("but_comma_3", "However,"),
("and_comma_1", ", and "),
("but_comma_1", ", but "),
("and_comma_2", ". Moreover, "),
("but_comma_2", ". Nonetheless, "),
("rebellion_agree_default", "[liege]"),
("rebellion_agree_martial", "I have decided. I will back {s45} as the rightful heir."),
("rebellion_agree_quarrelsome", "Ahh, I've thought long enough. I never did like {s46} much anyway. Let's go take his throne away from him."),
("rebellion_agree_pitiless", "You are fortunate. I have decided to join you. Pray do not give me cause to regret this decision."),
("rebellion_agree_cunning", "This is a most dangerous decision, but after careful consideration, I have decided that I will join you. Let's hope it is for the best."),
("rebellion_agree_sadistic", "I have decided. I will back your {reg3?woman:man} {s45}. But you'd best make sure that {reg3?she:he} rewards me well!"),
("rebellion_agree_goodnatured", "All right. I think your {reg3?woman:man} will be a good ruler. I'll join you."),
("rebellion_agree_upstanding", "So be it. My first duty is to this realm, and to save it from lawlessness I will back {s45} and renounce my homage to {s46}. May the Heavens forgive me if I do wrong."),
("rebellion_refuse_default", "[liege]"),
("rebellion_refuse_martial", "I am sorry. {s45} has a good claim, but it's not enough for me to turn my back on {s46}. I will remain loyal to my liege."),
("rebellion_refuse_quarrelsome", "Nah. Your whelp {s45} doesn't have what it takes to rule this realm. I'm sticking with {s46}."),
("rebellion_agree_pitiless", "No. I will not join your rebellion. I count it little more than the tantrum of a child, denied a bauble which {reg3?she:he} thinks should be {reg3?hers:his}. I will stick with {s46}, whose ability to rule is well-tested."),
("rebellion_agree_cunning", "I am sorry. You do not give me reason for confidence that you will win. Many will die, but I do not wish to be among them. I will continue to back {s46}."),
("rebellion_agree_sadistic", "No. I won't play your little game. You grasp at a crown, but I think instead you'll get a quick trip to the scaffold, and I'll be there by {s46}'s side to watch the headsman's axe drop."),
("rebellion_agree_goodnatured", "I am sorry. I don't feel right turning my back on {s46}. No hard feelings when me meet on the battlefield."),
("rebellion_agree_upstanding", "I am sorry. {s45}'s claim is not strong enough for me to inflict the curse of civil disorder on the poor wretches of this land. I will continue to back {s46}. May the Heavens forgive me if I do wrong."),
("talk_later_default", "[liege]"),
("talk_later_martial", "Now is not the time to talk politics! I am here today with my fellow lords, armed for battle. You'd better prepare to fight."),
("talk_later_quarrelsome", "Do you expect me to discuss betraying my liege with you, while we are surrounded by his army? What do you take me for, a bloody idiot?"),
("talk_later_pitiless", "Still your tongue! Whatever I have to say on this matter, I will not say it here and now, while we are in the midst of our army."),
("talk_later_cunning", "This is hardly the time or the place for such a discussion. Perhaps we can discuss it at a later time and a different place, but for now we're still foes."),
("talk_later_sadistic", "You should have your mouth sewn shut! Can you imagine what would happen if the other vassals see me talking to you of treason?"),
("talk_later_goodnatured", "So you wish to discuss your rebellion with me? Try that again when we aren't surrounded by my liege's army, and I will hear what you have to say."),
("talk_later_upstanding", "Whatever my thoughts on the legitimacy of the succession, I am not about to discuss them here and now. If we meet again when we can talk in privacy, I will hear what you have to say on the matter. But for now, consider me your enemy."),
("gossip_about_character_default", "They say that {s6} doesn't possess any interesting character traits."),
("gossip_about_character_martial", "They say that {s6} loves nothing more than war."),
("gossip_about_character_quarrelsome", "They say that {s6} almost came to blows with another lord lately, because the man made a joke about his nose."),
("gossip_about_character_selfrighteous", "I heard that {s6} had a squire executed because the unfortunate man killed a deer in his forest."),
("gossip_about_character_cunning", "They say that {s6} is a cunning opponent."),
("gossip_about_character_sadistic", "They say that {s6} likes to torture his enemies. I wouldn't want to get on the bad side of that man."),
("gossip_about_character_goodnatured", "They say that {s6} is a good man and treats people living in his lands decently. That is more than what can be said for most of the nobles."),
("gossip_about_character_upstanding", "People say that it is good to be in the service of {s6}. He is good to his followers, and rewards them if they work well."),
("latest_rumor", "The latest rumor you heard about {s6} was:"),
#steve post 0912 changes begin
("swadian_rebellion_pretender_intro", "I am Isolla, rightful Queen of the Swadians."),
("vaegir_rebellion_pretender_intro", "My name is Valdym. Some men call me 'the Bastard.' I am a prince of the Vaegirs, but by all rights I should be their king, instead of my cousin Yaroglek."),
("khergit_rebellion_pretender_intro", "I am Dustum Khan, son of Janakir Khan, and rightful Khan of the Khergits."),
("nord_rebellion_pretender_intro", "I am Lethwin Far-Seeker, son of Hakrim the Old, who should be king of the Nords of Calradia."),
("rhodok_rebellion_pretender_intro", "I am Lord Kastor, the rightful King of the Rhodoks, who will free them from tyranny."),
("swadian_rebellion_pretender_story_1", "I was the only child of my father, King Esterich. Although I am a woman, he loved me like a son and named me his heir -- not once, but several times, before the grandest nobles of the land so that none could doubt his intention. There is no law that bars a woman from ruling -- indeed, we Swadians tell tales of warrior queens who ruled us in our distant past."),
("vaegir_rebellion_pretender_story_1", "My father died when I was young, leaving me in the care of his brother, the regent Burelek. But rather than hold the throne until I came of age, this usurper used his newfound power to accuse my mother of adultery, and to claim that I was not my father's son. She was executed for treason, and I was declared a bastard."),
("khergit_rebellion_pretender_story_1", "Sanjar Khan and I are brothers, sons of the old Janakir Khan, although of different mothers. Although I was the younger brother, all those who knew the old Khan will testify that throughout my father's life, I was his favorite, entrusted with the responsibilities of government. Sanjar busied himself with hunts and feasts to win the affection of the more dissolate of my father's commanders."),
("nord_rebellion_pretender_story_1", "I am called the Far-Seeker because I have travelled great distances, even by the standards of the Nords, in search of knowledge. Before I came of age, my father sent me abroad on a tour of study at the courts and universities in the lands overseas. If the Nords are to call themselves the heirs of the Calradian empire, then they must act the part, and know something of law and letters, and not call themselves content merely to fight, plunder, and drink."),
("rhodok_rebellion_pretender_story_1", "The Rhodoks are a free people, and not slaves to any hereditary monarch. The king must be chosen from one of the leading noble families of the land, by a council drawn by lot from the patricians of the cities of Jelkala, Veluca, and Yalen. The council meets on a field before Jelkala, and no man is allowed to appear in arms during their deliberations, on pain of death."),
("swadian_rebellion_pretender_story_2", "Yet when my father died, his cousin Harlaus convinced the nobles that no Swadian king of sound mind could name a woman as his heir. Harlaus said that his designation of me was the act of a madman, and thus had no legal standing, and that he, as my father's closest male relative, should of take the throne."),
("vaegir_rebellion_pretender_story_2", "I was smuggled abroad by a faithful servant, but now I am of age and have returned to reclaim what is rightfully mine. Burelek died soon after his act of perfidy -- the judgment of heaven, no doubt. His son Yaroglek now calls himself king, but as his claim is tainted, he is no less a usurper than his father, and I will topple him from his throne."),
("khergit_rebellion_pretender_story_2", "According to Khergit custom, when a man dies his herds are split between all his sons, equally. So too it is with the khanate. When I heard of my father's death, I was away inspecting our borders, but I hurried home to Tulga, ready to give Sanjar his due and share the khanate with him. But when I arrived, I found that he rushed his supporters to the court, to have himself proclaimed as the sole khan."),
("nord_rebellion_pretender_story_2", "My father died however before I completed my course of study, and as I hurried home to claim his throne my ship was wrecked by a storm. One of my father's thanes, Ragnar, seized this opportunity and spread rumors that I had died abroad. He summoned a gathering of his supporters to have himself proclaimed king, and has taken the past few years to consolidate his power."),
("rhodok_rebellion_pretender_story_2", "During the last selection, there were but two candidates, myself, and Lord Graveth. While the council was deliberating, Graveth appeared, sword in hand, telling them that a Swadian raiding party was about to descend on the field of deliberation -- which was true, by the way -- and if he were not elected king, then he would leave them to their fate."),
("swadian_rebellion_pretender_story_3", "I will admit that I did my cause no good by cursing Harlaus and all who listened to him as traitors, but I also believe that the magistrates who ruled in his favor were bought. No matter -- I will raise an army of loyal subjects, who would honour their old king's memory and will. And if anyone doubts that a woman can wield power, then I will prove them wrong by taking Harlaus' ill-gotten crown away from him."),
("vaegir_rebellion_pretender_story_3", "Until I have my rights restored in the sight of all the Vaegirs, I will bear the sobriquet, 'the Bastard', to remind me of what I must do."),
("khergit_rebellion_pretender_story_3", "My brother thinks that Khergits will only respect strength: a leader who takes what he wants, when he wants it. But I think that he misreads the spirit of our people.--we admire a resolute leader, but even more we a just one, and we know that a man who does not respect his own brother's rights will not respect the rights of his followers."),
("nord_rebellion_pretender_story_3", "So I remain in exile -- except now I am not looking for sages to tutor me in the wisdom of faraway lands, but warriors, to come with me back to the land of the Nords and regain my throne. If Ragnar doubts my ability to rule, then let him say so face to face, as we stare at each other over the rims of our shields. For a warrior can be a scholar, and a scholar a warrior, and to my mind, only one who combines the two is fit to be king!"),
("rhodok_rebellion_pretender_story_3", "Well, Graveth defeated the Swadians, and for that, as a Rhodok, I am grateful. When I am king, I will myself place the wreath of victory on his head. But after that I will have it separated from his shoulders, for by his actions he has shown himself a traitor to the Rhodok confederacy and its sacred custom."),
("swadian_rebellion_monarch_response_1", "Isolla thinks she should be Queen of the Swadians? Well, King Esterich had a kind heart, and doted on his daughter, but a good-hearted king who doesn't use his head can be a curse to his people. Isolla may tell you stories of warrior queens of old, but you might also recall that all the old legends end in the same way -- with the Swadians crushed underfoot by the armies of the Calradic Emperor."),
("vaegir_rebellion_monarch_response_1", "Were Valdym to come to me in peace, I would laden him with titles and honours, and he would become the greatest of my vassals. But as he comes in war, I will drag him before me in chains and make him acknowledge me as rightful sovereign, then cut his tongue from his mouth so that he cannot recant."),
("khergit_rebellion_monarch_response_1", "My brother Dustum has perhaps told you of his insistence upon splitting the khanate, as though it were a herd of sheep. Let me tell you something. Ever since the Khergits established themselves on this land, the death of every khan has had the same result -- the land was divided, the khan's sons went to war, and the strongest took it all anyway. I simply had the foresight to stave off the civil war in advance."),
("nord_rebellion_monarch_response_1", "Lethwin 'Far-Seeker'? Lethwin Inkfingers, is more like it. Perhaps you have heard the expression, 'Unhappy is the land whose king is a child.' Unhappy too is the land whose king is a student. You want the Nords to be ruled by a beardless youth, whose hand bears no callouses left by a sword's grip, who has never stood in a shield wall? If Lethwin were king, his thanes would laugh at him to his face!"),
("rhodok_rebellion_monarch_response_1", "No doubt Lord Kastor told you that I defiled the hallowed Rhodok custom by interfering with the patricians' election of a king. Well, let me tell you something. The patricians of the towns make longwinded speeches about our ancient liberties, but then choose as their king whichever noble last sat in their villa and sipped a fine wine and promised to overlook their unpaid taxes."),
("swadian_rebellion_monarch_response_2", "Those who weep for the plight of a Swadian princess denied her father's throne should reflect instead on the fate of a Swadian herdswoman seized by a Vaegir raider and taken as chattel to the slave markets. Talk to me of queens and old stories when our warlike neighbors are vanquished, and our land is at peace."),
("vaegir_rebellion_monarch_response_2", "Whatever my father may or may not have done to secure the throne does not matter. I have inherited it, and that is final. If every old claim were to be brought up anew, if every man's inheritance could be called into question at any time, then it would be the end of the institution of kingship, and we would live in a state of constant civil war."),
("khergit_rebellion_monarch_response_2", "Dustum would make a fine assessor of flocks, or adjudicator of land disputes. But can you imagine such a man as khan? We would be run off of our land in no time by our neighbors, and return to our old days of starving and freezing on the steppe."),
("nord_rebellion_monarch_response_2", "Old Hakrim may have had fancy ideas about how to dispose of his kingdom, but it is not just royal blood that makes a King of the Nords. I am king by acclamation of the thanes, and by right of being the strongest. That counts for more than blood, and woe to any man in this land who says otherwise."),
("rhodok_rebellion_monarch_response_2", "The only liberty that concerns them is their liberty to grow fat. Meanwhile, my men sleep out on the steppe, and eat dry bread and salt fish, and scan the horizon for burning villages, and shed our blood to keep the caravan routes open. Here's an idea -- if I ever meet a merchant who limps from a Khergit arrow-wound or a Swadian sword-stroke, then I'll say, 'Here's a man whose counsel is worth taking.'"),
#steve post 0912 changes end
##########################
# Form Ranks strings begin
# Important note: Make sure the order of strings here is consistent with
# the formation type assignments' in module_constants.py,
# including number of types!!!
("formation_array_1", "Main Battle"),
("formation_array_2", "Vaward Battle"),
("formation_array_3", "Rearward Battle"),
("formation_array_4", "Forth Battle"),
("formation_array_5", "Fifth Battle"),
("formation_array_6", "Sixth Battle"),
("formation_array_7", "Seventh Battle"),
("formation_array_8", "Eighth Battle"),
("formation_array_end", "formation_array_end"),
("formation_order_panel_array_1", "Main"),
("formation_order_panel_array_2", "Vaward"),
("formation_order_panel_array_3", "Rearward"),
("formation_order_panel_array_4", "Forth"),
("formation_order_panel_array_5", "Fifth"),
("formation_order_panel_array_6", "Sixth"),
("formation_order_panel_array_7", "Seventh"),
("formation_order_panel_array_8", "Eighth"),
("formation_order_panel_array_end", "formation_array_end"),
("formation_command_line", "line"),
("formation_command_phalanx", "phalanx"),
("formation_command_wedge", "wedge"),
("formation_command_square", "square"),
("formation_command_cantabrian_circle", "Cantabrian circle"),
("formation_command_line_pl", "lines"),
("formation_command_phalanx_pl", "phalanxes"),
("formation_command_wedge_pl", "wedges"),
("formation_command_square_pl", "squares"),
("formation_command_cantabrian_circle_pl", "Cantabrian circles"),
("formation_command_end", "formation_command_end"),
("formation_advance", "advance"),
("formation_move_back", "move back"),
("formation_move_left", "move left"),
("formation_move_right", "move right"),
("formation_turn_left", "turn left"),
("formation_turn_right", "turn right"),
("formation_halt", "halt"),
("formation_charge", "charge"),
("formation_fall_back", "fall back"),
("formation_stand_closer", "stand closer"),
("formation_spread_out", "spread out"),
("key_array_selection_1", "Main Battle!"),
("key_array_selection_2", "Vaward Battle!"),
("key_array_selection_3", "Rearward Battle!"),
("key_array_selection_4", "Forth Battle!"),
("key_array_selection_5", "Fifth Battle!"),
("key_array_selection_6", "Sixth Battle!"),
("key_array_selection_7", "Seventh Battle!"),
("key_array_selection_8", "Eighth Battle!"),
("key_array_select_all", "All Battles!"),
("key_formation_selection", "Next formation"),
("key_formation_selection_backward", "Previous formation"),
("key_formation_tighten", "Stand closer"),
("key_formation_disperse", "Spread out"),
("key_formation_follow", "Follow me"),
("key_formation_hold_pos", "Hold this position"),
("key_auto_rotation_toggle", "Auto rotation"),
("key_apply_formation", "Apply formation"),
("key_formation_charge", "Charge"),
("key_formation_fall_back", "Fall back"),
("key_formation_halt", "Halt"),
("key_formation_tactical_charge", "Tactical charge"),
("key_formation_move_forward", "Move forward"),
("key_formation_move_backward", "Move backward"),
("key_formation_move_left", "Move left"),
("key_formation_move_right", "Move right"),
("key_formation_turn_left", "Turn left"),
("key_formation_turn_right", "Turn right"),
("key_dismiss_formation", "Dismiss formation"),
("key_formation_view_orders", "View orders"),
("formation_key_names_end", "formation_key_names_end"),
#
# Form Ranks strings end
##########################
("credits_1", "Mount&Blade Copyright 2001-2008 Taleworlds Entertainment"),
("credits_2", "Game design:^Armagan Yavuz^Steve Negus^Cem Cimenbicer"),
("credits_3", "Programming:^Armagan Yavuz^Cem Cimenbicer"),
("credits_4", "CG Artists:^Ipek Yavuz^Ozgur Saral^Mustafa Ozturk"),
("credits_8", "Animation:^Pinar Cekic^Umit Singil"),
("credits_5", "Concept Artist:^Ganbat Badamkhand"),
("credits_6", "Writing:^Steve Negus^Ryan A. Span^Armagan Yavuz"),
("credits_9", "Original Music:^Jesse Hopkins"),
("credits_7", "Additional Modeling:^Hilmi Aric^Ahmet Sarisakal^Katie Beedham^^^Additional Writing:^Michael Buhler^Patrick Desjardins^^^Voice Talents:^Tassilo Egloffstein^Jade E Henderson^^^\
Original Music Composed by:^Jesse Hopkins^\
Violin Solos Performed by:^Zoriy Zinger^\
Main Theme and Scherzo Performed by:^The Russian State Symphony Cinema Orchestra, Conducted by Sergei Skripka^^^\
Sound Samples:^Audiosparx.com^^^\
Mount&Blade Map Editor:^Matt Stentiford^^^\
Taleworlds Forum Programming:^Brett Flannigan www.fenrisoft.com^^^\
Mount&Blade Tutorial written by:^Edward Spoerl^^^\
Gameplay Videos:^Jemes Muia^^^\
Motion Capture System:^NaturalPoint-Optitrack Arena^^^\
Horse Motion Capture Animation Supplied by:^Richard Widgery & Kinetic Impulse^^^\
Ragdoll Physics:^Newton Game Dynamics^^^\
Sound and Music Program Library:^FMOD Sound System by Firelight Technologies^^^\
Copy Protection:^Themida by Oreans Technologies^^^\
Skybox Textures:^Jay Weston www.hyperfocaldesign.com^^^\
Third Party Art Libraries Used:^Texturemonk^Mayang Textures^cgtextures.com^3d.sk^^\
Unofficial Mount&Blade Editor:^Josh Dahlby^^^\
Many thanks to Marco Tarini for the Mountain shader idea!^^^\
Special Thanks to:^Ibrahim Dogan^Nova Language Works^Selim Kurtulus and UPS Turkey^^^\
Taleworlds.com Forum Administrators and Moderators:^Janus^Archonsod^Narcissus^Nairagorn^Lost Lamb^Deus Ex^Merentha^Volkier^Okin^Instag0\
^Deniz^ego^Guspav^Hallequin^Invictus^okiN^Raz^rejenorst^Skyrage^ThVaz^^^\
Spanish Translation^^Translators:^Anabel 'Rhaenys' Diaz^Analia 'Immortality' Dobarro^Anoik^^Medieval Consultant:^Enric 'Palafoxx' Clave^^Language Tester:^Theo de Moree^^^\
Mount&Blade Community Suggestions and Feedback:^\
13 Chain Bloody Spider^\
Aenarion^\
AgentSword^\
Ahadhran^\
Albino^\
Allegro^\
allthesedamnnamesare^\
Amman de Stazia^\
Ancientwanker^\
Anrea 'Skree' Giongiani^\
Aqtai^\
Art Falmingaid^\
bryce777^\
Bugman^\
Buxton^\
Calandale^\
Cartread^\
Chel^\
Chilly5^\
Cirdan^\
Cleaning agent^\
Cymro^\
DaBlade^\
DaLagga^\
Damien^\
danover^\
Dearahn^\
Deathblow^\
Destichado^\
Dryvus^\
dunnno^\
D'Sparil^\
ealabor^\
Ealdormann Hussey^\
EasyCo506^\
El Duke^\
Elias Maluco^\
Eogan^\
ex_ottoyuhr^\
Fisheye^\
Fossi^\
fujiwara^\
Fuzzpilz^\
GandalfTheGrey^\
Gerif^\
Grocat^\
Guspav^\
Halden The Borch shooter^\
Hallequin^\
Handel^\
Hardcode^\
Haupper^\
Hellequin^\
Highelf^\
Highlander^\
Ibrahim Turgut^\
Iesu^\
Ilex^\
Ingolifs^\
Invictus^\
Itchrelief^\
Jlgx50^\
JHermes^\
Jik^\
john259^\
JonathanStrange^\
jpgray^\
kamov23^\
Kayback^\
Khalid Ibn Walid^\
KON_Air^\
Lady Tanith^\
Larry Knight^\
LavaLampMaster^\
Leprechaun^\
Lhorkan^\
Llew2^\
Maelstorm^\
Manitas^\
Maw^\
MAXHARDMAN^\
Merentha^\
Merlkir^\
Michael Elijah 'ironpants' Bell-Rao^\
mihoshi^\
Mirathei^\
mkeller^\
Momaw^\
Morgoth2005^\
MrCrotch^\
mtarini^\
n00854180t^\
Naridill^\
Nicholas Altaman\
okiN^\
oksir^\
Oldtimer^\
Ollieh^\
oRGy^\
Oubliette^\
Patrick 'nox' Gallaty^\
Pavlov^\
Rando^\
Raz^\
rejenorst^\
Rjii^\
Ron Losey^\
Rorthic^\
RR_raptor^\
Scion^\
Seff^\
shenzay^\
Shadowmoses^\
shikamaru 1993^\
Silver^\
silverkatana^\
Sir Prince^\
Sirgigor^\
Skyrage^\
Smoson^\
sneakey pete^\
Stefano^\
Stella^\
Stonewall382^\
Talak^\
Tankai^\
TG^\
thelast^\
The Phoenix^\
The Pope^\
The Yogi^\
Thingy Master^\
Thormac^\
Thus_Spake_Nosferatu^\
ThVaz^\
Toygar Birinci^\
Tuckles^\
Tul^\
Ursca^\
Vaerraent^\
Vilhjalmr^\
Volkier^\
vuk^\
Wanderer^\
WhoCares^\
Winter^\
Worbah^\
Yoshiboy^\
...and many many other wonderful Mount&Blade players!^^\
(This is only a small sample of all the players who have contributed to the game by providing suggestions and feedback.^\
This list has been compiled by sampling only a few threads in the Taleworlds Forums.^\
Unfortunately compiling an exhaustive list is almost impossible.^\
We apologize sincerely if you contributed your suggestions and feedback but were not listed here, and please know that we are grateful to you all the same...)\
"),
("credits_10", "Paradox Interactive^^President and CEO:^Theodore Bergqvist^^Executive Vice President:^Fredrik Wester\
^^Chief Financial Officer:^Lena Eriksson^^Finance & Accounting:^Annlouise Larsson^^VP Sales & Marketing US:^Reena M. Miranda\
^^VP Sales & Marketing EU:^Martin Sirc^^Distribution Manager Nordic:^Erik Helmfridsson^^Director of PR & Marketing:^Susana Meza\
^^PR & Marketing:^Sofia Forsgren^^Product Manager:^Boel Bermann\
"),
("credits_11", "Logotype:^Jason Brown^^Cover Art:^Piotr Fox Wysocki\
^^Layout:^Christian Sabe^Melina Grundel^^Poster:^Piotr Fox Wysocki^^Map & Concept Art:^Ganbat Badamkhand\
^^Manual Editing:^Digital Wordsmithing: Ryan Newman, Nick Stewart^^Web:^Martin Ericsson^^Marketing Assets:^2Coats\
^^Localization:^S&H Entertainment Localization^^GamersGate:^Ulf Hedblom^Andreas Pousette^Martin Ericson^Christoffer Lindberg\
"),
("credits_12", "Thanks to all of our partners worldwide, in particular long-term partners:\
^Koch Media (Germany & UK)^Blue Label (Italy & France)^Friendware (Spain)^New Era Interactive Media Co. Ltd. (Asia)\
^Snowball (Russia)^Pinnacle (UK)^Porto Editora (Portugal)^Hell-Tech (Greece)^CD Projekt (Poland, Czech Republic, Slovakia & Hungary)\
^Paradox Scandinavian Distribution (Scandinavia)\
"),
]
| Python |
from header_particle_systems import *
#psf_always_emit = 0x0000000002
#psf_global_emit_dir = 0x0000000010
#psf_emit_at_water_level = 0x0000000020
#psf_billboard_2d = 0x0000000100 # up_vec = dir, front rotated towards camera
#psf_billboard_3d = 0x0000000200 # front_vec point to camera.
#psf_billboard_drop = 0x0000000300
#psf_turn_to_velocity = 0x0000000400
#psf_randomize_rotation = 0x0000001000
#psf_randomize_size = 0x0000002000
#psf_2d_turbulance = 0x0000010000
####################################################################################################################
# Each particle system contains the following fields:
#
# 1) Particle system id (string): used for referencing particle systems in other files.
# The prefix psys_ is automatically added before each particle system id.
# 2) Particle system flags (int). See header_particle_systems.py for a list of available flags
# 3) mesh-name.
####
# 4) Num particles per second: Number of particles emitted per second.
# 5) Particle Life: Each particle lives this long (in seconds).
# 6) Damping: How much particle's speed is lost due to friction.
# 7) Gravity strength: Effect of gravity. (Negative values make the particles float upwards.)
# 8) Turbulance size: Size of random turbulance (in meters)
# 9) Turbulance strength: How much a particle is affected by turbulance.
####
# 10,11) Alpha keys : Each attribute is controlled by two keys and
# 12,13) Red keys : each key has two fields: (time, magnitude)
# 14,15) Green keys : For example scale key (0.3,0.6) means
# 16,17) Blue keys : scale of each particle will be 0.6 at the
# 18,19) Scale keys : time 0.3 (where time=0 means creation and time=1 means end of the particle)
#
# The magnitudes are interpolated in between the two keys and remain constant beyond the keys.
# Except the alpha always starts from 0 at time 0.
####
# 20) Emit Box Size : The dimension of the box particles are emitted from.
# 21) Emit velocity : Particles are initially shot with this velocity.
# 22) Emit dir randomness
# 23) Particle rotation speed: Particles start to rotate with this (angular) speed (degrees per second).
# 24) Particle rotation damping: How quickly particles stop their rotation
####################################################################################################################
particle_systems = [
("game_rain", psf_billboard_2d|psf_global_emit_dir|psf_always_emit, "prtcl_rain",
500, 0.5, 0.33, 1.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(1.0, 0.3), (1, 0.3), #alpha keys
(1.0, 1.0), (1, 1.0), #red keys
(1.0, 1.0), (1, 1.0), #green keys
(1.0, 1.0), (1, 1.0), #blue keys
(1.0, 1.0), (1.0, 1.0), #scale keys
(8.2, 8.2, 0.2), #emit box size
(0, 0, -10.0), #emit velocity
0.0, #emit dir randomness
0, #rotation speed
0.5 #rotation damping
),
("game_snow", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_snow_fall_1",
150, 2, 0.2, 0.1, 30, 20, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.2, 1), (1, 1), #alpha keys
(1.0, 1.0), (1, 1.0), #red keys
(1.0, 1.0), (1, 1.0), #green keys
(1.0, 1.0), (1, 1.0), #blue keys
(1.0, 1.0), (1.0, 1.0), #scale keys
(10, 10, 0.5), #emit box size
(0, 0, -5.0), #emit velocity
1, #emit dir randomness
200, #rotation speed
0.5 #rotation damping
),
## ("game_blood", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation, "prtcl_dust_a",
## 50, 0.65, 0.95, 1.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
## (0.3, 0.3), (1, 0.2), #alpha keys
## (1.0, 0.4), (1, 0.05), #red keys
## (1.0, 0.05),(1, 0.05), #green keys
## (1.0, 0.05),(1, 0.05), #blue keys
## (0.3, 0.5), (1.0, 2.5), #scale keys
## (0.04, 0.01, 0.01), #emit box size
## (0, 1, 0.0), #emit velocity
## 0.05, #emit dir randomness
## 0, #rotation speed
## 0.5 #rotation damping
## ),
##
("game_blood", psf_billboard_3d |psf_randomize_size|psf_randomize_rotation, "prt_mesh_blood_1",
500, 0.65, 3, 0.5, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.0, 0.7), (0.7, 0.7), #alpha keys
(0.1, 0.7), (1, 0.7), #red keys
(0.1, 0.7), (1, 0.7), #green keys
(0.1, 0.7), (1, 0.7), #blue keys
(0.0, 0.015), (1, 0.018), #scale keys
(0, 0.05, 0), #emit box size
(0, 1.0, 0.3), #emit velocity
0.9, #emit dir randomness
0, #rotation speed
0, #rotation damping
),
("game_blood_2", psf_billboard_3d | psf_randomize_size|psf_randomize_rotation , "prt_mesh_blood_3",
2000, 0.6, 3, 0.3, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.0, 0.25), (0.7, 0.1), #alpha keys
(0.1, 0.7), (1, 0.7), #red keys
(0.1, 0.7), (1, 0.7), #green keys
(0.1, 0.7), (1, 0.7), #blue keys
(0.0, 0.15), (1, 0.35), #scale keys
(0.01, 0.2, 0.01), #emit box size
(0.2, 0.3, 0), #emit velocity
0.3, #emit dir randomness
150, #rotation speed
0, #rotation damping
),
# ("game_hoof_dust", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation, "prtcl_dust_a",
# 50, 1.0, 0.95, -0.1, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
# (0.0, 0.5), (1, 0.0), #alpha keys
# (1.0, 0.9), (1, 0.05), #red keys
# (1.0, 0.8),(1, 0.05), #green keys
# (1.0, 0.7),(1, 0.05), #blue keys
# (0.0, 7.5), (1.0, 15.5), #scale keys
# (0.2, 0.3, 0.2), #emit box size
# (0, 0, 2.5), #emit velocity
# 0.05, #emit dir randomness
# 100, #rotation speed
# 0.5 #rotation damping
# ),
("game_hoof_dust", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation|psf_2d_turbulance, "prt_mesh_dust_1",#prt_mesh_dust_1
5, 2.0, 10, 0.05, 10.0, 39.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.2, 0.5), (1, 0.0), #alpha keys
(0, 1), (1, 1), #red keys
(0, 0.9),(1, 0.9), #green keys
(0, 0.78),(1, 0.78), #blue keys
(0.0, 2.0), (1.0, 3.5), #scale keys
(0.2, 0.3, 0.2), #emit box size
(0, 0, 3.9), #emit velocity
0.5, #emit dir randomness
130, #rotation speed
0.5 #rotation damping
),
("game_hoof_dust_snow", psf_billboard_3d|psf_randomize_size, "prt_mesh_snow_dust_1",#prt_mesh_dust_1
6, 2, 3.5, 1, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.2, 1), (1, 1), #alpha keys
(0, 1), (1, 1), #red keys
(0, 1),(1, 1), #green keys
(0, 1),(1, 1), #blue keys
(0.5, 4), (1.0, 5.7), #scale keys
(0.2, 1, 0.1), #emit box size
(0, 0, 1), #emit velocity
2, #emit dir randomness
0, #rotation speed
0 #rotation damping
),
("game_hoof_dust_mud", psf_billboard_2d|psf_randomize_size|psf_randomize_rotation|psf_2d_turbulance, "prt_mesh_mud_1",#prt_mesh_dust_1
5, .7, 10, 3, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0, 1), (1, 1), #alpha keys
(0, .7), (1, .7), #red keys
(0, 0.6),(1, 0.6), #green keys
(0, 0.4),(1, 0.4), #blue keys
(0.0, 0.2), (1.0, 0.22), #scale keys
(0.15, 0.5, 0.1), #emit box size
(0, 0, 15), #emit velocity
6, #emit dir randomness
200, #rotation speed
0.5 #rotation damping
),
("game_water_splash_1", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation|psf_emit_at_water_level, "prtcl_drop",
20, 0.85, 0.25, 0.9, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.3, 0.5), (1, 0.0), #alpha keys
(1.0, 1.0), (1, 1.0), #red keys
(1.0, 1.0), (1, 1.0), #green keys
(1.0, 1.0), (1, 1.0), #blue keys
(0.0, 0.3), (1.0, 0.18), #scale keys
(0.3, 0.2, 0.1), #emit box size
(0, 1.2, 2.3), #emit velocity
0.3, #emit dir randomness
50, #rotation speed
0.5 #rotation damping
),
("game_water_splash_2", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation|psf_emit_at_water_level, "prtcl_splash_b",
30, 0.4, 0.7, 0.5, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.3, 1.0), (1, 0.3), #alpha keys
(1.0, 1.0), (1, 1.0), #red keys
(1.0, 1.0), (1, 1.0), #green keys
(1.0, 1.0), (1, 1.0), #blue keys
(0.0, 0.25), (1.0, 0.7), #scale keys
(0.4, 0.3, 0.1), #emit box size
(0, 1.3, 1.1), #emit velocity
0.1, #emit dir randomness
50, #rotation speed
0.5 #rotation damping
),
("game_water_splash_3", psf_emit_at_water_level , "prt_mesh_water_wave_1",
5, 2.0, 0, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.03, 0.2), (1, 0.0), #alpha keys
(1.0, 1.0), (1, 1.0), #red keys
(1.0, 1.0), (1, 1.0), #green keys
(1.0, 1.0), (1, 1.0), #blue keys
(0.0, 3), (1.0, 10), #scale keys
(0.0, 0.0, 0.0), #emit box size
(0, 0, 0), #emit velocity
0.0, #emit dir randomness
0, #rotation speed
0.5 #rotation damping
),
("torch_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
50, 0.35, 0.2, 0.03, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.8), (1, 0), #alpha keys
(0.5, 1.0), (1, 0.9), #red keys
(0.5, 0.7),(1, 0.3), #green keys
(0.5, 0.2), (1, 0.0), #blue keys
(0, 0.15), (0.4, 0.3), #scale keys
(0.04, 0.04, 0.01), #emit box size
(0, 0, 0.5), #emit velocity
0.0, #emit dir randomness
200, #rotation speed
0.5 #rotation damping
),
("fire_glow_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_fire_2",
2, 0.55, 0.2, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.9), (1, 0), #alpha keys
(0.0, 0.9), (1, 0.9), #red keys
(0.0, 0.7),(1, 0.7), #green keys
(0.0, 0.4), (1, 0.4), #blue keys
(0, 2), (1.0, 2), #scale keys
(0.0, 0.0, 0.0), #emit box size
(0, 0, 0), #emit velocity
0.0, #emit dir randomness
0,
0
),
("fire_glow_fixed", psf_billboard_3d|psf_global_emit_dir, "prt_mesh_fire_2",
4, 100.0, 0.2, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(-0.01, 1.0), (1, 1.0), #alpha keys
(0.0, 0.9), (1, 0.9), #red keys
(0.0, 0.7),(1, 0.7), #green keys
(0.0, 0.4), (1, 0.4), #blue keys
(0, 2), (1.0, 2), #scale keys
(0.0, 0.0, 0.0), #emit box size
(0, 0, 0), #emit velocity
0.0, #emit dir randomness
0,
0
),
("torch_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prtcl_dust_a",
15, 0.5, 0.2, -0.2, 10.0, 0.1, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.25), (1, 0), #alpha keys
(0.0, 0.2), (1, 0.1), #red keys
(0.0, 0.2),(1, 0.09), #green keys
(0.0, 0.2), (1, 0.08), #blue keys
(0, 0.5), (0.8, 2.5), #scale keys
(0.1, 0.1, 0.1), #emit box size
(0, 0, 1.5), #emit velocity
0.1 #emit dir randomness
),
("flue_smoke_short", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prtcl_dust_a",
15, 1.5, 0.1, -0.0, 10.0, 12, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.0, 0.3), (1, 0), #alpha keys
(0.0, 0.2), (1, 0.1), #red keys
(0.0, 0.2),(1, 0.09), #green keys
(0.0, 0.2), (1, 0.08), #blue keys
(0, 1.5), (1, 7), #scale keys
(0, 0, 0), #emit box size
(0, 0, 1.5), #emit velocity
0.1, #emit dir randomness
150,
0.8,
),
("flue_smoke_tall", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prtcl_dust_a",
15, 3, 0.5, -0.0, 15.0, 12,#num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0, 0.35), (1, 0), #alpha keys
(0.0, 0.3), (1, 0.1), #red keys
(0.0, 0.3),(1, 0.1), #green keys
(0.0, 0.3), (1, 0.1), #blue keys
(0, 2), (1, 7), #scale keys
(0, 0, 0), #emit box size
(0, 0, 1.5), #emit velocity
0.1, #emit dir randomness
150,
0.5,
),
("war_smoke_tall", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_smoke_1",
5, 12, 0, 0, 7, 7, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0, 0.25), (1, 0), #alpha keys
(0.0, 1), (1, 0.8), #red keys
(0.0, 1),(1, 0.8), #green keys
(0.0, 1), (1, 0.8), #blue keys
(0, 2.2), (1, 15), #scale keys
(0, 0, 0), #emit box size
(0, 0, 2.2), #emit velocity
0.1, #emit dir randomness
100,
0.2,
),
("torch_fire_sparks", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size, "prt_sparks_mesh_1",
10, 0.7, 0.2, 0, 10.0, 0.02, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.66, 1), (1, 0), #alpha keys
(0.1, 0.7), (1, 0.7), #red keys
(0.1, 0.5),(1, 0.5), #green keys
(0.1, 0.1), (1, 0.1), #blue keys
(0.1, 0.05), (1, 0.05), #scale keys
(0.1, 0.1, 0.1), #emit box size
(0, 0, 0.9), #emit velocity
0.0, #emit dir randomness
0,
0,
),
("fire_sparks_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size, "prt_sparks_mesh_1",
10, 1.5, 0.2, 0, 3, 10, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.6, 1), (1, 1), #alpha keys
(0.1, 0.7), (1, 0.7), #red keys
(0.1, 0.5),(1, 0.5), #green keys
(0.1, 0.1), (1, 0.1), #blue keys
(0.1, 0.07), (1, 0.03), #scale keys
(0.17, 0.17, 0.01), #emit box size
(0, 0, 1), #emit velocity
0.0, #emit dir randomness
0,
0,
),
("pistol_smoke", psf_billboard_3d, "prtcl_dust_a",
90, 2.5, 0.6, -0.2, 60.0, 1.5, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.0, 0.75), (1, 0), #alpha keys
(0.0, 0.7), (1, 0.4), #red keys
(0.0, 0.7),(1, 0.4), #green keys
(0.0, 0.7), (1, 0.4), #blue keys
(0, 1.5), (0.5, 11.0), #scale keys
(0.1, 0.1, 0.1), #emit box size
(2, 2, 0), #emit velocity
0.1 #emit dir randomness
),
# ("cooking_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prtcl_fire",
# 50, 0.5, 0.2, -0.05, 30.0, 0.3, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
# (0.5, 1), (1, 1), #alpha keys
# (0.5, 1.0), (1, 0.9), #red keys
# (0.5, 0.4), (1, 0.1), #green keys
# (0.5, 0.2), (1, 0.0), #blue keys
# (0.3, 0.9), (0.9, 2), #scale keys
# (0.07, 0.07, 0.01), #emit box size
# (0, 0, 0.1), #emit velocity
# 0.1 #emit dir randomness
# ),
("brazier_fire_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
25, 0.5, 0.1, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.4), (1.0, 0), #alpha keys
(0.5, 1.0), (1.0, 0.9), #red keys
(0.5, 0.7),(1.0, 0.3), #green keys
(0.5, 0.2), (1, 0.0), #blue keys
(0.1, 0.2), (1.0, 0.5), #scale keys
(0.1, 0.1, 0.01), #emit box size
(0.0, 0.0, 0.4), #emit velocity
0.0, #emit dir randomness
100, #rotation speed
0.2 #rotation damping
),
# ("cooking_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_steam_1",
# 3, 3.5, 0.4, -0.03, 10.0, 10.9, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
# (0.4, 1), (1, 0), #alpha keys
# (0.0, 0.6), (1, 0.3), #red keys
# (0.0, 0.6),(1, 0.3), #green keys
# (0.0, 0.6), (1, 0.3), #blue keys
# (0, 2.5), (0.9, 7.5), #scale keys
# (0.1, 0.1, 0.06), #emit box size
# (0, 0, 1.3), #emit velocity
# 0.2, #emit dir randomness
# 200, #rotation speed
# 0.2, #rotation damping
# ),
("cooking_fire_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
25, 0.35, 0.1, 0.03, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.8), (1, 0), #alpha keys
(0.5, 0.5*1.0), (1, 0.3*0.9), #red keys
(0.5, 0.5*0.7),(1, 0.3*0.3), #green keys
(0.5, 0.5*0.2), (1, 0.0), #blue keys
(0.1, 0.5), (1, 1), #scale keys
(0.05, 0.05, 0.01), #emit box size
(0, 0, 1), #emit velocity
0.0, #emit dir randomness
200, #rotation speed
0.0 #rotation damping
),
("cooking_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_smoke_1",
4, 4, 0.1, 0, 3, 5, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.2, 0.20), (1.0, 0.0), #alpha keys
(0.0, 0.8), (1.0, 1.0), #red keys
(0.0, 0.8),(1.0, 1.0), #green keys
(0.0, 0.85), (1.0, 1.0), #blue keys
(0.0, 0.65), (1.0, 3.0), #scale keys
(0.0, 0.0, 0.0), #emit box size
(0.0, 0.0, 1.2), #emit velocity
0.0, #emit dir randomness
0,
0,
),
("food_steam", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_steam_1",
3, 1, 0, 0, 8.0, 1, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.1), (1, 0), #alpha keys
(0.0, 1), (1, 0.1), #red keys
(0.0, 1),(1, 0.1), #green keys
(0.0, 1), (1, 0.1), #blue keys
(0, 0.2), (0.9, 0.5), #scale keys
(0.05, 0.05, 0), #emit box size
(0, 0, 0.1), #emit velocity
0, #emit dir randomness
100, #rotation speed
0.5, #rotation damping
),
("candle_light", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_candle_fire_1",
7, 1.1, 0.6, -0.0, 10.0, 0.2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 0.5), (1, 0), #alpha keys
(0.5, 1.0), (1, 0.9), #red keys
(0.5, 0.6), (1, 0.1), #green keys
(0.5, 0.2), (1, 0.0), #blue keys
(0.3, 0.2), (1, 0.0), #scale keys
(0.0, 0.0, 0.0), #emit box size
(0, 0, 0.09), #emit velocity
0, #emit dir randomness
0, #rotation speed
0 #rotation damping
),
("candle_light_small", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_candle_fire_1",
4, 1.1, 0.6, -0.0, 10.0, 0.2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 0.8), (1, 0), #alpha keys
(0.5, 1.0), (1, 0.9), #red keys
(0.5, 0.6), (1, 0.1), #green keys
(0.5, 0.2), (1, 0.0), #blue keys
(0.3, 0.13), (1, 0.0), #scale keys
(0.0, 0.0, 0.0), #emit box size
(0, 0, 0.06), #emit velocity
0, #emit dir randomness
0, #rotation speed
0 #rotation damping
),
("lamp_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_fire_1",
10, 0.8, 0.6, -0.0, 10.0, 0.4, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 0.5), (1, 0), #alpha keys
(0.5, 1.0), (1, 0.9), #red keys
(0.5, 0.8), (1, 0.1), #green keys
(0.5, 0.4), (1, 0.0), #blue keys
(0.3, 0.35), (0.9, 0.5), #scale keys
(0.01, 0.01, 0.0), #emit box size
(0, 0, 0.35), #emit velocity
0.03, #emit dir randomness
100, #rotation speed
0.5, #rotation damping
),
#*-*-*-*-* D U M M Y *-*-*-*-#
("dummy_smoke", psf_billboard_3d|psf_randomize_size, "prt_mesh_dust_1",
500, 3, 15, -0.05, 10.0, 0.2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 0.5), (1, 0), #alpha keys
(0.1, 0.8), (1, 0.8), #red keys
(0.1, 0.7),(1, 0.7), #green keys
(0.1, 0.6), (1, 0.7), #blue keys
(0.0, 0.7), (1, 2.2), #scale keys
(0.2, 0.2, 0.5), #emit box size
(0, 0, 0.05), #emit velocity
2, #emit dir randomness
10, #rotation speed
0.1, #rotation damping
),
("dummy_straw", psf_randomize_size | psf_randomize_rotation, "prt_mesh_straw_1",
500, 1, 2, 0.9, 10, 2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 1), (1, 1), #alpha keys
(0.1, 0.6), (1, 0.6), #red keys
(0.1, 0.5),(1, 0.5), #green keys
(0.1, 0.4), (1, 0.4), #blue keys
(0.0, 0.3), (1, 0.3), #scale keys
(0.2, 0.2, 0.5), #emit box size
(0, 0, 0), #emit velocity
2.3, #emit dir randomness
200, #rotation speed
0, #rotation damping
),
#*-*-*-*-* D U M M Y E N D *-*-*-*-#
#*-*-*-*-* GOURD *-*-*-*-#
("gourd_smoke", psf_billboard_3d|psf_randomize_size, "prt_mesh_dust_1",
500, 3, 15, -0.05, 10.0, 0.2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 0.5), (1, 0), #alpha keys
(0.1, 0.8), (1, 0.8), #red keys
(0.1, 0.7),(1, 0.7), #green keys
(0.1, 0.6), (1, 0.7), #blue keys
(0.0, 0.5), (1, 1), #scale keys
(0.2, 0.2, 0.5), #emit box size
(0, 0, 0.05), #emit velocity
2, #emit dir randomness
10, #rotation speed
0.1, #rotation damping
),
("gourd_piece_1", psf_randomize_rotation, "prt_gourd_piece_1",
15, 1, 2, 0.9, 10, 2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 1), (1, 1), #alpha keys
(0.1, 0.6), (1, 0.6), #red keys
(0.1, 0.5),(1, 0.5), #green keys
(0.1, 0.4), (1, 0.4), #blue keys
(0.0, 1), (1, 1), #scale keys
(0.2, 0.2, 0.5), #emit box size
(0, 0, 0), #emit velocity
2.3, #emit dir randomness
200, #rotation speed
0, #rotation damping
),
("gourd_piece_2", psf_randomize_size | psf_randomize_rotation, "prt_gourd_piece_2",
50, 1, 2, 0.9, 10, 2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 1), (1, 1), #alpha keys
(0.1, 0.6), (1, 0.6), #red keys
(0.1, 0.5),(1, 0.5), #green keys
(0.1, 0.4), (1, 0.4), #blue keys
(0.0, 1), (1, 1), #scale keys
(0.2, 0.2, 0.5), #emit box size
(0, 0, 0), #emit velocity
2.3, #emit dir randomness
200, #rotation speed
0, #rotation damping
),
## ("rat_particle", psf_global_emit_dir|psf_2d_turbulance | psf_randomize_size |psf_billboard_3d, "rat_particle",
## 500, 4, 0, 0, 20, 10, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
## (0.1, 1), (1, 1), #alpha keys
## (0.1, 0.6), (1, 0.6), #red keys
## (0.1, 0.5),(1, 0.5), #green keys
## (0.1, 0.4), (1, 0.4), #blue keys
## (0.1, 1), (1, 1), #scale keys
## (0.1, 0.1, 0.1), #emit box size
## (0, 0, 0), #emit velocity
## 5, #emit dir randomness
## ),
#*-*-*-**** BLOOD ****-*-*-*#
##("blood_hit_1", psf_billboard_3d | psf_randomize_size , "prt_mesh_blood_1",
## 5000, 0.5, 6, 0.5, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
## (0.1, 1), (1, 0), #alpha keys
## (0.1, 0.6), (1, 0.6), #red keys
## (0.1, 0.5),(1, 0.5), #green keys
## (0.1, 0.4), (1, 0.4), #blue keys
## (0.0, 0.05), (1, 0.05), #scale keys
## (0, 0.5, 0), #emit box size
## (0, -1, 0), #emit velocity
## 1.5, #emit dir randomness
## 0, #rotation speed
## 0, #rotation damping
## ),
## #("blood_hit_2", 0 , "prt_mesh_blood_2",
## # 500, 0.3, 0,0, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
## # (0.1, 1), (1, 0.0), #alpha keys
## # (0.1, 0.6), (1, 0.6), #red keys
## # (0.1, 0.5),(1, 0.5), #green keys
## # (0.1, 0.4), (1, 0.4), #blue keys
## # (0.0, 0.4), (1, 2), #scale keys
## # (0.0, 0.0, 0.0), #emit box size
## # (0, -0.1, 0), #emit velocity
## # 0, #emit dir randomness
## # 0, #rotation speed
## # 0, #rotation damping
## # ),
## ("blood_hit_3", psf_billboard_3d | psf_randomize_size , "prt_mesh_blood_3",
## 500, 0.3, 1,0.0, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
## (0.1, 1), (1, 0.0), #alpha keys
## (0.1, 0.6), (1, 0.6), #red keys
## (0.1, 0.5),(1, 0.5), #green keys
## (0.1, 0.4), (1, 0.4), #blue keys
## (0.0, 0.2), (1, 0.8), #scale keys
## (0.0, 0.3, 0.0), #emit box size
## (0, 1, 0), #emit velocity
## 1, #emit dir randomness
## 250, #rotation speed
## 0, #rotation damping
## ),
#*-*-*-**** BLOOD END ****-*-*-*#
#-*-*-*- Fire Fly Deneme *-*-*-*-#
("fire_fly_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_sparks_mesh_1",
2, 5, 1.2, 0, 50, 7, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 0.8), (1, 0.2), #alpha keys
(0.5, .7), (1, 0.7), #red keys
(0.5, 0.8), (1, 0.8), #green keys
(0.5, 1), (1, 1), #blue keys
(0, 0.1), (1, 0.1), #scale keys
(20, 20, 0.5), #emit box size
(0, 0, 0), #emit velocity
5, #emit dir randomness
0, #rotation speed
0 #rotation damping
),
("bug_fly_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_snow_dust_1",
5, 5, 1.2, 0, 50, 20, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.1, 1), (1, 1), #alpha keys
(0, 0), (1, 0), #red keys
(0, 0), (1, 0), #green keys
(0, 0), (1, 0), #blue keys
(0, 0.05), (1, 0.05), #scale keys
(20, 20, 0.5), #emit box size
(0, 0, 0), #emit velocity
5, #emit dir randomness
100, #rotation speed
0.5, #rotation damping
),
#-*-*-*- Fire Fly End*-*-*-*-#
#-*-*-*- Moon Beam *-*-*-*-*-*-*#
("moon_beam_1", psf_billboard_2d|psf_global_emit_dir|psf_always_emit|psf_randomize_size, "prt_mesh_moon_beam",#prt_mesh_moon_beam
2, 4, 1.2, 0, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 1), (1, 0), #alpha keys
(0, 0.4), (1, 0.4), #red keys
(0, 0.5), (1, 0.5), #green keys
(0, 0.6), (1, 0.6), #blue keys
(0, 2), (1, 2.2), #scale keys
(1, 1, 0.2), #emit box size
(0, 0, -2), #emit velocity
0, #emit dir randomness
100, #rotation speed
0.5, #rotation damping
),
("moon_beam_paricle_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size, "prt_sparks_mesh_1",
10, 1.5, 1.5, 0, 10, 10, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 1), (1, 0.0), #alpha keys
(0.5, .5), (1, 0.5), #red keys
(0.5, 0.7), (1, 0.7), #green keys
(0.5, 1), (1, 1), #blue keys
(0, 0.1), (1, 0.1), #scale keys
(1, 1, 4), #emit box size
(0, 0, 0), #emit velocity
0.5, #emit dir randomness
0, #rotation speed
0 #rotation damping
),
#-*-*-*- Moon Beam End *-*-*-*-*-*-*#
#-*-*-*- Stone Smoke *-*-*-*-*-*-*#
##("stone_hit_1", psf_billboard_3d | psf_randomize_size | psf_randomize_rotation, "prt_mesh_dust_1",
## 5000, 0.5, 6, 0.1, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
## (0.1, .2), (1, 0), #alpha keys
## (0.5, 0.7), (1, 0.7), #red keys
## (0.5, 0.6), (1, 0.6), #green keys
## (0.5, 0.6), (1, 0.6), #blue keys
## (0.0, .2), (1, 0.7), #scale keys
## (0, 0.3, 0), #emit box size
## (0, 0, 0), #emit velocity
## 1.1, #emit dir randomness
## 200, #rotation speed
## 0.8, #rotation damping
## ),
#-*-*-*- Stone Smoke END -*-*-*-*-*#
("night_smoke_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_dust_1",
5, 10, 1.5, 0, 50, 2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.3, 0.2), (1, 0), #alpha keys
(0.5, 0.5), (1, 0.5), #red keys
(0.5, 0.5), (1, 0.5), #green keys
(0.5, 0.5), (1, 0.6), #blue keys
(0, 10), (1, 10), #scale keys
(25, 25, 0.5), #emit box size
(0, 1, 0), #emit velocity
2, #emit dir randomness
20, #rotation speed
1 #rotation damping
),
#-*-*-*- Fire For Fireplace -*-*-*-#
("fireplace_fire_small", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
25, 0.8, 0.2, -0.1, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.5), (1, 0), #alpha keys
(0.5, 1.0), (1, 0.9), #red keys
(0.5, 0.7),(1, 0.3), #green keys
(0.5, 0.2), (1, 0.0), #blue keys
(0, 0.2), (1, 0.7), #scale keys
(0.2, 0.1, 0.01), #emit box size
(0, 0, 0.2), #emit velocity
0.1, #emit dir randomness
100, #rotation speed
0.5 #rotation damping
),
("fireplace_fire_big", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
35, 0.6, 0.2, -0.2, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.5), (1, 0), #alpha keys
(0.5, 1.0), (1, 0.9), #red keys
(0.5, 0.7),(1, 0.3), #green keys
(0.5, 0.2), (1, 0.0), #blue keys
(0, 0.4), (1, 1), #scale keys
(0.4, 0.2, 0.01), #emit box size
(0, 0, 0.4), #emit velocity
0.1, #emit dir randomness
100, #rotation speed
0.5 #rotation damping
),
#-*-*-*- Fire For Fireplace -*-*-*-#
#-*-*-*- Village Fire *-*-*-*-#
("village_fire_big", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
50, 1.0, 0, -1.2, 25.0, 10.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.2, 0.7), (1, 0), #alpha keys
(0.2, 1.0), (1, 0.9), #red keys
(0.2, 0.7),(1, 0.3), #green keys
(0.2, 0.2), (1, 0.0), #blue keys
(0, 2), (1, 6), #scale keys
(2.2, 2.2, 0.2), #emit box size
(0, 0, 0.0), #emit velocity
0.0, #emit dir randomness
250, #rotation speed
0.3 #rotation damping
),
("village_fire_smoke_big", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_smoke_1",
30, 2, 0.3, -1, 50.0, 10.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.15), (1, 0), #alpha keys
(0.2, 0.4), (1, 0.2), #red keys
(0.2, 0.4),(1, 0.2), #green keys
(0.2, 0.4), (1, 0.2), #blue keys
(0, 6), (1, 8), #scale keys
(2, 2, 1), #emit box size
(0, 0, 5), #emit velocity
0.0, #emit dir randomness
0, #rotation speed
0.1 #rotation damping
),
("map_village_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
20, 1.0, 0, -0.2, 3.0, 3.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.2, 0.7), (1, 0), #alpha keys
(0.2, 1.0), (1, 0.9), #red keys
(0.2, 0.7),(1, 0.3), #green keys
(0.2, 0.2), (1, 0.0), #blue keys
(0, 0.15), (1, 0.45), #scale keys
(0.2, 0.2, 0.02), #emit box size
(0, 0, 0.0), #emit velocity
0.0, #emit dir randomness
250, #rotation speed
0.3 #rotation damping
),
("map_village_fire_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_smoke_1",
25, 2.5, 0.3, -0.15, 3.0, 3.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.15), (1, 0), #alpha keys
(0.2, 0.4), (1, 0.3), #red keys
(0.2, 0.4),(1, 0.3), #green keys
(0.2, 0.4), (1, 0.3), #blue keys
(0, 0.6), (1, 0.9), #scale keys
(0.2, 0.2, 0.1), #emit box size
(0, 0, 0.03), #emit velocity
0.0, #emit dir randomness
0, #rotation speed
0.1 #rotation damping
),
("map_village_looted_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_smoke_1",
20, 3, 0.3, -0.11, 3.0, 2.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0.15), (1, 0), #alpha keys
(0.2, 0.5), (1, 0.5), #red keys
(0.2, 0.5),(1, 0.5), #green keys
(0.2, 0.5), (1, 0.5), #blue keys
(0, 0.7), (1, 1.3), #scale keys
(0.2, 0.2, 0.1), #emit box size
(0, 0, 0.015), #emit velocity
0.0, #emit dir randomness
0, #rotation speed
0.1 #rotation damping
),
##### Dungeon Water Drops #####
("dungeon_water_drops", psf_billboard_2d|psf_global_emit_dir|psf_always_emit, "prtcl_rain",
1, 1, 0.33, 0.8, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(1.0, 0.2), (1, 0.2), #alpha keys
(1.0, 1.0), (1, 1.0), #red keys
(1.0, 1.0), (1, 1.0), #green keys
(1.0, 1.0), (1, 1.0), #blue keys
(1.0, 0.8), (1.0, 0.8), #scale keys
(0.05, 0.05, 0.5), #emit box size
(0, 0, -5.0), #emit velocity
0.0, #emit dir randomness
0, #rotation speed
0, #rotation damping
),
##### Dungeon Water Drops END #####
###############################
# Form Ranks kit section
#
###command_cursor_minimod_begin###
("fat_arrow", psf_always_emit|psf_billboard_2d|psf_global_emit_dir, "arrow_up_rot",
100, 0.1, 0.0, 0.0, 100.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.0, 0.7), (1.0, 0.7), #alpha keys
(0.0, 0.0), (1.0, 0.0), #red keys
(0.0, 1.0), (1.0, 1.0), #green keys
(0.0, 0.0), (1.0, 0.0), #blue keys
(0, 30), (1.0, 30.0), #scale keys
(0.0, 0.0, 0.0), #emit box size
(0.0, 0.0, 0.0), #emit velocity
0.0, #emit dir randomness
0,
0
),
("fat_arrow_rising", psf_always_emit|psf_billboard_2d|psf_global_emit_dir, "arrow_up_rot",
100, 3, 0.0, 0.0, 0.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.0, 0.7), (1.0, 0.7), #alpha keys
(0.25, 0.0), (1, 1.0), #red keys
(0.0, 1.0),(0.5, 0.0), #green keys
(0.0, 0.0), (1, 0.0), #blue keys
(0, 30), (1.0, 30), #scale keys
(0.0, 0.0, 0.0), #emit box size
(0.0, 0, 3), #emit velocity
0.0, #emit dir randomness
0,
0
),
###command_cursor_minimod)end###
#
# Form Ranks kit section end
###############################
]
| Python |
p_main_party = 0
p_temp_party = 1
p_camp_bandits = 2
p_temp_party_2 = 3
p_temp_casualties = 4
p_temp_casualties_2 = 5
p_temp_casualties_3 = 6
p_temp_wounded = 7
p_temp_killed = 8
p_main_party_backup = 9
p_encountered_party_backup = 10
p_collective_friends_backup = 11
p_player_casualties = 12
p_enemy_casualties = 13
p_ally_casualties = 14
p_collective_enemy = 15
p_collective_ally = 16
p_collective_friends = 17
p_zendar = 18
p_town_1 = 19
p_town_2 = 20
p_town_3 = 21
p_town_4 = 22
p_town_5 = 23
p_town_6 = 24
p_town_7 = 25
p_town_8 = 26
p_town_9 = 27
p_town_10 = 28
p_town_11 = 29
p_town_12 = 30
p_town_13 = 31
p_town_14 = 32
p_town_15 = 33
p_town_16 = 34
p_town_17 = 35
p_town_18 = 36
p_castle_1 = 37
p_castle_2 = 38
p_castle_3 = 39
p_castle_4 = 40
p_castle_5 = 41
p_castle_6 = 42
p_castle_7 = 43
p_castle_8 = 44
p_castle_9 = 45
p_castle_10 = 46
p_castle_11 = 47
p_castle_12 = 48
p_castle_13 = 49
p_castle_14 = 50
p_castle_15 = 51
p_castle_16 = 52
p_castle_17 = 53
p_castle_18 = 54
p_castle_19 = 55
p_castle_20 = 56
p_castle_21 = 57
p_castle_22 = 58
p_castle_23 = 59
p_castle_24 = 60
p_castle_25 = 61
p_castle_26 = 62
p_castle_27 = 63
p_castle_28 = 64
p_castle_29 = 65
p_castle_30 = 66
p_castle_31 = 67
p_castle_32 = 68
p_castle_33 = 69
p_castle_34 = 70
p_castle_35 = 71
p_castle_36 = 72
p_castle_37 = 73
p_castle_38 = 74
p_castle_39 = 75
p_castle_40 = 76
p_village_1 = 77
p_village_2 = 78
p_village_3 = 79
p_village_4 = 80
p_village_5 = 81
p_village_6 = 82
p_village_7 = 83
p_village_8 = 84
p_village_9 = 85
p_village_10 = 86
p_village_11 = 87
p_village_12 = 88
p_village_13 = 89
p_village_14 = 90
p_village_15 = 91
p_village_16 = 92
p_village_17 = 93
p_village_18 = 94
p_village_19 = 95
p_village_20 = 96
p_village_21 = 97
p_village_22 = 98
p_village_23 = 99
p_village_24 = 100
p_village_25 = 101
p_village_26 = 102
p_village_27 = 103
p_village_28 = 104
p_village_29 = 105
p_village_30 = 106
p_village_31 = 107
p_village_32 = 108
p_village_33 = 109
p_village_34 = 110
p_village_35 = 111
p_village_36 = 112
p_village_37 = 113
p_village_38 = 114
p_village_39 = 115
p_village_40 = 116
p_village_41 = 117
p_village_42 = 118
p_village_43 = 119
p_village_44 = 120
p_village_45 = 121
p_village_46 = 122
p_village_47 = 123
p_village_48 = 124
p_village_49 = 125
p_village_50 = 126
p_village_51 = 127
p_village_52 = 128
p_village_53 = 129
p_village_54 = 130
p_village_55 = 131
p_village_56 = 132
p_village_57 = 133
p_village_58 = 134
p_village_59 = 135
p_village_60 = 136
p_village_61 = 137
p_village_62 = 138
p_village_63 = 139
p_village_64 = 140
p_village_65 = 141
p_village_66 = 142
p_village_67 = 143
p_village_68 = 144
p_village_69 = 145
p_village_70 = 146
p_village_71 = 147
p_village_72 = 148
p_village_73 = 149
p_village_74 = 150
p_village_75 = 151
p_village_76 = 152
p_village_77 = 153
p_village_78 = 154
p_village_79 = 155
p_village_80 = 156
p_village_81 = 157
p_village_82 = 158
p_village_83 = 159
p_village_84 = 160
p_village_85 = 161
p_village_86 = 162
p_village_87 = 163
p_village_88 = 164
p_village_89 = 165
p_village_90 = 166
p_salt_mine = 167
p_four_ways_inn = 168
p_test_scene = 169
p_battlefields = 170
p_dhorak_keep = 171
p_training_ground = 172
p_training_ground_1 = 173
p_training_ground_2 = 174
p_training_ground_3 = 175
p_training_ground_4 = 176
p_training_ground_5 = 177
p_bridge_1 = 178
p_bridge_2 = 179
p_bridge_3 = 180
p_bridge_4 = 181
p_bridge_5 = 182
p_bridge_6 = 183
p_bridge_7 = 184
p_bridge_8 = 185
p_bridge_9 = 186
p_bridge_10 = 187
p_bridge_11 = 188
p_bridge_12 = 189
p_bridge_13 = 190
p_bridge_14 = 191
p_bridge_15 = 192
p_looter_spawn_point = 193
p_steppe_bandit_spawn_point = 194
p_forest_bandit_spawn_point = 195
p_mountain_bandit_spawn_point = 196
p_sea_raider_spawn_point_1 = 197
p_sea_raider_spawn_point_2 = 198
p_spawn_points_end = 199
| Python |
from header_meshes import *
####################################################################################################################
# Each mesh record contains the following fields:
# 1) Mesh id: used for referencing meshes in other files. The prefix mesh_ is automatically added before each mesh id.
# 2) Mesh flags. See header_meshes.py for a list of available flags
# 3) Mesh resource name: Resource name of the mesh
# 4) Mesh translation on x axis: Will be done automatically when the mesh is loaded
# 5) Mesh translation on y axis: Will be done automatically when the mesh is loaded
# 6) Mesh translation on z axis: Will be done automatically when the mesh is loaded
# 7) Mesh rotation angle over x axis: Will be done automatically when the mesh is loaded
# 8) Mesh rotation angle over y axis: Will be done automatically when the mesh is loaded
# 9) Mesh rotation angle over z axis: Will be done automatically when the mesh is loaded
# 10) Mesh x scale: Will be done automatically when the mesh is loaded
# 11) Mesh y scale: Will be done automatically when the mesh is loaded
# 12) Mesh z scale: Will be done automatically when the mesh is loaded
####################################################################################################################
meshes = [
("pic_bandits", 0, "pic_bandits", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_mb_warrior_1", 0, "pic_mb_warrior_1", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_messenger", 0, "pic_messenger", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_prisoner_man", 0, "pic_prisoner_man", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_prisoner_fem", 0, "pic_prisoner_fem", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_prisoner_wilderness", 0, "pic_prisoner_wilderness", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_siege_sighted", 0, "pic_siege_sighted", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_siege_sighted_fem", 0, "pic_siege_sighted_fem", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_camp", 0, "pic_camp", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_payment", 0, "pic_payment", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_escape_1", 0, "pic_escape_1", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_escape_1_fem", 0, "pic_escape_1_fem", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_victory", 0, "pic_victory", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_defeat", 0, "pic_defeat", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_wounded", 0, "pic_wounded", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_wounded_fem", 0, "pic_wounded_fem", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_steppe_bandits", 0, "pic_steppe_bandits", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_mountain_bandits", 0, "pic_mountain_bandits", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_sea_raiders", 0, "pic_sea_raiders", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_deserters", 0, "pic_deserters", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_forest_bandits", 0, "pic_forest_bandits", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_cattle", 0, "pic_cattle", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_looted_village", 0, "pic_looted_village", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_village_p", 0, "pic_village_p", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_village_s", 0, "pic_village_s", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_village_w", 0, "pic_village_w", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_recruits", 0, "pic_recruits", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_arms_swadian", 0, "pic_arms_swadian", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_arms_vaegir", 0, "pic_arms_vaegir", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_arms_khergit", 0, "pic_arms_khergit", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_arms_nord", 0, "pic_arms_nord", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("pic_arms_rhodok", 0, "pic_arms_rhodok", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("portrait_blend_out", 0, "portrait_blend_out", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("load_window", 0, "load_window", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("checkbox_off", render_order_plus_1, "checkbox_off", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("checkbox_on", render_order_plus_1, "checkbox_on", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("white_plane", 0, "white_plane", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("white_dot", 0, "white_dot", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("player_dot", 0, "player_dot", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("flag_infantry", 0, "flag_infantry", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("flag_archers", 0, "flag_archers", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("flag_cavalry", 0, "flag_cavalry", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("color_picker", 0, "color_picker", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("custom_map_banner_01", 0, "custom_map_banner_01", 0, 0, 0, -90, 0, 90, 1, 1, 1),
("custom_map_banner_02", 0, "custom_map_banner_02", 0, 0, 0, -90, 0, 90, 1, 1, 1),
("custom_map_banner_03", 0, "custom_map_banner_03", 0, 0, 0, -90, 0, 90, 1, 1, 1),
("custom_banner_01", 0, "custom_banner_01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("custom_banner_02", 0, "custom_banner_02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("custom_banner_bg", 0, "custom_banner_bg", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg01", 0, "custom_banner_fg01", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg02", 0, "custom_banner_fg02", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg03", 0, "custom_banner_fg03", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg04", 0, "custom_banner_fg04", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg05", 0, "custom_banner_fg05", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg06", 0, "custom_banner_fg06", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg07", 0, "custom_banner_fg07", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg08", 0, "custom_banner_fg08", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg09", 0, "custom_banner_fg09", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg10", 0, "custom_banner_fg10", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg11", 0, "custom_banner_fg11", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg12", 0, "custom_banner_fg12", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg13", 0, "custom_banner_fg13", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg14", 0, "custom_banner_fg14", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg15", 0, "custom_banner_fg15", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg16", 0, "custom_banner_fg16", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg17", 0, "custom_banner_fg17", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg18", 0, "custom_banner_fg18", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg19", 0, "custom_banner_fg19", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg20", 0, "custom_banner_fg20", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg21", 0, "custom_banner_fg21", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg22", 0, "custom_banner_fg22", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_fg23", 0, "custom_banner_fg23", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_01", 0, "custom_banner_charge_01", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_02", 0, "custom_banner_charge_02", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_03", 0, "custom_banner_charge_03", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_04", 0, "custom_banner_charge_04", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_05", 0, "custom_banner_charge_05", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_06", 0, "custom_banner_charge_06", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_07", 0, "custom_banner_charge_07", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_08", 0, "custom_banner_charge_08", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_09", 0, "custom_banner_charge_09", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_10", 0, "custom_banner_charge_10", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_11", 0, "custom_banner_charge_11", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_12", 0, "custom_banner_charge_12", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_13", 0, "custom_banner_charge_13", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_14", 0, "custom_banner_charge_14", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_15", 0, "custom_banner_charge_15", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_16", 0, "custom_banner_charge_16", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_17", 0, "custom_banner_charge_17", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_18", 0, "custom_banner_charge_18", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_19", 0, "custom_banner_charge_19", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_20", 0, "custom_banner_charge_20", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_21", 0, "custom_banner_charge_21", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_22", 0, "custom_banner_charge_22", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_23", 0, "custom_banner_charge_23", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_24", 0, "custom_banner_charge_24", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_25", 0, "custom_banner_charge_25", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_26", 0, "custom_banner_charge_26", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_27", 0, "custom_banner_charge_27", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_28", 0, "custom_banner_charge_28", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_29", 0, "custom_banner_charge_29", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_30", 0, "custom_banner_charge_30", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_31", 0, "custom_banner_charge_31", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_32", 0, "custom_banner_charge_32", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_33", 0, "custom_banner_charge_33", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_34", 0, "custom_banner_charge_34", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_35", 0, "custom_banner_charge_35", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_36", 0, "custom_banner_charge_36", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_37", 0, "custom_banner_charge_37", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_38", 0, "custom_banner_charge_38", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_39", 0, "custom_banner_charge_39", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_40", 0, "custom_banner_charge_40", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_41", 0, "custom_banner_charge_41", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_42", 0, "custom_banner_charge_42", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_43", 0, "custom_banner_charge_43", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_44", 0, "custom_banner_charge_44", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_45", 0, "custom_banner_charge_45", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("custom_banner_charge_46", 0, "custom_banner_charge_46", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_custom_banner", 0, "tableau_mesh_custom_banner", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_custom_banner_square", 0, "tableau_mesh_custom_banner_square", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_custom_banner_tall", 0, "tableau_mesh_custom_banner_tall", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_custom_banner_short", 0, "tableau_mesh_custom_banner_short", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_round_1", 0, "tableau_mesh_shield_round_1", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_round_2", 0, "tableau_mesh_shield_round_2", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_round_3", 0, "tableau_mesh_shield_round_3", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_round_4", 0, "tableau_mesh_shield_round_4", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_round_5", 0, "tableau_mesh_shield_round_5", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_small_round_1", 0, "tableau_mesh_shield_small_round_1", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_small_round_2", 0, "tableau_mesh_shield_small_round_2", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_small_round_3", 0, "tableau_mesh_shield_small_round_3", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_kite_1", 0, "tableau_mesh_shield_kite_1", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_kite_2", 0, "tableau_mesh_shield_kite_2", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_kite_3", 0, "tableau_mesh_shield_kite_3", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_kite_4", 0, "tableau_mesh_shield_kite_4", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_heater_1", 0, "tableau_mesh_shield_heater_1", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_heater_2", 0, "tableau_mesh_shield_heater_2", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_pavise_1", 0, "tableau_mesh_shield_pavise_1", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_shield_pavise_2", 0, "tableau_mesh_shield_pavise_2", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("heraldic_armor_bg", 0, "heraldic_armor_bg", 0, 0, 0, 0, 0, 0, 10, 10, 10),
("tableau_mesh_heraldic_armor_a", 0, "tableau_mesh_heraldic_armor_a", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("tableau_mesh_heraldic_armor_b", 0, "tableau_mesh_heraldic_armor_b", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("tableau_mesh_heraldic_armor_c", 0, "tableau_mesh_heraldic_armor_c", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("tableau_mesh_heraldic_armor_d", 0, "tableau_mesh_heraldic_armor_d", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("outer_terrain_plain_1", 0, "ter_border_a", -90, 0, 0, 0, 0, 0, 1, 1, 1),
("banner_a01", 0, "banner_a01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a02", 0, "banner_a02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a03", 0, "banner_a03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a04", 0, "banner_a04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a05", 0, "banner_a05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a06", 0, "banner_a06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a07", 0, "banner_a07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a08", 0, "banner_a08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a09", 0, "banner_a09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a10", 0, "banner_a10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a11", 0, "banner_a11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a12", 0, "banner_a12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a13", 0, "banner_a13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a14", 0, "banner_a14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a15", 0, "banner_f21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a16", 0, "banner_a16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a17", 0, "banner_a17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a18", 0, "banner_a18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a19", 0, "banner_a19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a20", 0, "banner_a20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_a21", 0, "banner_a21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b01", 0, "banner_b01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b02", 0, "banner_b02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b03", 0, "banner_b03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b04", 0, "banner_b04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b05", 0, "banner_b05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b06", 0, "banner_b06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b07", 0, "banner_b07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b08", 0, "banner_b08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b09", 0, "banner_b09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b10", 0, "banner_b10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b11", 0, "banner_b11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b12", 0, "banner_b12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b13", 0, "banner_b13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b14", 0, "banner_b14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b15", 0, "banner_b15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b16", 0, "banner_b16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b17", 0, "banner_b17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b18", 0, "banner_b18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b19", 0, "banner_b19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b20", 0, "banner_b20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_b21", 0, "banner_b21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c01", 0, "banner_c01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c02", 0, "banner_c02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c03", 0, "banner_c03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c04", 0, "banner_c04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c05", 0, "banner_c05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c06", 0, "banner_c06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c07", 0, "banner_c07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c08", 0, "banner_c08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c09", 0, "banner_c09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c10", 0, "banner_c10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c11", 0, "banner_c11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c12", 0, "banner_c12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c13", 0, "banner_c13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c14", 0, "banner_c14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c15", 0, "banner_c15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c16", 0, "banner_c16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c17", 0, "banner_c17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c18", 0, "banner_c18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c19", 0, "banner_c19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c20", 0, "banner_c20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_c21", 0, "banner_c21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d01", 0, "banner_d01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d02", 0, "banner_d02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d03", 0, "banner_d03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d04", 0, "banner_d04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d05", 0, "banner_d05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d06", 0, "banner_d06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d07", 0, "banner_d07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d08", 0, "banner_d08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d09", 0, "banner_d09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d10", 0, "banner_d10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d11", 0, "banner_d11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d12", 0, "banner_d12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d13", 0, "banner_d13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d14", 0, "banner_d14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d15", 0, "banner_d15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d16", 0, "banner_d16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d17", 0, "banner_d17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d18", 0, "banner_d18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d19", 0, "banner_d19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d20", 0, "banner_d20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_d21", 0, "banner_d21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e01", 0, "banner_e01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e02", 0, "banner_e02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e03", 0, "banner_e03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e04", 0, "banner_e04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e05", 0, "banner_e05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e06", 0, "banner_e06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e07", 0, "banner_e07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e08", 0, "banner_e08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e09", 0, "banner_e09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e10", 0, "banner_e10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e11", 0, "banner_e11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e12", 0, "banner_e12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e13", 0, "banner_e13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e14", 0, "banner_e14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e15", 0, "banner_e15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e16", 0, "banner_e16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e17", 0, "banner_e17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e18", 0, "banner_e18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e19", 0, "banner_e19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e20", 0, "banner_e20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_e21", 0, "banner_e21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f01", 0, "banner_f01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f02", 0, "banner_f02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f03", 0, "banner_f03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f04", 0, "banner_f04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f05", 0, "banner_f05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f06", 0, "banner_f06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f07", 0, "banner_f07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f08", 0, "banner_f08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f09", 0, "banner_f09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f10", 0, "banner_f10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f11", 0, "banner_f11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f12", 0, "banner_f12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f13", 0, "banner_f13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f14", 0, "banner_f14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f15", 0, "banner_f15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f16", 0, "banner_f16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f17", 0, "banner_f17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f18", 0, "banner_f18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f19", 0, "banner_f19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f20", 0, "banner_f20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banner_f21", 0, "banner_a15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a01", 0, "arms_a01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a02", 0, "arms_a02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a03", 0, "arms_a03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a04", 0, "arms_a04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a05", 0, "banner_a05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a06", 0, "arms_a06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a07", 0, "banner_a07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a08", 0, "arms_a08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a09", 0, "banner_a09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a10", 0, "banner_a10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a11", 0, "banner_a11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a12", 0, "arms_a12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a13", 0, "arms_a13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a14", 0, "banner_a14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a15", 0, "banner_f21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a16", 0, "arms_a16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a17", 0, "arms_a17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a18", 0, "arms_a18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a19", 0, "arms_a19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a20", 0, "arms_a20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_a21", 0, "arms_a21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b01", 0, "arms_b01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b02", 0, "arms_b02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b03", 0, "banner_b03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b04", 0, "banner_b04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b05", 0, "arms_b05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b06", 0, "arms_b06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b07", 0, "arms_b07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b08", 0, "arms_b08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b09", 0, "arms_b09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b10", 0, "arms_b10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b11", 0, "banner_b11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b12", 0, "banner_b12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b13", 0, "banner_b13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b14", 0, "arms_b14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b15", 0, "arms_b15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b16", 0, "arms_b16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b17", 0, "banner_b17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b18", 0, "arms_b18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b19", 0, "banner_b19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b20", 0, "arms_b20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_b21", 0, "banner_b21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c01", 0, "arms_c01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c02", 0, "banner_c02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c03", 0, "banner_c03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c04", 0, "arms_c04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c05", 0, "banner_c05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c06", 0, "arms_c06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c07", 0, "arms_c07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c08", 0, "banner_c08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c09", 0, "banner_c09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c10", 0, "arms_c10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c11", 0, "banner_c11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c12", 0, "arms_c12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c13", 0, "arms_c13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c14", 0, "arms_c14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c15", 0, "banner_c15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c16", 0, "arms_c16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c17", 0, "banner_c17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c18", 0, "banner_c18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c19", 0, "arms_c19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c20", 0, "banner_c20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_c21", 0, "banner_c21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d01", 0, "banner_d01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d02", 0, "arms_d02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d03", 0, "arms_d03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d04", 0, "arms_d04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d05", 0, "banner_d05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d06", 0, "arms_d06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d07", 0, "arms_d07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d08", 0, "arms_d08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d09", 0, "arms_d09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d10", 0, "banner_d10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d11", 0, "arms_d11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d12", 0, "arms_d12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d13", 0, "arms_d13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d14", 0, "arms_d14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d15", 0, "arms_d15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d16", 0, "arms_d16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d17", 0, "arms_d17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d18", 0, "arms_d18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d19", 0, "arms_d19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d20", 0, "arms_d20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_d21", 0, "arms_d21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e01", 0, "banner_e01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e02", 0, "arms_e02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e03", 0, "banner_e03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e04", 0, "banner_e04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e05", 0, "banner_e05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e06", 0, "banner_e06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e07", 0, "banner_e07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e08", 0, "banner_e08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e09", 0, "banner_e09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e10", 0, "banner_e10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e11", 0, "banner_e11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e12", 0, "banner_e12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e13", 0, "banner_e13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e14", 0, "banner_e14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e15", 0, "banner_e15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e16", 0, "banner_e16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e17", 0, "banner_e17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e18", 0, "banner_e18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e19", 0, "banner_e19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e20", 0, "banner_e20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_e21", 0, "banner_e21", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f01", 0, "banner_f01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f02", 0, "banner_f02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f03", 0, "banner_f03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f04", 0, "banner_f04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f05", 0, "banner_f05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f06", 0, "banner_f06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f07", 0, "banner_f07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f08", 0, "banner_f08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f09", 0, "banner_f09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f10", 0, "banner_f10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f11", 0, "banner_f11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f12", 0, "banner_f12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f13", 0, "banner_f13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f14", 0, "banner_f14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f15", 0, "banner_f15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f16", 0, "banner_f16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f17", 0, "banner_f17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f18", 0, "banner_f18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f19", 0, "banner_f19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f20", 0, "banner_f20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("arms_f21", 0, "banner_a15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banners_default_a", 0, "banners_default_a", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banners_default_b", 0, "banners_default_b", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banners_default_c", 0, "banners_default_c", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banners_default_d", 0, "banners_default_d", 0, 0, 0, -90, 0, 0, 1, 1, 1),
("banners_default_e", 0, "banners_default_e", 0, 0, 0, -90, 0, 0, 1, 1, 1),
]
| Python |
from module_info import *
from module_simple_triggers import *
from process_common import *
from process_operations import *
def save_simple_triggers(variable_list,variable_uses,triggers,tag_uses,quick_strings):
file = open(export_dir + "simple_triggers.txt","w")
file.write("simple_triggers_file version 1\n")
file.write("%d\n"%len(simple_triggers))
for i in xrange(len(simple_triggers)):
simple_trigger = simple_triggers[i]
file.write("%f "%(simple_trigger[0]))
save_statement_block(file,0, 1, simple_trigger[1] , variable_list,variable_uses,tag_uses,quick_strings)
file.write("\n")
file.close()
print "exporting simple triggers..."
variable_uses = []
variables = load_variables(export_dir,variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_simple_triggers(variables,variable_uses,simple_triggers,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir,tag_uses)
save_quick_strings(export_dir,quick_strings)
#print "finished."
| Python |
import string
import types
from process_common import *
from header_common import *
from header_operations import *
from module_strings import *
from module_skills import *
from module_music import *
from module_meshes import *
from module_sounds import *
from module_items import *
from module_troops import *
from module_factions import *
from module_quests import *
from module_party_templates import *
from module_parties import *
from module_scenes import *
from module_scripts import *
from module_mission_templates import *
from module_game_menus import *
from module_particle_systems import *
from module_scene_props import *
from module_scene_props import *
from module_presentations import *
from module_map_icons import *
from module_tableau_materials import *
from module_animations import *
def get_id_value(tag, identifier, tag_uses):
tag_type = -1
id_no = -1
if (tag == "str"):
id_no = find_object(strings,identifier)
tag_type = tag_string
elif (tag == "itm"):
id_no = find_object(items,identifier)
tag_type = tag_item
elif (tag == "trp"):
id_no = find_object(troops,identifier)
tag_type = tag_troop
elif (tag == "fac"):
id_no = find_object(factions,identifier)
tag_type = tag_faction
elif (tag == "qst"):
id_no = find_object(quests,identifier)
tag_type = tag_quest
elif (tag == "pt"):
id_no = find_object(party_templates,identifier)
tag_type = tag_party_tpl
elif (tag == "p"):
id_no = find_object(parties,identifier)
tag_type = tag_party
elif (tag == "scn"):
id_no = find_object(scenes,identifier)
tag_type = tag_scene
elif (tag == "mt"):
id_no = find_object(mission_templates,identifier)
tag_type = tag_mission_tpl
elif (tag == "mnu"):
id_no = find_object(game_menus,identifier)
tag_type = tag_menu
elif (tag == "script"):
id_no = find_object(scripts,identifier)
tag_type = tag_script
elif (tag == "psys"):
id_no = find_object(particle_systems,identifier)
tag_type = tag_particle_sys
elif (tag == "spr"):
id_no = find_object(scene_props,identifier)
tag_type = tag_scene_prop
elif (tag == "prsnt"):
id_no = find_object(presentations,identifier)
tag_type = tag_presentation
elif (tag == "snd"):
id_no = find_object(sounds,identifier)
tag_type = tag_sound
elif (tag == "icon"):
id_no = find_object(map_icons,identifier)
tag_type = tag_map_icon
elif (tag == "skl"):
id_no = find_object(skills,identifier)
tag_type = tag_skill
elif (tag == "track"):
id_no = find_object(tracks,identifier)
tag_type = tag_track
elif (tag == "mesh"):
id_no = find_object(meshes,identifier)
tag_type = tag_mesh
elif (tag == "anim"):
id_no = find_object(animations,identifier)
tag_type = tag_animation
elif (tag == "tableau"):
id_no = find_object(tableaus,identifier)
tag_type = tag_tableau
if (tag_type > -1 and id_no > -1):
add_tag_use(tag_uses,tag_type,id_no)
return (tag_type, id_no)
def get_identifier_value(str, tag_uses):
underscore_pos = string.find(str, "_")
result = -1
if (underscore_pos > 0):
tag_str = str[0:underscore_pos]
id_str = str[underscore_pos + 1:len(str)]
(tag_type, id_no) = get_id_value(tag_str,id_str,tag_uses)
if (tag_type > 0):
if (id_no < 0):
print "Error: Unable to find object:" + str
else:
result = id_no | (tag_type << op_num_value_bits)
else:
print "Error: Unrecognized tag:" +tag_str + "in object:" + str
else:
print "Error: Invalid object:" +str + ".Variables should start with $ sign and references should start with a tag"
return result
def load_quick_strings(export_dir):
quick_strings = []
try:
file = open(export_dir + "quick_strings.txt", "r")
str_list = file.readlines()
file.close()
for s in str_list:
s = string.strip(s)
if s:
ssplit = s.split(' ')
if len(ssplit) == 2:
quick_strings.append(ssplit)
except:
print "Creating new quick_strings.txt file..."
return quick_strings
def save_quick_strings(export_dir, quick_strings):
file = open(export_dir + "quick_strings.txt", "w")
file.write("%d\n"%len(quick_strings))
for i in xrange(len(quick_strings)):
file.write("%s %s\n"%(quick_strings[i][0],replace_spaces(quick_strings[i][1])))
file.close()
def load_variables(export_dir,variable_uses):
variables = []
try:
file = open(export_dir + "variables.txt","r")
var_list = file.readlines()
file.close()
for v in var_list:
vv = string.strip(v)
if vv:
variables.append(vv)
except:
print "variables.txt not found. Creating new variables.txt file"
try:
file = open(export_dir + "variable_uses.txt","r")
var_list = file.readlines()
file.close()
for v in var_list:
vv = string.strip(v)
if vv:
variable_uses.append(int(vv))
except:
print "variable_uses.txt not found. Creating new variable_uses.txt file"
return variables
def save_variables(export_dir,variables_list,variable_uses,):
file = open(export_dir + "variables.txt","w")
for i in xrange(len(variables_list)):
file.write("%s\n"%variables_list[i])
file.close()
file = open(export_dir + "variable_uses.txt","w")
for i in xrange(len(variables_list)):
file.write("%d\n"%variable_uses[i])
file.close()
def ensure_tag_use(tag_uses, tag_no, object_no):
if len(tag_uses[tag_no]) <= object_no:
num_to_add = object_no + 1 - len(tag_uses[tag_no])
for j in xrange(num_to_add):
tag_uses[tag_no].append(0)
def add_tag_use(tag_uses, tag_no, object_no):
#TODO: Uncomment to make build_module_check_tags work
# ensure_tag_use(tag_uses, tag_no, object_no)
# tag_uses[tag_no][object_no] = tag_uses[tag_no][object_no] + 1
pass
def load_tag_uses(export_dir):
tag_uses = []
for i in xrange(tags_end):
sub_tag_uses = []
tag_uses.append(sub_tag_uses)
try:
file = open(export_dir + "tag_uses.txt","r")
var_list = file.readlines()
file.close()
for v in var_list:
vv = string.strip(v).split(';')
if vv:
for v2 in vv:
vvv = v2.split(' ')
if len(vvv) >= 3:
ensure_tag_use(tag_uses,int(vvv[0]),int(vvv[1]))
tag_uses[int(vvv[0])][int(vvv[1])] = int(vvv[2])
except:
print "Creating new tag_uses.txt file..."
return tag_uses
def save_tag_uses(export_dir,tag_uses):
file = open(export_dir + "tag_uses.txt","w")
for i in xrange(len(tag_uses)):
for j in xrange(len(tag_uses[i])):
file.write("%d %d %d;" % (i, j, tag_uses[i][j]))
file.write("\n")
file.close()
def add_cookie(cookies_list,cookie_string):
found = 0
result = -1
for i_t in xrange(len(cookies_list)):
if cookie_string == cookies_list[i_t]:
found = 1
result = i_t
break
if not found:
cookies_list.append(cookie_string)
result = len(cookies_list) - 1
return result
def get_cookie(cookies_list,cookie_string):
found = 0
result = -1
for i_t in xrange(len(cookies_list)):
if cookie_string == cookies_list[i_t]:
found = 1
result = i_t
break
if not found:
print "ERROR: input token not found:" + cookie_string
cookies_list.append(cookie_string)
result = len(cookies_list) - 1
return result
def check_varible_not_defined(variable_string,variables_list):
for i_t in xrange(len(variables_list)):
if variable_string == variables_list[i_t]:
print "WARNING: Variable name used for both local and global contexts:" + variable_string
break
#def add_get_variable(variable_string,variables_list):
# found = 0
# result = -1
# for i_t in xrange(len(variables_list)):
# if variable_string == variables_list[i_t]:
# found = 1
# result = i_t
# break
# if not found:
# variables_list.append(variable_string)
# result = len(variables_list) - 1
# return result
def add_variable(variable_string,variables_list,variable_uses):
found = 0
for i_t in xrange(len(variables_list)):
if variable_string == variables_list[i_t]:
found = 1
variable_uses[i_t] = variable_uses[i_t] - 1
break
if not found:
variables_list.append(variable_string)
variable_uses.append(-1)
# print " (assign, \"$"+variable_string+"\", %d),"%(len(variables_list))
def get_variable(variable_string,variables_list,variable_uses):
found = 0
result = -1
var_string = variable_string[1:]
for i_t in xrange(len(variables_list)):
if var_string == variables_list[i_t]:
found = 1
result = i_t
variable_uses[result] = variable_uses[result] + 1
break
if not found:
if (variable_string[0] == '$'):
variables_list.append(variable_string)
variable_uses.append(0)
result = len(variables_list) - 1
print "WARNING: Usage of unassigned global variable: " + variable_string
else:
print "ERROR: Usage of unassigned local variable: " + variable_string
return result
def is_lhs_operation(op_code):
found = 0
if op_code in lhs_operations:
return 1
return 0
def is_lhs_operation_for_global_vars(op_code):
found = 0
if op_code in lhs_operations:
return 1
if op_code in global_lhs_operations:
return 1
return 0
def is_can_fail_operation(op_code):
found = 0
if op_code in can_fail_operations:
return 1
return 0
def search_quick_string_keys(key, quick_strings):
index = -1
for i in xrange(len(quick_strings)):
if quick_strings[i][0] == key:
index = i
return index
def insert_quick_string_with_auto_id(sentence,quick_strings):
index = 0
text = convert_to_identifier_with_no_lowercase(sentence)
sentence = replace_spaces(sentence)
done = 0
i = 20
lt = len(text)
if (i > lt):
i = lt
auto_id = "qstr_" + text[0:i]
done = 0
index = search_quick_string_keys(auto_id, quick_strings)
if index >= 0 and (quick_strings[index][1] == sentence):
done = 1
while (i <= lt) and not done:
auto_id = "qstr_" + text[0:i]
index = search_quick_string_keys(auto_id, quick_strings)
if index >= 0:
if quick_strings[index][1] == sentence:
done = 1
else:
i += 1
else:
done = 1
index = len(quick_strings)
quick_strings.append([auto_id, sentence])
if not done:
number = 1
new_auto_id = auto_id + str(number)
while quick_strings.has_key(new_auto_id):
number += 1
new_auto_id = auto_id + str(number)
auto_id = new_auto_id
index = len(quick_strings)
quick_strings.append([auto_id, sentence])
return index
def process_param(param,global_vars_list,global_var_uses, local_vars_list, local_var_uses, tag_uses, quick_strings):
result = 0
if (type(param) == types.StringType):
if (param[0] == '$'):
check_varible_not_defined(param[1:], local_vars_list)
result = get_variable(param, global_vars_list,global_var_uses)
result |= opmask_variable
elif (param[0] == ':'):
check_varible_not_defined(param[1:], global_vars_list)
result = get_variable(param, local_vars_list,local_var_uses)
result |= opmask_local_variable
elif (param[0] == '@'):
result = insert_quick_string_with_auto_id(param[1:], quick_strings)
result |= opmask_quick_string
else:
result = get_identifier_value(param.lower(), tag_uses)
if (result < 0):
print "ERROR: Illegal Identifier:" + param
else:
result = param
return result
def save_statement(ofile,opcode,no_variables,statement,variable_list,variable_uses,local_vars_list,local_var_uses,tag_uses,quick_strings):
if no_variables == 0:
lenstatement = len(statement) - 1
if (is_lhs_operation(opcode) == 1):
if (lenstatement > 0):
param = statement[1]
if (type(param) == types.StringType):
if (param[0] == ':'):
add_variable(param[1:], local_vars_list, local_var_uses)
else:
lenstatement = 0
ofile.write("%d %d "%(opcode, lenstatement))
for i in xrange(lenstatement):
operand = process_param(statement[i + 1],variable_list,variable_uses,local_vars_list,local_var_uses,tag_uses,quick_strings)
ofile.write("%d "%operand)
def compile_global_vars_in_statement(statement,variable_list, variable_uses):
opcode = 0
if ((type(statement) != types.ListType) and (type(statement) != types.TupleType)):
opcode = statement
else:
opcode = statement[0]
if (is_lhs_operation_for_global_vars(opcode) == 1):
if (len(statement) > 1):
param = statement[1]
if (type(param) == types.StringType):
if (statement[1][0] == '$'):
add_variable(statement[1][1:], variable_list, variable_uses)
def save_statement_block(ofile,statement_name,can_fail_statement,statement_block,variable_list, variable_uses,tag_uses,quick_strings):
local_vars = []
local_var_uses = []
ofile.write(" %d "%(len(statement_block)))
store_script_param_1_uses = 0
store_script_param_2_uses = 0
current_depth = 0
can_fail = 0
for i in xrange(len(statement_block)):
statement = statement_block[i]
if ((type(statement) != types.ListType) and (type(statement) != types.TupleType)):
opcode = statement
no_variables = 1
else:
opcode = statement[0]
no_variables = 0
if (opcode in [try_begin,
try_for_range,
try_for_range_backwards,
try_for_parties,
try_for_agents]):
current_depth = current_depth + 1
elif (opcode == try_end):
current_depth = current_depth - 1
elif (opcode == store_script_param_1 or (opcode == store_script_param and statement[2] == 1)):
store_script_param_1_uses = store_script_param_1_uses + 1
elif (opcode == store_script_param_2 or (opcode == store_script_param and statement[2] == 2)):
store_script_param_2_uses = store_script_param_2_uses + 1
elif (can_fail_statement == 0 and current_depth == 0
and (is_can_fail_operation(opcode)
or ((opcode == call_script) and (statement[1].startswith("cf_", 7))))
and (not statement_name.startswith("cf_"))):
print "WARNING: Script can fail at operation #" + str(i) + ". Use cf_ at the beginning of its name: " + statement_name
save_statement(ofile,opcode,no_variables,statement,variable_list,variable_uses,local_vars, local_var_uses,tag_uses,quick_strings)
if (store_script_param_1_uses > 1):
print "WARNING: store_script_param_1 is used more than once:" + statement_name
if (store_script_param_2_uses > 1):
print "WARNING: store_script_param_2 is used more than once:" + statement_name
i = 0
while (i < len(local_vars)):
if (local_var_uses[i] == 0 and not(local_vars[i].startswith("unused"))):
print "WARNING: Local variable never used: " + local_vars[i]
i = i + 1
def compile_global_vars(statement_block,variable_list, variable_uses):
for statement in statement_block:
compile_global_vars_in_statement(statement, variable_list, variable_uses)
def save_simple_triggers(ofile,triggers,variable_list, variable_uses,tag_uses,quick_strings):
ofile.write("%d\n"%len(triggers))
for trigger in triggers:
ofile.write("%f "%(trigger[0]))
save_statement_block(ofile,0,1,trigger[1] , variable_list, variable_uses,tag_uses,quick_strings)
ofile.write("\n")
ofile.write("\n")
| Python |
skl_trade = 0
skl_leadership = 1
skl_prisoner_management = 2
skl_reserved_1 = 3
skl_reserved_2 = 4
skl_reserved_3 = 5
skl_reserved_4 = 6
skl_persuasion = 7
skl_engineer = 8
skl_first_aid = 9
skl_surgery = 10
skl_wound_treatment = 11
skl_inventory_management = 12
skl_spotting = 13
skl_pathfinding = 14
skl_tactics = 15
skl_tracking = 16
skl_trainer = 17
skl_reserved_5 = 18
skl_reserved_6 = 19
skl_reserved_7 = 20
skl_reserved_8 = 21
skl_looting = 22
skl_horse_archery = 23
skl_riding = 24
skl_athletics = 25
skl_shield = 26
skl_weapon_master = 27
skl_reserved_9 = 28
skl_reserved_10 = 29
skl_reserved_11 = 30
skl_reserved_12 = 31
skl_reserved_13 = 32
skl_power_draw = 33
skl_power_throw = 34
skl_power_strike = 35
skl_ironflesh = 36
skl_reserved_14 = 37
skl_reserved_15 = 38
skl_reserved_16 = 39
skl_reserved_17 = 40
skl_reserved_18 = 41
| Python |
from header_common import *
from header_operations import *
from header_triggers import *
from header_scenes import *
from module_constants import *
####################################################################################################################
# Each scene record contains the following fields:
# 1) Scene id {string}: used for referencing scenes in other files. The prefix scn_ is automatically added before each scene-id.
# 2) Scene flags {int}. See header_scenes.py for a list of available flags
# 3) Mesh name {string}: This is used for indoor scenes only. Use the keyword "none" for outdoor scenes.
# 4) Body name {string}: This is used for indoor scenes only. Use the keyword "none" for outdoor scenes.
# 5) Min-pos {(float,float)}: minimum (x,y) coordinate. Player can't move beyond this limit.
# 6) Max-pos {(float,float)}: maximum (x,y) coordinate. Player can't move beyond this limit.
# 7) Water-level {float}.
# 8) Terrain code {string}: You can obtain the terrain code by copying it from the terrain generator screen
# 9) List of other scenes accessible from this scene {list of strings}.
# (deprecated. This will probably be removed in future versions of the module system)
# (In the new system passages are used to travel between scenes and
# the passage's variation-no is used to select the game menu item that the passage leads to.)
# 10) List of chest-troops used in this scene {list of strings}. You can access chests by placing them in edit mode.
# The chest's variation-no is used with this list for selecting which troop's inventory it will access.
# town_1 Sargoth #plain
# town_2 Tihr #steppe
# town_3 Veluca #steppe
# town_4 Suno #plain
# town_5 Jelkala #plain
# town_6 Praven #plain
# town_7 Uxkhal #plain
# town_8 Reyvadin #plain
# town_9 Khudan #snow
# town_10 Tulga #steppe
# town_11 Curaw #snow
# town_12 Wercheg #plain
# town_13 Rivacheg #plain
# town_14 Halmar #steppe
####################################################################################################################
scenes = [
("random_scene",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be",
[],[]),
("conversation_scene",0,"encounter_spot", "bo_encounter_spot", (-40,-40),(40,40),-100,"0",
[],[]),
("random_scene_steppe",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x0000000229602800000691a400003efe00004b34000059be",
[],[], "outer_terrain_steppe"),
("random_scene_plain",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x0000000229602800000691a400003efe00004b34000059be",
[],[], "outer_terrain_plain"),
("random_scene_snow",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x0000000229602800000691a400003efe00004b34000059be",
[],[], "outer_terrain_snow"),
("random_scene_desert",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x0000000229602800000691a400003efe00004b34000059be",
[],[], "outer_terrain_steppe"),
("random_scene_steppe_forest",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be",
[],[], "outer_terrain_plain"),
("random_scene_plain_forest",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be",
[],[], "outer_terrain_plain"),
("random_scene_snow_forest",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be",
[],[], "outer_terrain_snow"),
("random_scene_desert_forest",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be",
[],[], "outer_terrain_plain"),
("camp_scene",sf_generate|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be",
[],[], "outer_terrain_plain"),
("camp_scene_horse_track",sf_generate|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be",
[],[], "outer_terrain_plain"),
("four_ways_inn",sf_generate,"none", "none", (0,0),(120,120),-100,"0x0230817a00028ca300007f4a0000479400161992",
[],[], "outer_terrain_plain"),
("test_scene",sf_generate,"none", "none", (0,0),(120,120),-100,"0x0230817a00028ca300007f4a0000479400161992",
[],[], "outer_terrain_plain"),
("quick_battle_1",sf_generate,"none", "none", (0,0),(120,120),-100,"0x30401ee300059966000001bf0000299a0000638f",
[],[], "outer_terrain_plain"),
("quick_battle_2",sf_generate,"none", "none", (0,0),(120,120),-100,"0xa0425ccf0004a92a000063d600005a8a00003d9a",
[],[], "outer_terrain_steppe"),
("quick_battle_3",sf_generate,"none", "none", (0,0),(120,120),-100,"0x4c6024e3000691a400001b7c0000591500007b52",
[],[], "outer_terrain_snow"),
("quick_battle_4",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00001d63c005114300006228000053bf00004eb9",
[],[], "outer_terrain_plain"),
("quick_battle_5",sf_generate,"none", "none", (0,0),(120,120),-100,"0x3a078bb2000589630000667200002fb90000179c",
[],[], "outer_terrain_plain"),
("quick_battle_6",sf_generate,"none", "none", (0,0),(120,120),-100,"0xa0425ccf0004a92a000063d600005a8a00003d9a",
[],[], "outer_terrain_steppe"),
("quick_battle_7",sf_generate,"none", "none", (0,0),(100,100),-100,"0x314d060900036cd70000295300002ec9000025f3",
[],[],"outer_terrain_plain"),
("salt_mine",sf_generate,"none", "none", (-200,-200),(200,200),-100,"0x2a07b23200025896000023ee00007f9c000022a8",
[],[], "outer_terrain_steppe"),
("novice_ground",sf_indoors,"training_house_a", "bo_training_house_a", (-100,-100),(100,100),-100,"0",
[],[]),
("zendar_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[], "outer_terrain_plain"),
("dhorak_keep",sf_generate,"none", "none", (0,0),(120,120),-100,"0x33a7946000028ca300007f4a0000479400161992",
["exit"],[]),
("reserved4",sf_generate,"none", "none", (0,0),(120,120),-100,"28791",
[],[]),
("reserved5",sf_generate,"none", "none", (0,0),(120,120),-100,"117828",
[],[]),
("reserved6",sf_generate,"none", "none", (0,0),(100,100),-100,"6849",
[],[]),
("reserved7",sf_generate,"none", "none", (0,0),(100,100),-100,"6849",
[],[]),
("reserved8",sf_generate,"none", "none", (0,0),(100,100),-100,"13278",
[],[]),
("reserved9",sf_indoors,"thirsty_lion", "bo_thirsty_lion", (-100,-100),(100,100),-100,"0",
[],[]),
("reserved10",0,"none", "none", (-100,-100),(100,100),-100,"0",
[],[]),
("reserved11",0,"none", "none", (-100,-100),(100,100),-100,"0",
[],[]),
("reserved12",sf_indoors,"thirsty_lion", "bo_thirsty_lion", (-100,-100),(100,100),-100,"0",
[],[]),
("training_ground",sf_generate,"none", "none", (0,0),(120,120),-100,"0x30000500400360d80000189f00002a8380006d91",
[],["tutorial_chest_1", "tutorial_chest_2"], "outer_terrain_plain_1"),
("tutorial_1",sf_indoors,"tutorial_1_scene", "bo_tutorial_1_scene", (-100,-100),(100,100),-100,"0",
[],[]),
("tutorial_2",sf_indoors,"tutorial_2_scene", "bo_tutorial_2_scene", (-100,-100),(100,100),-100,"0",
[],[]),
("tutorial_3",sf_indoors,"tutorial_3_scene", "bo_tutorial_3_scene", (-100,-100),(100,100),-100,"0",
[],[]),
("tutorial_4",sf_generate,"none", "none", (0,0),(120,120),-100,"0x30000500400360d80000189f00002a8380006d91",
[],[], "outer_terrain_plain"),
("tutorial_5",sf_generate,"none", "none", (0,0),(120,120),-100,"0x3a06dca80005715c0000537400001377000011fe",
[],[], "outer_terrain_plain"),
("training_ground_horse_track_1",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000000337553240004d53700000c0500002a0f80006267",
[],[], "outer_terrain_plain"),
("training_ground_horse_track_2",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000000301553240004d5370000466000002a0f800073f1",
[],[], "outer_terrain_plain"),
#Kar
("training_ground_horse_track_3",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000000400c12b2000515470000216b0000485e00006928",
[],[], "outer_terrain_snow"),
#Steppe
("training_ground_horse_track_4",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000000200b60320004a5290000180d0000452f00000e90",
[],[], "outer_terrain_steppe"),
#Plain
("training_ground_horse_track_5",sf_generate,"none", "none", (0,0),(120,120),-100,"0x000000003008208e0006419000000f730000440f00003c86",
[],[], "outer_terrain_plain"),
("training_ground_ranged_melee_1",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000001350455c20005194a000041cb00005ae800000ff5",
[],[], "outer_terrain_plain"),
("training_ground_ranged_melee_2",sf_generate,"none", "none", (0,0),(120,120),-100,"0x0000000532c8dccb0005194a000041cb00005ae800001bdd",
[],[], "outer_terrain_plain"),
#Kar
("training_ground_ranged_melee_3",sf_generate,"none", "none", (0,0),(120,120),-100,"0x000000054327dcba0005194a00001b1d00005ae800004d63",
[],[], "outer_terrain_snow"),
#Steppe
("training_ground_ranged_melee_4",sf_generate,"none", "none", (0,0),(120,120),-100,"0x000000012247dcba0005194a000041ef00005ae8000050af",
[],[], "outer_terrain_steppe"),
#Plain
("training_ground_ranged_melee_5",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000001324a9cba0005194a000041ef00005ae800003c55",
[],[], "outer_terrain_plain"),
("zendar_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
["the_happy_boar","","zendar_merchant"],[], "outer_terrain_plain_1"),
# ("zendar_center",0,"sargoth_square", "bo_sargoth_square", (-24,-22),(21,13),-100,"0",
# ["the_happy_boar","","zendar_merchant"],[]),
("the_happy_boar",sf_indoors,"interior_town_house_f", "bo_interior_town_house_f", (-100,-100),(100,100),-100,"0",
["zendar_center"],["zendar_chest"]),
("zendar_merchant",sf_indoors,"interior_town_house_i", "bo_interior_town_house_i", (-100,-100),(100,100),-100,"0",
[],[]),
# Tvern names:
#the shy monkey
#the singing pumpkin
#three swords
#red stag
#the bard's corner
#interior_tavern_a
# town_1 Sargoth #plain
# town_2 Tihr #plain
# town_3 Veluca #steppe
# town_4 Suno #plain
# town_5 Jelkala #plain
# town_6 Praven #plain
# town_7 Uxkhal #plain
# town_8 Reyvadin #plain
# town_9 Khudan #snow
# town_10 Tulga #steppe
# town_11 Curaw #snow
# town_12 Wercheg #plain
# town_13 Rivacheg #plain
# town_14 Halmar #steppe
("town_1_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x20008a110002589600006af30000356b00002c27",
[],[],"outer_terrain_plain"),
("town_2_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa009c7070002589600002b6300001ef60000122e",
[],["bonus_chest_3"],"outer_terrain_town_thir_1"),
("town_3_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x000000002005591e00040506000059a100002cd500005052",
[],[],"outer_terrain_steppe"),
("town_4_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_plain"),
("town_5_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x00000000300798b2000380e3000037960000573900003f48",
[],["bonus_chest_2"],"outer_terrain_plain"),
("town_6_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x3000148000025896000074e600006c260000125a",
[],[],"outer_terrain_plain"),
("town_7_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30050d0d0002d4b300000e2f000027d200005f66",
[],[],"outer_terrain_plain"),
("town_8_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x3000148000025896000074e600006c260000125a",
[],[],"outer_terrain_plain"),
("town_9_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x400790b20002c8b0000050d500006f8c00006dbd",
[],[],"outer_terrain_snow"),
("town_10_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x00000000200016da000364d9000060f500007591000064e7",
[],[],"outer_terrain_steppe"),
("town_11_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x400790b20002c8b0000050d500006f8c00006dbd",
[],[],"outer_terrain_snow"),
("town_12_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x3002cd340002b4ac00002ccd800026dc00000c1d",
[],[],"outer_terrain_town_thir"),
("town_13_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x300416a600035cd600007ee80000012100003fbc",
[],["bonus_chest_1"]),
("town_14_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x00000000200016da000364d9000060f500007591000064e7",
[],[],"outer_terrain_steppe"),
("town_15_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x2007956000025896000037e800000e860000674b",
[],[],"outer_terrain_steppe"),
("town_16_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130001887000334d0000073ed00004f1a00007a35",
[],[],"outer_terrain_steppe"),
("town_17_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x0000000020045abc000308c4000029d9000033bd000009b9",
[],[],"outer_terrain_steppe"),
("town_18_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x0000000020049cbd00025896000048e90000164400002b3f",
[],[],"outer_terrain_steppe"),
("town_1_castle",sf_indoors,"interior_castle_y", "bo_interior_castle_y", (-100,-100),(100,100),-100,"0",
[],["town_1_seneschal"]),
("town_2_castle",sf_indoors,"interior_castle_t", "bo_interior_castle_t", (-100,-100),(100,100),-100,"0",
["exit"],["town_2_seneschal"]),
("town_3_castle",sf_indoors,"interior_castle_a", "bo_interior_castle_a", (-100,-100),(100,100),-100,"0",
["exit"],["town_3_seneschal"]),
("town_4_castle",sf_indoors, "interior_castle_q", "bo_interior_castle_q", (-100,-100),(100,100),-100,"0",
["exit"],["town_4_seneschal"]),
("town_5_castle",sf_indoors, "interior_castle_c", "bo_interior_castle_c", (-100,-100),(100,100),-100,"0",
["exit"],["town_5_seneschal"]),
("town_6_castle",sf_indoors, "interior_castle_z", "bo_interior_castle_z", (-100,-100),(100,100),-100,"0",
["exit"],["town_6_seneschal"]),
("town_7_castle",sf_indoors, "interior_castle_v", "bo_interior_castle_v", (-100,-100),(100,100),-100,"0",
["exit"],["town_7_seneschal"]),
("town_8_castle",sf_indoors, "interior_castle_w", "bo_interior_castle_w", (-100,-100),(100,100),-100,"0",
["exit"],["town_8_seneschal"]),
("town_9_castle",sf_indoors, "interior_castle_g", "bo_interior_castle_g", (-100,-100),(100,100),-100,"0",
["exit"],["town_9_seneschal"]),
("town_10_castle",sf_generate, "none", "none", (-100,-100),(100,100),-100,"0x00000007300005000002308c00004a840000624700004fda",
["exit"],["town_10_seneschal"]),
("town_11_castle",sf_indoors, "interior_castle_i", "bo_interior_castle_i", (-100,-100),(100,100),-100,"0",
["exit"],["town_11_seneschal"]),
("town_12_castle",sf_indoors, "interior_castle_x", "bo_interior_castle_x", (-100,-100),(100,100),-100,"0",
["exit"],["town_12_seneschal"]),
("town_13_castle",sf_indoors, "interior_castle_b", "bo_interior_castle_b", (-100,-100),(100,100),-100,"0",
["exit"],["town_13_seneschal"]),
("town_14_castle",sf_indoors, "interior_castle_g_square_keep", "bo_interior_castle_g_square_keep", (-100,-100),(100,100),-100,"0",
["exit"],["town_14_seneschal"]),
("town_15_castle",sf_indoors, "interior_castle_e", "bo_interior_castle_e", (-100,-100),(100,100),-100,"0",
["exit"],["town_15_seneschal"]),
("town_16_castle",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0",
["exit"],["town_16_seneschal"]),
("town_17_castle",sf_indoors, "interior_castle_g_square_keep", "bo_interior_castle_g_square_keep", (-100,-100),(100,100),-100,"0",
["exit"],["town_17_seneschal"]),
("town_18_castle",sf_generate, "none", "none", (-100,-100),(100,100),-100,"0x00000007300005000002308c00004a840000624700004fda",
["exit"],["town_18_seneschal"]),
("town_1_tavern",sf_indoors,"interior_town_house_f", "bo_interior_town_house_f", (-100,-100),(100,100),-100,"0",
[],[]),
("town_2_tavern",sf_indoors,"interior_tavern_e", "bo_interior_tavern_e", (-100,-100),(100,100),-100,"0",
["exit"],[],"outer_terrain_town_thir_1"),
("town_3_tavern",sf_indoors,"interior_town_house_d", "bo_interior_town_house_d", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_4_tavern",sf_indoors, "interior_tavern_f", "bo_interior_tavern_f", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_5_tavern",sf_indoors, "interior_tavern_h", "bo_interior_tavern_h", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_6_tavern",sf_indoors, "interior_tavern_g", "bo_interior_tavern_g", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_7_tavern",sf_indoors, "interior_town_house_f", "bo_interior_town_house_f", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_8_tavern",sf_indoors, "interior_tavern_h", "bo_interior_tavern_h", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_9_tavern",sf_indoors, "interior_tavern_g", "bo_interior_tavern_g", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_10_tavern",sf_indoors, "interior_town_house_steppe_c", "bo_interior_town_house_steppe_c", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_11_tavern",sf_indoors, "interior_tavern_c", "bo_interior_tavern_c", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_12_tavern",sf_indoors, "interior_town_house_aa", "bo_interior_town_house_aa", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_13_tavern",sf_indoors, "interior_tavern_g", "bo_interior_tavern_g", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_14_tavern",sf_indoors, "interior_town_house_steppe_g", "bo_interior_town_house_steppe_g", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_15_tavern",sf_indoors, "interior_tavern_d", "bo_interior_tavern_d", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_16_tavern",sf_indoors, "interior_tavern_b", "bo_interior_tavern_b", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_17_tavern",sf_indoors, "interior_town_house_steppe_g", "bo_interior_town_house_steppe_g", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_18_tavern",sf_indoors, "interior_town_house_steppe_c", "bo_interior_town_house_steppe_c", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_1_store",sf_indoors,"interior_town_house_i", "bo_interior_town_house_i", (-100,-100),(100,100),-100,"0",
[],[]),
("town_2_store",sf_indoors,"interior_town_house_j", "bo_interior_town_house_j", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_3_store",sf_indoors,"interior_town_house_e", "bo_interior_town_house_e", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_4_store",sf_indoors, "interior_town_house_a", "bo_interior_town_house_a", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_5_store",sf_indoors, "interior_town_house_d", "bo_interior_town_house_d", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_6_store",sf_indoors, "interior_town_house_j", "bo_interior_town_house_j", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_7_store",sf_indoors, "interior_house_a", "bo_interior_house_a", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_8_store",sf_indoors, "interior_house_b", "bo_interior_house_b", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_9_store",sf_indoors, "interior_tavern_a", "bo_interior_tavern_a", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_10_store",sf_indoors, "interior_town_house_steppe_d", "bo_interior_town_house_steppe_d", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_11_store",sf_indoors, "interior_town_house_j", "bo_interior_town_house_j", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_12_store",sf_indoors, "interior_house_a", "bo_interior_house_a", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_13_store",sf_indoors, "interior_town_house_j", "bo_interior_town_house_j", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_14_store",sf_indoors, "interior_house_extension_h", "bo_interior_house_extension_h", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_15_store",sf_indoors, "interior_town_house_c", "bo_interior_town_house_c", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_16_store",sf_indoors, "interior_town_house_i", "bo_interior_town_house_i", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_17_store",sf_indoors, "interior_town_house_steppe_g", "bo_interior_town_house_steppe_g", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_18_store",sf_indoors, "interior_town_house_steppe_d", "bo_interior_town_house_steppe_d", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_1_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_plain"),
("town_2_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_town_thir_1"),
("town_3_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[]),
("town_4_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_plain"),
("town_5_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_plain"),
("town_6_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_plain"),
("town_7_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_plain"),
("town_8_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_plain"),
("town_9_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x40001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_snow"),
("town_10_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200005000005f57b00005885000046bd00006d9c",
[],[],"outer_terrain_steppe"),
("town_11_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x40001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_snow"),
("town_12_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_town_thir_1"),
("town_13_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[]),
("town_14_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200005000005f57b00005885000046bd00006d9c",
[],[],"outer_terrain_steppe"),
("town_15_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_plain"),
("town_16_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c",
[],[],"outer_terrain_plain"),
("town_17_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200005000005f57b00005885000046bd00006d9c",
[],[],"outer_terrain_steppe"),
("town_18_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200005000005f57b00005885000046bd00006d9c",
[],[],"outer_terrain_steppe"),
("town_1_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0",
[],[]),
("town_2_prison",sf_indoors,"interior_prison_b", "bo_interior_prison_b", (-100,-100),(100,100),-100,"0",
[],[]),
("town_3_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0",
[],[]),
("town_4_prison",sf_indoors,"interior_prison_g", "bo_interior_prison_g", (-100,-100),(100,100),-100,"0",
[],[]),
("town_5_prison",sf_indoors,"interior_prison_h", "bo_interior_prison_h", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_6_prison",sf_indoors,"interior_prison_e", "bo_interior_prison_e", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_7_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_8_prison",sf_indoors,"dungeon_cell_b", "bo_dungeon_cell_b", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_9_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_10_prison",sf_indoors,"interior_prison_o", "bo_interior_prison_o", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_11_prison",sf_indoors,"dungeon_a", "bo_dungeon_a", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_12_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_13_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_14_prison",sf_indoors,"interior_prison_n", "bo_interior_prison_n", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_15_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_16_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_17_prison",sf_indoors,"interior_prison_n", "bo_interior_prison_n", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_18_prison",sf_indoors,"interior_prison_o", "bo_interior_prison_o", (-100,-100),(100,100),-100,"0",
["exit"],[]),
("town_1_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002491600055157000000d20000152a0000611a",
[],[],"outer_terrain_plain"),
("town_2_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002491600055157000000d20000152a0000611a",
[],[],"outer_terrain_plain"),
("town_3_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000120044ecf0005955e0000119b0000290000001f11",
[],[],"outer_terrain_steppe"),
("town_4_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300010c800054d5c00004af000005d3f00002ca0",
[],[],"outer_terrain_plain"),
("town_5_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130028e320005e17b00004a14000006d70000019d",
[],[],"outer_terrain_plain"),
("town_6_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300010c800054d5c00004af000005d3f00002ca0",
[],[],"outer_terrain_plain"),
("town_7_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002491600055157000000d20000152a0000611a",
[],[],"outer_terrain_plain"),
("town_8_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002491600055157000000d20000152a0000611a",
[],[],"outer_terrain_plain"),
("town_9_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000140015033000651900000159f0000619800006af6",
[],[],"outer_terrain_snow"),
("town_10_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200011af00065192000067110000688300003435",
[],[],"outer_terrain_steppe"),
("town_11_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000140015033000651900000159f0000619800006af6",
[],[],"outer_terrain_snow"),
("town_12_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300010c800054d5c00004af000005d3f00002ca0",
[],[],"outer_terrain_plain"),
("town_13_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130028e320005e17b00004a14000006d70000019d",
[],[],"outer_terrain_plain"),
("town_14_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200011af00065192000067110000688300003435",
[],[],"outer_terrain_steppe"),
("town_15_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000530040ece0005b56d000072a70000240a00001534",
[],[],"outer_terrain_steppe"),
("town_16_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013001c98d0005b56d000072a70000240a00001e09",
[],[],"outer_terrain_steppe"),
("town_17_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200011af00065192000067110000688300003435",
[],[],"outer_terrain_steppe"),
("town_18_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200011af00065192000067110000688300003435",
[],[],"outer_terrain_steppe"),
("town_1_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[],"outer_terrain_plain"),
("town_2_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[],"outer_terrain_town_thir"),
("town_3_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[]),
("town_4_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[],"outer_terrain_plain"),
("town_5_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[],"outer_terrain_plain"),
("town_6_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[],"outer_terrain_plain"),
("town_7_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x20008a110002589600006af30000356b00002c27",
[],[],"outer_terrain_plain"),
("town_8_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[],"outer_terrain_plain"),
("town_9_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x400211130001e07800002ad400001172000035c4",
[],[],"outer_terrain_snow"),
("town_10_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000420000500000334ce00001d1100003d0600000d27",
[],[],"outer_terrain_steppe"),
("town_11_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x400211130001e07800002ad400001172000035c4",
[],[],"outer_terrain_snow"),
("town_12_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[],"outer_terrain_town_thir"),
("town_13_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[]),
("town_14_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000420000500000334ce00001d1100003d0600000d27",
[],[],"outer_terrain_steppe"),
("town_15_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[],"outer_terrain_steppe"),
("town_16_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932",
[],[],"outer_terrain_steppe"),
("town_17_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000420000500000334ce00001d1100003d0600000d27",
[],[],"outer_terrain_steppe"),
("town_18_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000420000500000334ce00001d1100003d0600000d27",
[],[],"outer_terrain_steppe"),
#0x30054d228004050000005a768000688400002e3b
#0x30054da28004050000005a76800022aa00002e3b
#Castles:
# 1 Steppe
("castle_1_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30054da28004050000005a76800022aa00002e3b",
[],[],"outer_terrain_steppe"),
("castle_1_interior",sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100,-100),(100,100),-100,"0",
["exit"],["castle_1_seneschal"]),
("castle_1_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0",
[],[]),
# 2 Plain
("castle_2_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa00363638005c16d00003c82000037e000002303",
[],[],"outer_terrain_plain"),
("castle_2_interior",sf_indoors, "interior_castle_u", "bo_interior_castle_u", (-100,-100),(100,100),-100,"0",
["exit"],["castle_2_seneschal"]),
("castle_2_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0",#### B bkullanilmayacak
[],[]),
# 3 Plain
("castle_3_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030044e900003dd02000077b20000400100005697",
[],[],"outer_terrain_plain"),
("castle_3_interior",sf_indoors, "interior_castle_m", "bo_interior_castle_m", (-100,-100),(100,100),-100,"0",
["exit"],["castle_3_seneschal"]),
("castle_3_prison",sf_indoors,"interior_prison_e", "bo_interior_prison_e", (-100,-100),(100,100),-100,"0",
[],[]),
# 4 Plain
("castle_4_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030044e900003dd02000077b20000400100005697",
[],[],"outer_terrain_plain"),
("castle_4_interior",sf_indoors, "interior_castle_k", "bo_interior_castle_k", (-100,-100),(100,100),-100,"0",
["exit"],["castle_4_seneschal"]),
("castle_4_prison",sf_indoors,"interior_prison_l", "bo_interior_prison_l", (-100,-100),(100,100),-100,"0",
[],[]),
# 5 Plain
("castle_5_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x3189dc1a000429090000619700007cbd00005ab7",
[],[],"outer_terrain_plain"),
("castle_5_interior",sf_indoors, "interior_castle_j", "bo_interior_castle_j", (-100,-100),(100,100),-100,"0",
["exit"],["castle_5_seneschal"]),
("castle_5_prison",sf_indoors,"interior_prison_l", "bo_interior_prison_l", (-100,-100),(100,100),-100,"0",
[],[]),
# 6 Plain
("castle_6_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000000b009723200059d6800005f4f0000757f000069cd",
[],[],"outer_terrain_plain"),
("castle_6_interior",sf_indoors, "interior_castle_p", "bo_interior_castle_p", (-100,-100),(100,100),-100,"0",
["exit"],["castle_6_seneschal"]),
("castle_6_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0",
[],[]),
# 7 Snow
("castle_7_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000000c007a56300047d1e00006c9100002859000028bc",
[],[],"outer_terrain_snow"),
("castle_7_interior",sf_indoors, "interior_castle_o", "bo_interior_castle_o", (-100,-100),(100,100),-100,"0",
["exit"],["castle_7_seneschal"]),
("castle_7_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0",
[],[]),
# 8 Plain
("castle_8_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x314d060900036cd70000295300002ec9000025f3",
[],[],"outer_terrain_plain"),
("castle_8_interior",sf_indoors, "interior_castle_t", "bo_interior_castle_t", (-100,-100),(100,100),-100,"0",
["exit"],["castle_8_seneschal"]),
("castle_8_prison",sf_indoors,"interior_prison_e", "bo_interior_prison_e", (-100,-100),(100,100),-100,"0",
[],[]),
# 9 Steppe
("castle_9_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0048e000004d93700004f91000065980000229b",
[],[],"outer_terrain_castle_9"),
("castle_9_interior",sf_indoors, "interior_castle_l", "bo_interior_castle_l", (-100,-100),(100,100),-100,"0",
["exit"],["castle_9_seneschal"]),
("castle_9_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0",
[],[]),
# 10 Steppe
("castle_10_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0045f200004751b000051cf00007f7a00002cd9",
[],[],"outer_terrain_steppe"),
("castle_10_interior",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0",
["exit"],["castle_10_seneschal"]),
("castle_10_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0",
[],[]),
# 11 Plain
("castle_11_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030044e900003dd02000077b20000400100005697",
[],[],"outer_terrain_plain"),
("castle_11_interior",sf_indoors, "interior_castle_a", "bo_interior_castle_a", (-100,-100),(100,100),-100,"0",
["exit"],["castle_11_seneschal"]),
("castle_11_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0",
[],[]),
# Plain
("castle_12_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230054f630005fd820000222a00003de000005f00",
[],[],"outer_terrain_town_thir_1"),
("castle_12_interior",sf_indoors, "interior_castle_y", "bo_interior_castle_y", (-100,-100),(100,100),-100,"0",
["exit"],["castle_12_seneschal"]),
("castle_12_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0",
[],[]),
# Plain
("castle_13_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230054f630005fd820000222a00003de000005f00",
[],[],"outer_terrain_plain"),
("castle_13_interior",sf_indoors, "interior_castle_v", "bo_interior_castle_v", (-100,-100),(100,100),-100,"0",
["exit"],["castle_13_seneschal"]),
("castle_13_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0",
[],[]),
# Plain
("castle_14_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023007a3b20005795e0000706d0000381800000bbc",
[],[],"outer_terrain_plain"),
("castle_14_interior",sf_indoors, "interior_castle_j", "bo_interior_castle_j" , (-100,-100),(100,100),-100,"0",
["exit"],["castle_14_seneschal"]),
("castle_14_prison",sf_indoors,"interior_prison_m", "bo_interior_prison_m", (-100,-100),(100,100),-100,"0",
[],[]),
# Plain
("castle_15_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023007941f0005415000007e650000225f00003b3e",
[],[],"outer_terrain_plain"),
("castle_15_interior",sf_indoors, "interior_castle_p", "bo_interior_castle_p", (-100,-100),(100,100),-100,"0",
["exit"],["castle_15_seneschal"]),
("castle_15_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0",
[],[]),
# Plain
("castle_16_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023007a3b20005795e0000706d0000381800000bbc",
[],[],"outer_terrain_plain"),
("castle_16_interior",sf_indoors, "interior_castle_k", "bo_interior_castle_k", (-100,-100),(100,100),-100,"0",
["exit"],["castle_16_seneschal"]),
("castle_16_prison",sf_indoors,"interior_prison_l", "bo_interior_prison_l", (-100,-100),(100,100),-100,"0",
[],[]),
# Steppe
("castle_17_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000220045d9b0005d9760000034a00002a3e00006fbd",
[],[],"outer_terrain_steppe"),
("castle_17_interior",sf_indoors, "interior_castle_l", "bo_interior_castle_l", (-100,-100),(100,100),-100,"0",
["exit"],["castle_17_seneschal"]),
("castle_17_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0",
[],[]),
# Snow
("castle_18_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000240079f9e0005695a0000035f00003ef400004aa8",
[],[],"outer_terrain_snow"),
("castle_18_interior",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0",
["exit"],["castle_18_seneschal"]),
("castle_18_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0",
[],[]),
# Snow
("castle_19_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000014004d81100057963000062ce0000255800004c09",
[],[],"outer_terrain_snow"),
("castle_19_interior",sf_indoors, "interior_castle_c", "bo_interior_castle_c", (-100,-100),(100,100),-100,"0",
["exit"],["castle_19_seneschal"]),
("castle_19_prison",sf_indoors,"interior_prison_e", "bo_interior_prison_e", (-100,-100),(100,100),-100,"0",
[],[]),
# Plain
("castle_20_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013006199a0004e5370000494f000028fc00006cf6",
[],[],"outer_terrain_plain"),
("castle_20_interior",sf_indoors, "interior_castle_a", "bo_interior_castle_a", (-100,-100),(100,100),-100,"0",
["exit"],["castle_20_seneschal"]),
("castle_20_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_21_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030011ab20005d57800003a2600004b7a000071ef",
[],[],"outer_terrain_plain"),
("castle_21_interior",sf_indoors, "interior_castle_c", "bo_interior_castle_c", (-100,-100),(100,100),-100,"0",
["exit"],["castle_21_seneschal"]),
("castle_21_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_22_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003000ad340004d537000024650000253c00000461",
[],[],"outer_terrain_plain"),
("castle_22_interior",sf_indoors, "interior_castle_a", "bo_interior_castle_a", (-100,-100),(100,100),-100,"0",
["exit"],["castle_22_seneschal"]),
("castle_22_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_23_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300658bc0007bded000025520000093800006114",
[],[], "outer_terrain_plain"),
("castle_23_interior",sf_indoors, "interior_castle_y", "bo_interior_castle_y", (-100,-100),(100,100),-100,"0",
["exit"],["castle_23_seneschal"]),
("castle_23_prison",sf_indoors,"interior_prison_b", "bo_interior_prison_b", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_24_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130021f63000721ca000055be000079d90000156d",
[],[],"outer_terrain_plain"),
("castle_24_interior",sf_indoors, "castle_h_interior_b", "bo_castle_h_interior_b", (-100,-100),(100,100),-100,"0",
["exit"],["castle_24_seneschal"]),
("castle_24_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_25_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013004e0a600061989000053d50000749800005f64",
[],[],"outer_terrain_plain"),
("castle_25_interior",sf_indoors, "castle_h_interior_b", "bo_castle_h_interior_b", (-100,-100),(100,100),-100,"0",
["exit"],["castle_25_seneschal"]),
("castle_25_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_26_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013005213200077dda0000733300002edf000052ba",
[],[],"outer_terrain_plain"),
("castle_26_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0",
["exit"],["castle_26_seneschal"]),
("castle_26_prison",sf_indoors,"interior_prison_h", "bo_interior_prison_h", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_27_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007b23200070dbc000041de00000c4900003cfc",
[],[],"outer_terrain_plain"),
("castle_27_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0",
["exit"],["castle_27_seneschal"]),
("castle_27_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_28_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007b232000715c50000084c00001b5b000018ec",
[],[],"outer_terrain_plain"),
("castle_28_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0",
["exit"],["castle_28_seneschal"]),
("castle_28_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_29_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000006400796b20005053e000042ed0000199b000037cd",
[],[],"outer_terrain_snow"),
("castle_29_interior",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0",
["exit"],["castle_29_seneschal"]),
("castle_29_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_30_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000620035e32000611840000147f00003dac00000660",
[],[],"outer_terrain_plain"),
("castle_30_interior",sf_indoors, "interior_castle_g_square_keep", "bo_interior_castle_g_square_keep", (-100,-100),(100,100),-100,"0",
["exit"],["castle_30_seneschal"]),
("castle_30_prison",sf_indoors,"interior_prison_n", "bo_interior_prison_n", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_31_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230025b8d0006459400006a3700002adb00007091",
[],[],"outer_terrain_plain"),
("castle_31_interior",sf_indoors, "interior_castle_y", "bo_interior_castle_y", (-100,-100),(100,100),-100,"0",
["exit"],["castle_31_seneschal"]),
("castle_31_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_32_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230041fb20005fd7d00002692000029b700007d12",
[],[],"outer_terrain_plain"),
("castle_32_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0",
["exit"],["castle_32_seneschal"]),
("castle_32_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_33_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230029cb2000709c200003c9500004b9b00002f4d",
[],[],"outer_terrain_plain"),
("castle_33_interior",sf_indoors, "interior_castle_v", "bo_interior_castle_v", (-100,-100),(100,100),-100,"0",
["exit"],["castle_33_seneschal"]),
("castle_33_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_34_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002b007b232000715c50000084c00001b5b00006580",
[],[],"outer_terrain_plain"),
("castle_34_interior",sf_indoors, "interior_castle_c", "bo_interior_castle_c", (-100,-100),(100,100),-100,"0",
["exit"],["castle_34_seneschal"]),
("castle_34_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_35_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130031be30006f9bc00000aae00000fb80000243f",
[],[],"outer_terrain_plain"),
("castle_35_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0",
["exit"],["castle_35_seneschal"]),
("castle_35_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_36_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007b2630005695c00001ebe0000028e00007e37",
[],[],"outer_terrain_plain"),
("castle_36_interior",sf_indoors, "castle_h_interior_b", "bo_castle_h_interior_b", (-100,-100),(100,100),-100,"0",
["exit"],["castle_36_seneschal"]),
("castle_36_prison",sf_indoors,"interior_prison_h", "bo_interior_prison_h", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_37_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130025cb20006097f00005b1400000e2f00005fd9",
[],[],"outer_terrain_plain"),
("castle_37_interior",sf_indoors, "interior_castle_k", "bo_interior_castle_k", (-100,-100),(100,100),-100,"0",
["exit"],["castle_37_seneschal"]),
("castle_37_prison",sf_indoors,"interior_prison_l", "bo_interior_prison_l", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_38_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012007985300055550000064d500005c060000759e",
[],[],"outer_terrain_steppe"),
("castle_38_interior",sf_generate, "none", "none", (-100,-100),(100,100),-100,"0x00000007300005000002308c00004a840000624700004fda",
["exit"],["castle_38_seneschal"]),
("castle_38_prison",sf_indoors,"interior_prison_o", "bo_interior_prison_o", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_39_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000014007a0320005695f0000601c00007a8800001a17",
[],[],"outer_terrain_snow"),
("castle_39_interior",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0",
["exit"],["castle_39_seneschal"]),
("castle_39_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0",
[],[]),
("castle_40_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012007985300055550000064d500005c060000759e",
[],[],"outer_terrain_plain"),
("castle_40_interior",sf_indoors, "interior_castle_g_square_keep", "bo_interior_castle_g_square_keep", (-100,-100),(100,100),-100,"0",
["exit"],["castle_40_seneschal"]),
("castle_40_prison",sf_indoors,"interior_prison_n", "bo_interior_prison_n", (-100,-100),(100,100),-100,"0",
[],[]),
#!!Villages !!#
("village_1",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030081763000589620000338e00004f2c00005cfb",
[],[],"outer_terrain_plain"),
("village_2",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003007a21c0003ecfe000001f0000073b100000fd2",
[],[],"outer_terrain_plain"),
("village_3",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023003dc4e0006118b000029f8000034670000105f",
[],[],"outer_terrain_plain"),
("village_4",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079732000651a00000044c0000177200000234",
[],[],"outer_terrain_plain"),
("village_5",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003001ce100006097d0000134c000016d8000042a2",
[],[],"outer_terrain_plain"),
("village_6",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230035598000761df000058ea000006f3000005e7",
[],[],"outer_terrain_plain"),
("village_7",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000031059a0d0004792000005c3a00004df500000dbc",
[],[],"outer_terrain_plain"),
("village_8",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300798320006499200002acc000040d70000421d",
[],[],"outer_terrain_plain"),
("village_9",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000004300005008005b57000004e31800017d80000754b",
[],[],"outer_terrain_plain"),
("village_10",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013005dad40005f57b0000543e0000279d000052b4",
[],[],"outer_terrain_plain"),
("village_11",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000220029c4400077de100002dcc00002edf00003925",
[],[],"outer_terrain_steppe"),
("village_12",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200213e300077ddf000019d3000034520000626e",
[],[],"outer_terrain_steppe"),
("village_13",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000000300265e3400691a400005e4d80006dfa00003bc8",
[],[], "outer_terrain_plain"),
("village_14",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230029ce30004912400002acc000040d7000077db",
[],[], "outer_terrain_plain"),
("village_15",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300029d4000691a4000015148000335800004190",
[],[],"outer_terrain_plain"),
("village_16",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000240031a0f0006b9ae00006e1b00006e9000007281",
[],[],"outer_terrain_snow"),
("village_17",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002c003131700066da00000484c000008630000613d",
[],[],),
("village_18",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000024003561a00070dbe000016f8000010ca000069f8",
[],[],"outer_terrain_snow"),
("village_19",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000024003991e0006f1bc000055cc0000085600001563",
[],[],"outer_terrain_snow"),
("village_20",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000024003d7d20007d1f40000374100001e120000097b",
[],[],"outer_terrain_snow"),
("village_21",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000240024d3800074dcc0000488b0000016100002047",
[],[],"outer_terrain_snow"),
("village_22",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000024003d7d20007d1f40000374100001e120000097b",
[],[],"outer_terrain_snow"),
("village_23",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300415380007b5e600005f7b00000a9200001615",
[],[],),
("village_24",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023002e1ad00048924000031e70000677500002a0c",
[],[],"outer_terrain_plain"),
("village_25",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002d0021ede000775dd000032670000173700007c40",
[],[],"outer_terrain_steppe"),
("village_26",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230020a008005294c000063fc0000771c0000216f",
[],[],"outer_terrain_plain"),
("village_27",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013001b2320004a52900004d390000518c00001ab1",
[],[],"outer_terrain_plain"),
("village_28",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022002de4c00077ddd00007e1300000af400006de1",
[],[],"outer_terrain_steppe"),
("village_29",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023007b2320004f93c000023ed000053e500002949",
[],[],"outer_terrain_plain"),
("village_30",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230025e0a0004dd3700004822000032ea0000011b",
[],[],"outer_terrain_plain"),
("village_31",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300619e38003a8ec00004c8380005c6600001cb5", ##0x00000001300619e30003a8ec00004c8380007de100001cb5",
[],[],"outer_terrain_plain"),
("village_32",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300619e30003a8ec00004c8380007de100001cb5",
[],[],"outer_terrain_plain"),
("village_33",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130001700000649920000423900007768000062c3",
[],[],"outer_terrain_plain"),
("village_34",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300323e3000611860000392d00005c05000067e1",
[],[],"outer_terrain_plain"),
("village_35",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079cb20005394e00001ef90000753000000731",
[],[],"outer_terrain_town_thir_1"),
("village_36",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013003a1560006118d00003ce300004123000043b2",
[],[],"outer_terrain_plain"),
("village_37",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022004d36300077dd600002e08000036ab00004651",
[],[],"outer_terrain_steppe"),
("village_38",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013003e21e0005fd7f000028920000650500005c53",
[],[],"outer_terrain_plain"),
("village_39",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013003e5990005fd78000069670000446c00007476",
[],[],"outer_terrain_plain"),
("village_40",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000220031f6300076dda000056f100004f6d000070b3",
[],[],"outer_terrain_steppe"),
("village_41",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022000a3e300062d8d0000444e0000276e00006eb1",
[],[],"outer_terrain_steppe"),
("village_42",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022007b23200062d8d000060b900003b8b00006c93",
[],[],"outer_terrain_castle_9"),
("village_43",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022000320e0005856300001d770000792700002aa1",
[],[],"outer_terrain_steppe"),
("village_44",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200020200005c574000075480000002d00004be7",
[],[],"outer_terrain_steppe"),
("village_45",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012007a3df0004e52b0000167700005180000051ea",
[],[],"outer_terrain_steppe"),
("village_46",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007a03200061184000058d20000717a00001af0",
[],[],"outer_terrain_plain"),
("village_47",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000000300621b100051d47000034e300007926000048d3",
[],[],"outer_terrain_plain"),
("village_48",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001b0051ebc00062d8b0000570d00005b3900001ae1",
[],[],"outer_terrain_plain"),
("village_49",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000140029bbc0006799b000009cb0000720000006555",
[],[],"outer_terrain_snow"),
("village_50",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000140029bbc0006799b000009cb0000720000006555",
[],[],"outer_terrain_snow"),
("village_51",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023002b0e30006a5a90000722700002f5200005e2b",
[],[],"outer_terrain_plain"),
("village_52",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000220011de30005655900002c2300003b2400000d47",
[],[],"outer_terrain_steppe"),
("village_53",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023002dd19000691a40000566a000012a000001037",
[],[],"outer_terrain_plain"),
("village_54",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300032300005c5740000243e000056aa00003a7a",
[],[],"outer_terrain_plain"),
("village_55",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300019500006c1b4000065c700002bea0000154e",
[],[],"outer_terrain_plain"),
("village_56",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300296320006b5aa00006f3200003a5000004fed",
[],[],"outer_terrain_town_thir_1"),
("village_57",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300027b200065d9700004dcf0000212800001bf0",
[],[],"outer_terrain_plain"),
("village_58",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300018e38005e58300000376000027e70000015c",
[],[],"outer_terrain_plain"),
("village_59",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300022a60005314c0000428100007e0100002e97",
[],[],"outer_terrain_plain"),
("village_60",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079c3200060d860000428100007e01000071b4",
[],[],"outer_terrain_plain"),
("village_61",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300325350006659e0000603500006b0200005676",
[],[],"outer_terrain_plain"),
("village_62",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130038cbc00062d8b00006cb100002b9f00002ca6",
[],[],"outer_terrain_steppe"),
("village_63",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007a6b20006258b00006bb8000074df00002f18",
[],[],"outer_terrain_plain"),
("village_64",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300410320005a96800006b5300004edc00000d11",
[],[],"outer_terrain_plain"),
("village_65",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013004d8320006358b00006d2b000005d5000023e5",
[],[],"outer_terrain_plain"),
("village_66",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007a2b20006097f00001342000050d900003545",
[],[],"outer_terrain_town_thir_1"),
("village_67",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013003e02d0005ed7800002c2e0000688800005fe4",
[],[],"outer_terrain_plain"),
("village_68",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130079a3200062d8b0000297c00000def000067b7",
[],[],"outer_terrain_plain"),
("village_69",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300022a60005314c0000428100007e0100002e97",
[],[],"outer_terrain_plain"),
("village_70",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079c3200060d860000428100007e01000071b4",
[],[],"outer_terrain_plain"),
("village_71",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000630079ab20005fd7f0000687300007190000006df",
[],[],"outer_terrain_plain"),
("village_72",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000006300654ac00062d910000635800007c9600005d35",
[],[],"outer_terrain_plain"),
("village_73",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079db200050d4500001b4b00007cf400001973",
[],[],"outer_terrain_plain"),
("village_74",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300794320005f17c00003187000051540000350a",
[],[],"outer_terrain_plain"),
("village_75",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002400798b20005ed7b000019160000650f000072d2",
[],[],"outer_terrain_snow"),
("village_76",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022007a7b200045d19000004920000076d00003b0a",
[],[],"outer_terrain_steppe"),
("village_77",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023009629a0005615800005564000023590000579e",
[],[],"outer_terrain_plain"),
("village_78",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023004561e00069da700000f490000256b000058b5",
[],[],"outer_terrain_plain"),
("village_79",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230084fac00057d5f00002ba900004a7a000060be",
[],[],"outer_terrain_plain"),
("village_80",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013001b21e0004f13e000042b2000058e400007fce",
[],[],"outer_terrain_plain"),
#################### Yeni koyler ######################
("village_81",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079ab20005fd7f0000621700007190000006df",
[],[],"outer_terrain_plain"),
("village_82",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002541c00062d8b00000a01000068cb00006d9b",
[],[],"outer_terrain_plain"),
("village_83",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007b2320005956300001e640000462c00003a51",
[],[],"outer_terrain_plain"),
("village_84",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130069b270004dd390000689b00002d3b00001876",
[],[],"outer_terrain_plain"),
("village_85",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000014007b26300059563000051e000001aa4000034ee",
[],[],"outer_terrain_snow"),
("village_86",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000014007b26300059563000051e000001aa4000034ee",
[],[],"outer_terrain_snow"),
("village_87",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013001c98a0004dd3000001a5e00005c6200001ec9",
[],[],"outer_terrain_plain"),
("village_88",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012007a83200049924000049bd00001f7a00006c57",
[],[],"outer_terrain_steppe"),
("village_89",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001200513940005314c00001f6d00006d7700006698",
[],[],"outer_terrain_steppe"),
("village_90",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012002cd900005314c00001f6d00006d7700003493",
[],[],"outer_terrain_steppe"),
("field_1",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000033a059a5a0009525600002005000060e300001175",
[],[],"outer_terrain_plain"),
("field_2",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000033a079a3f000a3a8000006dfd000030a100006522",
[],[],"outer_terrain_steppe"),
("field_3",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30054da28004050000005a76800022aa00002e3b",
[],[],"outer_terrain_steppe"),
("field_4",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30054da28004050000005a76800022aa00002e3b",
[],[],"outer_terrain_steppe"),
("field_5",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30054da28004050000005a76800022aa00002e3b",
[],[],"outer_terrain_steppe"),
]
| Python |
from module_info import *
from module_party_templates import *
#from process_operations import *
from process_common import *
def save_party_template_troop(file,troop):
if troop:
# add_tag_use(tag_uses,tag_troop,troop[0])
file.write("%d %d %d "%(troop[0],troop[1],troop[2]))
if (len(troop) > 3):
file.write("%d "%troop[3])
else:
file.write("0 ")
else:
file.write("-1 ")
def save_party_templates():
file = open(export_dir + "party_templates.txt","w")
file.write("partytemplatesfile version 1\n")
file.write("%d\n"%(len(party_templates)))
for party_template in party_templates:
# add_tag_use(tag_uses,tag_faction,party_template[4])
file.write("pt_%s %s %d %d %d %d "%(convert_to_identifier(party_template[0]),replace_spaces(party_template[1]),party_template[2],party_template[3], party_template[4], party_template[5]))
members = party_template[6]
if (len(members) > 6):
print "Error! NUMBER OF TEMPLATE MEMBERS EXCEEDS 6 " + party_template[0]
members = members[0:6]
for party_template_member in members:
save_party_template_troop(file,party_template_member)
for i in xrange(6 - len(members)):
save_party_template_troop(file,0)
file.write("\n")
file.close()
def save_python_header():
file = open("./ID_party_templates.py","w")
for i_party_template in xrange(len(party_templates)):
file.write("pt_%s = %d\n"%(convert_to_identifier(party_templates[i_party_template][0]),i_party_template))
file.close()
print "Exporting party_template data..."
#tag_uses = load_tag_uses(export_dir)
save_python_header()
save_party_templates()
#save_tag_uses(export_dir, tag_uses)
| Python |
from header_common import *
from header_operations import *
from header_parties import *
from header_items import *
from header_skills import *
from header_triggers import *
from header_troops import *
from module_constants import *
####################################################################################################################
# Each trigger contains the following fields:
# 1) Check interval: How frequently this trigger will be checked
# 2) Delay interval: Time to wait before applying the consequences of the trigger
# After its conditions have been evaluated as true.
# 3) Re-arm interval. How much time must pass after applying the consequences of the trigger for the trigger to become active again.
# You can put the constant ti_once here to make sure that the trigger never becomes active again after it fires once.
# 4) Conditions block (list). This must be a valid operation block. See header_operations.py for reference.
# Every time the trigger is checked, the conditions block will be executed.
# If the conditions block returns true, the consequences block will be executed.
# If the conditions block is empty, it is assumed that it always evaluates to true.
# 5) Consequences block (list). This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################
# Some constants for use below
merchant_inventory_space = 30
num_merchandise_goods = 36
triggers = [
# Tutorial:
(0.1, 0, ti_once, [(map_free,0)], [(dialog_box,"str_tutorial_map1"),
# Here's something tricky, making global variables compatible with native, don't touch or modify.
(eq, 0, 1), # make sure the following are never reached
##############################################
# Native global variables decleration
##############################################
#Triggers begin
(assign, "$caravan_escort_state", 0),
(assign, "$qst_bring_back_runaway_serfs_num_parties_fleed", 0),
(assign, "$qst_bring_back_runaway_serfs_num_parties_returned", 0),
(assign, "$qst_follow_spy_run_away", 0),
(assign, "$qst_follow_spy_meeting_state", 0),
(assign, "$qst_follow_spy_meeting_counter", 0),
(assign, "$qst_follow_spy_spy_back_in_town", 0),
(assign, "$qst_follow_spy_partner_back_in_town", 0),
(assign, "$qst_follow_spy_no_active_parties", 0),
(assign, "$debt_to_merchants_guild", 0),
(assign, "$npc_with_personality_clash", 0),
(assign, "$personality_clash_after_24_hrs", 0),
(assign, "$npc_is_quitting", 0),
#Triggers end
#Dialogs begin
(assign, "$g_talk_troop", 0),
(assign, "$g_talk_agent", 0),
(assign, "$g_talk_troop_faction", 0),
(assign, "$g_talk_troop_relation", 0),
(assign, "$g_talk_troop_faction_relation", 0),
(assign, "$g_talk_troop_party", 0),
(assign, "$g_current_hours", 0),
(assign, "$g_talk_troop_last_talk_time", 0),
(assign, "$g_time_since_last_talk", 0),
(assign, "$g_talk_troop_met", 0),
(assign, "$g_enemy_strength", 0),
(assign, "$g_ally_strength", 0),
(assign, "$g_strength_ratio", 0),
(assign, "$g_comment_found", 0),
(assign, "$g_leave_encounter", 0),
(assign, "$g_move_heroes", 0),
(assign, "$supported_pretender", 0),
(assign, "$npc_quit_morale", 0),
(assign, "$player_can_refuse_npc_quitting", 0),
(assign, "$player_can_persuade_npc", 0),
(assign, "$temp", 0),
(assign, "$g_center_taken_by_player_faction", 0),
(assign, "$map_talk_troop", 0),
(assign, "$npc_with_grievance", 0),
(assign, "$npc_with_personality_clash_2", 0),
(assign, "$npc_with_personality_match", 0),
(assign, "$disable_local_histories", 0),
(assign, "$g_enemy_surrenders", 0),
(assign, "$g_castle_left_to_player", 0),
(assign, "$g_player_surrenders", 0),
(assign, "$pretender_told_story", 0),
(assign, "$town_to_rebel", 0),
(assign, "$town_to_approach", 0),
(assign, "$player_made_legitimacy_claim", 0),
(assign, "$player_made_benefit_claim", 0),
(assign, "$player_made_strength_claim", 0),
(assign, "$g_invite_offered_center", 0),
(assign, "$g_player_follow_army_warnings", 0),
(assign, "$prisoner_lord_to_buy", 0),
(assign, "$g_ransom_offer_rejected", 0),
(assign, "$g_convince_quest", 0),
(assign, "$auto_menu", 0),
(assign, "$capturer_party", 0),
(assign, "$players_oath_renounced_given_center", 0),
(assign, "$players_oath_renounced_terms_state", 0),
(assign, "$player_has_homage", 0),
(assign, "$g_leave_town_outside", 0),
(assign, "$mercenary_service_accumulated_pay", 0),
(assign, "$temp_2", 0),
(assign, "$g_recalculate_ais", 0),
(assign, "$hero_requested_to_learn_location", 0),
(assign, "$faction_requested_to_learn_more_details_about_the_war_against", 0),
(assign, "$encountered_party_hostile", 0),
(assign, "$g_rebellion_suggest_friends_stronger", 0),
(assign, "$rival_lord", 0),
(assign, "$rebellion_chance", 0),
(assign, "$prior_argument_value", 0),
(assign, "$current_argument", 0),
(assign, "$current_argument_value", 0),
(assign, "$player_made_ruler_claim", 0),
(assign, "$rebellion_check", 0),
(assign, "$g_invite_faction", 0),
(assign, "$g_invite_faction_lord", 0),
(assign, "$supported_pretender_old_faction", 0),
(assign, "$g_player_banner_granted", 0),
(assign, "$town_suggested_to_go_to", 0),
(assign, "$suggested_to_attack_party", 0),
(assign, "$suggested_to_attack_center", 0),
(assign, "$mercenary_service_next_pay_time", 0),
(assign, "$mercenary_service_next_renew_day", 0),
(assign, "$random_quest_no", 0),
(assign, "$g_leave_town", 0),
(assign, "$qst_kill_local_merchant_center", 0),
(assign, "$qst_follow_spy_spy_partners_party", 0),
(assign, "$qst_follow_spy_spy_party", 0),
(assign, "$qst_bring_back_runaway_serfs_party_1", 0),
(assign, "$qst_bring_back_runaway_serfs_party_2", 0),
(assign, "$qst_bring_back_runaway_serfs_party_3", 0),
(assign, "$auto_enter_town", 0),
(assign, "$lord_requested_to_talk_to", 0),
(assign, "$troop_to_restore_relations_with", 0),
(assign, "$lady_restore_cost_1", 0),
(assign, "$lady_restore_cost_2", 0),
(assign, "$lady_restore_cost_3", 0),
(assign, "$convince_value", 0),
(assign, "$convince_relation_penalty", 0),
(assign, "$persuasion_strength", 0),
(assign, "$hero_requested_to_learn_relations", 0),
(assign, "$caravan_distance_to_target", 0),
(assign, "$caravan_escort_offer", 0),
(assign, "$caravan_escort_destination_town", 0),
(assign, "$caravan_escort_party_id", 0),
(assign, "$caravan_escort_agreed_reward", 0),
(assign, "$g_permitted_to_center", 0),
(assign, "$deserter_tribute", 0),
(assign, "$buy_drinks_last_time", 0),
(assign, "$ransom_broker_families_told", 0),
(assign, "$ransom_broker_prices_told", 0),
(assign, "$ransom_broker_ransom_me_told", 0),
(assign, "$traveler_land_asked", 0),
(assign, "$last_lost_companion", 0),
(assign, "$traveller_claimants_mentioned", 0),
(assign, "$num_opponents_to_beat_in_a_row", 0),
(assign, "$waiting_for_training_fight_result", 0),
(assign, "$novicemaster_opponent_troop", 0),
(assign, "$training_system_explained", 0),
(assign, "$novice_training_difficulty", 0),
(assign, "$training_fight_won", 0),
(assign, "$merchant_quest_last_offerer", 0),
(assign, "$merchant_offered_quest", 0),
(assign, "$g_force_peace_faction_1", 0),
(assign, "$g_force_peace_faction_2", 0),
(assign, "$random_merchant_quest_no", 0),
(assign, "$mayor_info_lord_told", 0),
(assign, "$escort_merchant_caravan_mode", 0),
(assign, "$qst_troublesome_bandits_eliminated", 0),
(assign, "$qst_troublesome_bandits_eliminated_by_player", 0),
(assign, "$arena_reward_asked", 0),
(assign, "$arena_tournaments_asked", 0),
(assign, "$arena_master_first_talk", 0),
(assign, "$last_training_fight_town", 0),
(assign, "$training_fight_time", 0),
(assign, "$g_mt_mode", 0),
(assign, "$g_player_entry_point", 0),
(assign, "$bandit_tribute", 0),
(assign, "$welfare_inquired", 0),
(assign, "$rumors_inquired", 0),
(assign, "$info_inquired", 0),
#Dialogs end
#Game menus begin
(assign, "$character_gender", 0),
(assign, "$cheat_mode", 0),
(assign, "$g_custom_battle_scenario", 0),
(assign, "$g_battle_result", 0),
(assign, "$g_player_troop", 0),
(assign, "$g_custom_battle_scene", 0),
(assign, "$background_type", 0),
(assign, "$background_answer_2", 0),
(assign, "$background_answer_3", 0),
(assign, "$background_answer_4", 0),
(assign, "$current_string_reg", 0),
(assign, "$g_cheat_selected_faction", 0),
(assign, "$g_player_reading_book", 0),
(assign, "$g_player_icon_state", 0),
(assign, "$g_camp_mode", 0),
(assign, "$g_prisoner_recruit_troop_id", 0),
(assign, "$g_prisoner_recruit_size", 0),
(assign, "$g_prisoner_recruit_last_time", 0),
(assign, "$g_player_debt_to_party_members", 0),
(assign, "$g_enemy_party", 0),
(assign, "$g_ally_party", 0),
(assign, "$new_encounter", 0),
(assign, "$g_encounter_is_in_village", 0),
(assign, "$g_encounter_type", 0),
(assign, "$encountered_party_friendly", 0),
(assign, "$cant_leave_encounter", 0),
(assign, "$talk_context", 0),
(assign, "$g_next_menu", 0),
(assign, "$g_engaged_enemy", 0),
(assign, "$g_village_raid_evil", 0),
(assign, "$no_soldiers_left", 0),
(assign, "$playerparty_postbattle_regulars", 0),
(assign, "$thanked_by_ally_leader", 0),
(assign, "$g_relation_boost", 0),
(assign, "$last_defeated_hero", 0),
(assign, "$last_freed_hero", 0),
(assign, "$capture_screen_shown", 0),
(assign, "$pin_number", 0),
(assign, "$loot_screen_shown", 0),
(assign, "$g_total_victories", 0),
(assign, "$g_total_defeats", 0),
(assign, "$g_siege_final_menu", 0),
(assign, "$g_siege_battle_state", 0),
(assign, "$all_doors_locked", 0),
(assign, "$current_town", 0),
(assign, "$entry_to_town_forbidden", 0),
(assign, "$sneaked_into_town", 0),
(assign, "$town_entered", 0),
(assign, "$g_player_besiege_town", 0),
(assign, "$cant_sneak_into_town", 0),
(assign, "$castle_undefended", 0),
(assign, "$g_town_visit_after_rest", 0),
(assign, "$g_last_defeated_bandits_town", 0),
(assign, "$num_castle_meeting_troops", 0),
(assign, "$castle_meeting_selected_troop", 0),
(assign, "$g_siege_force_wait", 0),
(assign, "$g_siege_method", 0),
(assign, "$g_siege_sallied_out_once", 0),
(assign, "$cant_talk_to_enemy", 0),
(assign, "$auto_besiege_town", 0),
(assign, "$g_siege_method_finish_hours", 0),
(assign, "$g_castle_requested_by_player", 0),
(assign, "$players_oath_renounced_against_kingdom", 0),
(assign, "$players_oath_renounced_begin_time", 0),
(assign, "$g_battle_simulation_cancel_for_party", 0),
(assign, "$g_battle_simulation_auto_enter_town_after_battle", 0),
(assign, "$g_siege_first_encounter", 0),
(assign, "$g_siege_join", 0),
(assign, "$g_defending_against_siege", 0),
(assign, "$qst_collect_taxes_currently_collecting", 0),
(assign, "$qst_train_peasants_against_bandits_currently_training", 0),
(assign, "$auto_enter_menu_in_center", 0),
(assign, "$g_player_raiding_village", 0),
(assign, "$qst_eliminate_bandits_infesting_village_num_bandits", 0),
(assign, "$qst_eliminate_bandits_infesting_village_num_villagers", 0),
(assign, "$g_player_raid_complete", 0),
(assign, "$town_nighttime", 0),
(assign, "$g_last_rest_center", 0),
(assign, "$g_strength_contribution_of_player", 0),
(assign, "$g_improvement_type", 0),
(assign, "$quest_auto_menu", 0),
(assign, "$g_town_assess_trade_goods_after_rest", 0),
(assign, "$g_tournament_cur_tier", 0),
(assign, "$g_tournament_player_team_won", 0),
(assign, "$g_tournament_bet_placed", 0),
(assign, "$g_tournament_bet_win_amount", 0),
(assign, "$g_tournament_last_bet_tier", 0),
(assign, "$g_tournament_next_num_teams", 0),
(assign, "$g_tournament_next_team_size", 0),
(assign, "$g_last_rest_payment_until", 0),
(assign, "$g_main_ship_party", 0),
(assign, "$g_tournament_num_participants_for_fight", 0),
(assign, "$qst_collect_taxes_total_hours", 0),
(assign, "$qst_collect_taxes_hourly_income", 0),
(assign, "$qst_collect_taxes_menu_counter", 0),
(assign, "$qst_collect_taxes_unrest_counter", 0),
(assign, "$qst_collect_taxes_halve_taxes", 0),
(assign, "$g_train_peasants_against_bandits_num_peasants", 0),
(assign, "$g_encountered_party", 0),
(assign, "$last_sneak_attempt_town", 0),
(assign, "$last_sneak_attempt_time", 0),
(assign, "$g_training_ground_melee_training_scene", 0),
(assign, "$g_training_ground_training_count", 0),
(assign, "$temp_3", 0),
(assign, "$g_presentation_marshall_selection_max_renown_2", 0),
(assign, "$g_presentation_marshall_selection_max_renown_2_troop", 0),
(assign, "$g_presentation_marshall_selection_max_renown_1", 0),
(assign, "$g_presentation_marshall_selection_max_renown_1_troop", 0),
(assign, "$g_player_is_captive", 0),
(assign, "$player_ransom_amount", 0),
(assign, "$players_kingdom", 0),
#Game menus end
#Mission templates begin
(assign, "$g_train_peasants_against_bandits_training_succeeded", 0),
(assign, "$pin_player_fallen", 0),
(assign, "$battle_won", 0),
(assign, "$defender_reinforcement_stage", 0),
(assign, "$attacker_reinforcement_stage", 0),
(assign, "$g_presentation_battle_active", 0),
# (assign, "$formation_vector", 0),
# (assign, "$formation_temp_vector", 0),
# (assign, "$formation_selected", 0),
# (assign, "$formation_array_selected", 0),
# (assign, "$formation_max_array_no", 0),
# (assign, "$formation_auto_rotation", 0),
(assign, "$defender_team", 0),
(assign, "$attacker_team", 0),
(assign, "$defender_team_2", 0),
(assign, "$attacker_team_2", 0),
(assign, "$belfry_positioned", 0),
(assign, "$trainer_help_message", 0),
(assign, "$g_last_destroyed_gourds", 0),
(assign, "$g_training_ground_training_success_ratio", 0),
(assign, "$scene_num_total_gourds_destroyed", 0),
(assign, "$g_arena_training_num_agents_spawned", 0),
(assign, "$g_arena_training_kills", 0),
(assign, "$g_arena_training_max_opponents", 0),
(assign, "$g_arena_training_won", 0),
(assign, "$g_arena_training_next_spawn_time", 0),
(assign, "$tutorial_1_state", 0),
(assign, "$tutorial_1_msg_1_displayed", 0),
(assign, "$tutorial_1_msg_2_displayed", 0),
(assign, "$tutorial_1_msg_3_displayed", 0),
(assign, "$tutorial_1_msg_4_displayed", 0),
(assign, "$tutorial_1_msg_5_displayed", 0),
(assign, "$tutorial_1_msg_6_displayed", 0),
(assign, "$tutorial_num_total_dummies_destroyed", 0),
(assign, "$tutorial_time", 0),
(assign, "$g_last_archery_point_earned", 0),
(assign, "$tutorial_num_arrows_hit", 0),
(assign, "$tutorial_1_finished", 0),
(assign, "$tutorial_2_state", 0),
(assign, "$tutorial_2_msg_1_displayed", 0),
(assign, "$tutorial_2_msg_2_displayed", 0),
(assign, "$tutorial_2_msg_3_displayed", 0),
(assign, "$tutorial_2_msg_4_displayed", 0),
(assign, "$tutorial_2_msg_5_displayed", 0),
(assign, "$tutorial_2_msg_6_displayed", 0),
(assign, "$tutorial_2_msg_7_displayed", 0),
(assign, "$tutorial_2_msg_8_displayed", 0),
(assign, "$tutorial_2_msg_9_displayed", 0),
(assign, "$tutorial_2_melee_agent_state", 0),
(assign, "$tutorial_2_finished", 0),
(assign, "$tutorial_3_state", 0),
(assign, "$tutorial_3_msg_1_displayed", 0),
(assign, "$tutorial_3_msg_2_displayed", 0),
(assign, "$tutorial_3_msg_3_displayed", 0),
(assign, "$tutorial_3_msg_4_displayed", 0),
(assign, "$tutorial_3_msg_5_displayed", 0),
(assign, "$tutorial_3_msg_6_displayed", 0),
(assign, "$tutorial_3_finished", 0),
(assign, "$tutorial_4_state", 0),
(assign, "$tutorial_4_msg_1_displayed", 0),
(assign, "$tutorial_4_msg_2_displayed", 0),
(assign, "$tutorial_4_msg_3_displayed", 0),
(assign, "$tutorial_4_msg_4_displayed", 0),
(assign, "$tutorial_4_msg_5_displayed", 0),
(assign, "$tutorial_4_msg_6_displayed", 0),
(assign, "$tutorial_4_msg_7_displayed", 0),
(assign, "$tutorial_4_finished", 0),
(assign, "$tutorial_5_state", 0),
(assign, "$tutorial_5_msg_1_displayed", 0),
(assign, "$tutorial_5_msg_2_displayed", 0),
(assign, "$tutorial_5_msg_3_displayed", 0),
(assign, "$tutorial_5_msg_4_displayed", 0),
(assign, "$tutorial_5_msg_5_displayed", 0),
(assign, "$tutorial_5_msg_6_displayed", 0),
(assign, "$tutorial_5_finished", 0),
#Mission templates end
#Presentations begin
(assign, "$g_presentation_credits_obj_1", 0),
(assign, "$g_presentation_credits_obj_2", 0),
(assign, "$g_presentation_credits_obj_3", 0),
(assign, "$g_presentation_credits_obj_4", 0),
(assign, "$g_presentation_credits_obj_5", 0),
(assign, "$g_presentation_credits_obj_6", 0),
(assign, "$g_presentation_credits_obj_7", 0),
(assign, "$g_presentation_credits_obj_8", 0),
(assign, "$g_presentation_credits_obj_9", 0),
(assign, "$g_presentation_credits_obj_10", 0),
(assign, "$g_presentation_credits_obj_11", 0),
(assign, "$g_presentation_credits_obj_12", 0),
(assign, "$g_presentation_credits_obj_1_alpha", 0),
(assign, "$g_presentation_credits_obj_2_alpha", 0),
(assign, "$g_presentation_credits_obj_3_alpha", 0),
(assign, "$g_presentation_credits_obj_4_alpha", 0),
(assign, "$g_presentation_credits_obj_5_alpha", 0),
(assign, "$g_presentation_credits_obj_6_alpha", 0),
(assign, "$g_presentation_credits_obj_7_alpha", 0),
(assign, "$g_presentation_credits_obj_8_alpha", 0),
(assign, "$g_presentation_credits_obj_9_alpha", 0),
(assign, "$g_presentation_obj_1", 0),
(assign, "$g_presentation_banner_start", 0),
(assign, "$g_presentation_page_no", 0),
(assign, "$g_presentation_obj_22", 0),
(assign, "$g_presentation_obj_23", 0),
(assign, "$g_presentation_obj_2", 0),
(assign, "$g_presentation_obj_3", 0),
(assign, "$g_presentation_obj_4", 0),
(assign, "$g_presentation_obj_5", 0),
(assign, "$g_presentation_obj_19", 0),
(assign, "$g_presentation_obj_20", 0),
(assign, "$g_presentation_obj_16", 0),
(assign, "$g_presentation_obj_17", 0),
(assign, "$g_presentation_obj_18", 0),
(assign, "$g_presentation_obj_15", 0),
(assign, "$g_presentation_obj_21", 0),
(assign, "$g_presentation_obj_14", 0),
(assign, "$g_presentation_obj_6", 0),
(assign, "$g_presentation_obj_7", 0),
(assign, "$g_presentation_obj_24", 0),
(assign, "$g_presentation_obj_28", 0),
(assign, "$g_presentation_obj_32", 0),
(assign, "$g_presentation_obj_33", 0),
(assign, "$g_presentation_obj_8", 0),
(assign, "$g_presentation_obj_9", 0),
(assign, "$g_presentation_obj_25", 0),
(assign, "$g_presentation_obj_29", 0),
(assign, "$g_presentation_obj_34", 0),
(assign, "$g_presentation_obj_35", 0),
(assign, "$g_presentation_obj_10", 0),
(assign, "$g_presentation_obj_11", 0),
(assign, "$g_presentation_obj_26", 0),
(assign, "$g_presentation_obj_30", 0),
(assign, "$g_presentation_obj_36", 0),
(assign, "$g_presentation_obj_37", 0),
(assign, "$g_presentation_obj_12", 0),
(assign, "$g_presentation_obj_13", 0),
(assign, "$g_presentation_obj_27", 0),
(assign, "$g_presentation_obj_31", 0),
(assign, "$g_presentation_obj_38", 0),
(assign, "$g_presentation_obj_39", 0),
(assign, "$g_presentation_next_presentation", 0),
(assign, "$g_presentation_output_slot", 0),
(assign, "$g_presentation_input", 0),
(assign, "$g_presentation_marshall_selection_1_vote", 0),
(assign, "$g_presentation_marshall_selection_2_vote", 0),
(assign, "$g_presentation_marshall_selection_ended", 0),
(assign, "$g_formation_infantry_selected", 0),
(assign, "$g_formation_archers_selected", 0),
(assign, "$g_formation_cavalry_selected", 0),
(assign, "$g_presentation_infantry_movement", 0),
(assign, "$g_presentation_infantry_riding", 0),
(assign, "$g_presentation_infantry_weapon_usage", 0),
(assign, "$g_presentation_archers_movement", 0),
(assign, "$g_presentation_archers_riding", 0),
(assign, "$g_presentation_archers_weapon_usage", 0),
(assign, "$g_presentation_cavalry_movement", 0),
(assign, "$g_presentation_cavalry_riding", 0),
(assign, "$g_presentation_cavalry_weapon_usage", 0),
(assign, "$g_battle_us_ready", 0),
(assign, "$g_battle_us_wounded", 0),
(assign, "$g_battle_us_dead", 0),
(assign, "$g_battle_enemies_ready", 0),
(assign, "$g_battle_enemies_wounded", 0),
(assign, "$g_battle_enemies_dead", 0),
(assign, "$g_battle_allies_ready", 0),
(assign, "$g_battle_allies_wounded", 0),
(assign, "$g_battle_allies_dead", 0),
(assign, "$g_battle_map_width", 0),
(assign, "$g_battle_map_scale", 0),
(assign, "$g_battle_map_height", 0),
(assign, "$g_battle_map_plane", 0),
(assign, "$g_battle_map_infantry_order_flag", 0),
(assign, "$g_battle_map_archers_order_flag", 0),
(assign, "$g_battle_map_cavalry_order_flag", 0),
(assign, "$g_presentation_obj_1_val", 0),
(assign, "$g_presentation_obj_2_val", 0),
(assign, "$g_presentation_obj_3_val", 0),
(assign, "$g_presentation_obj_4_val", 0),
#Presentations end
#Scripts begin
(assign, "$g_player_luck", 0),
(assign, "$g_election_date", 0),
(assign, "$g_player_party_icon", 0),
(assign, "$disable_npc_complaints", 0),
(assign, "$g_encountered_party_2", 0),
(assign, "$g_encountered_party_faction", 0),
(assign, "$g_encountered_party_relation", 0),
(assign, "$g_encountered_party_type", 0),
(assign, "$g_encountered_party_template", 0),
(assign, "$playerparty_prebattle_regulars", 0),
(assign, "$g_training_ground_used_weapon_proficiency", 0),
(assign, "$g_training_ground_training_scene", 0),
(assign, "$g_training_ground_training_num_enemies", 0),
(assign, "$g_training_ground_training_hardness", 0),
(assign, "$g_training_ground_training_num_gourds_to_destroy", 0),
(assign, "$g_training_ground_ranged_distance", 0),
(assign, "$qst_deliver_wine_debt", 0),
(assign, "$incriminate_quest_sacrificed_troop", 0),
(assign, "$pout_party", 0),
(assign, "$player_honor", 0),
(assign, "$g_player_party_morale_modifier_party_size", 0),
(assign, "$g_player_party_morale_modifier_leadership", 0),
(assign, "$g_player_party_morale_modifier_food", 0),
(assign, "$g_player_party_morale_modifier_no_food", 0),
(assign, "$g_player_party_morale_modifier_debt", 0),
(assign, "$party_relative_strength", 0),
(assign, "$ratio_of_prisoners", 0),
(assign, "$ai_team_1_battle_tactic", 0),
(assign, "$ai_team_1", 0),
(assign, "$ai_team_2", 0),
(assign, "$ai_team_2_battle_tactic", 0),
(assign, "$g_player_current_own_troop_kills", 0),
(assign, "$g_last_mission_player_damage", 0),
(assign, "$g_friend_fit_for_battle", 0),
(assign, "$g_enemy_fit_for_battle", 0),
(assign, "$g_starting_strength_main_party", 0),
(assign, "$g_starting_strength_enemy_party", 0),
(assign, "$g_starting_strength_friends", 0),
(assign, "$battle_renown_value", 0),
(assign, "$spy_item_worn", 0),
(assign, "$spy_quest_troop", 0),
(assign, "$num_center_bandits", 0),
(assign, "$cur_belfry_pos", 0),
(assign, "$belfry_rotating_objects_begin", 0),
(assign, "$last_belfry_object_pos", 0),
(assign, "$belfry_num_slots_positioned", 0),
(assign, "$belfry_num_men_pushing", 0),
(assign, "$g_total_quests_completed", 0),
(assign, "$any_allies_at_the_last_battle", 0),
(assign, "$number_of_npc_slots", 0),
(assign, "$npc_grievance_string", 0),
(assign, "$npc_grievance_slot", 0),
(assign, "$npc_praise_not_complaint", 0),
(assign, "$npc_map_talk_context", 0),
(assign, "$g_ransom_offer_troop", 0),
(assign, "$g_ransom_offer_party", 0),
(assign, "$g_check_autos_at_hour", 0),
(assign, "$g_average_center_value_per_faction", 0),
(assign, "$num_log_entries", 0),
(assign, "$log_comment_relation_change", 0),
(assign, "$g_custom_battle_team1_death_count", 0),
(assign, "$g_custom_battle_team2_death_count", 0),
#Scripts end
#Simple triggers begin
(assign, "$g_notification_menu_var1", 0),
(assign, "$g_notification_menu_var2", 0),
(assign, "$g_cur_week_half_daily_wage_payments", 0),
(assign, "$g_last_half_payment_check_day", 0),
(assign, "$g_half_payment_checkpoint", 0),
(assign, "$g_presentation_marshall_selection_max_renown_3", 0),
(assign, "$g_presentation_marshall_selection_max_renown_3_troop", 0),
(assign, "$g_center_to_give_to_player", 0),
(assign, "$g_random_army_quest", 0),
(assign, "$qst_scout_waypoints_wp_1", 0),
(assign, "$qst_scout_waypoints_wp_2", 0),
(assign, "$qst_scout_waypoints_wp_3", 0),
(assign, "$qst_scout_waypoints_wp_1_visited", 0),
(assign, "$qst_scout_waypoints_wp_2_visited", 0),
(assign, "$qst_scout_waypoints_wp_3_visited", 0),
(assign, "$qst_train_peasants_against_bandits_num_hours_trained", 0),
#Simple triggers end
##########################################
# Native global variables decleration end
##########################################
]),
# (1.0, 0, ti_once, [(map_free,0)], [(start_map_conversation,"trp_guide")]),
# Refresh Merchants
(0.0, 0, 24.0, [], [
(reset_item_probabilities,100),
(set_merchandise_modifier_quality,150),
(reset_item_probabilities,100),(set_item_probability_in_merchandise,"itm_salt",700),
(troop_add_merchandise,"trp_salt_mine_merchant",itp_type_goods,num_merchandise_goods),
# Add trade goods to merchant inventories
# (store_sub, ":item_to_production_slot", slot_town_trade_good_productions_begin, trade_goods_begin),
(store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
(try_for_range,":cur_center",towns_begin,towns_end),
(party_get_slot,":cur_merchant",":cur_center",slot_town_merchant),
(reset_item_probabilities,100),
(try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
# (store_add, ":cur_production_slot", ":cur_goods", ":item_to_production_slot"),
(store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
# (party_get_slot, ":cur_production", ":cur_center", ":cur_production_slot"),
(party_get_slot, ":cur_price", ":cur_center", ":cur_price_slot"),
## (assign, ":cur_probability", 100),
## (store_add, ":cur_production", 100, ":cur_production"),
## (val_mul, ":cur_probability", ":cur_production"),
## (val_div, ":cur_probability", 100),
## (try_begin),
## (gt, ":cur_probability", 100),
## (store_sub, ":temp_dif", ":cur_probability", 100),
## (val_mul, ":temp_dif", 4),
## (val_add, ":cur_probability", ":temp_dif"),
## (try_end),
## (store_sub, ":temp_dif", average_price_factor, ":cur_price"),
## (val_div, ":temp_dif", 2),
## (val_add, ":cur_price", ":temp_dif"),
(assign, ":cur_probability", 100),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(set_item_probability_in_merchandise,":cur_goods",":cur_probability"),
(try_end),
(troop_add_merchandise,":cur_merchant",itp_type_goods,num_merchandise_goods),
(troop_ensure_inventory_space,":cur_merchant",merchant_inventory_space),
(troop_sort_inventory, ":cur_merchant"),
(store_troop_gold, ":cur_gold",":cur_merchant"),
(lt,":cur_gold",1500),
(store_random_in_range,":new_gold",500,1000),
(call_script, "script_troop_add_gold",":cur_merchant",":new_gold"),
(try_end),
]),
# Refresh Armor sellers
(0.0, 0, 24.0, [], [
(reset_item_probabilities,100),
(set_merchandise_modifier_quality,150),
(try_for_range,reg(2),armor_merchants_begin,armor_merchants_end),
(troop_add_merchandise,reg(2),itp_type_body_armor,16),
(troop_add_merchandise,reg(2),itp_type_head_armor,16),
(troop_add_merchandise,reg(2),itp_type_foot_armor,8),
(troop_add_merchandise,reg(2),itp_type_hand_armor,4),
(troop_ensure_inventory_space,reg(2),merchant_inventory_space),
(troop_sort_inventory, reg(2)),
(store_troop_gold, reg(6),reg(2)),
(lt,reg(6),900),
(store_random_in_range,":new_gold",200,400),
(call_script, "script_troop_add_gold",reg(2),":new_gold"),
(end_try,0),
]),
# Refresh Weapon sellers
(0.0, 0, 24.0, [], [
(reset_item_probabilities,100),
(set_merchandise_modifier_quality,150),
(try_for_range,reg(2),weapon_merchants_begin,weapon_merchants_end),
(troop_add_merchandise,reg(2),itp_type_one_handed_wpn,5),
(troop_add_merchandise,reg(2),itp_type_two_handed_wpn,5),
(troop_add_merchandise,reg(2),itp_type_polearm,5),
(troop_add_merchandise,reg(2),itp_type_shield,6),
(troop_add_merchandise,reg(2),itp_type_bow,4),
(troop_add_merchandise,reg(2),itp_type_crossbow,3),
(troop_add_merchandise,reg(2),itp_type_thrown,5),
(troop_add_merchandise,reg(2),itp_type_arrows,2),
(troop_add_merchandise,reg(2),itp_type_bolts,2),
(troop_ensure_inventory_space,reg(2),merchant_inventory_space),
(troop_sort_inventory, reg(2)),
(store_troop_gold, reg(6),reg(2)),
(lt,reg(6),900),
(store_random_in_range,":new_gold",200,400),
(call_script, "script_troop_add_gold",reg(2),":new_gold"),
(end_try,0),
]),
# Refresh Horse sellers
(0.0, 0, 24.0, [], [
(reset_item_probabilities,100),
(set_merchandise_modifier_quality,150),
(try_for_range,":cur_merchant",horse_merchants_begin,horse_merchants_end),
(troop_add_merchandise,":cur_merchant",itp_type_horse,5),
(troop_ensure_inventory_space,":cur_merchant",65),
(troop_sort_inventory, ":cur_merchant"),
(store_troop_gold, ":cur_gold",":cur_merchant"),
(lt,":cur_gold",600),
(store_random_in_range,":new_gold",200,400),
(call_script, "script_troop_add_gold",":cur_merchant",":new_gold"),
(try_end),
]),
#############
#Captivity:
# (1.0, 0, 0.0, [],
# [
# (ge,"$captivity_mode",1),
# (store_current_hours,reg(1)),
# (val_sub,reg(1),"$captivity_end_time"),
# (ge,reg(1),0),
# (display_message,"str_nobleman_reached_destination"),
# (jump_to_menu,"$captivity_end_menu"),
# ]),
(5.7, 0, 0.0, [(store_num_parties_created,reg(3),"pt_manhunters"),
(lt,reg(3),num_max_zendar_manhunters),
(store_num_parties_of_template, reg(2), "pt_manhunters"), (lt,reg(2),3)],
[(set_spawn_radius,1),(spawn_around_party,"p_zendar","pt_manhunters")]),
# (5.2, 0, 0.0, [(store_num_parties_created,reg(3),"pt_peasant"),(lt,reg(3),num_max_zendar_peasants),
# (store_num_parties_of_template, reg(2), "pt_peasant"), (lt,reg(2),3)],
# [(set_spawn_radius,1),(spawn_around_party,"p_zendar","pt_peasant")]),
#Tax Collectors
# Prisoner Trains
# (4.1, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_swadians"),
# (assign, "$pin_party_template", "pt_swadian_prisoner_train"),
# (assign, "$pin_limit", peak_prisoner_trains),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party),
# (party_set_ai_object,"$pout_party","$pout_town"),
# ]),
#
# (4.1, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_vaegirs"),
# (assign, "$pin_party_template", "pt_vaegir_prisoner_train"),
# (assign, "$pin_limit", peak_prisoner_trains),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party),
# (party_set_ai_object,"$pout_party","$pout_town"),
# ]),
(2.0, 0, 0, [(store_random_party_of_template, reg(2), "pt_prisoner_train_party"),
(party_is_in_any_town,reg(2)),
],
[(store_faction_of_party, ":faction_no", reg(2)),
(call_script,"script_cf_select_random_walled_center_with_faction", ":faction_no", -1),
(party_set_ai_behavior,reg(2),ai_bhvr_travel_to_party),
(party_set_ai_object,reg(2),reg0),
(party_set_flags, reg(2), pf_default_behavior, 0),
]),
##Caravans
# (4.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_swadians"),
# (assign, "$pin_party_template", "pt_swadian_caravan"),
# (assign, "$pin_limit", peak_kingdom_caravans),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party),
# (party_set_ai_object,"$pout_party","$pout_town"),
# ]),
# (4.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_vaegirs"),
# (assign, "$pin_party_template", "pt_vaegir_caravan"),
# (assign, "$pin_limit", peak_kingdom_caravans),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party),
# (party_set_ai_object,"$pout_party","$pout_town"),
# ]),
## (2.0, 0, 0, [(store_random_party_of_template, reg(2), "pt_kingdom_caravan_party"),
## (party_is_in_any_town,reg(2)),
## ],
## [(store_faction_of_party, ":faction_no", reg(2)),
## (call_script,"script_cf_select_random_town_with_faction", ":faction_no"),
## (party_set_ai_behavior,reg(2),ai_bhvr_travel_to_party),
## (party_set_ai_object,reg(2),reg0),
## (party_set_flags, reg(2), pf_default_behavior, 0),
## ]),
(4.0, 0, 0.0, [(eq, "$caravan_escort_state", 1), #cancel caravan_escort_state if caravan leaves the destination
(get_party_ai_object,reg(1),"$caravan_escort_party_id"),
(neq,reg(1),"$caravan_escort_destination_town"),
],
[(assign,"$caravan_escort_state",0),
# (add_xp_as_reward,100),
]),
#Messengers
# (4.2, 0, 0.0, [],
# [(assign, "$pin_faction", "fac_swadians"),
# (assign, "$pin_party_template", "pt_swadian_messenger"),
# (assign, "$pin_limit", peak_kingdom_messengers),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party),
# (party_set_ai_object,"$pout_party","$pout_town"),
# ]),
# (4.2, 0, 0.0, [],
# [(assign, "$pin_faction", "fac_vaegirs"),
# (assign, "$pin_party_template", "pt_vaegir_messenger"),
# (assign, "$pin_limit", peak_kingdom_caravans),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party),
# (party_set_ai_object,"$pout_party","$pout_town"),
# ]),
(1.5, 0, 0, [(store_random_party_of_template, reg(2), "pt_messenger_party"),
(party_is_in_any_town,reg(2)),
],
[(store_faction_of_party, ":faction_no", reg(2)),
(call_script,"script_cf_select_random_walled_center_with_faction", ":faction_no", -1),
(party_set_ai_behavior,reg(2),ai_bhvr_travel_to_party),
(party_set_ai_object,reg(2),reg0),
(party_set_flags, reg(2), pf_default_behavior, 0),
]),
#Deserters
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_swadians"),
# (assign, "$pin_party_template", "pt_swadian_deserters"),
# (assign, "$pin_limit", 4),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_vaegirs"),
# (assign, "$pin_party_template", "pt_vaegir_deserters"),
# (assign, "$pin_limit", 4),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
#Kingdom Parties
(1.0, 0, 0.0, [],
[(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(neq, ":cur_kingdom", "fac_player_supporters_faction"),
## (try_begin),
## (store_random_in_range, ":random_no", 0, 100),
## (lt, ":random_no", 10),
## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_forager),
## (try_end),
## (try_begin),
## (store_random_in_range, ":random_no", 0, 100),
## (lt, ":random_no", 10),
## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_scout),
## (try_end),
## (try_begin),
## (store_random_in_range, ":random_no", 0, 100),
## (lt, ":random_no", 10),
## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_patrol),
## (try_end),
## (try_begin),
## (store_random_in_range, ":random_no", 0, 100),
## (lt, ":random_no", 10),
## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_messenger),
## (try_end),
(try_begin),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 10),
(call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_kingdom_caravan),
(try_end),
## (try_begin),
## (store_random_in_range, ":random_no", 0, 100),
## (lt, ":random_no", 10),
## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_prisoner_train),
## (try_end),
(try_end),
]),
#Swadians
# (0.0, 0.0, ti_once, [], [(assign,"$peak_swadian_foragers",4)]),
# (0.0, 0.0, ti_once, [], [(assign,"$peak_swadian_scouts",4)]),
# (0.0, 0.0, ti_once, [], [(assign,"$peak_swadian_harassers",3)]),
# (0.0, 0.0, ti_once, [], [(assign,"$peak_swadian_war_parties",2)]),
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_swadians"),
# (assign, "$pin_party_template", "pt_swadian_foragers"),
# (assign, "$pin_limit", "$peak_swadian_foragers"),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_swadians"),
# (assign, "$pin_party_template", "pt_swadian_scouts"),
# (assign, "$pin_limit", "$peak_swadian_scouts"),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_swadians"),
# (assign, "$pin_party_template", "pt_swadian_patrol"),
# (assign, "$pin_limit", "$peak_swadian_harassers"),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_swadians"),
# (assign, "$pin_party_template", "pt_swadian_war_party"),
# (assign, "$pin_limit", "$peak_swadian_war_parties"),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
#Vaegirs
# (0.0, 0.0, ti_once, [], [(assign,"$peak_vaegir_foragers",4)]),
# (0.0, 0.0, ti_once, [], [(assign,"$peak_vaegir_scouts",4)]),
# (0.0, 0.0, ti_once, [], [(assign,"$peak_vaegir_harassers",3)]),
# (0.0, 0.0, ti_once, [], [(assign,"$peak_vaegir_war_parties",2)]),
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_vaegirs"),
# (assign, "$pin_party_template", "pt_vaegir_foragers"),
# (assign, "$pin_limit", "$peak_vaegir_foragers"),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_vaegirs"),
# (assign, "$pin_party_template", "pt_vaegir_scouts"),
# (assign, "$pin_limit", "$peak_vaegir_scouts"),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_vaegirs"),
# (assign, "$pin_party_template", "pt_vaegir_patrol"),
# (assign, "$pin_limit", "$peak_vaegir_harassers"),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
# (10.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_vaegirs"),
# (assign, "$pin_party_template", "pt_vaegir_war_party"),
# (assign, "$pin_limit", "$peak_vaegir_war_parties"),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
#Villains etc.
# (14.2, 0, 0.0, [],
# [
# (assign, "$pin_faction", "fac_sea_raiders"),
# (assign, "$pin_party_template", "pt_sea_raiders"),
# (assign, "$pin_limit", 5),
# (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"),
# ]),
#
## (10.1, 0, 0.0, [],
## [
## (assign, "$pin_party_template", "pt_refugees"),
## (assign, "$pin_limit", 5),
## (call_script,"script_cf_spawn_party_at_random_town_if_below_limit"),
## ]),
##
## (10.1, 0, 0.0, [],
## [
## (assign, "$pin_party_template", "pt_farmers"),
## (assign, "$pin_limit", 6),
## (call_script,"script_cf_spawn_party_at_random_town_if_below_limit"),
## ]),
# [1.0, 96.0, ti_once, [], [[assign,"$peak_dark_hunters",3]]],
## (10.1, 0, 0.0, [],
## [
## (assign, "$pin_party_template", "pt_dark_hunters"),
## (assign, "$pin_limit", "$peak_dark_hunters"),
## (call_script,"script_cf_spawn_party_at_random_town_if_below_limit"),
## ]),
#Companion quests
## (0, 0, ti_once,
## [
## (entering_town,"p_town_1"),
## (main_party_has_troop,"trp_borcha"),
## (eq,"$borcha_freed",0)
## ],
##
## [
## (assign,"$borcha_arrive_sargoth_as_prisoner",1),
## (start_map_conversation,"trp_borcha")
## ]
## ),
##
## (1, 0, ti_once,
## [
## (map_free,0),
## (eq,"$borcha_asked_for_freedom",0),
## (main_party_has_troop,"trp_borcha")
## ],
## [
## (start_map_conversation,"trp_borcha")
## ]
## ),
##
## (2, 0, ti_once,
## [
## (map_free, 0),
## (neq,"$borcha_asked_for_freedom",0),
## (eq,"$borcha_freed",0),
## (main_party_has_troop,"trp_borcha")
## ],
## [
## (start_map_conversation,"trp_borcha"),
## ]
## ),
##### TODO: QUESTS COMMENT OUT BEGIN
###########################################################################
### Random Governer Quest triggers
###########################################################################
# Incriminate Loyal Advisor quest
(0.2, 0.0, 0.0,
[
(check_quest_active, "qst_incriminate_loyal_commander"),
(neg|check_quest_concluded, "qst_incriminate_loyal_commander"),
(quest_slot_eq, "qst_incriminate_loyal_commander", slot_quest_current_state, 2),
(quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
(quest_get_slot, ":quest_target_party", "qst_incriminate_loyal_commander", slot_quest_target_party),
(try_begin),
(neg|party_is_active, ":quest_target_party"),
(quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_current_state, 3),
(call_script, "script_fail_quest", "qst_incriminate_loyal_commander"),
(else_try),
(party_is_in_town, ":quest_target_party", ":quest_target_center"),
(remove_party, ":quest_target_party"),
(quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_current_state, 3),
(quest_get_slot, ":quest_object_troop", "qst_incriminate_loyal_commander", slot_quest_object_troop),
(assign, ":num_available_factions", 0),
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(neq, ":faction_no", "fac_player_supporters_faction"),
(neg|quest_slot_eq, "qst_incriminate_loyal_commander", slot_quest_target_faction, ":faction_no"),
(val_add, ":num_available_factions", 1),
(try_end),
(try_begin),
(gt, ":num_available_factions", 0),
(store_random_in_range, ":random_faction", 0, ":num_available_factions"),
(assign, ":target_faction", -1),
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(eq, ":target_faction", -1),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(neq, ":faction_no", "fac_player_supporters_faction"),
(neg|quest_slot_eq, "qst_incriminate_loyal_commander", slot_quest_target_faction, ":faction_no"),
(val_sub, ":random_faction", 1),
(lt, ":random_faction", 0),
(assign, ":target_faction", ":faction_no"),
(try_end),
(try_end),
(try_begin),
(gt, ":target_faction", 0),
(call_script, "script_change_troop_faction", ":quest_object_troop", ":target_faction"),
(else_try),
(call_script, "script_change_troop_faction", ":quest_object_troop", "fac_robber_knights"),
(try_end),
(call_script, "script_succeed_quest", "qst_incriminate_loyal_commander"),
(try_end),
],
[]
),
# Runaway Peasants quest
(0.2, 0.0, 0.0,
[
(check_quest_active, "qst_bring_back_runaway_serfs"),
(neg|check_quest_concluded, "qst_bring_back_runaway_serfs"),
(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(quest_get_slot, ":quest_target_center", "qst_bring_back_runaway_serfs", slot_quest_target_center),
(try_begin),
(party_is_active, "$qst_bring_back_runaway_serfs_party_1"),
(try_begin),
(party_is_in_town, "$qst_bring_back_runaway_serfs_party_1", ":quest_target_center"),
(remove_party, "$qst_bring_back_runaway_serfs_party_1"),
(val_add, "$qst_bring_back_runaway_serfs_num_parties_fleed", 1),
(else_try),
(party_is_in_town, "$qst_bring_back_runaway_serfs_party_1", ":quest_object_center"),
(remove_party, "$qst_bring_back_runaway_serfs_party_1"),
(val_add, "$qst_bring_back_runaway_serfs_num_parties_returned", 1),
(else_try),
(store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_bring_back_runaway_serfs_party_1"),
(gt, ":cur_distance", 3),
(party_set_ai_object, "$qst_bring_back_runaway_serfs_party_1", ":quest_target_center"),
(try_end),
(try_end),
(try_begin),
(party_is_active, "$qst_bring_back_runaway_serfs_party_2"),
(try_begin),
(party_is_in_town, "$qst_bring_back_runaway_serfs_party_2", ":quest_target_center"),
(remove_party, "$qst_bring_back_runaway_serfs_party_2"),
(val_add, "$qst_bring_back_runaway_serfs_num_parties_fleed", 1),
(else_try),
(party_is_in_town, "$qst_bring_back_runaway_serfs_party_2", ":quest_object_center"),
(remove_party, "$qst_bring_back_runaway_serfs_party_2"),
(val_add, "$qst_bring_back_runaway_serfs_num_parties_returned", 1),
(else_try),
(store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_bring_back_runaway_serfs_party_2"),
(gt, ":cur_distance", 3),
(party_set_ai_object, "$qst_bring_back_runaway_serfs_party_2", ":quest_target_center"),
(try_end),
(try_end),
(try_begin),
(party_is_active, "$qst_bring_back_runaway_serfs_party_3"),
(try_begin),
(party_is_in_town, "$qst_bring_back_runaway_serfs_party_3", ":quest_target_center"),
(remove_party, "$qst_bring_back_runaway_serfs_party_3"),
(val_add, "$qst_bring_back_runaway_serfs_num_parties_fleed", 1),
(else_try),
(party_is_in_town, "$qst_bring_back_runaway_serfs_party_3", ":quest_object_center"),
(remove_party, "$qst_bring_back_runaway_serfs_party_3"),
(val_add, "$qst_bring_back_runaway_serfs_num_parties_returned", 1),
(else_try),
(store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_bring_back_runaway_serfs_party_3"),
(gt, ":cur_distance", 3),
(party_set_ai_object, "$qst_bring_back_runaway_serfs_party_3", ":quest_target_center"),
(try_end),
(try_end),
(assign, ":sum_removed", "$qst_bring_back_runaway_serfs_num_parties_returned"),
(val_add, ":sum_removed", "$qst_bring_back_runaway_serfs_num_parties_fleed"),
(ge, ":sum_removed", 3),
(try_begin),
(ge, "$qst_bring_back_runaway_serfs_num_parties_returned", 3),
(call_script, "script_succeed_quest", "qst_bring_back_runaway_serfs"),
(else_try),
(eq, "$qst_bring_back_runaway_serfs_num_parties_returned", 0),
(call_script, "script_fail_quest", "qst_bring_back_runaway_serfs"),
(else_try),
(call_script, "script_conclude_quest", "qst_bring_back_runaway_serfs"),
(try_end),
],
[]
),
### Defend Nobles Against Peasants quest
## (0.2, 0.0, 0.0,
## [
## (check_quest_active, "qst_defend_nobles_against_peasants"),
## (neg|check_quest_succeeded, "qst_defend_nobles_against_peasants"),
## (neg|check_quest_failed, "qst_defend_nobles_against_peasants"),
## (quest_get_slot, ":quest_target_center", "qst_defend_nobles_against_peasants", slot_quest_target_center),
## (assign, ":num_active_parties", 0),
## (try_begin),
## (gt, "$qst_defend_nobles_against_peasants_noble_party_1", 0),
## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_1"),
## (val_add, ":num_active_parties", 1),
## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_1", ":quest_target_center"),
## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_1"),
## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_1"),
## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"),
## (try_end),
## (try_begin),
## (gt, "$qst_defend_nobles_against_peasants_noble_party_2", 0),
## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_2"),
## (val_add, ":num_active_parties", 1),
## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_2", ":quest_target_center"),
## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_2"),
## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_2"),
## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"),
## (try_end),
## (try_begin),
## (gt, "$qst_defend_nobles_against_peasants_noble_party_3", 0),
## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_3"),
## (val_add, ":num_active_parties", 1),
## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_3", ":quest_target_center"),
## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_3"),
## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_3"),
## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"),
## (try_end),
## (try_begin),
## (gt, "$qst_defend_nobles_against_peasants_noble_party_4", 0),
## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_4"),
## (val_add, ":num_active_parties", 1),
## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_4", ":quest_target_center"),
## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_4"),
## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_4"),
## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"),
## (try_end),
## (try_begin),
## (gt, "$qst_defend_nobles_against_peasants_noble_party_5", 0),
## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_5"),
## (val_add, ":num_active_parties", 1),
## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_5", ":quest_target_center"),
## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_5"),
## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_5"),
## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"),
## (try_end),
## (try_begin),
## (gt, "$qst_defend_nobles_against_peasants_noble_party_6", 0),
## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_6"),
## (val_add, ":num_active_parties", 1),
## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_6", ":quest_target_center"),
## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_6"),
## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_6"),
## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"),
## (try_end),
## (try_begin),
## (gt, "$qst_defend_nobles_against_peasants_noble_party_7", 0),
## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_7"),
## (val_add, ":num_active_parties", 1),
## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_7", ":quest_target_center"),
## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_7"),
## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_7"),
## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"),
## (try_end),
## (try_begin),
## (gt, "$qst_defend_nobles_against_peasants_noble_party_8", 0),
## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_8"),
## (val_add, ":num_active_parties", 1),
## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_8", ":quest_target_center"),
## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_8"),
## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_8"),
## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"),
## (try_end),
## (eq, ":num_active_parties", 0),
## (try_begin),
## (store_div, ":limit", "$qst_defend_nobles_against_peasants_num_nobles_to_save", 2),
## (ge, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":limit"),
## (call_script, "script_succeed_quest", "qst_defend_nobles_against_peasants"),
## (else_try),
## (call_script, "script_fail_quest", "qst_defend_nobles_against_peasants"),
## (try_end),
## ],
## []
## ),
### Capture Conspirators quest
## (0.15, 0.0, 0.0,
## [
## (check_quest_active, "qst_capture_conspirators"),
## (neg|check_quest_succeeded, "qst_capture_conspirators"),
## (neg|check_quest_failed, "qst_capture_conspirators"),
## (quest_get_slot, ":quest_target_center", "qst_capture_conspirators", slot_quest_target_center),
## (quest_get_slot, ":faction_no", "qst_capture_conspirators", slot_quest_target_faction),
## (try_begin),
## (gt, "$qst_capture_conspirators_num_parties_to_spawn", "$qst_capture_conspirators_num_parties_spawned"),
## (store_random_in_range, ":random_no", 0, 100),
## (lt, ":random_no", 20),
## (set_spawn_radius, 3),
## (spawn_around_party,":quest_target_center","pt_conspirator"),
## (val_add, "$qst_capture_conspirators_num_parties_spawned", 1),
## (party_get_num_companions, ":num_companions", reg0),
## (val_add, "$qst_capture_conspirators_num_troops_to_capture", ":num_companions"),
## (party_set_ai_behavior, reg0, ai_bhvr_travel_to_party),
## (party_set_ai_object, reg0, "$qst_capture_conspirators_party_1"),
## (party_set_flags, reg0, pf_default_behavior, 0),
## (try_begin),
## (le, "$qst_capture_conspirators_party_2", 0),
## (assign, "$qst_capture_conspirators_party_2", reg0),
## (else_try),
## (le, "$qst_capture_conspirators_party_3", 0),
## (assign, "$qst_capture_conspirators_party_3", reg0),
## (else_try),
## (le, "$qst_capture_conspirators_party_4", 0),
## (assign, "$qst_capture_conspirators_party_4", reg0),
## (else_try),
## (le, "$qst_capture_conspirators_party_5", 0),
## (assign, "$qst_capture_conspirators_party_5", reg0),
## (else_try),
## (le, "$qst_capture_conspirators_party_6", 0),
## (assign, "$qst_capture_conspirators_party_6", reg0),
## (else_try),
## (le, "$qst_capture_conspirators_party_7", 0),
## (assign, "$qst_capture_conspirators_party_7", reg0),
## (try_end),
## (try_end),
##
## (assign, ":num_active_parties", 0),
##
## (try_begin),
## (gt, "$qst_capture_conspirators_party_1", 0),
## (party_is_active, "$qst_capture_conspirators_party_1"),
## (val_add, ":num_active_parties", 1),
## (try_begin),
## (party_is_in_any_town, "$qst_capture_conspirators_party_1"),
## (remove_party, "$qst_capture_conspirators_party_1"),
## (else_try),
## (party_get_num_attached_parties, ":num_attachments", "$qst_capture_conspirators_party_1"),
## (gt, ":num_attachments", 0),
## (assign, ":leave_meeting", 0),
## (try_begin),
## (store_sub, ":required_attachments", "$qst_capture_conspirators_num_parties_to_spawn", 1),
## (eq, ":num_attachments", ":required_attachments"),
## (val_add, "$qst_capture_conspirators_leave_meeting_counter", 1),
## (ge, "$qst_capture_conspirators_leave_meeting_counter", 15),
## (assign, ":leave_meeting", 1),
## (try_end),
## (try_begin),
## (eq, "$qst_capture_conspirators_num_parties_to_spawn", "$qst_capture_conspirators_num_parties_spawned"),
## (store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_capture_conspirators_party_1"),
## (assign, ":min_distance", 3),
## (try_begin),
## (is_currently_night),
## (assign, ":min_distance", 2),
## (try_end),
## (lt, ":cur_distance", ":min_distance"),
## (assign, "$qst_capture_conspirators_leave_meeting_counter", 15),
## (assign, ":leave_meeting", 1),
## (try_end),
## (eq, ":leave_meeting", 1),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_1", ai_bhvr_travel_to_point),
## (party_set_flags, "$qst_capture_conspirators_party_1", pf_default_behavior, 0),
## (party_get_position, pos1, "$qst_capture_conspirators_party_1"),
## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17),
## (party_set_ai_target_position, "$qst_capture_conspirators_party_1", pos2),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_2", 0),
## (party_detach, "$qst_capture_conspirators_party_2"),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_2", ai_bhvr_travel_to_point),
## (party_set_flags, "$qst_capture_conspirators_party_2", pf_default_behavior, 0),
## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17),
## (party_set_ai_target_position, "$qst_capture_conspirators_party_2", pos2),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_3", 0),
## (party_detach, "$qst_capture_conspirators_party_3"),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_3", ai_bhvr_travel_to_point),
## (party_set_flags, "$qst_capture_conspirators_party_3", pf_default_behavior, 0),
## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17),
## (party_set_ai_target_position, "$qst_capture_conspirators_party_3", pos2),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_4", 0),
## (party_detach, "$qst_capture_conspirators_party_4"),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_4", ai_bhvr_travel_to_point),
## (party_set_flags, "$qst_capture_conspirators_party_4", pf_default_behavior, 0),
## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17),
## (party_set_ai_target_position, "$qst_capture_conspirators_party_4", pos2),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_5", 0),
## (party_detach, "$qst_capture_conspirators_party_5"),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_5", ai_bhvr_travel_to_point),
## (party_set_flags, "$qst_capture_conspirators_party_5", pf_default_behavior, 0),
## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17),
## (party_set_ai_target_position, "$qst_capture_conspirators_party_5", pos2),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_6", 0),
## (party_detach, "$qst_capture_conspirators_party_6"),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_6", ai_bhvr_travel_to_point),
## (party_set_flags, "$qst_capture_conspirators_party_6", pf_default_behavior, 0),
## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17),
## (party_set_ai_target_position, "$qst_capture_conspirators_party_6", pos2),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_7", 0),
## (party_detach, "$qst_capture_conspirators_party_7"),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_7", ai_bhvr_travel_to_point),
## (party_set_flags, "$qst_capture_conspirators_party_7", pf_default_behavior, 0),
## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17),
## (party_set_ai_target_position, "$qst_capture_conspirators_party_7", pos2),
## (try_end),
## (try_end),
## (try_begin),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_1"),
## (eq, ":ai_behavior", ai_bhvr_travel_to_point),
## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_1"),
## (party_get_position, pos1, "$qst_capture_conspirators_party_1"),
## (get_distance_between_positions, ":distance", pos2, pos1),
## (lt, ":distance", 200),
## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_1", ":faction_no"),#Can fail
## (ge, reg0, 0),
## (party_set_ai_object, "$qst_capture_conspirators_party_1", reg0),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_1", ai_bhvr_travel_to_party),
## (party_set_flags, "$qst_capture_conspirators_party_1", pf_default_behavior, 0),
## (try_end),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_2", 0),
## (party_is_active, "$qst_capture_conspirators_party_2"),
## (val_add, ":num_active_parties", 1),
## (try_begin),
## (party_is_in_any_town, "$qst_capture_conspirators_party_2"),
## (try_begin),
## (neg|party_is_in_town, "$qst_capture_conspirators_party_2", "$qst_capture_conspirators_party_1"),
## (remove_party, "$qst_capture_conspirators_party_2"),
## (else_try),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_2"),
## (neq, ":ai_behavior", ai_bhvr_hold),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_2", ai_bhvr_hold),
## (party_attach_to_party, "$qst_capture_conspirators_party_2", "$qst_capture_conspirators_party_1"),
## (party_set_flags, "$qst_capture_conspirators_party_2", pf_default_behavior, 0),
## (try_end),
## (try_end),
## (try_begin),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_2"),
## (eq, ":ai_behavior", ai_bhvr_travel_to_point),
## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_2"),
## (party_get_position, pos1, "$qst_capture_conspirators_party_2"),
## (get_distance_between_positions, ":distance", pos2, pos1),
## (lt, ":distance", 200),
## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_2", ":faction_no"),#Can fail
## (ge, reg0, 0),
## (party_set_ai_object, "$qst_capture_conspirators_party_2", reg0),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_2", ai_bhvr_travel_to_party),
## (party_set_flags, "$qst_capture_conspirators_party_2", pf_default_behavior, 0),
## (try_end),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_3", 0),
## (party_is_active, "$qst_capture_conspirators_party_3"),
## (val_add, ":num_active_parties", 1),
## (try_begin),
## (party_is_in_any_town, "$qst_capture_conspirators_party_3"),
## (try_begin),
## (neg|party_is_in_town, "$qst_capture_conspirators_party_3", "$qst_capture_conspirators_party_1"),
## (remove_party, "$qst_capture_conspirators_party_3"),
## (else_try),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_3"),
## (neq, ":ai_behavior", ai_bhvr_hold),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_3", ai_bhvr_hold),
## (party_attach_to_party, "$qst_capture_conspirators_party_3", "$qst_capture_conspirators_party_1"),
## (party_set_flags, "$qst_capture_conspirators_party_3", pf_default_behavior, 0),
## (try_end),
## (try_end),
## (try_begin),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_3"),
## (eq, ":ai_behavior", ai_bhvr_travel_to_point),
## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_3"),
## (party_get_position, pos1, "$qst_capture_conspirators_party_3"),
## (get_distance_between_positions, ":distance", pos2, pos1),
## (lt, ":distance", 200),
## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_3", ":faction_no"),#Can fail
## (ge, reg0, 0),
## (party_set_ai_object, "$qst_capture_conspirators_party_3", reg0),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_3", ai_bhvr_travel_to_party),
## (party_set_flags, "$qst_capture_conspirators_party_3", pf_default_behavior, 0),
## (try_end),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_4", 0),
## (party_is_active, "$qst_capture_conspirators_party_4"),
## (val_add, ":num_active_parties", 1),
## (try_begin),
## (party_is_in_any_town, "$qst_capture_conspirators_party_4"),
## (try_begin),
## (neg|party_is_in_town, "$qst_capture_conspirators_party_4", "$qst_capture_conspirators_party_1"),
## (remove_party, "$qst_capture_conspirators_party_4"),
## (else_try),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_4"),
## (neq, ":ai_behavior", ai_bhvr_hold),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_4", ai_bhvr_hold),
## (party_set_flags, "$qst_capture_conspirators_party_4", pf_default_behavior, 0),
## (party_attach_to_party, "$qst_capture_conspirators_party_4", "$qst_capture_conspirators_party_1"),
## (try_end),
## (try_end),
## (try_begin),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_4"),
## (eq, ":ai_behavior", ai_bhvr_travel_to_point),
## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_4"),
## (party_get_position, pos1, "$qst_capture_conspirators_party_4"),
## (get_distance_between_positions, ":distance", pos2, pos1),
## (lt, ":distance", 200),
## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_4", ":faction_no"),#Can fail
## (ge, reg0, 0),
## (party_set_ai_object, "$qst_capture_conspirators_party_4", reg0),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_4", ai_bhvr_travel_to_party),
## (party_set_flags, "$qst_capture_conspirators_party_4", pf_default_behavior, 0),
## (try_end),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_5", 0),
## (party_is_active, "$qst_capture_conspirators_party_5"),
## (val_add, ":num_active_parties", 1),
## (try_begin),
## (party_is_in_any_town, "$qst_capture_conspirators_party_5"),
## (try_begin),
## (neg|party_is_in_town, "$qst_capture_conspirators_party_5", "$qst_capture_conspirators_party_1"),
## (remove_party, "$qst_capture_conspirators_party_5"),
## (else_try),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_5"),
## (neq, ":ai_behavior", ai_bhvr_hold),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_5", ai_bhvr_hold),
## (party_set_flags, "$qst_capture_conspirators_party_5", pf_default_behavior, 0),
## (party_attach_to_party, "$qst_capture_conspirators_party_5", "$qst_capture_conspirators_party_1"),
## (try_end),
## (try_end),
## (try_begin),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_5"),
## (eq, ":ai_behavior", ai_bhvr_travel_to_point),
## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_5"),
## (party_get_position, pos1, "$qst_capture_conspirators_party_5"),
## (get_distance_between_positions, ":distance", pos2, pos1),
## (lt, ":distance", 200),
## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_5", ":faction_no"),#Can fail
## (ge, reg0, 0),
## (party_set_ai_object, "$qst_capture_conspirators_party_5", reg0),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_5", ai_bhvr_travel_to_party),
## (party_set_flags, "$qst_capture_conspirators_party_5", pf_default_behavior, 0),
## (try_end),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_6", 0),
## (party_is_active, "$qst_capture_conspirators_party_6"),
## (val_add, ":num_active_parties", 1),
## (try_begin),
## (party_is_in_any_town, "$qst_capture_conspirators_party_6"),
## (try_begin),
## (neg|party_is_in_town, "$qst_capture_conspirators_party_6", "$qst_capture_conspirators_party_1"),
## (remove_party, "$qst_capture_conspirators_party_6"),
## (else_try),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_6"),
## (neq, ":ai_behavior", ai_bhvr_hold),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_6", ai_bhvr_hold),
## (party_set_flags, "$qst_capture_conspirators_party_6", pf_default_behavior, 0),
## (party_attach_to_party, "$qst_capture_conspirators_party_6", "$qst_capture_conspirators_party_1"),
## (try_end),
## (try_end),
## (try_begin),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_6"),
## (eq, ":ai_behavior", ai_bhvr_travel_to_point),
## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_6"),
## (party_get_position, pos1, "$qst_capture_conspirators_party_6"),
## (get_distance_between_positions, ":distance", pos2, pos1),
## (lt, ":distance", 200),
## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_6", ":faction_no"),#Can fail
## (ge, reg0, 0),
## (party_set_ai_object, "$qst_capture_conspirators_party_6", reg0),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_6", ai_bhvr_travel_to_party),
## (party_set_flags, "$qst_capture_conspirators_party_6", pf_default_behavior, 0),
## (try_end),
## (try_end),
## (try_begin),
## (gt, "$qst_capture_conspirators_party_7", 0),
## (party_is_active, "$qst_capture_conspirators_party_7"),
## (val_add, ":num_active_parties", 1),
## (try_begin),
## (party_is_in_any_town, "$qst_capture_conspirators_party_7"),
## (try_begin),
## (neg|party_is_in_town, "$qst_capture_conspirators_party_7", "$qst_capture_conspirators_party_1"),
## (remove_party, "$qst_capture_conspirators_party_7"),
## (else_try),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_7"),
## (neq, ":ai_behavior", ai_bhvr_hold),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_7", ai_bhvr_hold),
## (party_set_flags, "$qst_capture_conspirators_party_7", pf_default_behavior, 0),
## (party_attach_to_party, "$qst_capture_conspirators_party_7", "$qst_capture_conspirators_party_1"),
## (try_end),
## (try_end),
## (try_begin),
## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_7"),
## (eq, ":ai_behavior", ai_bhvr_travel_to_point),
## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_7"),
## (party_get_position, pos1, "$qst_capture_conspirators_party_7"),
## (get_distance_between_positions, ":distance", pos2, pos1),
## (lt, ":distance", 200),
## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_7", ":faction_no"),#Can fail
## (ge, reg0, 0),
## (party_set_ai_object, "$qst_capture_conspirators_party_7", reg0),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_7", ai_bhvr_travel_to_party),
## (party_set_flags, "$qst_capture_conspirators_party_7", pf_default_behavior, 0),
## (try_end),
## (try_end),
##
## (eq, ":num_active_parties", 0),
## (party_count_prisoners_of_type, ":count_captured_conspirators", "p_main_party", "trp_conspirator"),
## (party_count_prisoners_of_type, ":count_captured_conspirator_leaders", "p_main_party", "trp_conspirator_leader"),
## (val_add, ":count_captured_conspirators", ":count_captured_conspirator_leaders"),
## (try_begin),
## (store_div, ":limit", "$qst_capture_conspirators_num_troops_to_capture", 2),
## (gt, ":count_captured_conspirators", ":limit"),
## (call_script, "script_succeed_quest", "qst_capture_conspirators"),
## (else_try),
## (call_script, "script_fail_quest", "qst_capture_conspirators"),
## (try_end),
## ],
## []
## ),
# Follow Spy quest
(0.5, 0.0, 0.0,
[
(check_quest_active, "qst_follow_spy"),
(eq, "$qst_follow_spy_no_active_parties", 0),
(quest_get_slot, ":quest_giver_center", "qst_follow_spy", slot_quest_giver_center),
(quest_get_slot, ":quest_object_center", "qst_follow_spy", slot_quest_object_center),
(assign, ":abort_meeting", 0),
(try_begin),
(this_or_next|eq, "$qst_follow_spy_run_away", 1),
(this_or_next|neg|party_is_active, "$qst_follow_spy_spy_party"),
(neg|party_is_active, "$qst_follow_spy_spy_partners_party"),
(else_try),
(eq, "$qst_follow_spy_meeting_state", 0),
(store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_follow_spy_spy_party"),
(try_begin),
(assign, ":min_distance", 3),
(try_begin),
(is_currently_night),
(assign, ":min_distance", 1),
(try_end),
(le, ":cur_distance", ":min_distance"),
(store_distance_to_party_from_party, ":player_distance_to_quest_giver_center", "p_main_party", ":quest_giver_center"),
(gt, ":player_distance_to_quest_giver_center", 1),
(assign, ":abort_meeting", 1),
(assign, "$qst_follow_spy_run_away", 1),
(display_message, "str_qst_follow_spy_noticed_you"),
(else_try),
(store_distance_to_party_from_party, ":cur_distance", "$qst_follow_spy_spy_partners_party", "$qst_follow_spy_spy_party"),
(le, ":cur_distance", 1),
(party_attach_to_party, "$qst_follow_spy_spy_party", "$qst_follow_spy_spy_partners_party"),
(assign, "$qst_follow_spy_meeting_state", 1),
(assign, "$qst_follow_spy_meeting_counter", 0),
(try_end),
(else_try),
(eq, "$qst_follow_spy_meeting_state", 1),
(store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_follow_spy_spy_partners_party"),
(try_begin),
(le, ":cur_distance", 1),
(party_detach, "$qst_follow_spy_spy_party"),
(assign, ":abort_meeting", 1),
(assign, "$qst_follow_spy_run_away", 1),
(display_message, "str_qst_follow_spy_noticed_you"),
(else_try),
(val_add, "$qst_follow_spy_meeting_counter", 1),
(gt, "$qst_follow_spy_meeting_counter", 4),
(party_detach, "$qst_follow_spy_spy_party"),
(assign, ":abort_meeting", 0),
(assign, "$qst_follow_spy_meeting_state", 2),
(try_end),
(try_end),
(try_begin),
(eq, ":abort_meeting", 1),
(party_set_ai_object, "$qst_follow_spy_spy_party", ":quest_giver_center"),
(party_set_ai_object, "$qst_follow_spy_spy_partners_party", ":quest_object_center"),
(party_set_ai_behavior, "$qst_follow_spy_spy_party", ai_bhvr_travel_to_party),
(party_set_ai_behavior, "$qst_follow_spy_spy_partners_party", ai_bhvr_travel_to_party),
(party_set_flags, "$qst_follow_spy_spy_party", pf_default_behavior, 0),
(party_set_flags, "$qst_follow_spy_spy_partners_party", pf_default_behavior, 0),
(try_end),
(assign, ":num_active", 0),
(try_begin),
(party_is_active, "$qst_follow_spy_spy_party"),
(val_add, ":num_active", 1),
(party_is_in_town, "$qst_follow_spy_spy_party", ":quest_giver_center"),
(remove_party, "$qst_follow_spy_spy_party"),
(assign, "$qst_follow_spy_spy_back_in_town", 1),
(val_sub, ":num_active", 1),
(try_end),
(try_begin),
(party_is_active, "$qst_follow_spy_spy_partners_party"),
(val_add, ":num_active", 1),
(party_is_in_town, "$qst_follow_spy_spy_partners_party", ":quest_object_center"),
(remove_party, "$qst_follow_spy_spy_partners_party"),
(assign, "$qst_follow_spy_partner_back_in_town", 1),
(val_sub, ":num_active", 1),
(try_end),
(try_begin),
(eq, "$qst_follow_spy_partner_back_in_town",1),
(eq, "$qst_follow_spy_spy_back_in_town",1),
(call_script, "script_fail_quest", "qst_follow_spy"),
(try_end),
(try_begin),
(eq, ":num_active", 0),
(assign, "$qst_follow_spy_no_active_parties", 1),
(party_count_prisoners_of_type, ":num_spies", "p_main_party", "trp_spy"),
(party_count_prisoners_of_type, ":num_spy_partners", "p_main_party", "trp_spy_partner"),
(gt, ":num_spies", 0),
(gt, ":num_spy_partners", 0),
(call_script, "script_succeed_quest", "qst_follow_spy"),
(try_end),
],
[]
),
### Raiders quest
## (0.95, 0.0, 0.2,
## [
## (check_quest_active, "qst_hunt_down_raiders"),
## (neg|check_quest_succeeded, "qst_hunt_down_raiders"),
## (neg|check_quest_failed, "qst_hunt_down_raiders"),
## ],
## [
## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party),
## (party_set_ai_behavior, ":quest_target_party", ai_bhvr_hold),
## (party_set_flags, ":quest_target_party", pf_default_behavior, 0),
## ]
## ),
##
## (0.7, 0, 0.2,
## [
## (check_quest_active, "qst_hunt_down_raiders"),
## (neg|check_quest_succeeded, "qst_hunt_down_raiders"),
## (neg|check_quest_failed, "qst_hunt_down_raiders"),
## ],
## [
## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party),
## (party_set_ai_behavior,":quest_target_party",ai_bhvr_travel_to_party),
## (party_set_flags, ":quest_target_party", pf_default_behavior, 0),
## ]
## ),
##
## (0.1, 0.0, 0.0,
## [
## (check_quest_active, "qst_hunt_down_raiders"),
## (neg|check_quest_succeeded, "qst_hunt_down_raiders"),
## (neg|check_quest_failed, "qst_hunt_down_raiders"),
## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party),
## (neg|party_is_active, ":quest_target_party")
## ],
## [
## (call_script, "script_succeed_quest", "qst_hunt_down_raiders"),
## ]
## ),
##
## (1.3, 0, 0.0,
## [
## (check_quest_active, "qst_hunt_down_raiders"),
## (neg|check_quest_succeeded, "qst_hunt_down_raiders"),
## (neg|check_quest_failed, "qst_hunt_down_raiders"),
## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party),
## (quest_get_slot, ":quest_target_center", "qst_hunt_down_raiders", slot_quest_target_center),
## (party_is_in_town,":quest_target_party",":quest_target_center")
## ],
## [
## (call_script, "script_fail_quest", "qst_hunt_down_raiders"),
## (display_message, "str_raiders_reached_base"),
## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party),
## (remove_party, ":quest_target_party"),
## ]
## ),
##### TODO: QUESTS COMMENT OUT END
#########################################################################
# Random MERCHANT quest triggers
####################################
# Apply interest to merchants guild debt 1% per week
(24.0 * 7, 0.0, 0.0,
[],
[
(val_mul,"$debt_to_merchants_guild",101),
(val_div,"$debt_to_merchants_guild",100)
]
),
# Escort merchant caravan:
(0.1, 0.0, 0.1, [(check_quest_active, "qst_escort_merchant_caravan"),
(eq, "$escort_merchant_caravan_mode", 1)
],
[(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
(try_begin),
(party_is_active, ":quest_target_party"),
(party_set_ai_behavior, ":quest_target_party", ai_bhvr_hold),
(party_set_flags, ":quest_target_party", pf_default_behavior, 0),
(try_end),
]),
(0.1, 0.0, 0.1, [(check_quest_active, "qst_escort_merchant_caravan"),
(eq, "$escort_merchant_caravan_mode", 0),
],
[(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
(try_begin),
(party_is_active, ":quest_target_party"),
(party_set_ai_behavior, ":quest_target_party", ai_bhvr_escort_party),
(party_set_flags, ":quest_target_party", pf_default_behavior, 0),
(party_set_ai_object, ":quest_target_party", "p_main_party"),
(try_end),
]),
(0.1, 0, 0.0, [(check_quest_active, "qst_escort_merchant_caravan"),
(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
(neg|party_is_active,":quest_target_party"),
],
[(call_script, "script_abort_quest", "qst_escort_merchant_caravan", 2),
]),
# Troublesome bandits
(0.3, 0.0, 1.1, [(check_quest_active, "qst_troublesome_bandits"),
(neg|check_quest_failed, "qst_troublesome_bandits"),
(store_num_parties_destroyed, ":cur_eliminated", "pt_troublesome_bandits"),
(lt, "$qst_troublesome_bandits_eliminated", ":cur_eliminated"),
(store_num_parties_destroyed_by_player, ":cur_eliminated_by_player", "pt_troublesome_bandits"),
(eq, ":cur_eliminated_by_player", "$qst_troublesome_bandits_eliminated_by_player"),
],
[(display_message, "str_bandits_eliminated_by_another"),
(call_script, "script_abort_quest", "qst_troublesome_bandits", 2),
]),
(0.3, 0.0, 1.1, [(check_quest_active, "qst_troublesome_bandits"),
(neg|check_quest_succeeded, "qst_troublesome_bandits"),
(store_num_parties_destroyed, ":cur_eliminated", "pt_troublesome_bandits"),
(lt, "$qst_troublesome_bandits_eliminated", ":cur_eliminated"),
(store_num_parties_destroyed_by_player, ":cur_eliminated_by_player", "pt_troublesome_bandits"),
(neq, ":cur_eliminated_by_player", "$qst_troublesome_bandits_eliminated_by_player"),
],
[(call_script, "script_succeed_quest", "qst_troublesome_bandits"),]),
# Kidnapped girl:
(1, 0, 0,
[(check_quest_active, "qst_kidnapped_girl"),
(quest_get_slot, ":quest_target_party", "qst_kidnapped_girl", slot_quest_target_party),
(party_is_active, ":quest_target_party"),
(party_is_in_any_town, ":quest_target_party"),
(remove_party, ":quest_target_party"),
],
[]
),
#Rebellion changes begin
#move
(0, 0, 24 * 14,
[
(try_for_range, ":pretender", pretenders_begin, pretenders_end),
(troop_set_slot, ":pretender", slot_troop_cur_center, 0),
(neq, ":pretender", "$supported_pretender"),
(troop_get_slot, ":target_faction", ":pretender", slot_troop_original_faction),
(faction_slot_eq, ":target_faction", slot_faction_state, sfs_active),
(faction_slot_eq, ":target_faction", slot_faction_has_rebellion_chance, 1),
(neg|troop_slot_eq, ":pretender", slot_troop_occupation, slto_kingdom_hero),
(try_for_range, ":unused", 0, 30),
(troop_slot_eq, ":pretender", slot_troop_cur_center, 0),
(store_random_in_range, ":town", towns_begin, towns_end),
(store_faction_of_party, ":town_faction", ":town"),
(store_relation, ":relation", ":town_faction", ":target_faction"),
(le, ":relation", 0), #fail if nothing qualifies
(troop_set_slot, ":pretender", slot_troop_cur_center, ":town"),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, 4, ":pretender"),
(str_store_party_name, 5, ":town"),
(display_message, "@{s4} is in {s5}"),
(try_end),
(try_end),
# (try_for_range, ":rebel_faction", rebel_factions_begin, rebel_factions_end),
# (faction_get_slot, ":rebellion_status", ":rebel_faction", slot_faction_state),
# (eq, ":rebellion_status", sfs_inactive_rebellion),
# (faction_get_slot, ":pretender", ":rebel_faction", slot_faction_leader),
# (faction_get_slot, ":target_faction", ":rebel_faction", slot_faction_rebellion_target),#
# (store_random_in_range, ":town", towns_begin, towns_end),
# (store_faction_of_party, ":town_faction", ":town"),
# (store_relation, ":relation", ":town_faction", ":target_faction"),
# (le, ":relation", 0), #fail if nothing qualifies
# (faction_set_slot, ":rebel_faction", slot_faction_inactive_leader_location, ":town"),
(try_end),
],
[]
),
#Rebellion changes end
#NPC system changes begin
#Move unemployed NPCs around taverns
(24 * 15, 0, 0,
[
(call_script, "script_update_companion_candidates_in_taverns"),
],
[]
),
#Process morale and determine personality clashes
(0, 0, 24,
[],
[
#Count NPCs in party and get the "grievance divisor", which determines how fast grievances go away
#Set their relation to the player
(assign, ":npcs_in_party", 0),
(assign, ":grievance_divisor", 100),
(try_for_range, ":npc1", companions_begin, companions_end),
(main_party_has_troop, ":npc1"),
(val_add, ":npcs_in_party", 1),
(try_end),
(val_sub, ":grievance_divisor", ":npcs_in_party"),
(store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
(val_add, ":grievance_divisor", ":persuasion_level"),
(assign, reg7, ":grievance_divisor"),
# (display_message, "@Process NPC changes. GD: {reg7}"),
##Activate personality clash from 24 hours ago
(try_begin), #scheduled personality clashes require at least 24hrs together
(gt, "$personality_clash_after_24_hrs", 0),
(eq, "$disable_npc_complaints", 0),
(try_begin),
(troop_get_slot, ":other_npc", "$personality_clash_after_24_hrs", slot_troop_personalityclash_object),
(main_party_has_troop, "$personality_clash_after_24_hrs"),
(main_party_has_troop, ":other_npc"),
(assign, "$npc_with_personality_clash", "$personality_clash_after_24_hrs"),
(try_end),
(assign, "$personality_clash_after_24_hrs", 0),
(try_end),
#
(try_for_range, ":npc", companions_begin, companions_end),
###Reset meeting variables
(troop_set_slot, ":npc", slot_troop_turned_down_twice, 0),
(try_begin),
(troop_slot_eq, ":npc", slot_troop_met, 1),
(troop_set_slot, ":npc", slot_troop_met_previously, 1),
(try_end),
###Check for coming out of retirement
(troop_get_slot, ":occupation", ":npc", slot_troop_occupation),
(try_begin),
(eq, ":occupation", slto_retirement),
(troop_get_slot, ":renown_min", ":npc", slot_troop_return_renown),
(str_store_troop_name, s31, ":npc"),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(assign, reg4, ":player_renown"),
(assign, reg5, ":renown_min"),
# (display_message, "@Test {s31} for retirement return {reg4}, {reg5}."),
(gt, ":player_renown", ":renown_min"),
(troop_set_slot, ":npc", slot_troop_personalityclash_penalties, 0),
(troop_set_slot, ":npc", slot_troop_morality_penalties, 0),
(troop_set_slot, ":npc", slot_troop_occupation, 0),
(try_end),
(try_begin),
(main_party_has_troop, ":npc"),
#Check for quitting
(call_script, "script_npc_morale", ":npc"),
(assign, ":npc_morale", reg0),
(try_begin),
(lt, ":npc_morale", 20),
(store_random_in_range, ":random", 0, 100),
(val_add, ":npc_morale", ":random"),
(lt, ":npc_morale", 20),
(assign, "$npc_is_quitting", ":npc"),
(try_end),
#Reduce grievance over time (or augment, if party is overcrowded
(troop_get_slot, ":grievance", ":npc", slot_troop_personalityclash_penalties),
(val_mul, ":grievance", 90),
(val_div, ":grievance", ":grievance_divisor"),
(troop_set_slot, ":npc", slot_troop_personalityclash_penalties, ":grievance"),
(troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties),
(val_mul, ":grievance", 90),
(val_div, ":grievance", ":grievance_divisor"),
(troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"),
#Change personality grievance levels
(try_begin),
(this_or_next|troop_slot_ge, ":npc", slot_troop_personalityclash_state, 1),
(eq, "$disable_npc_complaints", 1),
(troop_get_slot, ":object", ":npc", slot_troop_personalityclash_object),
(main_party_has_troop, ":object"),
(call_script, "script_reduce_companion_morale_for_clash", ":npc", ":object", slot_troop_personalityclash_state),
(try_end),
(try_begin),
(this_or_next|troop_slot_ge, ":npc", slot_troop_personalityclash2_state, 1),
(eq, "$disable_npc_complaints", 1),
(troop_get_slot, ":object", ":npc", slot_troop_personalityclash2_object),
(main_party_has_troop, ":object"),
(call_script, "script_reduce_companion_morale_for_clash", ":npc", ":object", slot_troop_personalityclash2_state),
(try_end),
(try_begin),
(this_or_next|troop_slot_ge, ":npc", slot_troop_personalitymatch_state, 1),
(eq, "$disable_npc_complaints", 1),
(troop_get_slot, ":object", ":npc", slot_troop_personalitymatch_object),
(main_party_has_troop, ":object"),
(troop_get_slot, ":grievance", ":npc", slot_troop_personalityclash_penalties),
(val_mul, ":grievance", 9),
(val_div, ":grievance", 10),
(troop_set_slot, ":npc", slot_troop_personalityclash_penalties, ":grievance"),
(try_end),
#Check for new personality clashes
#Active personality clash 1 if at least 24 hours have passed
(try_begin),
(eq, "$disable_npc_complaints", 0),
(eq, "$npc_with_personality_clash", 0),
(eq, "$npc_with_personality_clash_2", 0),
(eq, "$personality_clash_after_24_hrs", 0),
(troop_slot_eq, ":npc", slot_troop_personalityclash_state, 0),
(troop_get_slot, ":other_npc", ":npc", slot_troop_personalityclash_object),
(main_party_has_troop, ":other_npc"),
(assign, "$personality_clash_after_24_hrs", ":npc"),
(try_end),
#Personality clash 2 and personality match is triggered by battles
(try_end),
(try_end),
]),
#NPC system changes end
]
| Python |
from header_music import *
####################################################################################################################
# Each track record contains the following fields:
# 1) Track id: used for referencing tracks.
# 2) Track file: filename of the track
# 3) Track flags. See header_music.py for a list of available flags
# 4) Continue Track flags: Shows in which situations or cultures the track can continue playing. See header_music.py for a list of available flags
####################################################################################################################
# WARNING: You MUST add mtf_module_track flag to the flags of the tracks located under module directory
tracks = [
## ("losing_battle", "alosingbattle.mp3", sit_calm|sit_action),
## ("reluctant_hero", "reluctanthero.mp3", sit_action),
## ("the_great_hall", "thegreathall.mp3", sit_calm),
## ("requiem", "requiem.mp3", sit_calm),
## ("silent_intruder", "silentintruder.mp3", sit_calm|sit_action),
## ("the_pilgrimage", "thepilgrimage.mp3", sit_calm),
## ("ambushed", "ambushed.mp3", sit_action),
## ("triumph", "triumph.mp3", sit_action),
## ("losing_battle", "alosingbattle.mp3", mtf_sit_map_travel|mtf_sit_attack),
## ("reluctant_hero", "reluctanthero.mp3", mtf_sit_attack),
## ("the_great_hall", "thegreathall.mp3", mtf_sit_map_travel),
## ("requiem", "requiem.mp3", mtf_sit_map_travel),
## ("silent_intruder", "silentintruder.mp3", mtf_sit_map_travel|mtf_sit_attack),
## ("the_pilgrimage", "thepilgrimage.mp3", mtf_sit_map_travel),
## ("ambushed", "ambushed.mp3", mtf_sit_attack),
## ("triumph", "triumph.mp3", mtf_sit_attack),
("bogus", "cant_find_this.ogg", 0, 0),
("mount_and_blade_title_screen", "mount_and_blade_title_screen.ogg", mtf_sit_main_title|mtf_start_immediately, 0),
("ambushed_by_neutral", "ambushed_by_neutral.ogg", mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight),
("ambushed_by_khergit", "ambushed_by_khergit.ogg", mtf_culture_3|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all),
("ambushed_by_nord", "ambushed_by_nord.ogg", mtf_culture_4|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all),
("ambushed_by_rhodok", "ambushed_by_rhodok.ogg", mtf_culture_5|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all),
("ambushed_by_swadian", "ambushed_by_swadian.ogg", mtf_culture_1|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all),
("ambushed_by_vaegir", "ambushed_by_vaegir.ogg", mtf_culture_2|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all),
("arena_1", "arena_1.ogg", mtf_sit_arena, 0),
# ("arena_2", "arena_2.ogg", mtf_looping|mtf_sit_arena, 0),
("armorer", "armorer.ogg", mtf_sit_travel, 0),
("bandit_fight", "bandit_fight.ogg", mtf_sit_fight|mtf_sit_ambushed, 0),
("calm_night_1", "calm_night_2.ogg", mtf_sit_night, mtf_sit_town|mtf_sit_tavern|mtf_sit_travel),
("captured", "capture.ogg", mtf_persist_until_finished, 0),
("defeated_by_neutral", "defeated_by_neutral.ogg",mtf_persist_until_finished|mtf_sit_killed, 0),
("defeated_by_neutral_2", "defeated_by_neutral_2.ogg", mtf_persist_until_finished|mtf_sit_killed, 0),
("defeated_by_neutral_3", "defeated_by_neutral_3.ogg", mtf_persist_until_finished|mtf_sit_killed, 0),
("empty_village", "empty_village.ogg", mtf_persist_until_finished, 0),
("encounter_hostile_nords", "encounter_hostile_nords.ogg", mtf_persist_until_finished|mtf_sit_encounter_hostile, 0),
("escape", "escape.ogg", mtf_persist_until_finished, 0),
("fight_1", "fight_1.ogg", mtf_sit_fight|mtf_sit_ambushed, 0),
("fight_2", "fight_2.ogg", mtf_sit_fight|mtf_sit_ambushed, 0),
("fight_3", "fight_3.ogg", mtf_sit_fight|mtf_sit_ambushed, 0),
("fight_as_khergit", "fight_as_khergit.ogg", mtf_culture_3|mtf_sit_fight|mtf_sit_ambushed, mtf_culture_all),
("fight_as_nord", "fight_as_nord.ogg", mtf_culture_4|mtf_sit_fight|mtf_sit_ambushed, mtf_culture_all),
("fight_as_rhodok", "fight_as_rhodok.ogg", mtf_culture_5|mtf_sit_fight|mtf_sit_ambushed, mtf_culture_all),
# ("fight_as_swadian", "fight_as_swadian.ogg", mtf_culture_1|mtf_sit_fight, mtf_culture_all),
("fight_as_vaegir", "fight_as_vaegir.ogg", mtf_culture_2|mtf_sit_fight|mtf_sit_ambushed, mtf_culture_all),
("fight_while_mounted_1", "fight_while_mounted_1.ogg", mtf_sit_fight|mtf_sit_ambushed, 0),
("fight_while_mounted_2", "fight_while_mounted_2.ogg", mtf_sit_fight|mtf_sit_ambushed, 0),
("infiltration_khergit", "infiltration_khergit.ogg", mtf_culture_3|mtf_sit_town_infiltrate, mtf_culture_all),
("killed_by_khergit", "killed_by_khergit.ogg", mtf_persist_until_finished|mtf_culture_3|mtf_sit_killed, 0),
# ("killed_by_neutral", "killed_by_neutral.ogg", mtf_persist_until_finished|mtf_culture_6|mtf_sit_killed, 0),
# ("killed_by_nord", "killed_by_nord.ogg", mtf_persist_until_finished|mtf_culture_4|mtf_sit_killed, 0),
# ("killed_by_rhodok", "killed_by_rhodok.ogg", mtf_persist_until_finished|mtf_culture_5|mtf_sit_killed, 0),
("killed_by_swadian", "killed_by_swadian.ogg", mtf_persist_until_finished|mtf_culture_1|mtf_sit_killed, 0),
# ("killed_by_vaegir", "killed_by_vaegir.ogg", mtf_persist_until_finished|mtf_culture_2|mtf_sit_killed, 0),
("lords_hall_khergit", "lords_hall_khergit.ogg", mtf_culture_3|mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern|mtf_culture_all),
("lords_hall_nord", "lords_hall_nord.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern),
("lords_hall_swadian", "lords_hall_swadian.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern),
("lords_hall_rhodok", "lords_hall_rhodok.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern),
("lords_hall_vaegir", "lords_hall_vaegir.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern),
("mounted_snow_terrain_calm", "mounted_snow_terrain_calm.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_night|mtf_sit_tavern),
("neutral_infiltration", "neutral_infiltration.ogg", mtf_sit_town_infiltrate, 0),
("outdoor_beautiful_land", "outdoor_beautiful_land.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_night|mtf_sit_tavern),
("retreat", "retreat.ogg", mtf_persist_until_finished|mtf_sit_killed, 0),
("seige_neutral", "seige_neutral.ogg", mtf_sit_siege, mtf_sit_fight|mtf_sit_ambushed),
("tavern_1", "tavern_1.ogg", mtf_sit_tavern, 0),
("tavern_2", "tavern_2.ogg", mtf_sit_tavern, 0),
("town_neutral", "town_neutral.ogg", mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night),
("town_khergit", "town_khergit.ogg", mtf_culture_3|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("town_nord", "town_nord.ogg", mtf_culture_4|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("town_rhodok", "town_rhodok.ogg", mtf_culture_5|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("town_swadian", "town_swadian.ogg", mtf_culture_1|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("town_vaegir", "town_vaegir.ogg", mtf_culture_2|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("travel_khergit", "travel_khergit.ogg", mtf_culture_3|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("travel_neutral", "travel_neutral.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night),
("travel_nord", "travel_nord.ogg", mtf_culture_4|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("travel_rhodok", "travel_rhodok.ogg", mtf_culture_5|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("travel_swadian", "travel_swadian.ogg", mtf_culture_1|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("travel_vaegir", "travel_vaegir.ogg", mtf_culture_2|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all),
("uncertain_homestead", "uncertain_homestead.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern),
("victorious_evil", "victorious_evil.ogg", mtf_persist_until_finished, 0),
("victorious_neutral_1", "victorious_neutral_1.ogg", mtf_persist_until_finished|mtf_sit_victorious, 0),
("victorious_neutral_2", "victorious_neutral_2.ogg", mtf_persist_until_finished|mtf_sit_victorious, 0),
("victorious_neutral_3", "victorious_neutral_3.ogg", mtf_persist_until_finished|mtf_sit_victorious, 0),
("victorious_swadian", "victorious_swadian.ogg", mtf_persist_until_finished|mtf_culture_2|mtf_sit_victorious, 0),
("victorious_vaegir", "victorious_vaegir.ogg", mtf_persist_until_finished|mtf_culture_2|mtf_sit_victorious, 0),
("victorious_vaegir_2", "victorious_vaegir_2.ogg", mtf_persist_until_finished|mtf_culture_2|mtf_sit_victorious, 0),
]
| Python |
import string
import types
from module_info import *
from module_triggers import *
from module_dialogs import *
from process_common import *
from process_operations import *
speaker_pos = 0
ipt_token_pos = 1
sentence_conditions_pos = 2
text_pos = 3
opt_token_pos = 4
sentence_consequences_pos = 5
#-------------------------------------------------------
def save_dialog_states(dialog_states):
file = open(export_dir + "dialog_states.txt","w")
for dialog_state in dialog_states:
file.write("%s\n"%dialog_state)
file.close()
#def compile_variables(cookies_list):
# for trigger in triggers:
# for consequence in trigger[trigger_consequences_pos]:
# compile_statement(consequence,cookies_list)
# for sentence in sentences:
# for consequence in sentence[sentence_consequences_pos]:
# compile_statement(consequence,cookies_list)
# for trigger in triggers:
# for condition in trigger[trigger_conditions_pos]:
# compile_statement(condition,cookies_list)
# for sentence in sentences:
# for condition in sentence[sentence_conditions_pos]:
# compile_statement(condition,cookies_list)
# return cookies_list
def save_triggers(variable_list,variable_uses,triggers,tag_uses,quick_strings):
file = open(export_dir + "triggers.txt","w")
file.write("triggersfile version 1\n")
file.write("%d\n"%len(triggers))
for i in xrange(len(triggers)):
trigger = triggers[i]
file.write("%f %f %f "%(trigger[trigger_check_pos],trigger[trigger_delay_pos],trigger[trigger_rearm_pos]))
save_statement_block(file,0,1,trigger[trigger_conditions_pos] , variable_list, variable_uses,tag_uses,quick_strings)
save_statement_block(file,0,1,trigger[trigger_consequences_pos], variable_list, variable_uses,tag_uses,quick_strings)
# for condition in trigger[trigger_conditions_pos]:
# save_operation(file,condition,variable_list)
# file.write(" %d "%(len(trigger[trigger_consequences_pos])))
# for consequence in trigger[trigger_consequences_pos]:
# save_operation(file,consequence,variable_list)
file.write("\n")
file.close()
#=================================================================
def compile_sentence_tokens(sentences):
input_tokens = []
output_tokens = []
dialog_states = ["start","party_encounter","prisoner_liberated","enemy_defeated","party_relieved","event_triggered","close_window","trade","exchange_members", "trade_prisoners","buy_mercenaries","view_char","training","member_chat","prisoner_chat"]
for sentence in sentences:
output_token_id = -1
output_token = sentence[opt_token_pos]
found = 0
for i_t in xrange(len(dialog_states)):
if output_token == dialog_states[i_t]:
output_token_id = i_t
found = 1
break
if not found:
dialog_states.append(output_token)
output_token_id = len(dialog_states) - 1
output_tokens.append(output_token_id)
for sentence in sentences:
input_token_id = -1
input_token = sentence[ipt_token_pos]
found = 0
for i_t in xrange(len(dialog_states)):
if input_token == dialog_states[i_t]:
input_token_id = i_t
found = 1
break
if not found:
print sentence[ipt_token_pos]
print sentence[text_pos]
print sentence[opt_token_pos]
print "**********************************************************************************"
print "ERROR: INPUT TOKEN NOT FOUND:" + input_token
print "**********************************************************************************"
print "**********************************************************************************"
input_tokens.append(input_token_id)
save_dialog_states(dialog_states)
return (input_tokens, output_tokens)
def create_auto_id(sentence,auto_ids):
text = convert_to_identifier(sentence[text_pos])
done = 0
i = 20
lt = len(text)
if (i > lt):
i = lt
auto_id = "dlga_" + text[0:i]
done = 0
if auto_ids.has_key(auto_id) and (auto_ids[auto_id] == text):
done = 1
while (i <= lt) and not done:
auto_id = "dlga_" + text[0:i]
if auto_ids.has_key(auto_id):
if auto_ids[auto_id] == text:
done = 1
else:
i += 1
else:
done = 1
auto_ids[auto_id] = text
if not done:
number = 1
new_auto_id = auto_id + str(number)
while auto_ids.has_key(new_auto_id):
number += 1
new_auto_id = auto_id + str(number)
auto_id = new_auto_id
auto_ids[auto_id] = text
return auto_id
def create_auto_id2(sentence,auto_ids):
text = sentence[text_pos]
token_ipt = convert_to_identifier(sentence[ipt_token_pos])
token_opt = convert_to_identifier(sentence[opt_token_pos])
done = 0
auto_id = "dlga_" + token_ipt + ":" + token_opt
done = 0
if not auto_ids.has_key(auto_id):
done = 1
else:
if auto_ids.has_key(auto_id) and (auto_ids[auto_id] == text):
done = 1
if not done:
number = 1
new_auto_id = auto_id + "." + str(number)
while auto_ids.has_key(new_auto_id):
number += 1
new_auto_id = auto_id + "." + str(number)
auto_id = new_auto_id
auto_ids[auto_id] = text
return auto_id
def save_sentences(variable_list,variable_uses,sentences,tag_uses,quick_strings,input_states,output_states):
file = open(export_dir + "conversation.txt","w")
file.write("dialogsfile version 1\n")
file.write("%d\n"%len(sentences))
# Create an empty dictionary
auto_ids = {}
for i in xrange(len(sentences)):
sentence = sentences[i]
try:
dialog_id = create_auto_id2(sentence,auto_ids)
file.write("%s %d %d "%(dialog_id,sentence[speaker_pos],input_states[i]))
save_statement_block(file, 0, 1, sentence[sentence_conditions_pos], variable_list,variable_uses,tag_uses,quick_strings)
file.write("%s "%(string.replace(sentence[text_pos]," ","_")))
if (len(sentence[text_pos]) == 0):
file.write("NO_TEXT ")
file.write(" %d "%(output_states[i]))
save_statement_block(file, 0, 1, sentence[sentence_consequences_pos], variable_list,variable_uses,tag_uses,quick_strings)
file.write("\n")
except:
print "Error in dialog line:"
print sentence
file.close()
# Registered cookies is a list which enables the order of cookies to remain fixed across changes.
# In order to remove cookies not used anymore, edit the cookies_registery.py and remove all entries.
print "exporting triggers..."
variable_uses = []
variables = load_variables(export_dir,variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
#compile_variables(variables)
save_triggers(variables,variable_uses,triggers,tag_uses,quick_strings)
print "exporting dialogs..."
(input_states,output_states) = compile_sentence_tokens(dialogs)
save_sentences(variables,variable_uses,dialogs,tag_uses,quick_strings,input_states,output_states)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir, tag_uses)
save_quick_strings(export_dir,quick_strings)
#print "finished."
| Python |
import string
from header_common import *
from module_info import *
from module_music import *
from process_common import *
def save_python_header():
ofile = open("./ID_music.py","w")
for i_track in xrange(len(tracks)):
ofile.write("track_%s = %d\n"%(tracks[i_track][0],i_track))
ofile.write("\n\n")
ofile.close()
def save_tracks():
file = open(export_dir + "music.txt","w")
file.write("%d\n"%len(tracks))
for track in tracks:
file.write("%s %d %d\n"%(track[1], track[2], (track[2] | track[3])))
file.close()
print "Exporting tracks..."
save_python_header()
save_tracks()
| Python |
track_bogus = 0
track_mount_and_blade_title_screen = 1
track_ambushed_by_neutral = 2
track_ambushed_by_khergit = 3
track_ambushed_by_nord = 4
track_ambushed_by_rhodok = 5
track_ambushed_by_swadian = 6
track_ambushed_by_vaegir = 7
track_arena_1 = 8
track_armorer = 9
track_bandit_fight = 10
track_calm_night_1 = 11
track_captured = 12
track_defeated_by_neutral = 13
track_defeated_by_neutral_2 = 14
track_defeated_by_neutral_3 = 15
track_empty_village = 16
track_encounter_hostile_nords = 17
track_escape = 18
track_fight_1 = 19
track_fight_2 = 20
track_fight_3 = 21
track_fight_as_khergit = 22
track_fight_as_nord = 23
track_fight_as_rhodok = 24
track_fight_as_vaegir = 25
track_fight_while_mounted_1 = 26
track_fight_while_mounted_2 = 27
track_infiltration_khergit = 28
track_killed_by_khergit = 29
track_killed_by_swadian = 30
track_lords_hall_khergit = 31
track_lords_hall_nord = 32
track_lords_hall_swadian = 33
track_lords_hall_rhodok = 34
track_lords_hall_vaegir = 35
track_mounted_snow_terrain_calm = 36
track_neutral_infiltration = 37
track_outdoor_beautiful_land = 38
track_retreat = 39
track_seige_neutral = 40
track_tavern_1 = 41
track_tavern_2 = 42
track_town_neutral = 43
track_town_khergit = 44
track_town_nord = 45
track_town_rhodok = 46
track_town_swadian = 47
track_town_vaegir = 48
track_travel_khergit = 49
track_travel_neutral = 50
track_travel_nord = 51
track_travel_rhodok = 52
track_travel_swadian = 53
track_travel_vaegir = 54
track_uncertain_homestead = 55
track_victorious_evil = 56
track_victorious_neutral_1 = 57
track_victorious_neutral_2 = 58
track_victorious_neutral_3 = 59
track_victorious_swadian = 60
track_victorious_vaegir = 61
track_victorious_vaegir_2 = 62
| Python |
leave_wo_battle = 0
leave_during_battle = 1
cancel_attack = 2
speak = 3
intend_battle = 4
cancel_reinforce = 5
surrender = 6
stay_back = 7
charge = 8
stay_back_with_ally = 9
charge_with_ally = 10
| Python |
from ID_items import *
from ID_quests import *
from ID_factions import *
##############################################################
# These constants are used in various files.
# If you need to define a value that will be used in those files,
# just define it here rather than copying it across each file, so
# that it will be easy to change it if you need to.
##############################################################
########################################################
## ITEM SLOTS #############################
########################################################
slot_item_is_checked = 0
slot_item_food_bonus = 1
slot_item_book_reading_progress = 2
slot_item_book_read = 3
slot_item_intelligence_requirement= 4
########################################################
## AGENT SLOTS #############################
########################################################
slot_agent_target_entry_point = 0
slot_agent_target_x_pos = 1
slot_agent_target_y_pos = 2
slot_agent_is_alive_before_retreat= 3
slot_agent_is_in_scripted_mode = 4
slot_agent_is_not_reinforcement = 5
slot_agent_tournament_point = 6
slot_agent_arena_team_set = 7
slot_agent_map_overlay_id = 10
slot_agent_target_entry_point = 11
########################################################
## FACTION SLOTS #############################
########################################################
slot_faction_ai_state = 4
slot_faction_ai_object = 5
slot_faction_ai_last_offensive_time = 6
slot_faction_marshall = 7
slot_faction_ai_offensive_max_followers = 8
slot_faction_culture = 9
slot_faction_leader = 10
##slot_faction_vassal_of = 11
slot_faction_number_of_parties = 20
slot_faction_state = 21
slot_faction_player_alarm = 30
slot_faction_last_mercenary_offer_time = 31
slot_faction_tier_1_troop = 41
slot_faction_tier_2_troop = 42
slot_faction_tier_3_troop = 43
slot_faction_tier_4_troop = 44
slot_faction_tier_5_troop = 45
slot_faction_deserter_troop = 48
slot_faction_guard_troop = 49
slot_faction_messenger_troop = 50
slot_faction_prison_guard_troop = 51
slot_faction_castle_guard_troop = 52
slot_faction_has_rebellion_chance = 60
#Rebellion changes
#slot_faction_rebellion_target = 65
#slot_faction_inactive_leader_location = 66
#slot_faction_support_base = 67
#Rebellion changes
#slot_faction_deserter_party_template = 62
slot_faction_reinforcements_a = 77
slot_faction_reinforcements_b = 78
slot_faction_reinforcements_c = 79
slot_faction_num_armies = 80
slot_faction_num_castles = 81
slot_faction_num_towns = 82
########################################################
## PARTY SLOTS #############################
########################################################
slot_party_type = 0 #spt_caravan, spt_town, spt_castle
slot_party_retreat_flag = 2
slot_party_ignore_player_until = 3
slot_party_ai_state = 4
slot_party_ai_object = 5
slot_town_belongs_to_kingdom = 6
slot_town_lord = 7
slot_party_ai_substate = 8
slot_town_claimed_by_player = 9
slot_cattle_driven_by_player = slot_town_lord #hack
slot_town_center = 10
slot_town_castle = 11
slot_town_prison = 12
slot_town_tavern = 13
slot_town_store = 14
slot_town_arena = 16
slot_town_alley = 17
slot_town_walls = 18
slot_center_culture = 19
slot_town_tavernkeeper = 20
slot_town_weaponsmith = 21
slot_town_armorer = 22
slot_town_merchant = 23
slot_town_horse_merchant= 24
slot_town_elder = 25
slot_center_player_relation = 26
slot_center_siege_with_belfry = 27
slot_center_last_taken_by_troop = 28
# party will follow this party if set:
slot_party_commander_party = 30 #default -1
slot_party_following_player = 31
slot_party_follow_player_until_time = 32
slot_party_dont_follow_player_until_time = 33
slot_village_raided_by = 34
slot_village_state = 35 #svs_normal, svs_being_raided, svs_looted, svs_recovering, svs_deserted
slot_village_raid_progress = 36
slot_village_recover_progress = 37
slot_village_smoke_added = 38
slot_village_infested_by_bandits = 39
slot_center_last_player_alarm_hour = 42
slot_village_land_quality = 44
slot_village_number_of_cattle = 45
slot_village_player_can_not_steal_cattle = 46
slot_center_accumulated_rents = 47
slot_center_accumulated_tariffs = 48
slot_town_wealth = 49
slot_town_prosperity = 50
slot_town_player_odds = 51
slot_party_last_toll_paid_hours = 52
slot_party_food_store = 53 #used for sieges
slot_center_is_besieged_by = 54 #used for sieges
slot_center_last_spotted_enemy = 55
slot_party_cached_strength = 56
slot_party_nearby_friend_strength = 57
slot_party_nearby_enemy_strength = 58
slot_party_follower_strength = 59
slot_town_reinforcement_party_template = 60
slot_center_original_faction = 61
slot_center_ex_faction = 62
slot_party_follow_me = 63
slot_center_siege_begin_hours = 64 #used for sieges
slot_center_siege_hardness = 65
slot_castle_exterior = slot_town_center
#slot_town_rebellion_contact = 76
#trs_not_yet_approached = 0
#trs_approached_before = 1
#trs_approached_recently = 2
argument_none = 0
argument_claim = 1
argument_ruler = 2
argument_benefit = 3
argument_victory = 4
slot_town_rebellion_readiness = 77
#(readiness can be a negative number if the rebellion has been defeated)
slot_town_arena_melee_mission_tpl = 78
slot_town_arena_torny_mission_tpl = 79
slot_town_arena_melee_1_num_teams = 80
slot_town_arena_melee_1_team_size = 81
slot_town_arena_melee_2_num_teams = 82
slot_town_arena_melee_2_team_size = 83
slot_town_arena_melee_3_num_teams = 84
slot_town_arena_melee_3_team_size = 85
slot_town_arena_melee_cur_tier = 86
##slot_town_arena_template = 87
slot_center_npc_volunteer_troop_type = 90
slot_center_npc_volunteer_troop_amount = 91
slot_center_mercenary_troop_type = 90
slot_center_mercenary_troop_amount= 91
slot_center_volunteer_troop_type = 92
slot_center_volunteer_troop_amount= 93
#slot_center_companion_candidate = 94
slot_center_ransom_broker = 95
slot_center_tavern_traveler = 96
slot_center_traveler_info_faction = 97
slot_center_tavern_bookseller = 98
slot_center_tavern_minstrel = 99
num_party_loot_slots = 5
slot_party_next_looted_item_slot = 109
slot_party_looted_item_1 = 110
slot_party_looted_item_2 = 111
slot_party_looted_item_3 = 112
slot_party_looted_item_4 = 113
slot_party_looted_item_5 = 114
slot_party_looted_item_1_modifier = 115
slot_party_looted_item_2_modifier = 116
slot_party_looted_item_3_modifier = 117
slot_party_looted_item_4_modifier = 118
slot_party_looted_item_5_modifier = 119
slot_village_bound_center = 120
slot_village_market_town = 121
slot_village_farmer_party = 122
slot_party_home_center = 123
slot_center_current_improvement = 124
slot_center_improvement_end_hour = 125
slot_center_has_manor = 130 #village
slot_center_has_fish_pond = 131 #village
slot_center_has_watch_tower = 132 #village
slot_center_has_school = 133 #village
slot_center_has_messenger_post = 134 #town, castle, village
slot_center_has_prisoner_tower = 135 #town, castle
village_improvements_begin = slot_center_has_manor
village_improvements_end = 135
walled_center_improvements_begin = slot_center_has_messenger_post
walled_center_improvements_end = 136
slot_center_has_bandits = 149
slot_town_has_tournament = 150
slot_town_tournament_max_teams = 151
slot_town_tournament_max_team_size = 152
slot_center_faction_when_oath_renounced = 155
slot_center_walker_0_troop = 160
slot_center_walker_1_troop = 161
slot_center_walker_2_troop = 162
slot_center_walker_3_troop = 163
slot_center_walker_4_troop = 164
slot_center_walker_5_troop = 165
slot_center_walker_6_troop = 166
slot_center_walker_7_troop = 167
slot_center_walker_8_troop = 168
slot_center_walker_9_troop = 169
slot_center_walker_0_dna = 170
slot_center_walker_1_dna = 171
slot_center_walker_2_dna = 172
slot_center_walker_3_dna = 173
slot_center_walker_4_dna = 174
slot_center_walker_5_dna = 175
slot_center_walker_6_dna = 176
slot_center_walker_7_dna = 177
slot_center_walker_8_dna = 178
slot_center_walker_9_dna = 179
slot_center_walker_0_type = 180
slot_center_walker_1_type = 181
slot_center_walker_2_type = 182
slot_center_walker_3_type = 183
slot_center_walker_4_type = 184
slot_center_walker_5_type = 185
slot_center_walker_6_type = 186
slot_center_walker_7_type = 187
slot_center_walker_8_type = 188
slot_center_walker_9_type = 189
slot_town_trade_route_1 = 190
slot_town_trade_route_2 = 191
slot_town_trade_route_3 = 192
slot_town_trade_route_4 = 193
slot_town_trade_route_5 = 194
slot_town_trade_route_6 = 195
slot_town_trade_route_7 = 196
slot_town_trade_route_8 = 197
slot_town_trade_route_9 = 198
slot_town_trade_route_10 = 199
slot_town_trade_route_11 = 200
slot_town_trade_route_12 = 201
slot_town_trade_route_13 = 202
slot_town_trade_route_14 = 203
slot_town_trade_route_15 = 204
slot_town_trade_routes_begin = slot_town_trade_route_1
slot_town_trade_routes_end = slot_town_trade_route_15 + 1
num_trade_goods = itm_siege_supply - itm_smoked_fish
slot_town_trade_good_productions_begin = 205
slot_town_trade_good_prices_begin = slot_town_trade_good_productions_begin + num_trade_goods + 1
#slot_party_type values
##spt_caravan = 1
spt_castle = 2
spt_town = 3
spt_village = 4
##spt_forager = 5
##spt_war_party = 6
##spt_patrol = 7
##spt_messenger = 8
##spt_raider = 9
##spt_scout = 10
spt_kingdom_caravan = 11
##spt_prisoner_train = 12
spt_kingdom_hero_party = 13
##spt_merchant_caravan = 14
spt_village_farmer = 15
spt_ship = 16
spt_cattle_herd = 17
#spt_deserter = 20
kingdom_party_types_begin = spt_kingdom_caravan
kingdom_party_types_end = spt_kingdom_hero_party + 1
#slot_faction_state values
sfs_active = 0
sfs_defeated = 1
sfs_inactive = 2
sfs_inactive_rebellion = 3
sfs_beginning_rebellion = 4
#slot_faction_ai_state values
sfai_default = 0
sfai_gathering_army = 1
sfai_attacking_center = 2
sfai_raiding_village = 3
sfai_attacking_enemy_army = 4
sfai_attacking_enemies_around_center = 5
#Rebellion system changes begin
sfai_nascent_rebellion = 6
#Rebellion system changes end
#slot_party_ai_state values
spai_undefined = -1
spai_besieging_center = 1
spai_patrolling_around_center = 4
spai_raiding_around_center = 5
##spai_raiding_village = 6
spai_holding_center = 7
##spai_helping_town_against_siege = 9
spai_engaging_army = 10
spai_accompanying_army = 11
spai_trading_with_town = 13
spai_retreating_to_center = 14
##spai_trading_within_kingdom = 15
spai_recruiting_troops = 16
#slot_village_state values
svs_normal = 0
svs_being_raided = 1
svs_looted = 2
svs_recovering = 3
svs_deserted = 4
svs_under_siege = 5
#$g_player_icon_state values
pis_normal = 0
pis_camping = 1
pis_ship = 2
########################################################
## SCENE SLOTS #############################
########################################################
slot_scene_visited = 0
slot_scene_belfry_props_begin = 10
########################################################
## TROOP SLOTS #############################
########################################################
#slot_troop_role = 0 # 10=Kingdom Lord
slot_troop_occupation = 2 # 0 = free, 1 = merchant
#slot_troop_duty = 3 # Kingdom duty, 0 = free
slot_troop_state = 3
slot_troop_last_talk_time = 4
slot_troop_met = 5
slot_troop_party_template = 6
#slot_troop_kingdom_rank = 7
slot_troop_renown = 7
##slot_troop_is_prisoner = 8 # important for heroes only
slot_troop_prisoner_of_party = 8 # important for heroes only
#slot_troop_is_player_companion = 9 # important for heroes only:::USE slot_troop_occupation = slto_player_companion
slot_troop_leaded_party = 10 # important for kingdom heroes only
slot_troop_wealth = 11 # important for kingdom heroes only
slot_troop_cur_center = 12 # important for royal family members only (non-kingdom heroes)
slot_troop_banner_scene_prop = 13 # important for kingdom heroes and player only
slot_troop_original_faction = 14 # for pretenders
slot_troop_loyalty = 15
slot_troop_player_order_state = 16
slot_troop_player_order_object = 17
#slot_troop_present_at_event = 19 #defined below
slot_troop_does_not_give_quest = 20
slot_troop_player_debt = 21
slot_troop_player_relation = 22
#slot_troop_player_favor = 23
slot_troop_last_quest = 24
slot_troop_last_quest_betrayed = 25
slot_troop_last_persuasion_time= 26
slot_troop_last_comment_time = 27
slot_troop_spawned_before = 28
#Post 0907 changes begin
slot_troop_last_comment_slot = 29
slot_troop_present_at_event = 19
#Post 0907 changes end
slot_troop_spouse = 30
slot_troop_father = 31
slot_troop_mother = 32
slot_troop_daughter = 33
slot_troop_son = 34
slot_troop_sibling = 35
slot_troop_lover = 36
slot_troop_trainer_met = 30
slot_troop_trainer_waiting_for_result = 31
slot_troop_trainer_training_fight_won = 32
slot_troop_trainer_num_opponents_to_beat = 33
slot_troop_trainer_training_system_explained = 34
slot_troop_trainer_opponent_troop = 35
slot_troop_trainer_training_difficulty = 36
slot_troop_trainer_training_fight_won = 37
slot_troop_family_begin = 30
slot_troop_family_end = 36
slot_troop_enemy_1 = 40
slot_troop_enemy_2 = 41
slot_troop_enemy_3 = 42
slot_troop_enemy_4 = 43
slot_troop_enemy_5 = 44
slot_troop_enemies_begin = 40
slot_troop_enemies_end = 45
slot_troop_honorable = 50
#slot_troop_merciful = 51
slot_lord_reputation_type = 52
slot_troop_change_to_faction = 55
slot_troop_readiness_to_join_army = 57
slot_troop_readiness_to_follow_orders = 58
# NPC-related constants
#NPC companion changes begin
slot_troop_first_encountered = 59
slot_troop_home = 60
slot_troop_morality_state = 61
tms_no_problem = 0
tms_acknowledged = 1
tms_dismissed = 2
slot_troop_morality_type = 62
tmt_aristocratic = 1
tmt_egalitarian = 2
tmt_humanitarian = 3
tmt_honest = 4
tmt_pious = 5
slot_troop_morality_value = 63
slot_troop_2ary_morality_type = 64
slot_troop_2ary_morality_state = 65
slot_troop_2ary_morality_value = 66
slot_troop_morality_penalties = 69 ### accumulated grievances from morality conflicts
slot_troop_personalityclash_object = 71
#(0 - they have no problem, 1 - they have a problem)
slot_troop_personalityclash_state = 72 #1 = pclash_penalty_to_self, 2 = pclash_penalty_to_other, 3 = pclash_penalty_to_other,
pclash_penalty_to_self = 1
pclash_penalty_to_other = 2
pclash_penalty_to_both = 3
#(a string)
slot_troop_personalityclash2_object = 73
slot_troop_personalityclash2_state = 74
slot_troop_personalitymatch_object = 75
slot_troop_personalitymatch_state = 76
slot_troop_personalityclash_penalties = 77 ### accumulated grievances from personality clash
slot_troop_home_speech_delivered = 78
#NPC history slots
slot_troop_met_previously = 80
slot_troop_turned_down_twice = 81
slot_troop_playerparty_history = 82
pp_history_scattered = 1
pp_history_dismissed = 2
pp_history_quit = 3
pp_history_indeterminate = 4
slot_troop_playerparty_history_string = 83
slot_troop_return_renown = 84
slot_troop_custom_banner_bg_color_1 = 85
slot_troop_custom_banner_bg_color_2 = 86
slot_troop_custom_banner_charge_color_1 = 87
slot_troop_custom_banner_charge_color_2 = 88
slot_troop_custom_banner_charge_color_3 = 89
slot_troop_custom_banner_charge_color_4 = 90
slot_troop_custom_banner_bg_type = 91
slot_troop_custom_banner_charge_type_1 = 92
slot_troop_custom_banner_charge_type_2 = 93
slot_troop_custom_banner_charge_type_3 = 94
slot_troop_custom_banner_charge_type_4 = 95
slot_troop_custom_banner_flag_type = 96
slot_troop_custom_banner_num_charges = 97
slot_troop_custom_banner_positioning = 98
slot_troop_custom_banner_map_flag_type = 99
#conversation strings -- must be in this order!
slot_troop_intro = 101
slot_troop_intro_response_1 = 102
slot_troop_intro_response_2 = 103
slot_troop_backstory_a = 104
slot_troop_backstory_b = 105
slot_troop_backstory_c = 106
slot_troop_backstory_delayed = 107
slot_troop_backstory_response_1 = 108
slot_troop_backstory_response_2 = 109
slot_troop_signup = 110
slot_troop_signup_2 = 111
slot_troop_signup_response_1 = 112
slot_troop_signup_response_2 = 113
slot_troop_mentions_payment = 114 #Not actually used
slot_troop_payment_response = 115 #Not actually used
slot_troop_morality_speech = 116
slot_troop_2ary_morality_speech = 117
slot_troop_personalityclash_speech = 118
slot_troop_personalityclash_speech_b = 119
slot_troop_personalityclash2_speech = 120
slot_troop_personalityclash2_speech_b = 121
slot_troop_personalitymatch_speech = 122
slot_troop_personalitymatch_speech_b = 123
slot_troop_retirement_speech = 124
slot_troop_rehire_speech = 125
slot_troop_home_intro = 126
slot_troop_home_description = 127
slot_troop_home_description_2 = 128
slot_troop_home_recap = 129
slot_troop_honorific = 130
slot_troop_strings_end = 131
slot_troop_payment_request = 132
#Rebellion changes begin
slot_troop_discussed_rebellion = 140
slot_troop_support_base = 141
#Rebellion changes end
# character backgrounds
cb_noble = 1
cb_merchant = 2
cb_guard = 3
cb_forester = 4
cb_nomad = 5
cb_thief = 6
cb_priest = 7
cb2_page = 0
cb2_apprentice = 1
cb2_urchin = 2
cb2_steppe_child = 3
cb2_merchants_helper = 4
cb3_poacher = 3
cb3_craftsman = 4
cb3_peddler = 5
cb3_troubadour = 7
cb3_squire = 8
cb3_lady_in_waiting = 9
cb3_student = 10
cb4_revenge = 1
cb4_loss = 2
cb4_wanderlust = 3
cb4_disown = 5
cb4_greed = 6
#NPC system changes end
#Encounter types
enctype_fighting_against_village_raid = 1
enctype_catched_during_village_raid = 2
### Troop occupations slot_troop_occupation
##slto_merchant = 1
slto_kingdom_hero = 2
slto_player_companion = 3
slto_kingdom_lady = 4
slto_kingdom_seneschal = 5
slto_robber_knight = 6
stl_unassigned = -1
stl_reserved_for_player = -2
stl_rejected_by_player = -3
#NPC changes begin
slto_retirement = 11
#slto_retirement_medium = 12
#slto_retirement_short = 13
#NPC changes end
########################################################
## QUEST SLOTS #############################
########################################################
slot_quest_target_center = 1
slot_quest_target_troop = 2
slot_quest_target_faction = 3
slot_quest_object_troop = 4
##slot_quest_target_troop_is_prisoner = 5
slot_quest_giver_troop = 6
slot_quest_object_center = 7
slot_quest_target_party = 8
slot_quest_target_party_template = 9
slot_quest_target_amount = 10
slot_quest_current_state = 11
slot_quest_giver_center = 12
slot_quest_target_dna = 13
slot_quest_target_item = 14
slot_quest_object_faction = 15
slot_quest_convince_value = 19
slot_quest_importance = 20
slot_quest_xp_reward = 21
slot_quest_gold_reward = 22
slot_quest_expiration_days = 23
slot_quest_dont_give_again_period = 24
slot_quest_dont_give_again_remaining_days = 25
########################################################
## PARTY TEMPLATE SLOTS #############################
########################################################
# Ryan BEGIN
slot_party_template_num_killed = 1
# Ryan END
########################################################
rel_enemy = 0
rel_neutral = 1
rel_ally = 2
#Talk contexts
tc_town_talk = 0
tc_court_talk = 1
tc_party_encounter = 2
tc_castle_gate = 3
tc_siege_commander = 4
tc_join_battle_ally = 5
tc_join_battle_enemy = 6
tc_castle_commander = 7
tc_hero_freed = 8
tc_hero_defeated = 9
tc_entering_center_quest_talk = 10
tc_back_alley = 11
tc_siege_won_seneschal = 12
tc_ally_thanks = 13
tc_tavern_talk = 14
tc_rebel_thanks = 15
#Troop Commentaries begin
#Log entry types
#civilian
logent_village_raided = 1
logent_village_extorted = 2
logent_caravan_accosted = 3
logent_helped_peasants = 4
logent_castle_captured_by_player = 10
logent_lord_defeated_by_player = 11
logent_lord_captured_by_player = 12
logent_lord_defeated_but_let_go_by_player = 13
logent_player_defeated_by_lord = 14
logent_player_retreated_from_lord = 15
logent_player_retreated_from_lord_cowardly = 16
logent_lord_helped_by_player = 17
logent_player_participated_in_siege = 18
logent_player_participated_in_major_battle = 19
logent_pledged_allegiance = 21
logent_fief_granted_village = 22
logent_renounced_allegiance = 23
logent_game_start = 31
logent_poem_composed = 32 ##Not added
logent_tournament_distinguished = 33 ##Not added
logent_tournament_won = 34 ##Not added
#lord reputation type, for commentaries
#"Martial" will be twice as common as the other types
lrep_none = 0
lrep_martial = 1 #chivalrous but not terribly empathetic or introspective, - eg Richard Lionheart, your average 14th century French baron
lrep_quarrelsome = 2 #spiteful, cynical, a bit paranoid, possibly hotheaded - eg Robert Graves' Tiberius, Shakespeare's Richard III
lrep_selfrighteous = 3 #coldblooded, moralizing, often cruel - eg William the Conqueror, Timur, Octavian, Aurangzeb (although he borders on upstanding)
lrep_cunning = 4 #coldblooded, pragmatic, amoral - eg Louis XI, Guiscard, Akbar Khan, Abd al-Aziz Ibn Saud
lrep_debauched = 5 #spiteful, amoral, sadistic, - eg Caligula, Tuchman's Charles of Navarre
lrep_goodnatured = 6 #chivalrous, benevolent, perhaps a little too decent to be a good warlord - eg Hussein, poss Ranjit Singh (although roguish), Humayun
lrep_upstanding = 7 #moralizing, benevolent, pragmatic, - eg Bernard Cornwell's Alfred, Charlemagne, Sher Shah Suri
#Troop Commentaries end
#Walker types:
walkert_default = 0
walkert_needs_money = 1
walkert_needs_money_helped = 2
walkert_spy = 3
num_town_walkers = 8
town_walker_entries_start = 32
reinforcement_cost = 400
merchant_toll_duration = 72 #Tolls are valid for 72 hours
hero_escape_after_defeat_chance = 80
raid_distance = 4
##########################
# Form Ranks Constants Section
#
#######
# Note: Some operations are based on the relative position of slots,
# so when adding new slots, DO NOT insert in between, append them
# at the bottom.
#######
formation_order_functions = [
("@Dismiss", ("script_formation_dismiss_key_reaction",)),
("@Follow me", ("script_formation_follow_key_reaction",)),
("@Tactical charge", ("script_formation_tactical_charge_key_reaction",)),
("@Charge", ("script_formation_charge_key_reaction", 1, "str_formation_charge")),
("@Halt", ("script_formation_charge_key_reaction", 0, "str_formation_halt")),
("@Fall back", ("script_formation_charge_key_reaction", -1, "str_formation_fall_back")),
("@Move forward", ("script_formation_move_key_reaction", 0, 10, "str_formation_advance")),
("@Move backward", ("script_formation_move_key_reaction", 0, -10, "str_formation_move_back")),
("@Move left", ("script_formation_move_key_reaction", -10, 0, "str_formation_move_left")),
("@Move right", ("script_formation_move_key_reaction", 10, 0, "str_formation_move_right")),
("@Turn left", ("script_formation_turn_key_reaction", 15, "str_formation_turn_left")),
("@Turn right", ("script_formation_turn_key_reaction", -15, "str_formation_turn_right")),
("@Stand closer", ("script_formation_density_key_reaction", -1, "str_formation_stand_closer")),
("@Spred out", ("script_formation_density_key_reaction", 1, "str_formation_spread_out")),
("@Toward enemies", ("script_formation_auto_rotation_key_reaction", 1)),
("@Free direction", ("script_formation_auto_rotation_key_reaction", 0)),
]
formation_keys_list = [
#0x07, #
"$key_array_selection_1",
#0x08, #
"$key_array_selection_2",
#0x09, #
"$key_array_selection_3",
#0x0a, #
"$key_array_selection_4",
#0x0b, #
"$key_array_selection_5",
#0x0c, #
"$key_array_selection_6",
#0x0d, #
"$key_array_selection_7",
#0x1b, #
"$key_array_selection_8",
"$key_array_select_all",
"$key_formation_selection",
"$key_formation_selection_backward",
"$key_formation_tighten",
"$key_formation_disperse",
"$key_formation_follow",
"$key_formation_hold_pos",
"$key_auto_rotation_toggle",
"$key_apply_formation",
"$key_formation_charge",
"$key_formation_fall_back",
"$key_formation_halt",
"$key_formation_tactical_charge",
"$key_formation_move_forward",
"$key_formation_move_backward",
"$key_formation_move_left",
"$key_formation_move_right",
"$key_formation_turn_left",
"$key_formation_turn_right",
"$key_dismiss_formation",
"$key_formation_view_orders",
]
formation_default_key_list = [
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x2b, 0x02,
0x15, 0x16, 0x42, 0x43, 0x3c, 0x3b, 0x22, 0x25, 0x30,
0x32, 0x31, 0x23, 0xc8, 0xd0, 0xcb, 0xcd, 0x33, 0x34,
0x18, 0x2d,
]
all_keys_list = [
(0x02, "@1"), (0x03, "@2"), (0x04, "@3"), (0x05, "@4"),
(0x06, "@5"), (0x07, "@6"), (0x08, "@7"), (0x09, "@8"),
(0x0a, "@9"), (0x0b, "@0"), (0x1e, "@A"), (0x30, "@B"),
(0x2e, "@C"), (0x20, "@D"), (0x12, "@E"), (0x21, "@F"),
(0x22, "@G"), (0x23, "@H"), (0x17, "@I"), (0x24, "@J"),
(0x25, "@K"), (0x26, "@L"), (0x32, "@M"), (0x31, "@N"),
(0x18, "@O"), (0x19, "@P"), (0x10, "@Q"), (0x13, "@R"),
(0x1f, "@S"), (0x14, "@T"), (0x16, "@U"), (0x2f, "@V"),
(0x11, "@W"), (0x2d, "@X"), (0x15, "@Y"), (0x2c, "@Z"),
(0x52, "@Numpad 0"), (0x4f, "@Numpad 1"), (0x50, "@Numpad 2"),
(0x51, "@Numpad 3"), (0x4b, "@Numpad 4"), (0x4c, "@Numpad 5"),
(0x4d, "@Numpad 6"), (0x47, "@Numpad 7"), (0x48, "@Numpad 8"),
(0x49, "@Numpad 9"), (0x45, "@Num Lock"), (0xb5, "@Numpad Div"),
(0x37, "@Numpad Mul"), (0x4a, "@Numpad Mins"), (0x4e, "@Numpad Pls"),
(0x9c, "@Numpad Entr"), (0x53, "@Numpad Dot"), (0xd2, "@Insert"),
(0xd3, "@Delete"), (0xc7, "@Home"), (0xcf, "@End"),
(0xc9, "@Page Up"), (0xd1, "@Page Down"), (0xc8, "@Up"),
(0xd0, "@Down"), (0xcb, "@Left"), (0xcd, "@Right"),
(0x3b, "@F1"), (0x3c, "@F2"), (0x3d, "@F3"), (0x3e, "@F4"),
(0x3f, "@F5"), (0x40, "@F6"), (0x41, "@F7"), (0x42, "@F8"),
(0x43, "@F9"), (0x44, "@F10"), (0x57, "@F11"), (0x58, "@F12"),
(0x39, "@Space Bar"), (0x1c, "@Enter"),
(0x0f, "@Tab"), (0x0e, "@Backspace"), (0x1a, "@Left Bracess"),
(0x1b, "@Right Braces"), (0x33, "@Comma"), (0x34, "@Period"), (0x35, "@Slash"),
(0x2b, "@Back Slash"), (0x0d, "@Equals"), (0x0c, "@Minus"), (0x27, "@Semicolon"),
(0x28, "@Apostrophe"), (0x29, "@Tilde"), (0x3a, "@Caps Lock"),
(0x2a, "@Left Shift"), (0x36, "@Right Shift"), (0x1d, "@Left Ctrl"),
(0x9d, "@Right Ctrl"), (0x38, "@Left Alt"), (0xb8, "@Right Alt"),
(0xe0, "@Left Click"), (0xe1, "@Right Click"),
(0xe2, "@Mouse Button 3"), (0xe3, "@Mouse Button 4"),
(0xe4, "@Mouse Button 5"), (0xe5, "@Mouse Button 6"),
(0xe6, "@Mouse Button 7"), (0xe7, "@Mouse Button 8"),
(0xee, "@Scroll Up"), (0xef, "@Scroll Down"),
]
# agent slots for formation
slot_agent_native_end = 12 # refer this to the agent
# slot section for native,
# should be {the last slot}+1
slot_agent_formation_states = slot_agent_native_end
slot_agent_formation_x_pos = slot_agent_native_end+1
slot_agent_formation_y_pos = slot_agent_native_end+2
# slots for tactical algorithms
slot_agent_formation_alg_cell_1 = slot_agent_native_end+3
slot_agent_formation_alg_cell_2 = slot_agent_native_end+4
slot_agent_formation_alg_cell_3 = slot_agent_native_end+5
slot_agent_formation_alg_cell_4 = slot_agent_native_end+6
slot_agent_formation_alg_cell_5 = slot_agent_native_end+7
# slot_agent_formation_states masks
safs_in_formation = 0x10 # used when calculating formation
safs_array_leader = 0x20 # mark if agent is leader of array
safs_array_no = 0xF # so arrays can be numbered through 16, see notes below
safs_roar_stage = 0x1C0 # how long since the agent last roared
safs_roar_stage_second = 0x40 # bit representing one second for roar_stage
safs_full_mask = 0xFEF
formation_arrays = 8 # This can be changed if you want more arrays,
# but due to storage limitation of the party slots,
# the maximum is 10 for current configuration.
# Main party slots
slot_party_array_parties_begin = slot_center_walker_0_troop
slot_party_array_parties_end = slot_party_array_parties_begin+formation_arrays
slot_party_formation_keys_begin = slot_party_array_parties_end
slot_party_formation_keys_end = slot_party_formation_keys_begin+len(formation_keys_list)
slot_party_formation_ai_switch = slot_party_formation_keys_end
# Array party slots
slot_array_party_leader = slot_center_walker_0_troop
formation_vector = "$formation_vector"
formation_temp_vector = "$formation_temp_vector"
# Formation vector slots #############
slot_formation_array_marks_begin = 0
slot_formation_array_marks_end = slot_formation_array_marks_begin+formation_arrays+1
slot_formation_teams_begin = slot_formation_array_marks_end
# formation team section
# Indices are just offsets.
slot_formation_team_array_selection = 0
slot_formation_team_max_array_no = 1
slot_formation_team_arrays_begin = 2
# formation array section
# Nested in formation team section, these indices
# are just offsets.
slot_formation_array_leader = 0
slot_formation_array_ref_x_pos = 1
slot_formation_array_ref_y_pos = 2
slot_formation_array_ref_rotation = 3
slot_formation_array_num_of_men = 4
slot_formation_array_states = 5
# slot formation array states masks
sfas_formation_type = 0xFF # 256 formation types maximum..hmm..should suffice...
sfas_auto_rotate = 0x100 # mark if array should always face enemies
sfas_charge = 0x200 # mark if array is charging
sfas_fall_back = 0x400 # mark if array is falling back
sfas_speed = 0xF000 # speed of charge or fall back
sfas_speed_unit = 0x1000 # unit bit of speed
sfas_speed_base = 0x1000 # convertion base from bits to meters
sfas_speed_limit = 16 # maximum speed in kbits
sfas_formation_density = 0x30000 # The tightness of the formation
sfas_density_unit = 0x10000 # unit bit of density
sfas_density_base = 75 # base interval in centimetres
sfas_tactical_charge = 0x40000 # whether the formation is in tactical charge
sfas_engaged = 0x80000 # whether the array has engaged enmey
sfas_roar = 0x100000 # whether the soldiers give out war cry
tactical_charge_adjust_in = 10
tactical_charge_adjust_out = 30
tactical_charge_cut_in = 30
tactical_charge_listen_interval = 1 # the interval for trigger to activate
tactical_charge_arc_radius = 4500
sfa_array_section_size = 6
slot_formation_team_arrays_end = slot_formation_team_arrays_begin \
+sfa_array_section_size*formation_arrays
# slot formation team values
sft_team_section_size = slot_formation_team_arrays_end
slot_formation_teams_end = slot_formation_teams_begin \
+sft_team_section_size*4
# Formation types:
formation_types = 5 #number of formations
ft_line = 0
ft_phalanx = 1
ft_wedge = 2
ft_square = 3
ft_cant_circle = 4
# Formation vector slots end ###########
# Formation temporary vector slots #####
slot_formation_tmp_maintain = 0
slot_formation_tmp_density = 4*formation_arrays*2
slot_formation_tmp_team_stat_begin = slot_formation_tmp_density+4*formation_arrays
# below are off-sets for each team section
slot_formation_tmp_team_total = 0
slot_formation_tmp_team_infantry_high = 1
slot_formation_tmp_team_infantry_low = 2
slot_formation_tmp_team_archer = 3
slot_formation_tmp_team_cavalry_1 = 6
slot_formation_tmp_team_cavalry_2 = 7
slot_formation_tmp_team_horse_archer_1 = 4
slot_formation_tmp_team_horse_archer_2 = 5
slot_formation_tmp_team_arrays = 8
slot_formation_tmp_team_stat_section_size = 9
slot_formation_tmp_alg_stat_begin = slot_formation_tmp_team_stat_begin+slot_formation_tmp_team_stat_section_size*4
slot_formation_tmp_cavalry_target = slot_formation_tmp_alg_stat_begin+4*20
slot_formation_tmp_clustering = slot_formation_tmp_cavalry_target+12
sftc_max_stage = 7
sfas_clustering_stage = 0xFE00000 # timer for recalculating clustering
sfas_clustering_stage_unit=0x200000 # unit bit of stage
sfas_clustering_max_stage=0x1E00000 # interval for recalculating clustering
sftt_num_mask = 0xFFF
sftt_num_assigned_mask = 0xFFF000
sftt_num_assigned_base = 0x1000
sftt_formation_stage_mask = 0xF000000
sftt_formation_stage = 0x1000000
sftt_array_no_mask = 0x70000000
sftt_array_no_base = 0x10000000
sftt_deployed = 0x80000000
sftd_ratio_base = 12
# Formation temporary vector slots end #
# pos20 to pos51 for maintain formation, do not use in other mission-template triggers
maintain_formation_pos_begin = 20
# Formation strings index
formation_array_names_begin = "str_formation_array_1"
formation_array_names_end = "str_formation_array_end"
formation_order_panel_array_names_begin = "str_formation_order_panel_array_1"
formation_order_panel_array_names_end = "str_formation_order_panel_array_end"
formation_commands_begin = "str_formation_command_line"
formation_commands_pl_begin = "str_formation_command_line_pl"
formation_commands_end = "str_formation_command_end"
formation_key_names_begin = "str_key_array_selection_1"
formation_key_names_end = "str_formation_key_names_end"
# Formation scripts index
formation_scripts_begin = "script_formation_line"
formation_scripts_end = "script_dismiss_battle_array"
# Formation tactics scripts index
formation_tactics_scripts_begin = "script_formation_tactical_charge_line"
formation_tactcs_scripts_end = "script_formation_line"
Pi = 3.1415926535
# Colors
formation_message_color = 0xFFAAFF55
formation_warning_color = 0xFFAA5555
formation_order_color = 0xFFAAFF00
formation_debug_color = 0xFF0000FF
debug_point = (1106, "@DEBUG: Line reached!", formation_debug_color)
debug_point_1 = (1106, "@DEBUG: Routine 1", formation_debug_color)
debug_point_2 = (1106, "@DEBUG: Routine 2", formation_debug_color)
debug_point_3 = (1106, "@DEBUG: Routine 3", formation_debug_color)
debug_point_4 = (1106, "@DEBUG: Routine 4", formation_debug_color)
debug_point_5 = (1106, "@DEBUG: Routine 5", formation_debug_color)
def concatenate_scripts(block_list):
result = []
for block in block_list:
result += block
return result
#
# Form Ranks Constants Section End
############################
surnames_begin = "str_surname_1"
surnames_end = "str_surnames_end"
names_begin = "str_name_1"
names_end = surnames_begin
countersigns_begin = "str_countersign_1"
countersigns_end = names_begin
secret_signs_begin = "str_secret_sign_1"
secret_signs_end = countersigns_begin
kingdoms_begin = "fac_player_supporters_faction"
kingdoms_end = "fac_kingdoms_end"
kingdom_ladies_begin = "trp_knight_1_1_wife"
kingdom_ladies_end = "trp_heroes_end"
kings_begin = "trp_kingdom_1_lord"
kings_end = "trp_knight_1_1"
kingdom_heroes_begin = "trp_kingdom_1_lord"
kingdom_heroes_end = kingdom_ladies_begin
heroes_begin = kingdom_heroes_begin
heroes_end = kingdom_ladies_end
companions_begin = "trp_npc1"
companions_end = "trp_kingdom_heroes_including_player_begin"
soldiers_begin = "trp_farmer"
soldiers_end = "trp_town_walker_1"
#Rebellion changes
##rebel_factions_begin = "fac_kingdom_1_rebels"
##rebel_factions_end = "fac_kingdoms_end"
pretenders_begin = "trp_kingdom_1_pretender"
pretenders_end = kingdom_heroes_end
#Rebellion changes
tavern_minstrels_begin = "trp_tavern_minstrel_1"
tavern_minstrels_end = companions_begin
tavern_booksellers_begin = "trp_tavern_bookseller_1"
tavern_booksellers_end = tavern_minstrels_begin
tavern_travelers_begin = "trp_tavern_traveler_1"
tavern_travelers_end = tavern_booksellers_begin
ransom_brokers_begin = "trp_ransom_broker_1"
ransom_brokers_end = tavern_travelers_begin
mercenary_troops_begin = "trp_watchman"
mercenary_troops_end = "trp_mercenaries_end"
lord_quests_begin = "qst_deliver_message"
lord_quests_end = "qst_follow_army"
enemy_lord_quests_begin = "qst_lend_surgeon"
enemy_lord_quests_end = lord_quests_end
village_elder_quests_begin = "qst_deliver_grain"
village_elder_quests_end = "qst_eliminate_bandits_infesting_village"
mayor_quests_begin = "qst_move_cattle_herd"
mayor_quests_end = village_elder_quests_begin
lady_quests_begin = "qst_rescue_lord_by_replace"
lady_quests_end = mayor_quests_begin
army_quests_begin = "qst_deliver_cattle_to_army"
army_quests_end = lady_quests_begin
all_quests_begin = 0
all_quests_end = "qst_quests_end"
towns_begin = "p_town_1"
castles_begin = "p_castle_1"
villages_begin = "p_village_1"
towns_end = castles_begin
castles_end = villages_begin
villages_end = "p_salt_mine"
walled_centers_begin = towns_begin
walled_centers_end = castles_end
centers_begin = towns_begin
centers_end = villages_end
training_grounds_begin = "p_training_ground_1"
training_grounds_end = "p_Bridge_1"
scenes_begin = "scn_town_1_center"
scenes_end = "scn_castle_1_exterior"
spawn_points_begin = "p_zendar"
spawn_points_end = "p_spawn_points_end"
regular_troops_begin = "trp_novice_fighter"
regular_troops_end = "trp_tournament_master"
swadian_merc_parties_begin = "p_town_1_mercs"
swadian_merc_parties_end = "p_town_8_mercs"
vaegir_merc_parties_begin = "p_town_8_mercs"
vaegir_merc_parties_end = "p_zendar"
arena_masters_begin = "trp_town_1_arena_master"
arena_masters_end = "trp_town_1_armorer"
training_gound_trainers_begin = "trp_trainer_1"
training_gound_trainers_end = "trp_ransom_broker_1"
town_walkers_begin = "trp_town_walker_1"
town_walkers_end = "trp_village_walker_1"
village_walkers_begin = "trp_village_walker_1"
village_walkers_end = "trp_spy_walker_1"
spy_walkers_begin = "trp_spy_walker_1"
spy_walkers_end = "trp_tournament_master"
walkers_begin = town_walkers_begin
walkers_end = spy_walkers_end
armor_merchants_begin = "trp_town_1_armorer"
armor_merchants_end = "trp_town_1_weaponsmith"
weapon_merchants_begin = "trp_town_1_weaponsmith"
weapon_merchants_end = "trp_town_1_tavernkeeper"
tavernkeepers_begin = "trp_town_1_tavernkeeper"
tavernkeepers_end = "trp_town_1_merchant"
goods_merchants_begin = "trp_town_1_merchant"
goods_merchants_end = "trp_town_1_horse_merchant"
horse_merchants_begin = "trp_town_1_horse_merchant"
horse_merchants_end = "trp_town_1_mayor"
mayors_begin = "trp_town_1_mayor"
mayors_end = "trp_village_1_elder"
village_elders_begin = "trp_village_1_elder"
village_elders_end = "trp_merchants_end"
average_price_factor = 1000
minimum_price_factor = 100
maximum_price_factor = 10000
village_prod_min = -5
village_prod_max = 18
trade_goods_begin = "itm_smoked_fish"
trade_goods_end = "itm_siege_supply"
food_begin = "itm_smoked_fish"
food_end = "itm_wine"
reference_books_begin = "itm_book_wound_treatment_reference"
reference_books_end = trade_goods_begin
readable_books_begin = "itm_book_tactics"
readable_books_end = reference_books_begin
books_begin = readable_books_begin
books_end = reference_books_end
horses_begin = "itm_sumpter_horse"
horses_end = "itm_arrows"
weapons_begin = "itm_wooden_stick"
weapons_end = "itm_wooden_shield"
ranged_weapons_begin = "itm_jarid"
ranged_weapons_end = "itm_torch"
armors_begin = "itm_leather_gloves"
armors_end = "itm_wooden_stick"
shields_begin = "itm_wooden_shield"
shields_end = "itm_jarid"
# Banner constants
banner_meshes_begin = "mesh_banner_a01"
banner_meshes_end_minus_one = "mesh_banner_f21"
arms_meshes_begin = "mesh_arms_a01"
arms_meshes_end_minus_one = "mesh_arms_f21"
custom_banner_charges_begin = "mesh_custom_banner_charge_01"
custom_banner_charges_end = "mesh_tableau_mesh_custom_banner"
custom_banner_backgrounds_begin = "mesh_custom_banner_bg"
custom_banner_backgrounds_end = custom_banner_charges_begin
custom_banner_flag_types_begin = "mesh_custom_banner_01"
custom_banner_flag_types_end = custom_banner_backgrounds_begin
custom_banner_flag_map_types_begin = "mesh_custom_map_banner_01"
custom_banner_flag_map_types_end = custom_banner_flag_types_begin
custom_banner_flag_scene_props_begin = "spr_custom_banner_01"
custom_banner_flag_scene_props_end = "spr_banner_a"
custom_banner_map_icons_begin = "icon_custom_banner_01"
custom_banner_map_icons_end = "icon_banner_01"
banner_map_icons_begin = "icon_banner_01"
banner_map_icons_end_minus_one = "icon_banner_126"
banner_scene_props_begin = "spr_banner_a"
banner_scene_props_end_minus_one = "spr_banner_f21"
khergit_banners_begin_offset = 63
khergit_banners_end_offset = 84
# Some constants for merchant invenotries
merchant_inventory_space = 30
num_merchandise_goods = 40
num_max_river_pirates = 25
num_max_zendar_peasants = 25
num_max_zendar_manhunters = 10
num_max_dp_bandits = 10
num_max_refugees = 10
num_max_deserters = 10
num_max_militia_bands = 15
num_max_armed_bands = 12
num_max_vaegir_punishing_parties = 20
num_max_rebel_peasants = 25
num_max_frightened_farmers = 50
num_max_undead_messengers = 20
num_forest_bandit_spawn_points = 1
num_mountain_bandit_spawn_points = 1
num_steppe_bandit_spawn_points = 1
num_black_khergit_spawn_points = 1
num_sea_raider_spawn_points = 2
peak_prisoner_trains = 4
peak_kingdom_caravans = 12
peak_kingdom_messengers = 3
# Note positions
note_troop_location = 3
#battle tactics
btactic_hold = 1
btactic_follow_leader = 2
btactic_charge = 3
btactic_stand_ground = 4
#default right mouse menu orders
cmenu_move = -7
# Town center modes
tcm_default = 0
tcm_disguised = 1
# Arena battle modes
#abm_fight = 0
abm_training = 1
abm_visit = 2
abm_tournament = 3
# Camp training modes
ctm_melee = 1
ctm_ranged = 2
ctm_mounted = 3
ctm_training = 4
# Village bandits attack modes
vba_normal = 1
vba_after_training = 2
arena_tier1_opponents_to_beat = 3
arena_tier1_prize = 5
arena_tier2_opponents_to_beat = 6
arena_tier2_prize = 10
arena_tier3_opponents_to_beat = 10
arena_tier3_prize = 25
arena_tier4_opponents_to_beat = 20
arena_tier4_prize = 60
arena_grand_prize = 250
| Python |
script_game_start = 0
script_game_event_party_encounter = 1
script_game_event_simulate_battle = 2
script_game_event_battle_end = 3
script_order_best_besieger_party_to_guard_center = 4
script_game_get_item_buy_price_factor = 5
script_game_get_item_sell_price_factor = 6
script_get_trade_penalty = 7
script_game_event_buy_item = 8
script_game_event_sell_item = 9
script_game_get_troop_wage = 10
script_game_get_total_wage = 11
script_game_get_join_cost = 12
script_game_get_prisoner_price = 13
script_game_check_prisoner_can_be_sold = 14
script_game_event_detect_party = 15
script_game_event_undetect_party = 16
script_game_get_statistics_line = 17
script_game_get_date_text = 18
script_game_get_money_text = 19
script_game_get_party_companion_limit = 20
script_game_reset_player_party_name = 21
script_party_get_ideal_size = 22
script_game_get_party_prisoner_limit = 23
script_game_get_item_extra_text = 24
script_game_on_disembark = 25
script_game_context_menu_get_buttons = 26
script_game_event_context_menu_button_clicked = 27
script_game_get_skill_modifier_for_troop = 28
script_npc_get_troop_wage = 29
script_setup_talk_info = 30
script_setup_talk_info_companions = 31
script_update_party_creation_random_limits = 32
script_set_trade_route_between_centers = 33
script_center_change_trade_good_production = 34
script_average_trade_good_productions = 35
script_normalize_trade_good_productions = 36
script_update_trade_good_prices = 37
script_update_trade_good_price_for_party = 38
script_do_merchant_town_trade = 39
script_party_calculate_regular_strength = 40
script_party_calculate_strength = 41
script_loot_player_items = 42
script_party_calculate_loot = 43
script_calculate_main_party_shares = 44
script_party_give_xp_and_gold = 45
script_setup_troop_meeting = 46
script_setup_party_meeting = 47
script_party_remove_all_companions = 48
script_party_remove_all_prisoners = 49
script_party_add_party_companions = 50
script_party_add_party_prisoners = 51
script_party_prisoners_add_party_companions = 52
script_party_prisoners_add_party_prisoners = 53
script_party_add_party = 54
script_party_copy = 55
script_clear_party_group = 56
script_get_nonempty_party_in_group = 57
script_collect_prisoners_from_empty_parties = 58
script_print_casualties_to_s0 = 59
script_write_fit_party_members_to_stack_selection = 60
script_remove_fit_party_member_from_stack_selection = 61
script_remove_random_fit_party_member_from_stack_selection = 62
script_cf_training_ground_sub_routine_1_for_melee_details = 63
script_training_ground_sub_routine_2_for_melee_details = 64
script_cf_training_ground_sub_routine_for_training_result = 65
script_print_troop_owned_centers_in_numbers_to_s0 = 66
script_get_random_melee_training_weapon = 67
script_start_training_at_training_ground = 68
script_party_count_fit_regulars = 69
script_party_count_fit_for_battle = 70
script_party_count_members_with_full_health = 71
script_get_stack_with_rank = 72
script_inflict_casualties_to_party = 73
script_move_members_with_ratio = 74
script_count_parties_of_faction_and_party_type = 75
script_faction_get_number_of_armies = 76
script_faction_recalculate_strength = 77
script_cf_select_random_town_with_faction = 78
script_cf_select_random_village_with_faction = 79
script_cf_select_random_walled_center_with_faction = 80
script_cf_select_random_walled_center_with_faction_and_owner_priority_no_siege = 81
script_cf_select_random_walled_center_with_faction_and_less_strength_priority = 82
script_cf_select_random_town_at_peace_with_faction = 83
script_cf_select_random_town_at_peace_with_faction_in_trade_route = 84
script_shuffle_troop_slots = 85
script_get_random_quest = 86
script_cf_get_random_enemy_center_within_range = 87
script_cf_faction_get_random_enemy_faction = 88
script_cf_faction_get_random_friendly_faction = 89
script_cf_troop_get_random_enemy_troop_with_occupation = 90
script_cf_get_random_kingdom_hero_as_lover = 91
script_cf_get_random_lord_in_a_center_with_faction = 92
script_cf_get_random_lord_except_king_with_faction = 93
script_cf_get_random_lord_from_another_faction_in_a_center = 94
script_get_closest_walled_center = 95
script_get_closest_center = 96
script_get_closest_center_of_faction = 97
script_get_closest_walled_center_of_faction = 98
script_let_nearby_parties_join_current_battle = 99
script_party_wound_all_members_aux = 100
script_party_wound_all_members = 101
script_calculate_battle_advantage = 102
script_cf_check_enemies_nearby = 103
script_get_heroes_attached_to_center_aux = 104
script_get_heroes_attached_to_center = 105
script_get_heroes_attached_to_center_as_prisoner_aux = 106
script_get_heroes_attached_to_center_as_prisoner = 107
script_give_center_to_faction = 108
script_give_center_to_faction_aux = 109
script_change_troop_faction = 110
script_give_center_to_lord = 111
script_get_number_of_hero_centers = 112
script_cf_get_random_enemy_center = 113
script_find_travel_location = 114
script_get_relation_between_parties = 115
script_calculate_weekly_party_wage = 116
script_calculate_player_faction_wage = 117
script_calculate_hero_weekly_net_income_and_add_to_wealth = 118
script_cf_reinforce_party = 119
script_hire_men_to_kingdom_hero_party = 120
script_get_percentage_with_randomized_round = 121
script_create_cattle_herd = 122
script_buy_cattle_from_village = 123
script_kill_cattle_from_herd = 124
script_create_kingdom_hero_party = 125
script_create_kingdom_party_if_below_limit = 126
script_cf_create_kingdom_party = 127
script_get_troop_attached_party = 128
script_center_get_food_consumption = 129
script_center_get_food_store_limit = 130
script_refresh_village_merchant_inventory = 131
script_refresh_village_defenders = 132
script_village_set_state = 133
script_process_village_raids = 134
script_process_sieges = 135
script_lift_siege = 136
script_process_alarms = 137
script_party_set_ai_state = 138
script_decide_kingdom_party_ais = 139
script_party_decide_next_ai_state_under_command = 140
script_kingdom_hero_decide_next_ai_state_follow_or_not = 141
script_kingdom_hero_decide_next_ai_state = 142
script_process_kingdom_parties_ai = 143
script_process_hero_ai = 144
script_select_faction_marshall = 145
script_get_center_faction_relation_including_player = 146
script_decide_faction_ai = 147
script_check_and_finish_active_army_quests_for_faction = 148
script_troop_get_player_relation = 149
script_change_troop_renown = 150
script_change_player_relation_with_troop = 151
script_change_player_relation_with_center = 152
script_change_player_relation_with_faction = 153
script_set_player_relation_with_faction = 154
script_change_player_relation_with_faction_ex = 155
script_cf_get_random_active_faction_except_player_faction_and_faction = 156
script_make_kingdom_hostile_to_player = 157
script_change_player_honor = 158
script_change_player_party_morale = 159
script_cf_player_has_item_without_modifier = 160
script_get_player_party_morale_values = 161
script_diplomacy_start_war_between_kingdoms = 162
script_party_calculate_and_set_nearby_friend_strength = 163
script_init_ai_calculation = 164
script_recalculate_ais = 165
script_recalculate_ai_for_troop = 166
script_calculate_troop_ai = 167
script_calculate_troop_ai_under_command = 168
script_diplomacy_start_peace_between_kingdoms = 169
script_event_kingdom_make_peace_with_kingdom = 170
script_randomly_start_war_peace = 171
script_exchange_prisoners_between_factions = 172
script_add_notification_menu = 173
script_finish_quest = 174
script_get_information_about_troops_position = 175
script_recruit_troop_as_companion = 176
script_setup_random_scene = 177
script_enter_dungeon = 178
script_enter_court = 179
script_find_high_ground_around_pos1 = 180
script_select_battle_tactic = 181
script_select_battle_tactic_aux = 182
script_battle_tactic_init = 183
script_battle_tactic_init_aux = 184
script_battle_tactic_apply = 185
script_battle_tactic_apply_aux = 186
script_team_get_class_percentages = 187
script_get_closest3_distance_of_enemies_at_pos1 = 188
script_team_get_average_position_of_enemies = 189
script_search_troop_prisoner_of_party = 190
script_change_debt_to_troop = 191
script_abort_quest = 192
script_cf_is_quest_troop = 193
script_check_friendly_kills = 194
script_simulate_retreat = 195
script_simulate_battle_with_agents_aux = 196
script_map_get_random_position_around_position_within_range = 197
script_get_number_of_unclaimed_centers_by_player = 198
script_troop_count_number_of_enemy_troops = 199
script_cf_troop_check_troop_is_enemy = 200
script_troop_get_leaded_center_with_index = 201
script_cf_troop_get_random_leaded_walled_center_with_less_strength_priority = 202
script_cf_troop_get_random_leaded_town_or_village_except_center = 203
script_troop_write_owned_centers_to_s2 = 204
script_troop_write_family_relations_to_s1 = 205
script_write_family_relation_as_s3s_s2_to_s4 = 206
script_complete_family_relations = 207
script_collect_friendly_parties = 208
script_encounter_calculate_fit = 209
script_encounter_init_variables = 210
script_calculate_renown_value = 211
script_cf_get_first_agent_with_troop_id = 212
script_cf_team_get_average_position_of_agents_with_type_to_pos1 = 213
script_cf_turn_windmill_fans = 214
script_print_party_members = 215
script_round_value = 216
script_change_banners_and_chest = 217
script_remove_siege_objects = 218
script_describe_relation_to_s63 = 219
script_describe_center_relation_to_s3 = 220
script_center_ambiance_sounds = 221
script_center_set_walker_to_type = 222
script_cf_center_get_free_walker = 223
script_center_remove_walker_type_from_walkers = 224
script_init_town_walkers = 225
script_cf_enter_center_location_bandit_check = 226
script_init_town_agent = 227
script_init_town_walker_agents = 228
script_agent_get_town_walker_details = 229
script_tick_town_walkers = 230
script_set_town_walker_destination = 231
script_town_init_doors = 232
script_siege_init_ai_and_belfry = 233
script_cf_siege_move_belfry = 234
script_cf_siege_rotate_belfry_platform = 235
script_cf_siege_assign_men_to_belfry = 236
script_siege_move_archers_to_archer_positions = 237
script_store_movement_order_name_to_s1 = 238
script_store_riding_order_name_to_s1 = 239
script_store_weapon_usage_order_name_to_s1 = 240
script_team_give_order_from_order_panel = 241
script_update_order_panel = 242
script_update_agent_position_on_map = 243
script_convert_3d_pos_to_map_pos = 244
script_update_order_flags_on_map = 245
script_update_order_panel_checked_classes = 246
script_update_order_panel_statistics_and_map = 247
script_consume_food = 248
script_calculate_troop_score_for_center = 249
script_assign_lords_to_empty_centers = 250
script_create_village_farmer_party = 251
script_do_party_center_trade = 252
script_player_join_faction = 253
script_player_leave_faction = 254
script_activate_deactivate_player_faction = 255
script_agent_reassign_team = 256
script_start_quest = 257
script_conclude_quest = 258
script_succeed_quest = 259
script_fail_quest = 260
script_report_quest_troop_positions = 261
script_end_quest = 262
script_cancel_quest = 263
script_update_village_market_towns = 264
script_update_mercenary_units_of_towns = 265
script_update_volunteer_troops_in_village = 266
script_update_npc_volunteer_troops_in_village = 267
script_update_companion_candidates_in_taverns = 268
script_update_ransom_brokers = 269
script_update_tavern_travelers = 270
script_update_villages_infested_by_bandits = 271
script_update_booksellers = 272
script_update_tavern_minstels = 273
script_update_faction_notes = 274
script_update_faction_traveler_notes = 275
script_update_troop_notes = 276
script_update_troop_location_notes = 277
script_update_center_notes = 278
script_update_center_recon_notes = 279
script_update_all_notes = 280
script_shield_item_set_banner = 281
script_add_troop_to_cur_tableau = 282
script_add_troop_to_cur_tableau_for_character = 283
script_add_troop_to_cur_tableau_for_inventory = 284
script_add_troop_to_cur_tableau_for_party = 285
script_get_prosperity_text_to_s50 = 286
script_spawn_bandits = 287
script_count_mission_casualties_from_agents = 288
script_get_max_skill_of_player_party = 289
script_upgrade_hero_party = 290
script_get_improvement_details = 291
script_cf_troop_agent_is_alive = 292
script_cf_village_recruit_volunteers_cond = 293
script_village_recruit_volunteers_recruit = 294
script_get_troop_item_amount = 295
script_get_name_from_dna_to_s50 = 296
script_change_center_prosperity = 297
script_get_center_ideal_prosperity = 298
script_get_poorest_village_of_faction = 299
script_troop_add_gold = 300
script_initialize_npcs = 301
script_objectionable_action = 302
script_post_battle_personality_clash_check = 303
script_event_player_defeated_enemy_party = 304
script_event_player_captured_as_prisoner = 305
script_npc_morale = 306
script_retire_companion = 307
script_reassign_array_on_npc_leave = 308
script_reduce_companion_morale_for_clash = 309
script_calculate_ransom_amount_for_troop = 310
script_offer_ransom_amount_to_player_for_prisoners_in_party = 311
script_event_hero_taken_prisoner_by_player = 312
script_cf_check_hero_can_escape_from_player = 313
script_cf_party_remove_random_regular_troop = 314
script_place_player_banner_near_inventory = 315
script_place_player_banner_near_inventory_bms = 316
script_stay_captive_for_hours = 317
script_set_parties_around_player_ignore_player = 318
script_randomly_make_prisoner_heroes_escape_from_party = 319
script_fill_tournament_participants_troop = 320
script_get_num_tournament_participants = 321
script_get_random_tournament_participant = 322
script_add_tournament_participant = 323
script_get_random_tournament_team_amount_and_size = 324
script_get_troop_priority_point_for_tournament = 325
script_sort_tournament_participant_troops = 326
script_remove_tournament_participants_randomly = 327
script_end_tournament_fight = 328
script_get_win_amount_for_tournament_bet = 329
script_tournament_place_bet = 330
script_calculate_amount_of_cattle_can_be_stolen = 331
script_draw_banner_to_region = 332
script_get_troop_custom_banner_num_positionings = 333
script_get_custom_banner_charge_type_position_scale_color = 334
script_get_random_custom_banner = 335
script_get_custom_banner_color_from_index = 336
script_cf_check_color_visibility = 337
script_get_next_active_kingdom = 338
script_store_average_center_value_per_faction = 339
script_remove_cattles_if_herd_is_close_to_party = 340
script_get_rumor_to_s61 = 341
script_lord_comment_to_s43 = 342
script_add_log_entry = 343
script_get_relevant_comment_for_log_entry = 344
script_get_relevant_comment_to_s42 = 345
script_find_rival_from_faction = 346
script_rebellion_arguments = 347
script_get_culture_with_party_faction_for_music = 348
script_music_set_situation_with_culture = 349
script_combat_music_set_situation_with_culture = 350
script_play_victorious_sound = 351
script_set_items_for_tournament = 352
script_custom_battle_end = 353
script_remove_troop_from_prison = 354
script_formation_agent_init = 355
script_formation_array_init = 356
script_formation_formulate_arrays = 357
script_cf_formation_agent_assign_array = 358
script_cf_formation_elect_array_leader = 359
script_cf_apply_formation = 360
script_maintain_formation = 361
script_formation_clean_up = 362
script_formation_ai_tactics = 363
script_cf_formation_ai_deploy_array_generic = 364
script_formation_move_to_pos = 365
script_formation_move = 366
script_formation_turn = 367
script_formation_accelerate = 368
script_formation_density_change = 369
script_dismiss_battle_array = 370
script_formation_move_key_reaction = 371
script_formation_turn_key_reaction = 372
script_formation_charge_key_reaction = 373
script_formation_density_key_reaction = 374
script_formation_follow_key_reaction = 375
script_formation_move_to_pos_key_reaction = 376
script_apply_formation_key_reaction = 377
script_formation_auto_rotation_key_reaction = 378
script_formation_tactical_charge_key_reaction = 379
script_formation_dismiss_key_reaction = 380
script_calculate_formation_row = 381
script_calculate_formation_arc = 382
script_formation_reassign_array = 383
script_get_closest_distance_of_enemy_at_pos1 = 384
script_formation_tactical_charge_generic = 385
script_cf_calculate_enemy_infantry_centroid = 386
script_get_square_distance_between_positions = 387
script_calculate_enemy_infantry_clustering = 388
script_cf_calculate_enemy_infantry_linear_regression_pos = 389
script_formation_tactical_charge_cavalry = 390
script_formation_check_array_ammo = 391
script_formation_tactical_charge_ranged = 392
script_formation_tactical_charge_horse_archer = 393
script_convert_to_slot_no = 394
script_arctan = 395
script_formation_tactical_charge_line = 396
script_formation_tactical_charge_phalanx = 397
script_formation_tactical_charge_wedge = 398
script_formation_tactical_charge_square = 399
script_formation_tactical_charge_cantabrian_circle = 400
script_formation_line = 401
script_formation_phalanx = 402
script_formation_wedge = 403
script_formation_square = 404
script_formation_cantabrian_circle = 405
script_update_formation_key_config_buttons = 406
script_update_formation_order_panel = 407
script_update_formation_order_flags_on_map = 408
script_update_formation_order_panel_checked_arrays = 409
script_update_formation_order_panel_statistics_and_map = 410
script_cf_shift_pos1_along_y_axis_to_ground = 411
| Python |
# -*- coding: cp1254 -*-
from header_common import *
from header_operations import *
from module_constants import *
from header_parties import *
from header_skills import *
from header_mission_templates import *
from header_items import *
from header_triggers import *
from header_terrain_types import *
from header_music import *
from ID_animations import *
####################################################################################################################
# scripts is a list of script records.
# Each script record contns the following two fields:
# 1) Script id: The prefix "script_" will be inserted when referencing scripts.
# 2) Operation block: This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################
scripts = [
#script_game_start:
# This script is called when a new game is started
# INPUT: none
("game_start",
[
##################################
# Form Ranks section
#
# Set key configs to default in new game
]+[
(party_set_slot, "p_main_party", slot_party_formation_keys_begin+x, formation_default_key_list[x])
for x in range(len(formation_keys_list))
]+[
(party_set_slot, "p_main_party", slot_party_formation_ai_switch, 1),
#
# Form Ranks section end
##################################
(faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),
(assign, "$g_player_luck", 200),
(troop_set_slot, "trp_player", slot_troop_occupation, slto_kingdom_hero),
(troop_set_slot, "trp_player", slot_troop_prisoner_of_party, -1),
(try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end),
(troop_set_slot, ":cur_troop", slot_troop_prisoner_of_party, -1),
(troop_set_slot, ":cur_troop", slot_troop_custom_banner_flag_type, -1),
(troop_set_slot, ":cur_troop", slot_troop_custom_banner_map_flag_type, -1),
(try_end),
(troop_set_slot, "trp_player", slot_troop_custom_banner_flag_type, -1),
(troop_set_slot, "trp_player", slot_troop_custom_banner_map_flag_type, -1),
(store_random_in_range, "$g_election_date", 0, 45), #setting a random election date
#Assigning global constant
(call_script, "script_store_average_center_value_per_faction"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_bg_color_1, 0xFFFFFFFF),
(troop_set_slot, "trp_player", slot_troop_custom_banner_bg_color_2, 0xFFFFFFFF),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_color_1, 0xFFFFFFFF),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_color_2, 0xFFFFFFFF),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_color_3, 0xFFFFFFFF),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_color_4, 0xFFFFFFFF),
#Setting background colors for banners
(troop_set_slot, "trp_banner_background_color_array", 0, 0xFF8f4531),
(troop_set_slot, "trp_banner_background_color_array", 1, 0xFF315458),
(troop_set_slot, "trp_banner_background_color_array", 2, 0xFF373736),
(troop_set_slot, "trp_banner_background_color_array", 3, 0xFFa48b28),
(troop_set_slot, "trp_banner_background_color_array", 4, 0xFF497735),
(troop_set_slot, "trp_banner_background_color_array", 5, 0xFF82362d),
(troop_set_slot, "trp_banner_background_color_array", 6, 0xFF793329),
(troop_set_slot, "trp_banner_background_color_array", 7, 0xFF262521),
(troop_set_slot, "trp_banner_background_color_array", 8, 0xFFd9dad1),
(troop_set_slot, "trp_banner_background_color_array", 9, 0xFF524563),
(troop_set_slot, "trp_banner_background_color_array", 10, 0xFF91312c),
(troop_set_slot, "trp_banner_background_color_array", 11, 0xFFafa231),
(troop_set_slot, "trp_banner_background_color_array", 12, 0xFF706d3c),
(troop_set_slot, "trp_banner_background_color_array", 13, 0xFFd6d3ce),
(troop_set_slot, "trp_banner_background_color_array", 14, 0xFF912929),
(troop_set_slot, "trp_banner_background_color_array", 15, 0xFF394584),
(troop_set_slot, "trp_banner_background_color_array", 16, 0xFF42662e),
(troop_set_slot, "trp_banner_background_color_array", 17, 0xFFdfded6),
(troop_set_slot, "trp_banner_background_color_array", 18, 0xFF292724),
(troop_set_slot, "trp_banner_background_color_array", 19, 0xFF58611b),
(troop_set_slot, "trp_banner_background_color_array", 20, 0xFF313a67),
(troop_set_slot, "trp_banner_background_color_array", 21, 0xFFb5a231),
(troop_set_slot, "trp_banner_background_color_array", 22, 0xFFbdb629),
(troop_set_slot, "trp_banner_background_color_array", 23, 0xFF6e7929),
(troop_set_slot, "trp_banner_background_color_array", 24, 0xFFd6d3ce),
(troop_set_slot, "trp_banner_background_color_array", 25, 0xFF94a642),
(troop_set_slot, "trp_banner_background_color_array", 26, 0xFF944131),
(troop_set_slot, "trp_banner_background_color_array", 27, 0xFF893b34),
(troop_set_slot, "trp_banner_background_color_array", 28, 0xFF425510),
(troop_set_slot, "trp_banner_background_color_array", 29, 0xFF94452e),
(troop_set_slot, "trp_banner_background_color_array", 30, 0xFF475a94),
(troop_set_slot, "trp_banner_background_color_array", 31, 0xFFd1b231),
(troop_set_slot, "trp_banner_background_color_array", 32, 0xFFe1e2df),
(troop_set_slot, "trp_banner_background_color_array", 33, 0xFF4a4942),
(troop_set_slot, "trp_banner_background_color_array", 34, 0xFFc6b74d),
(troop_set_slot, "trp_banner_background_color_array", 35, 0xFF7b5184),
(troop_set_slot, "trp_banner_background_color_array", 36, 0xFF212421),
(troop_set_slot, "trp_banner_background_color_array", 37, 0xFF3c5d9a),
(troop_set_slot, "trp_banner_background_color_array", 38, 0xFF4d7136),
(troop_set_slot, "trp_banner_background_color_array", 39, 0xFFdfdfd6),
(troop_set_slot, "trp_banner_background_color_array", 40, 0xFF527539),
(troop_set_slot, "trp_banner_background_color_array", 41, 0xFF9c3c39),
(troop_set_slot, "trp_banner_background_color_array", 42, 0xFF42518c),
(troop_set_slot, "trp_banner_background_color_array", 43, 0xFFa46a2c),
(troop_set_slot, "trp_banner_background_color_array", 44, 0xFF843829),
(troop_set_slot, "trp_banner_background_color_array", 45, 0xFF2c6189),
(troop_set_slot, "trp_banner_background_color_array", 46, 0xFF556421),
(troop_set_slot, "trp_banner_background_color_array", 47, 0xFF9d621e),
(troop_set_slot, "trp_banner_background_color_array", 48, 0xFFdeded6),
(troop_set_slot, "trp_banner_background_color_array", 49, 0xFF6e4891),
(troop_set_slot, "trp_banner_background_color_array", 50, 0xFF865a29),
(troop_set_slot, "trp_banner_background_color_array", 51, 0xFFdedfd9),
(troop_set_slot, "trp_banner_background_color_array", 52, 0xFF524273),
(troop_set_slot, "trp_banner_background_color_array", 53, 0xFF8c3821),
(troop_set_slot, "trp_banner_background_color_array", 54, 0xFF948403),
(troop_set_slot, "trp_banner_background_color_array", 55, 0xFF313031),
(troop_set_slot, "trp_banner_background_color_array", 56, 0xFF47620d),
(troop_set_slot, "trp_banner_background_color_array", 57, 0xFFdfded6),
(troop_set_slot, "trp_banner_background_color_array", 58, 0xFFd6d7d6),
(troop_set_slot, "trp_banner_background_color_array", 59, 0xFF2e2f2c),
(troop_set_slot, "trp_banner_background_color_array", 60, 0xFF604283),
(troop_set_slot, "trp_banner_background_color_array", 61, 0xFF395584),
(troop_set_slot, "trp_banner_background_color_array", 62, 0xFF313031),
(troop_set_slot, "trp_banner_background_color_array", 63, 0xFF7e3f2e),
(troop_set_slot, "trp_banner_background_color_array", 64, 0xFF343434),
(troop_set_slot, "trp_banner_background_color_array", 65, 0xFF3c496b),
(troop_set_slot, "trp_banner_background_color_array", 66, 0xFFd9d8d1),
(troop_set_slot, "trp_banner_background_color_array", 67, 0xFF99823c),
(troop_set_slot, "trp_banner_background_color_array", 68, 0xFF9f822e),
(troop_set_slot, "trp_banner_background_color_array", 69, 0xFF393839),
(troop_set_slot, "trp_banner_background_color_array", 70, 0xFFa54931),
(troop_set_slot, "trp_banner_background_color_array", 71, 0xFFdfdcd6),
(troop_set_slot, "trp_banner_background_color_array", 72, 0xFF9f4a36),
(troop_set_slot, "trp_banner_background_color_array", 73, 0xFF8c7521),
(troop_set_slot, "trp_banner_background_color_array", 74, 0xFF9f4631),
(troop_set_slot, "trp_banner_background_color_array", 75, 0xFF793324),
(troop_set_slot, "trp_banner_background_color_array", 76, 0xFF395076),
(troop_set_slot, "trp_banner_background_color_array", 77, 0xFF2c2b2c),
(troop_set_slot, "trp_banner_background_color_array", 78, 0xFF657121),
(troop_set_slot, "trp_banner_background_color_array", 79, 0xFF7e3121),
(troop_set_slot, "trp_banner_background_color_array", 80, 0xFF76512e),
(troop_set_slot, "trp_banner_background_color_array", 81, 0xFFe7e3de),
(troop_set_slot, "trp_banner_background_color_array", 82, 0xFF947921),
(troop_set_slot, "trp_banner_background_color_array", 83, 0xFF4d7b7c),
(troop_set_slot, "trp_banner_background_color_array", 84, 0xFF343331),
(troop_set_slot, "trp_banner_background_color_array", 85, 0xFFa74d36),
(troop_set_slot, "trp_banner_background_color_array", 86, 0xFFe7e3de),
(troop_set_slot, "trp_banner_background_color_array", 87, 0xFFd6d8ce),
(troop_set_slot, "trp_banner_background_color_array", 88, 0xFF3e4d67),
(troop_set_slot, "trp_banner_background_color_array", 89, 0xFF913331),
(troop_set_slot, "trp_banner_background_color_array", 90, 0xFF4d6994),
(troop_set_slot, "trp_banner_background_color_array", 91, 0xFF4a6118),
(troop_set_slot, "trp_banner_background_color_array", 92, 0xFFd9d8d3),
(troop_set_slot, "trp_banner_background_color_array", 93, 0xFF394479),
(troop_set_slot, "trp_banner_background_color_array", 94, 0xFF343331),
(troop_set_slot, "trp_banner_background_color_array", 95, 0xFF3f4d5d),
(troop_set_slot, "trp_banner_background_color_array", 96, 0xFF4a6489),
(troop_set_slot, "trp_banner_background_color_array", 97, 0xFF313031),
(troop_set_slot, "trp_banner_background_color_array", 98, 0xFFd6d7ce),
(troop_set_slot, "trp_banner_background_color_array", 99, 0xFFc69e00),
(troop_set_slot, "trp_banner_background_color_array", 100, 0xFF638e52),
(troop_set_slot, "trp_banner_background_color_array", 101, 0xFFdcdbd3),
(troop_set_slot, "trp_banner_background_color_array", 102, 0xFFdbdcd3),
(troop_set_slot, "trp_banner_background_color_array", 103, 0xFF843831),
(troop_set_slot, "trp_banner_background_color_array", 104, 0xFFcecfc6),
(troop_set_slot, "trp_banner_background_color_array", 105, 0xFF8f4431),
(troop_set_slot, "trp_banner_background_color_array", 106, 0xFF602926),
(troop_set_slot, "trp_banner_background_color_array", 107, 0xFFd3d4cb),
(troop_set_slot, "trp_banner_background_color_array", 108, 0xFFdcdbd3),
(troop_set_slot, "trp_banner_background_color_array", 109, 0xFF556024),
(troop_set_slot, "trp_banner_background_color_array", 110, 0xFF602d2c),
(troop_set_slot, "trp_banner_background_color_array", 111, 0xFF315184),
(troop_set_slot, "trp_banner_background_color_array", 112, 0xFF313031),
(troop_set_slot, "trp_banner_background_color_array", 113, 0xFFe7e7e7),
(troop_set_slot, "trp_banner_background_color_array", 114, 0xFF526d47),
(troop_set_slot, "trp_banner_background_color_array", 115, 0xFFdedbd6),
(troop_set_slot, "trp_banner_background_color_array", 116, 0xFFb2a631),
(troop_set_slot, "trp_banner_background_color_array", 117, 0xFF76713f),
(troop_set_slot, "trp_banner_background_color_array", 118, 0xFFdedbd6),
(troop_set_slot, "trp_banner_background_color_array", 119, 0xFFe9eae7),
(troop_set_slot, "trp_banner_background_color_array", 120, 0xFF6b5131),
(troop_set_slot, "trp_banner_background_color_array", 121, 0xFF31557b),
(troop_set_slot, "trp_banner_background_color_array", 122, 0xFF703324),
(troop_set_slot, "trp_banner_background_color_array", 123, 0xFFe7e3de),
(troop_set_slot, "trp_banner_background_color_array", 124, 0xFFd6d7ce),
(troop_set_slot, "trp_banner_background_color_array", 125, 0xFF3f6e39),
#Default banners
(troop_set_slot, "trp_banner_background_color_array", 126, 0xFF212221),
(troop_set_slot, "trp_banner_background_color_array", 127, 0xFF212221),
(troop_set_slot, "trp_banner_background_color_array", 128, 0xFF2E3B10),
(troop_set_slot, "trp_banner_background_color_array", 129, 0xFF425D7B),
(troop_set_slot, "trp_banner_background_color_array", 130, 0xFF394608),
(store_random_in_range, ":starting_training_ground", training_grounds_begin, training_grounds_end),
(party_relocate_near_party, "p_main_party", ":starting_training_ground", 3),
(str_store_troop_name, s5, "trp_player"),
(party_set_name, "p_main_party", s5),
(call_script, "script_update_party_creation_random_limits"),
# Reseting player party icon
(assign, "$g_player_party_icon", -1),
# Setting food bonuses
(item_set_slot, "itm_smoked_fish", slot_item_food_bonus, 5),
(item_set_slot, "itm_dried_meat", slot_item_food_bonus, 5),
(item_set_slot, "itm_cattle_meat", slot_item_food_bonus, 7),
(item_set_slot, "itm_pork", slot_item_food_bonus, 6),
(item_set_slot, "itm_bread", slot_item_food_bonus, 4),
(item_set_slot, "itm_apples", slot_item_food_bonus, 5),
(item_set_slot, "itm_cheese", slot_item_food_bonus, 5),
(item_set_slot, "itm_chicken", slot_item_food_bonus, 6),
(item_set_slot, "itm_honey", slot_item_food_bonus, 10),
(item_set_slot, "itm_cabbages", slot_item_food_bonus, 4),
(item_set_slot, "itm_sausages", slot_item_food_bonus, 5),
(item_set_slot, "itm_butter", slot_item_food_bonus, 8),
(item_set_slot, "itm_wine", slot_item_food_bonus, 5),
(item_set_slot, "itm_ale", slot_item_food_bonus, 4),
#NPC companion changes begin
(call_script, "script_initialize_npcs"),
(assign, "$disable_npc_complaints", 0),
#NPC companion changes end
# Setting book intelligence requirements
(item_set_slot, "itm_book_tactics", slot_item_intelligence_requirement, 9),
(item_set_slot, "itm_book_persuasion", slot_item_intelligence_requirement, 8),
(item_set_slot, "itm_book_leadership", slot_item_intelligence_requirement, 7),
(item_set_slot, "itm_book_intelligence", slot_item_intelligence_requirement, 10),
(item_set_slot, "itm_book_trade", slot_item_intelligence_requirement, 11),
(item_set_slot, "itm_book_weapon_mastery", slot_item_intelligence_requirement, 9),
(item_set_slot, "itm_book_engineering", slot_item_intelligence_requirement, 12),
(item_set_slot, "itm_book_wound_treatment_reference", slot_item_intelligence_requirement, 10),
(item_set_slot, "itm_book_training_reference", slot_item_intelligence_requirement, 10),
(item_set_slot, "itm_book_surgery_reference", slot_item_intelligence_requirement, 10),
# Setting the random town sequence:
(store_sub, ":num_towns", towns_end, towns_begin),
(assign, ":num_iterations", ":num_towns"),
(try_for_range, ":cur_town_no", 0, ":num_towns"),
(troop_set_slot, "trp_random_town_sequence", ":cur_town_no", -1),
(try_end),
(assign, ":cur_town_no", 0),
(try_for_range, ":unused", 0, ":num_iterations"),
(store_random_in_range, ":random_no", 0, ":num_towns"),
(assign, ":is_unique", 1),
(try_for_range, ":cur_town_no_2", 0, ":num_towns"),
(troop_slot_eq, "trp_random_town_sequence", ":cur_town_no_2", ":random_no"),
(assign, ":is_unique", 0),
(try_end),
(try_begin),
(eq, ":is_unique", 1),
(troop_set_slot, "trp_random_town_sequence", ":cur_town_no", ":random_no"),
(val_add, ":cur_town_no", 1),
(else_try),
(val_add, ":num_iterations", 1),
(try_end),
(try_end),
# Cultures:
(faction_set_slot, "fac_culture_1", slot_faction_tier_1_troop, "trp_swadian_recruit"),
(faction_set_slot, "fac_culture_1", slot_faction_tier_2_troop, "trp_swadian_militia"),
(faction_set_slot, "fac_culture_1", slot_faction_tier_3_troop, "trp_swadian_footman"),
(faction_set_slot, "fac_culture_1", slot_faction_tier_4_troop, "trp_swadian_infantry"),
(faction_set_slot, "fac_culture_1", slot_faction_tier_5_troop, "trp_swadian_knight"),
(faction_set_slot, "fac_culture_2", slot_faction_tier_1_troop, "trp_vaegir_recruit"),
(faction_set_slot, "fac_culture_2", slot_faction_tier_2_troop, "trp_vaegir_footman"),
(faction_set_slot, "fac_culture_2", slot_faction_tier_3_troop, "trp_vaegir_veteran"),
(faction_set_slot, "fac_culture_2", slot_faction_tier_4_troop, "trp_vaegir_infantry"),
(faction_set_slot, "fac_culture_2", slot_faction_tier_5_troop, "trp_vaegir_knight"),
(faction_set_slot, "fac_culture_3", slot_faction_tier_1_troop, "trp_khergit_tribesman"),
(faction_set_slot, "fac_culture_3", slot_faction_tier_2_troop, "trp_khergit_skirmisher"),
(faction_set_slot, "fac_culture_3", slot_faction_tier_3_troop, "trp_khergit_horseman"),
(faction_set_slot, "fac_culture_3", slot_faction_tier_4_troop, "trp_khergit_horse_archer"),
(faction_set_slot, "fac_culture_3", slot_faction_tier_5_troop, "trp_khergit_veteran_horse_archer"),
(faction_set_slot, "fac_culture_4", slot_faction_tier_1_troop, "trp_nord_recruit"),
(faction_set_slot, "fac_culture_4", slot_faction_tier_2_troop, "trp_nord_footman"),
(faction_set_slot, "fac_culture_4", slot_faction_tier_3_troop, "trp_nord_trained_footman"),
(faction_set_slot, "fac_culture_4", slot_faction_tier_4_troop, "trp_nord_warrior"),
(faction_set_slot, "fac_culture_4", slot_faction_tier_5_troop, "trp_nord_veteran"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_1_troop, "trp_rhodok_tribesman"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_2_troop, "trp_rhodok_spearman"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_3_troop, "trp_rhodok_trained_spearman"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_4_troop, "trp_rhodok_veteran_spearman"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_5_troop, "trp_rhodok_sergeant"),
# Factions:
(faction_set_slot, "fac_kingdom_1", slot_faction_culture, "fac_culture_1"),
(faction_set_slot, "fac_kingdom_1", slot_faction_leader, "trp_kingdom_1_lord"),
(faction_set_slot, "fac_kingdom_2", slot_faction_culture, "fac_culture_2"),
(faction_set_slot, "fac_kingdom_2", slot_faction_leader, "trp_kingdom_2_lord"),
(faction_set_slot, "fac_kingdom_3", slot_faction_culture, "fac_culture_3"),
(faction_set_slot, "fac_kingdom_3", slot_faction_leader, "trp_kingdom_3_lord"),
(faction_set_slot, "fac_kingdom_4", slot_faction_culture, "fac_culture_4"),
(faction_set_slot, "fac_kingdom_4", slot_faction_leader, "trp_kingdom_4_lord"),
(faction_set_slot, "fac_kingdom_5", slot_faction_culture, "fac_culture_5"),
(faction_set_slot, "fac_kingdom_5", slot_faction_leader, "trp_kingdom_5_lord"),
## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_2"),
## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_5"),
## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_4", "fac_kingdom_2"),
## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_4", "fac_kingdom_1"),
## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_3", "fac_kingdom_2"),
## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_3", "fac_kingdom_5"),
(try_for_range, ":unused", 0, 70),
(call_script, "script_randomly_start_war_peace", 0),
(try_end),
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_set_slot, ":faction_no", slot_faction_marshall, -1),
(faction_get_slot, ":culture", ":faction_no", slot_faction_culture),
(faction_get_slot, ":troop", ":culture", slot_faction_tier_1_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_1_troop, ":troop"),
(faction_get_slot, ":troop", ":culture", slot_faction_tier_2_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_2_troop, ":troop"),
(faction_get_slot, ":troop", ":culture", slot_faction_tier_3_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_3_troop, ":troop"),
(faction_get_slot, ":troop", ":culture", slot_faction_tier_4_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_4_troop, ":troop"),
(faction_get_slot, ":troop", ":culture", slot_faction_tier_5_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_5_troop, ":troop"),
(try_begin),
(faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_1"),
(faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_swadian_deserter"),
(faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_swadian_sergeant"),
(faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_swadian_messenger"),
(faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_swadian_prison_guard"),
(faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_swadian_castle_guard"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_1_reinforcements_a"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_1_reinforcements_b"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_1_reinforcements_c"),
(else_try),
(faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_2"),
(faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_vaegir_deserter"),
(faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_vaegir_guard"),
(faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_vaegir_messenger"),
(faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_vaegir_prison_guard"),
(faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_vaegir_castle_guard"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_2_reinforcements_a"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_2_reinforcements_b"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_2_reinforcements_c"),
(else_try),
(faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_3"),
(faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_khergit_deserter"),
(faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_khergit_horseman"),
(faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_khergit_messenger"),
(faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_khergit_prison_guard"),
(faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_khergit_castle_guard"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_3_reinforcements_a"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_3_reinforcements_b"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_3_reinforcements_c"),
(else_try),
(faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_4"),
(faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_nord_deserter"),
(faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_nord_warrior"),
(faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_nord_messenger"),
(faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_nord_prison_guard"),
(faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_nord_castle_guard"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_4_reinforcements_a"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_4_reinforcements_b"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_4_reinforcements_c"),
(else_try),
(faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_5"),
(faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_rhodok_deserter"),
(faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_rhodok_veteran_spearman"),
(faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_rhodok_messenger"),
(faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_rhodok_prison_guard"),
(faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_rhodok_castle_guard"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_5_reinforcements_a"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_5_reinforcements_b"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_5_reinforcements_c"),
(try_end),
(try_end),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_marshall, "trp_player"),
# Towns:
(try_for_range, ":item_no", trade_goods_begin, trade_goods_end),
(store_sub, ":offset", ":item_no", trade_goods_begin),
(val_add, ":offset", slot_town_trade_good_prices_begin),
(try_for_range, ":center_no", centers_begin, centers_end),
(party_set_slot, ":center_no", ":offset", average_price_factor),
(try_end),
## (party_set_slot, "p_zendar", ":offset", average_price_factor),
## (party_set_slot, "p_salt_mine", ":offset", average_price_factor),
## (party_set_slot, "p_four_ways_inn", ":offset", average_price_factor),
(try_end),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_2"),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_4"),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_8"),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_9"),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_11"),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_12"),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_13"),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_15"),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_4"),
(call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_6"),
(call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_8"),
(call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_12"),
(call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_13"),
(call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_15"),
(call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_4"),
(call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_5"),
(call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_6"),
(call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_7"),
(call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_14"),
(call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_15"),
(call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_18"),
(call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_6"),
(call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_12"),
(call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_13"),
(call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_15"),
(call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_6"),
(call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_7"),
(call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_14"),
(call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_15"),
(call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_17"),
(call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_18"),
(call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_7"),
(call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_11"),
(call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_13"),
(call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_15"),
(call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_17"),
(call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_10"),
(call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_11"),
(call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_13"),
(call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_14"),
(call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_15"),
(call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_17"),
(call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_18"),
(call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_9"),
(call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_11"),
(call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_12"),
(call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_13"),
(call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_9", "p_town_11"),
(call_script, "script_set_trade_route_between_centers", "p_town_9", "p_town_12"),
(call_script, "script_set_trade_route_between_centers", "p_town_9", "p_town_13"),
(call_script, "script_set_trade_route_between_centers", "p_town_9", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_10", "p_town_11"),
(call_script, "script_set_trade_route_between_centers", "p_town_10", "p_town_14"),
(call_script, "script_set_trade_route_between_centers", "p_town_10", "p_town_17"),
(call_script, "script_set_trade_route_between_centers", "p_town_10", "p_town_18"),
(call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_12"),
(call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_13"),
(call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_14"),
(call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_17"),
(call_script, "script_set_trade_route_between_centers", "p_town_12", "p_town_13"),
(call_script, "script_set_trade_route_between_centers", "p_town_12", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_13", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_13", "p_town_17"),
(call_script, "script_set_trade_route_between_centers", "p_town_14", "p_town_17"),
(call_script, "script_set_trade_route_between_centers", "p_town_14", "p_town_18"),
(call_script, "script_set_trade_route_between_centers", "p_town_15", "p_town_16"),
(call_script, "script_set_trade_route_between_centers", "p_town_16", "p_town_17"),
(call_script, "script_set_trade_route_between_centers", "p_town_17", "p_town_18"),
(try_for_range, ":town_no", towns_begin, towns_end),
(party_set_slot, ":town_no", slot_town_tournament_max_teams, 4),
(party_set_slot, ":town_no", slot_town_tournament_max_team_size, 8),
(try_end),
(party_set_slot, "p_town_6", slot_town_tournament_max_team_size, 2),
#start some tournaments
(try_for_range, ":town_no", towns_begin, towns_end),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 20),
(store_random_in_range, ":random_days", 12, 15),
(party_set_slot, ":town_no", slot_town_has_tournament, ":random_days"),
(try_end),
(party_set_slot,"p_town_1", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_1", slot_town_arena_melee_1_team_size, 1),
(party_set_slot,"p_town_1", slot_town_arena_melee_2_num_teams, 4),
(party_set_slot,"p_town_1", slot_town_arena_melee_2_team_size, 1),
(party_set_slot,"p_town_1", slot_town_arena_melee_3_num_teams, 4),
(party_set_slot,"p_town_1", slot_town_arena_melee_3_team_size, 1),
(call_script, "script_center_change_trade_good_production", "p_town_1", "itm_linen", 110, 0),
(party_set_slot,"p_town_2", slot_town_arena_melee_1_num_teams, 4),
(party_set_slot,"p_town_2", slot_town_arena_melee_1_team_size, 4),
(party_set_slot,"p_town_2", slot_town_arena_melee_2_num_teams, 4),
(party_set_slot,"p_town_2", slot_town_arena_melee_2_team_size, 6),
(party_set_slot,"p_town_2", slot_town_arena_melee_3_num_teams, 4),
(party_set_slot,"p_town_2", slot_town_arena_melee_3_team_size, 8),
(call_script, "script_center_change_trade_good_production", "p_town_2", "itm_smoked_fish", 130, 0),
(party_set_slot,"p_town_3", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_3", slot_town_arena_melee_1_team_size, 8),
(party_set_slot,"p_town_3", slot_town_arena_melee_2_num_teams, 2),
(party_set_slot,"p_town_3", slot_town_arena_melee_2_team_size, 8),
(party_set_slot,"p_town_3", slot_town_arena_melee_3_num_teams, 2),
(party_set_slot,"p_town_3", slot_town_arena_melee_3_team_size, 8),
(call_script, "script_center_change_trade_good_production", "p_town_3", "itm_wine", 120, 0),
(party_set_slot,"p_town_4", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_4", slot_town_arena_melee_1_team_size, 8),
(party_set_slot,"p_town_4", slot_town_arena_melee_2_num_teams, 3),
(party_set_slot,"p_town_4", slot_town_arena_melee_2_team_size, 8),
(party_set_slot,"p_town_4", slot_town_arena_melee_3_num_teams, 2),
(party_set_slot,"p_town_4", slot_town_arena_melee_3_team_size, 5),
(call_script, "script_center_change_trade_good_production", "p_town_4", "itm_oil", 130, 0),
(party_set_slot,"p_town_5", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_5", slot_town_arena_melee_1_team_size, 3),
(party_set_slot,"p_town_5", slot_town_arena_melee_2_num_teams, 2),
(party_set_slot,"p_town_5", slot_town_arena_melee_2_team_size, 5),
(party_set_slot,"p_town_5", slot_town_arena_melee_3_num_teams, 2),
(party_set_slot,"p_town_5", slot_town_arena_melee_3_team_size, 8),
(call_script, "script_center_change_trade_good_production", "p_town_5", "itm_velvet", 80, 0),
(party_set_slot,"p_town_6", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_6", slot_town_arena_melee_1_team_size, 4),
(party_set_slot,"p_town_6", slot_town_arena_melee_2_num_teams, 3),
(party_set_slot,"p_town_6", slot_town_arena_melee_2_team_size, 4),
(party_set_slot,"p_town_6", slot_town_arena_melee_3_num_teams, 3),
(party_set_slot,"p_town_6", slot_town_arena_melee_3_team_size, 6),
(call_script, "script_center_change_trade_good_production", "p_town_6", "itm_ale", 130, 0),
(party_set_slot,"p_town_7", slot_town_arena_melee_1_num_teams, 4),
(party_set_slot,"p_town_7", slot_town_arena_melee_1_team_size, 4),
(party_set_slot,"p_town_7", slot_town_arena_melee_2_num_teams, 4),
(party_set_slot,"p_town_7", slot_town_arena_melee_2_team_size, 6),
(party_set_slot,"p_town_7", slot_town_arena_melee_3_num_teams, 4),
(party_set_slot,"p_town_7", slot_town_arena_melee_3_team_size, 8),
(call_script, "script_center_change_trade_good_production", "p_town_7", "itm_grain", 140, 0),
(call_script, "script_center_change_trade_good_production", "p_town_7", "itm_flour", 110, 0),
(party_set_slot,"p_town_8", slot_town_arena_melee_1_num_teams, 3),
(party_set_slot,"p_town_8", slot_town_arena_melee_1_team_size, 1),
(party_set_slot,"p_town_8", slot_town_arena_melee_2_num_teams, 3),
(party_set_slot,"p_town_8", slot_town_arena_melee_2_team_size, 3),
(party_set_slot,"p_town_8", slot_town_arena_melee_3_num_teams, 3),
(party_set_slot,"p_town_8", slot_town_arena_melee_3_team_size, 7),
(call_script, "script_center_change_trade_good_production", "p_town_8", "itm_wool", 130, 0),
(party_set_slot,"p_town_9", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_9", slot_town_arena_melee_1_team_size, 2),
(party_set_slot,"p_town_9", slot_town_arena_melee_2_num_teams, 2),
(party_set_slot,"p_town_9", slot_town_arena_melee_2_team_size, 5),
(party_set_slot,"p_town_9", slot_town_arena_melee_3_num_teams, 2),
(party_set_slot,"p_town_9", slot_town_arena_melee_3_team_size, 8),
(call_script, "script_center_change_trade_good_production", "p_town_9", "itm_furs", 135, 0),
(party_set_slot,"p_town_10", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_10", slot_town_arena_melee_1_team_size, 3),
(party_set_slot,"p_town_10", slot_town_arena_melee_2_num_teams, 2),
(party_set_slot,"p_town_10", slot_town_arena_melee_2_team_size, 5),
(party_set_slot,"p_town_10", slot_town_arena_melee_3_num_teams, 2),
(party_set_slot,"p_town_10", slot_town_arena_melee_3_team_size, 8),
(call_script, "script_center_change_trade_good_production", "p_town_10", "itm_spice", 86, 0),
(party_set_slot,"p_town_11", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_11", slot_town_arena_melee_1_team_size, 8),
(party_set_slot,"p_town_11", slot_town_arena_melee_2_num_teams, 3),
(party_set_slot,"p_town_11", slot_town_arena_melee_2_team_size, 4),
(party_set_slot,"p_town_11", slot_town_arena_melee_3_num_teams, 3),
(party_set_slot,"p_town_11", slot_town_arena_melee_3_team_size, 6),
(call_script, "script_center_change_trade_good_production", "p_town_11", "itm_iron", 130, 0),
(party_set_slot,"p_town_12", slot_town_arena_melee_1_num_teams, 3),
(party_set_slot,"p_town_12", slot_town_arena_melee_1_team_size, 8),
(party_set_slot,"p_town_12", slot_town_arena_melee_2_num_teams, 4),
(party_set_slot,"p_town_12", slot_town_arena_melee_2_team_size, 6),
(party_set_slot,"p_town_12", slot_town_arena_melee_3_num_teams, 4),
(party_set_slot,"p_town_12", slot_town_arena_melee_3_team_size, 5),
(call_script, "script_center_change_trade_good_production", "p_town_12", "itm_smoked_fish", 140, 0),
(party_set_slot,"p_town_13", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_13", slot_town_arena_melee_1_team_size, 8),
(party_set_slot,"p_town_13", slot_town_arena_melee_2_num_teams, 4),
(party_set_slot,"p_town_13", slot_town_arena_melee_2_team_size, 5),
(party_set_slot,"p_town_13", slot_town_arena_melee_3_num_teams, 4),
(party_set_slot,"p_town_13", slot_town_arena_melee_3_team_size, 7),
(call_script, "script_center_change_trade_good_production", "p_town_13", "itm_dried_meat", 120, 0),
(party_set_slot,"p_town_14", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_14", slot_town_arena_melee_1_team_size, 4),
(party_set_slot,"p_town_14", slot_town_arena_melee_2_num_teams, 2),
(party_set_slot,"p_town_14", slot_town_arena_melee_2_team_size, 5),
(party_set_slot,"p_town_14", slot_town_arena_melee_3_num_teams, 2),
(party_set_slot,"p_town_14", slot_town_arena_melee_3_team_size, 6),
(call_script, "script_center_change_trade_good_production", "p_town_14", "itm_pottery", 120, 0),
(party_set_slot,"p_town_15", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_15", slot_town_arena_melee_1_team_size, 8),
(party_set_slot,"p_town_15", slot_town_arena_melee_2_num_teams, 3),
(party_set_slot,"p_town_15", slot_town_arena_melee_2_team_size, 4),
(party_set_slot,"p_town_15", slot_town_arena_melee_3_num_teams, 3),
(party_set_slot,"p_town_15", slot_town_arena_melee_3_team_size, 6),
(call_script, "script_center_change_trade_good_production", "p_town_15", "itm_cheese", 100, 0),
(party_set_slot,"p_town_16", slot_town_arena_melee_1_num_teams, 3),
(party_set_slot,"p_town_16", slot_town_arena_melee_1_team_size, 8),
(party_set_slot,"p_town_16", slot_town_arena_melee_2_num_teams, 4),
(party_set_slot,"p_town_16", slot_town_arena_melee_2_team_size, 6),
(party_set_slot,"p_town_16", slot_town_arena_melee_3_num_teams, 4),
(party_set_slot,"p_town_16", slot_town_arena_melee_3_team_size, 5),
(call_script, "script_center_change_trade_good_production", "p_town_16", "itm_tools", 100, 0),
(party_set_slot,"p_town_17", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_17", slot_town_arena_melee_1_team_size, 8),
(party_set_slot,"p_town_17", slot_town_arena_melee_2_num_teams, 4),
(party_set_slot,"p_town_17", slot_town_arena_melee_2_team_size, 5),
(party_set_slot,"p_town_17", slot_town_arena_melee_3_num_teams, 4),
(party_set_slot,"p_town_17", slot_town_arena_melee_3_team_size, 7),
(call_script, "script_center_change_trade_good_production", "p_town_17", "itm_salt", 100, 0),
(party_set_slot,"p_town_18", slot_town_arena_melee_1_num_teams, 2),
(party_set_slot,"p_town_18", slot_town_arena_melee_1_team_size, 4),
(party_set_slot,"p_town_18", slot_town_arena_melee_2_num_teams, 2),
(party_set_slot,"p_town_18", slot_town_arena_melee_2_team_size, 5),
(party_set_slot,"p_town_18", slot_town_arena_melee_3_num_teams, 2),
(party_set_slot,"p_town_18", slot_town_arena_melee_3_team_size, 6),
(call_script, "script_center_change_trade_good_production", "p_town_18", "itm_oil", 125, 0),
(try_for_range, ":unused", 0, 1),
(call_script, "script_average_trade_good_productions"),
(try_end),
(call_script, "script_normalize_trade_good_productions"),
(try_for_range, ":town_no", towns_begin, towns_end),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_smoked_fish", -12, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_dried_meat", -12, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_cattle_meat", -15, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_cheese", -10, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_chicken", -10, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_honey", -9, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_cabbages", -10, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_butter", -12, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_wine", -14, 2),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_flour", -13, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_ale", -10, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_apples", -10, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_grain", -10, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_iron", -10, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_wool", -10, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_furs", -10, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_oil", -12, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_velvet", -3, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_spice", -5, 3),
(call_script, "script_center_change_trade_good_production", ":town_no", "itm_linen", -3, 3),
(try_end),
# Towns (loop)
(try_for_range, ":town_no", towns_begin, towns_end),
(store_sub, ":offset", ":town_no", towns_begin),
(party_set_slot,":town_no", slot_party_type, spt_town),
# (store_add, ":cur_object_no", "trp_town_1_seneschal", ":offset"),
# (party_set_slot,":town_no", slot_town_seneschal, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_center", ":offset"),
(party_set_slot,":town_no", slot_town_center, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_castle", ":offset"),
(party_set_slot,":town_no", slot_town_castle, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_prison", ":offset"),
(party_set_slot,":town_no", slot_town_prison, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_walls", ":offset"),
(party_set_slot,":town_no", slot_town_walls, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_tavern", ":offset"),
(party_set_slot,":town_no", slot_town_tavern, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_store", ":offset"),
(party_set_slot,":town_no", slot_town_store, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_arena", ":offset"),
(party_set_slot,":town_no", slot_town_arena, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_alley", ":offset"),
(party_set_slot,":town_no", slot_town_alley, ":cur_object_no"),
(store_add, ":cur_object_no", "trp_town_1_mayor", ":offset"),
(party_set_slot,":town_no", slot_town_elder, ":cur_object_no"),
(store_add, ":cur_object_no", "trp_town_1_tavernkeeper", ":offset"),
(party_set_slot,":town_no", slot_town_tavernkeeper, ":cur_object_no"),
(store_add, ":cur_object_no", "trp_town_1_weaponsmith", ":offset"),
(party_set_slot,":town_no", slot_town_weaponsmith, ":cur_object_no"),
(store_add, ":cur_object_no", "trp_town_1_armorer", ":offset"),
(party_set_slot,":town_no", slot_town_armorer, ":cur_object_no"),
(store_add, ":cur_object_no", "trp_town_1_merchant", ":offset"),
(party_set_slot,":town_no", slot_town_merchant, ":cur_object_no"),
(store_add, ":cur_object_no", "trp_town_1_horse_merchant", ":offset"),
(party_set_slot,":town_no", slot_town_horse_merchant, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_center", ":offset"),
(party_set_slot,":town_no", slot_town_center, ":cur_object_no"),
(party_set_slot,":town_no", slot_town_reinforcement_party_template, "pt_center_reinforcements"),
(try_end),
# Castles
(try_for_range, ":castle_no", castles_begin, castles_end),
(store_sub, ":offset", ":castle_no", castles_begin),
(val_mul, ":offset", 3),
# (store_add, ":senechal_troop_no", "trp_castle_1_seneschal", ":offset"),
# (party_set_slot,":castle_no", slot_town_seneschal, ":senechal_troop_no"),
(store_add, ":exterior_scene_no", "scn_castle_1_exterior", ":offset"),
(party_set_slot,":castle_no", slot_castle_exterior, ":exterior_scene_no"),
(store_add, ":interior_scene_no", "scn_castle_1_interior", ":offset"),
(party_set_slot,":castle_no", slot_town_castle, ":interior_scene_no"),
(store_add, ":interior_scene_no", "scn_castle_1_prison", ":offset"),
(party_set_slot,":castle_no", slot_town_prison, ":interior_scene_no"),
(party_set_slot,":castle_no", slot_town_reinforcement_party_template, "pt_center_reinforcements"),
(party_set_slot,":castle_no", slot_party_type, spt_castle),
(party_set_slot,":castle_no", slot_center_is_besieged_by, -1),
(try_end),
# Set which castles need to be attacked with siege towers.
(party_set_slot,"p_town_1", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_town_13", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_town_16", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_1", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_2", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_3", slot_center_siege_with_belfry, 0),
(party_set_slot,"p_castle_4", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_5", slot_center_siege_with_belfry, 0),
(party_set_slot,"p_castle_6", slot_center_siege_with_belfry, 0),
(party_set_slot,"p_castle_7", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_8", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_9", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_10", slot_center_siege_with_belfry, 0),
(party_set_slot,"p_castle_11", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_13", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_21", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_25", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_38", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_34", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_35", slot_center_siege_with_belfry, 1),
(party_set_slot,"p_castle_40", slot_center_siege_with_belfry, 1),
# Towns
# Villages
(call_script, "script_center_change_trade_good_production", "p_village_56", "itm_smoked_fish", 60, 0),
(call_script, "script_center_change_trade_good_production", "p_village_35", "itm_smoked_fish", 60, 0),
(call_script, "script_center_change_trade_good_production", "p_village_36", "itm_smoked_fish", 60, 0),
(call_script, "script_center_change_trade_good_production", "p_village_66", "itm_smoked_fish", 50, 0),
(call_script, "script_center_change_trade_good_production", "p_village_67", "itm_smoked_fish", 50, 0),
(try_for_range, ":village_no", villages_begin, villages_end),
#Not setting production for the cattle meat here.
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_dried_meat", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_pork", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_bread", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_apples", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_cheese", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_chicken", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_honey", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_cabbages", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_butter", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_wine", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_flour", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_ale", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_apples", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_grain", ":rand", 0),
(store_random_in_range, ":rand", village_prod_min, village_prod_max),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_oil", ":rand", 0),
(try_end),
(try_for_range, ":village_no", villages_begin, villages_end),
(store_random_in_range, ":random_land_quality", 0, 5),
(party_set_slot, ":village_no", slot_village_land_quality, ":random_land_quality"),
(store_random_in_range, ":random_cattle", 25, 75),
(party_set_slot, ":village_no", slot_village_number_of_cattle, ":random_cattle"),
#Reassigning the cattle production in the village
(store_sub, ":production", ":random_cattle", 10),
(val_div, ":production", 2),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_cattle_meat", ":production", 0),
(store_sub, ":offset", ":village_no", villages_begin),
(store_add, ":exterior_scene_no", "scn_village_1", ":offset"),
(party_set_slot,":village_no", slot_castle_exterior, ":exterior_scene_no"),
(store_add, ":store_troop_no", "trp_village_1_elder", ":offset"),
(party_set_slot,":village_no", slot_town_elder, ":store_troop_no"),
(party_set_slot,":village_no", slot_party_type, spt_village),
(party_set_slot,":village_no", slot_village_raided_by, -1),
(call_script, "script_refresh_village_merchant_inventory", ":village_no"),
(call_script, "script_refresh_village_merchant_inventory", ":village_no"),
(call_script, "script_refresh_village_defenders", ":village_no"),
(call_script, "script_refresh_village_defenders", ":village_no"),
(call_script, "script_refresh_village_defenders", ":village_no"),
(call_script, "script_refresh_village_defenders", ":village_no"),
(try_end),
# (store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin),
# (try_for_range, ":center_no", centers_begin, centers_end),
# (str_clear, s3),
# (this_or_next|is_between, ":center_no", towns_begin, towns_end),
# (is_between, ":center_no", villages_begin, villages_end),
# (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
# (store_add, ":cur_good_slot", ":cur_good", ":item_to_slot"),
# (str_store_party_name, s1, ":center_no"),
# (str_store_item_name, s2, ":cur_good"),
# (party_get_slot, ":center_production", ":center_no", ":cur_good_slot"),
# (assign, reg0, ":center_production"),
# (str_store_string, s3, "@{s3}^{s1} production for {s2}: {reg0}"),
# (try_end),
# (add_party_note_from_sreg, ":center_no", 2, s3, 0),
# (try_end),
(try_for_range, ":center_no", centers_begin, centers_end),
(party_set_slot, ":center_no", slot_center_last_spotted_enemy, -1),
(party_set_slot, ":center_no", slot_center_is_besieged_by, -1),
(party_set_slot, ":center_no", slot_center_last_taken_by_troop, -1),
#Assigning random prosperity
(store_random_in_range, ":random_prosperity_adder", -25, 15),
(call_script, "script_get_center_ideal_prosperity", ":center_no"),
(assign, ":prosperity", reg0),
(val_add, ":prosperity", ":random_prosperity_adder"),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(val_add, ":prosperity", 20),
(try_end),
(val_clamp, ":prosperity", 0, 100),
(party_set_slot, ":center_no", slot_town_prosperity, ":prosperity"),
(try_end),
#Initialize walkers
(try_for_range, ":center_no", centers_begin, centers_end),
(this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(try_for_range, ":walker_no", 0, num_town_walkers),
(call_script, "script_center_set_walker_to_type", ":center_no", ":walker_no", walkert_default),
(try_end),
(try_end),
# Troops:
# Assign banners and renown.
# We assume there are enough banners for all kingdom heroes.
(assign, ":num_khergit_lords_assigned", 0),
(try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),
(store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"),
(try_begin),
(eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Khergit Khanate
(store_add, ":kingdom_3_banners_begin", banner_scene_props_begin, khergit_banners_begin_offset),
(store_add, ":banner_id", ":kingdom_3_banners_begin", ":num_khergit_lords_assigned"),
(troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
(val_add, ":num_khergit_lords_assigned", 1),
(else_try),
(store_sub, ":hero_offset", ":kingdom_hero", kingdom_heroes_begin),
(val_sub, ":hero_offset", ":num_khergit_lords_assigned"),#Remove khergits from offset since their banners are assigned above here
(try_begin),
(gt, ":hero_offset", khergit_banners_begin_offset),#Do not add khergit banners to non-khergit lords
(val_add, ":hero_offset", khergit_banners_end_offset),
(val_sub, ":hero_offset", khergit_banners_begin_offset),
(try_end),
(store_add, ":banner_id", banner_scene_props_begin, ":hero_offset"),
(troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
(try_end),
(store_character_level, ":level", ":kingdom_hero"),
(store_mul, ":renown", ":level", ":level"),
(val_div, ":renown", 2),
(try_begin),
(faction_slot_eq, ":kingdom_hero_faction", slot_faction_leader, ":kingdom_hero"),
(troop_set_slot, ":kingdom_hero", slot_troop_loyalty, 100),
(store_random_in_range, ":random_renown", 250, 400),
(else_try),
(store_random_in_range, ":random_loyalty", 50, 100),
(troop_set_slot, ":kingdom_hero", slot_troop_loyalty, ":random_loyalty"),
(store_random_in_range, ":random_renown", 100, 200),
(try_end),
(val_add, ":renown", ":random_renown"),
(troop_set_slot, ":kingdom_hero", slot_troop_renown, ":renown"),
(store_random_in_range, ":random_readiness", 0, 100),
(troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_join_army, ":random_readiness"),
(troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_follow_orders, 100),
(troop_set_slot, ":kingdom_hero", slot_troop_player_order_state, spai_undefined),
(troop_set_slot, ":kingdom_hero", slot_troop_player_order_object, -1),
(try_end),
#Correcting banners according to the player banner
(troop_get_slot, ":selected_banner_spr", "trp_player", slot_troop_banner_scene_prop),
(assign, ":end_cond", kingdom_heroes_end),
(try_for_range, ":cur_troop", kingdom_heroes_begin, ":end_cond"),
(troop_slot_eq, ":cur_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"),
(troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
(assign, ":end_cond", 0),
(try_end),
(call_script, "script_give_center_to_lord", "p_town_1", "trp_kingdom_4_lord", 0),
(call_script, "script_give_center_to_lord", "p_town_2", "trp_knight_4_1", 0),
(call_script, "script_give_center_to_lord", "p_town_3", "trp_knight_5_1", 0),
(call_script, "script_give_center_to_lord", "p_town_4", "trp_knight_1_1", 0),
(call_script, "script_give_center_to_lord", "p_town_5", "trp_kingdom_5_lord", 0),
(call_script, "script_give_center_to_lord", "p_town_6", "trp_kingdom_1_lord", 0),
(call_script, "script_give_center_to_lord", "p_town_7", "trp_knight_1_2", 0),
(call_script, "script_give_center_to_lord", "p_town_8", "trp_kingdom_2_lord", 0),
(call_script, "script_give_center_to_lord", "p_town_9", "trp_knight_2_1", 0),
(call_script, "script_give_center_to_lord", "p_town_10", "trp_kingdom_3_lord", 0),
(call_script, "script_give_center_to_lord", "p_town_11", "trp_knight_2_2", 0),
(call_script, "script_give_center_to_lord", "p_town_12", "trp_knight_4_2", 0),
(call_script, "script_give_center_to_lord", "p_town_13", "trp_knight_2_3", 0),
(call_script, "script_give_center_to_lord", "p_town_14", "trp_knight_3_1", 0),
(call_script, "script_give_center_to_lord", "p_town_15", "trp_knight_5_2", 0),
(call_script, "script_give_center_to_lord", "p_town_16", "trp_knight_1_3", 0),
(call_script, "script_give_center_to_lord", "p_town_17", "trp_knight_3_2", 0),
(call_script, "script_give_center_to_lord", "p_town_18", "trp_knight_3_3", 0),
(call_script, "script_give_center_to_faction_aux", "p_castle_1", "fac_kingdom_5"),
(call_script, "script_give_center_to_faction_aux", "p_castle_2", "fac_kingdom_3"),
(call_script, "script_give_center_to_faction_aux", "p_castle_3", "fac_kingdom_2"),
(call_script, "script_give_center_to_faction_aux", "p_castle_4", "fac_kingdom_2"),
(call_script, "script_give_center_to_faction_aux", "p_castle_5", "fac_kingdom_4"),
(call_script, "script_give_center_to_faction_aux", "p_castle_6", "fac_kingdom_2"),
(call_script, "script_give_center_to_faction_aux", "p_castle_7", "fac_kingdom_3"),
(call_script, "script_give_center_to_faction_aux", "p_castle_8", "fac_kingdom_2"),
(call_script, "script_give_center_to_faction_aux", "p_castle_9", "fac_kingdom_5"),
(call_script, "script_give_center_to_faction_aux", "p_castle_10", "fac_kingdom_4"),
(call_script, "script_give_center_to_faction_aux", "p_castle_11", "fac_kingdom_4"),
(call_script, "script_give_center_to_faction_aux", "p_castle_12", "fac_kingdom_4"),
(call_script, "script_give_center_to_faction_aux", "p_castle_13", "fac_kingdom_1"),
(call_script, "script_give_center_to_faction_aux", "p_castle_14", "fac_kingdom_5"),
(call_script, "script_give_center_to_faction_aux", "p_castle_15", "fac_kingdom_5"),
(call_script, "script_give_center_to_faction_aux", "p_castle_16", "fac_kingdom_5"),
(call_script, "script_give_center_to_faction_aux", "p_castle_17", "fac_kingdom_3"),
(call_script, "script_give_center_to_faction_aux", "p_castle_18", "fac_kingdom_2"),
(call_script, "script_give_center_to_faction_aux", "p_castle_19", "fac_kingdom_2"),
(call_script, "script_give_center_to_faction_aux", "p_castle_20", "fac_kingdom_1"),
(call_script, "script_give_center_to_faction_aux", "p_castle_21", "fac_kingdom_5"),
(call_script, "script_give_center_to_faction_aux", "p_castle_22", "fac_kingdom_3"),
(call_script, "script_give_center_to_faction_aux", "p_castle_23", "fac_kingdom_1"),
(call_script, "script_give_center_to_faction_aux", "p_castle_24", "fac_kingdom_1"),
(call_script, "script_give_center_to_faction_aux", "p_castle_25", "fac_kingdom_1"),
(call_script, "script_give_center_to_faction_aux", "p_castle_26", "fac_kingdom_1"),
(call_script, "script_give_center_to_faction_aux", "p_castle_27", "fac_kingdom_1"),
(call_script, "script_give_center_to_faction_aux", "p_castle_28", "fac_kingdom_5"),
(call_script, "script_give_center_to_faction_aux", "p_castle_29", "fac_kingdom_2"),
(call_script, "script_give_center_to_faction_aux", "p_castle_30", "fac_kingdom_3"),
(call_script, "script_give_center_to_faction_aux", "p_castle_31", "fac_kingdom_1"),
(call_script, "script_give_center_to_faction_aux", "p_castle_32", "fac_kingdom_4"),
(call_script, "script_give_center_to_faction_aux", "p_castle_33", "fac_kingdom_5"),
(call_script, "script_give_center_to_faction_aux", "p_castle_34", "fac_kingdom_4"),
(call_script, "script_give_center_to_faction_aux", "p_castle_35", "fac_kingdom_1"),
(call_script, "script_give_center_to_faction_aux", "p_castle_36", "fac_kingdom_4"),
(call_script, "script_give_center_to_faction_aux", "p_castle_37", "fac_kingdom_2"),
(call_script, "script_give_center_to_faction_aux", "p_castle_38", "fac_kingdom_3"),
(call_script, "script_give_center_to_faction_aux", "p_castle_39", "fac_kingdom_2"),
(call_script, "script_give_center_to_faction_aux", "p_castle_40", "fac_kingdom_3"),
# fill_village_bound_centers
#pass 1: Give one village to each castle
(try_for_range, ":cur_center", castles_begin, castles_end),
(assign, ":min_dist", 999999),
(assign, ":min_dist_village", -1),
(try_for_range, ":cur_village", villages_begin, villages_end),
(neg|party_slot_ge, ":cur_village", slot_village_bound_center, 1), #skip villages which are already bound.
(store_distance_to_party_from_party, ":cur_dist", ":cur_village", ":cur_center"),
(lt, ":cur_dist", ":min_dist"),
(assign, ":min_dist", ":cur_dist"),
(assign, ":min_dist_village", ":cur_village"),
(try_end),
(party_set_slot, ":min_dist_village", slot_village_bound_center, ":cur_center"),
(store_faction_of_party, ":town_faction", ":cur_center"),
(call_script, "script_give_center_to_faction_aux", ":min_dist_village", ":town_faction"),
(try_end),
# Give family castles to certain nobles.
(call_script, "script_give_center_to_lord", "p_castle_29", "trp_knight_2_10", 0), #Nelag_Castle
(call_script, "script_give_center_to_lord", "p_castle_30", "trp_knight_3_4", 0), #Asugan_Castle
(call_script, "script_give_center_to_lord", "p_castle_35", "trp_knight_1_15", 0), #Haringoth_Castle
#pass 2: Give other villages to closest town.
(try_for_range, ":cur_village", villages_begin, villages_end),
(neg|party_slot_ge, ":cur_village", slot_village_bound_center, 1), #skip villages which are already bound.
(assign, ":min_dist", 999999),
(assign, ":min_dist_town", -1),
(try_for_range, ":cur_town", towns_begin, towns_end),
(store_distance_to_party_from_party, ":cur_dist", ":cur_village", ":cur_town"),
(lt, ":cur_dist", ":min_dist"),
(assign, ":min_dist", ":cur_dist"),
(assign, ":min_dist_town", ":cur_town"),
(try_end),
(party_set_slot, ":cur_village", slot_village_bound_center, ":min_dist_town"),
(store_faction_of_party, ":town_faction", ":min_dist_town"),
(call_script, "script_give_center_to_faction_aux", ":cur_village", ":town_faction"),
(try_end),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":original_faction", ":center_no"),
(faction_get_slot, ":culture", ":original_faction", slot_faction_culture),
(party_set_slot, ":center_no", slot_center_culture, ":culture"),
(party_set_slot, ":center_no", slot_center_original_faction, ":original_faction"),
(party_set_slot, ":center_no", slot_center_ex_faction, ":original_faction"),
(try_end),
(call_script, "script_update_village_market_towns"),
#Assign only family structures of lords who doesn't have a father. Other troops will get the family tree automatically
(troop_set_slot,"trp_knight_1_1", slot_troop_spouse, "trp_knight_1_1_wife"),
(troop_set_slot,"trp_knight_2_1", slot_troop_spouse, "trp_knight_2_1_wife"),
(troop_set_slot,"trp_knight_3_1", slot_troop_spouse, "trp_knight_3_1_wife"),
(troop_set_slot,"trp_knight_4_1", slot_troop_spouse, "trp_knight_4_1_wife"),
(troop_set_slot,"trp_knight_5_1", slot_troop_spouse, "trp_knight_5_1_wife"),
(troop_set_slot,"trp_knight_1_2", slot_troop_spouse, "trp_knight_1_2_wife"),
(troop_set_slot,"trp_knight_2_2", slot_troop_spouse, "trp_knight_2_2_wife"),
(troop_set_slot,"trp_knight_3_2", slot_troop_spouse, "trp_knight_3_2_wife"),
(troop_set_slot,"trp_knight_4_2", slot_troop_spouse, "trp_knight_4_2_wife"),
(troop_set_slot,"trp_knight_5_2", slot_troop_spouse, "trp_knight_5_2_wife"),
(troop_set_slot,"trp_knight_1_3", slot_troop_spouse, "trp_knight_1_1_daughter"),
(troop_set_slot,"trp_knight_2_3", slot_troop_spouse, "trp_knight_2_1_daughter"),
(troop_set_slot,"trp_knight_3_3", slot_troop_spouse, "trp_knight_3_1_daughter"),
(troop_set_slot,"trp_knight_4_3", slot_troop_spouse, "trp_knight_4_1_daughter"),
(troop_set_slot,"trp_knight_5_3", slot_troop_spouse, "trp_knight_5_1_daughter"),
(troop_set_slot,"trp_knight_1_4", slot_troop_spouse, "trp_knight_1_2_daughter"),
(troop_set_slot,"trp_knight_2_4", slot_troop_spouse, "trp_knight_2_2_daughter"),
(troop_set_slot,"trp_knight_3_4", slot_troop_spouse, "trp_knight_3_2_daughter"),
(troop_set_slot,"trp_knight_4_4", slot_troop_spouse, "trp_knight_4_2_daughter"),
(troop_set_slot,"trp_knight_5_4", slot_troop_spouse, "trp_knight_5_2_daughter"),
## (troop_set_slot,"trp_kingdom_2_lord_a", slot_troop_spouse, "trp_kingdom_2_lady_a"),
## (troop_set_slot,"trp_kingdom_2_lord_a", slot_troop_son, "trp_kingdom_2_lord_b"),
## (troop_set_slot,"trp_kingdom_2_lord_a", slot_troop_sibling, "trp_kingdom_2_lady_c"),
## (troop_set_slot,"trp_kingdom_2_lord_a", slot_troop_daughter, "trp_kingdom_2_lady_e"),
##
## (troop_set_slot,"trp_kingdom_2_lord_b", slot_troop_daughter, "trp_kingdom_2_lady_b"),
## (troop_set_slot,"trp_kingdom_2_lord_c", slot_troop_spouse, "trp_kingdom_2_lady_c"),
## (troop_set_slot,"trp_kingdom_2_lord_d", slot_troop_daughter, "trp_kingdom_2_lady_d"),
## (troop_set_slot,"trp_kingdom_2_lord_e", slot_troop_spouse, "trp_kingdom_2_lady_e"),
## (troop_set_slot,"trp_kingdom_2_lord_f", slot_troop_daughter, "trp_kingdom_2_lady_f"),
## (troop_set_slot,"trp_kingdom_2_lord_g", slot_troop_spouse, "trp_kingdom_2_lady_g"),
## (troop_set_slot,"trp_kingdom_2_lord_h", slot_troop_daughter, "trp_kingdom_2_lady_h"),
## (troop_set_slot,"trp_kingdom_2_lord_i", slot_troop_spouse, "trp_kingdom_2_lady_i"),
## (troop_set_slot,"trp_kingdom_2_lord_j", slot_troop_daughter, "trp_kingdom_2_lady_j"),
## (try_for_range, ":troop_id", merchants_begin, merchants_end),
## (troop_set_slot, ":troop_id", slot_troop_occupation, slto_merchant),
## (try_end),
(try_for_range, ":troop_id", kingdom_heroes_begin, kingdom_heroes_end),
(try_begin),
(store_troop_faction, ":faction_id", ":troop_id"),
(is_between, ":faction_id", kingdoms_begin, kingdoms_end),
(troop_set_slot, ":troop_id", slot_troop_original_faction, ":faction_id"),
(try_begin),
(is_between, ":troop_id", pretenders_begin, pretenders_end),
(faction_set_slot, ":faction_id", slot_faction_has_rebellion_chance, 1),
(else_try),
(troop_set_slot, ":troop_id", slot_troop_occupation, slto_kingdom_hero),
(try_end),
(try_end),
(assign, ":initial_wealth", 6000),
(try_begin),
(store_troop_faction, ":faction", ":troop_id"),
(faction_slot_eq, ":faction", slot_faction_leader, ":troop_id"),
(assign, ":initial_wealth", 20000),
(try_end),
(troop_set_slot, ":troop_id", slot_troop_wealth, ":initial_wealth"),
(try_end),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),#add town garrisons
#Add initial center wealth
(assign, ":initial_wealth", 2000),
(try_begin),
(is_between, ":center_no", towns_begin, towns_end),
(val_mul, ":initial_wealth", 2),
(try_end),
(party_set_slot, ":center_no", slot_town_wealth, ":initial_wealth"),
(assign, ":garrison_strength", 13),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(assign, ":garrison_strength", 40),
(try_end),
(try_for_range, ":unused", 0, ":garrison_strength"),
(call_script, "script_cf_reinforce_party", ":center_no"),
(try_end),
## ADD some XP initially
(store_div, ":xp_amount", ":garrison_strength", 8),
(val_add, ":xp_amount", 4),
(try_for_range, ":unused", 0, ":xp_amount"),
(store_random_in_range, ":xp", 7000, 9000),
(party_upgrade_with_xp, ":center_no", ":xp", 0),
(try_end),
#Fill town food stores upto half the limit
(call_script, "script_center_get_food_store_limit", ":center_no"),
(assign, ":food_store_limit", reg0),
(val_div, ":food_store_limit", 2),
(party_set_slot, ":center_no", slot_party_food_store, ":food_store_limit"),
#create lord parties
(party_get_slot, ":center_lord", ":center_no", slot_town_lord),
(ge, ":center_lord", 1),
(troop_slot_eq, ":center_lord", slot_troop_leaded_party, 0),
(call_script, "script_create_kingdom_hero_party", ":center_lord", ":center_no"),
(assign, ":lords_party", "$pout_party"),
(party_attach_to_party, ":lords_party", ":center_no"),
(party_set_slot, ":center_no", slot_town_player_odds, 1000),
(try_end),
(call_script, "script_complete_family_relations"),
(call_script, "script_complete_family_relations"),
(try_for_range, ":troop_id", kingdom_ladies_begin, kingdom_ladies_end),
(troop_set_slot, ":troop_id", slot_troop_occupation, slto_kingdom_lady),
(troop_get_slot, ":cur_family", ":troop_id", slot_troop_father),
(try_begin),
(eq, ":cur_family", 0),
(troop_get_slot, ":cur_family", ":troop_id", slot_troop_spouse),
(try_end),
(try_begin),
(gt, ":cur_family", 0),
(call_script, "script_get_troop_attached_party", ":cur_family"),
(assign, ":cur_center", reg0),
(gt, ":cur_center", 0),
(troop_set_slot, ":troop_id", slot_troop_cur_center, ":cur_center"),
(else_try),
(store_troop_faction, ":faction_no", ":troop_id"),
(call_script, "script_cf_select_random_walled_center_with_faction", ":faction_no", -1),
(assign, ":cur_center", reg0),
(troop_set_slot, ":troop_id", slot_troop_cur_center, ":cur_center"),
(try_end),
(try_end),
(try_for_range, ":troop_id", heroes_begin, heroes_end),
(troop_slot_eq, ":troop_id", slot_troop_occupation, slto_kingdom_lady),
(troop_get_slot, ":cur_father", ":troop_id", slot_troop_father),
(gt, ":cur_father", 0),# Lovers for daughters only
(store_random_in_range, ":random_no", 0, 100),
(le, ":random_no", 80),
(call_script, "script_cf_get_random_kingdom_hero_as_lover", ":troop_id"),#Can fail
(assign, ":cur_lover", reg0),
(troop_set_slot, ":troop_id", slot_troop_lover, ":cur_lover"),
(troop_set_slot, ":cur_lover", slot_troop_lover, ":troop_id"),
(try_end),
(try_for_range, ":troop_id", heroes_begin, heroes_end),
(troop_get_slot, ":in_relation_1", ":troop_id", slot_troop_spouse),
(troop_get_slot, ":in_relation_2", ":troop_id", slot_troop_sibling),
(troop_get_slot, ":in_relation_3", ":troop_id", slot_troop_daughter),
(troop_get_slot, ":in_relation_4", ":troop_id", slot_troop_son),
(troop_get_slot, ":in_relation_5", ":troop_id", slot_troop_father),
(troop_get_slot, ":in_relation_6", ":troop_id", slot_troop_mother),
(troop_get_slot, ":in_relation_7", ":troop_id", slot_troop_lover),
# (troop_get_slot, ":troop_rank", ":troop_id", slot_troop_kingdom_rank),
(store_troop_faction, ":troop_faction", ":troop_id"),
(assign, ":troop_enemy_count", 0),
(try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
(troop_slot_ge, ":troop_id", ":i_enemy_slot", 1),
(val_add, ":troop_enemy_count", 1),
(try_end),
(try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
(troop_set_slot, ":troop_id", ":i_enemy_slot", -1),
(try_end),
(store_random_in_range, ":random_enemy_count", 0, 4),
(val_add, ":random_enemy_count", ":troop_enemy_count"),
(val_min, ":random_enemy_count", 5),
(try_for_range, ":unused", ":troop_enemy_count", ":random_enemy_count"),
(assign, ":possible_enemy_count", 0),
(try_for_range, ":enemy_troop_id", heroes_begin, heroes_end),
(neq, ":enemy_troop_id", ":troop_id"),
(neq, ":enemy_troop_id", ":in_relation_1"),
(neq, ":enemy_troop_id", ":in_relation_2"),
(neq, ":enemy_troop_id", ":in_relation_3"),
(neq, ":enemy_troop_id", ":in_relation_4"),
(neq, ":enemy_troop_id", ":in_relation_5"),
(neq, ":enemy_troop_id", ":in_relation_6"),
(neq, ":enemy_troop_id", ":in_relation_7"),
(store_troop_faction, ":enemy_troop_faction", ":enemy_troop_id"),
(eq, ":enemy_troop_faction", ":troop_faction"),
# (troop_get_slot, ":enemy_troop_rank", ":enemy_troop_id", slot_troop_kingdom_rank),
# (lt, ":enemy_troop_rank", 4),
# (lt, ":troop_rank", 4),
(assign, ":marked_as_enemy", 0),
(try_for_range, ":i_enemy_slot_mark", slot_troop_enemies_begin, slot_troop_enemies_end),
(troop_slot_eq, ":troop_id", ":i_enemy_slot_mark", ":enemy_troop_id"),
(assign, ":marked_as_enemy", 1),
(try_end),
(eq, ":marked_as_enemy", 0),
(val_add, ":possible_enemy_count", 1),
(try_end),
(store_random_in_range, ":random_enemy", 0, ":possible_enemy_count"),
(assign, ":possible_enemy_count", 0),
(assign, ":result", -1),
(try_for_range, ":enemy_troop_id", heroes_begin, heroes_end),
(eq, ":result", -1),
(neq, ":enemy_troop_id", ":troop_id"),
(neq, ":enemy_troop_id", ":in_relation_1"),
(neq, ":enemy_troop_id", ":in_relation_2"),
(neq, ":enemy_troop_id", ":in_relation_3"),
(neq, ":enemy_troop_id", ":in_relation_4"),
(neq, ":enemy_troop_id", ":in_relation_5"),
(neq, ":enemy_troop_id", ":in_relation_6"),
(neq, ":enemy_troop_id", ":in_relation_7"),
(store_troop_faction, ":enemy_troop_faction", ":enemy_troop_id"),
(eq, ":enemy_troop_faction", ":troop_faction"),
# (troop_get_slot, ":enemy_troop_rank", ":enemy_troop_id", slot_troop_kingdom_rank),
# (lt, ":enemy_troop_rank", 4),
# (lt, ":troop_rank", 4),
(assign, ":marked_as_enemy", 0),
(try_for_range, ":i_enemy_slot_mark", slot_troop_enemies_begin, slot_troop_enemies_end),
(troop_slot_eq, ":troop_id", ":i_enemy_slot_mark", ":enemy_troop_id"),
(assign, ":marked_as_enemy", 1),
(try_end),
(eq, ":marked_as_enemy", 0),
(val_add, ":possible_enemy_count", 1),
(gt, ":possible_enemy_count", ":random_enemy"),
(assign, ":result", ":enemy_troop_id"),
(try_end),
(gt, ":result", 0),
(assign, ":enemy_troop_enemy_count", 0),
(try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
(troop_slot_ge, ":result", ":i_enemy_slot", 1),
(val_add, ":enemy_troop_enemy_count", 1),
(try_end),
(lt, ":enemy_troop_enemy_count", 5),
(assign, ":troop_enemy_count", 0),
(try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
(troop_slot_ge, ":troop_id", ":i_enemy_slot", 1),
(val_add, ":troop_enemy_count", 1),
(try_end),
(store_add, ":cur_slot", slot_troop_enemies_begin, ":troop_enemy_count"),
(troop_set_slot, ":troop_id", ":cur_slot", ":result"),
(store_add, ":cur_slot", slot_troop_enemies_begin, ":enemy_troop_enemy_count"),
(troop_set_slot, ":result", ":cur_slot", ":troop_id"),
(try_end),
(try_end),
(try_for_range, ":unused", 0, 8),
(call_script, "script_spawn_bandits"),
(try_end),
(set_spawn_radius, 50),
(try_for_range, ":unused", 0, 25),
(spawn_around_party,"p_main_party","pt_looters"),
(try_end),
(try_for_range, ":unused", 0, 6),
(call_script, "script_update_trade_good_prices"),
(try_end),
(call_script, "script_assign_lords_to_empty_centers"),
(call_script, "script_update_mercenary_units_of_towns"),
(call_script, "script_update_companion_candidates_in_taverns"),
(call_script, "script_update_ransom_brokers"),
(call_script, "script_update_tavern_travelers"),
(call_script, "script_update_tavern_minstels"),
(call_script, "script_update_booksellers"),
(try_for_range, ":village_no", villages_begin, villages_end),
(call_script, "script_update_volunteer_troops_in_village", ":village_no"),
(try_end),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
(call_script, "script_update_faction_notes", ":cur_kingdom"),
(store_random_in_range, ":random_no", -60, 0),
(faction_set_slot, ":faction_no", slot_faction_ai_last_offensive_time, ":random_no"),
(try_end),
(try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end),
(call_script, "script_update_troop_notes", ":cur_troop"),
(try_end),
(try_for_range, ":cur_center", centers_begin, centers_end),
(call_script, "script_update_center_notes", ":cur_center"),
(try_end),
(call_script, "script_update_troop_notes", "trp_player"),
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(call_script, "script_faction_recalculate_strength", ":faction_no"),
(try_end),
## (assign, "$players_kingdom", "fac_kingdom_1"),
## (call_script, "script_give_center_to_lord", "p_town_7", "trp_player", 0),
## (call_script, "script_give_center_to_lord", "p_town_16", "trp_player", 0),
#### (call_script, "script_give_center_to_lord", "p_castle_10", "trp_player", 0),
## (assign, "$g_castle_requested_by_player", "p_castle_10"),
(call_script, "script_get_player_party_morale_values"),
(party_set_morale, "p_main_party", reg0),
]),
# script_game_event_party_encounter:
# This script is called from the game engine whenever player party encounters another party or a battle on the world map
# INPUT:
# param1: encountered_party
# param2: second encountered_party (if this was a battle
("game_event_party_encounter",
[
(store_script_param_1, "$g_encountered_party"),
(store_script_param_2, "$g_encountered_party_2"),# encountered_party2 is set when we come across a battle or siege, otherwise it's a negative value
# (store_encountered_party, "$g_encountered_party"),
# (store_encountered_party2,"$g_encountered_party_2"), # encountered_party2 is set when we come across a battle or siege, otherwise it's a minus value
(store_faction_of_party, "$g_encountered_party_faction","$g_encountered_party"),
(store_relation, "$g_encountered_party_relation", "$g_encountered_party_faction", "fac_player_faction"),
(party_get_slot, "$g_encountered_party_type", "$g_encountered_party", slot_party_type),
(party_get_template_id,"$g_encountered_party_template","$g_encountered_party"),
# (try_begin),
# (gt, "$g_encountered_party_2", 0),
# (store_faction_of_party, "$g_encountered_party_2_faction","$g_encountered_party_2"),
# (store_relation, "$g_encountered_party_2_relation", "$g_encountered_party_2_faction", "fac_player_faction"),
# (party_get_template_id,"$g_encountered_party_2_template","$g_encountered_party_2"),
# (else_try),
# (assign, "$g_encountered_party_2_faction",-1),
# (assign, "$g_encountered_party_2_relation", 0),
# (assign,"$g_encountered_party_2_template", -1),
# (try_end),
#NPC companion changes begin
(call_script, "script_party_count_fit_regulars", "p_main_party"),
(assign, "$playerparty_prebattle_regulars", reg0),
# (try_begin),
# (assign, "$player_party__regulars", 0),
# (call_script, "script_party_count_fit_regulars", "p_main_party"),
# (gt, reg0, 0),
# (assign, "$player_party_contains_regulars", 1),
# (try_end),
#NPC companion changes end
(assign, "$g_last_rest_center", -1),
(assign, "$talk_context", 0),
(assign,"$g_player_surrenders",0),
(assign,"$g_enemy_surrenders",0),
(assign, "$g_leave_encounter",0),
(assign, "$g_engaged_enemy", 0),
# (assign,"$waiting_for_arena_fight_result", 0),
# (assign,"$arena_bet_amount",0),
# (assign,"$g_player_raiding_village",0),
(try_begin),
(neg|is_between, "$g_encountered_party", centers_begin, centers_end),
(rest_for_hours, 0), #stop waiting
(try_end),
# (assign, "$g_permitted_to_center",0),
(assign, "$new_encounter", 1), #check this in the menu.
(try_begin),
(lt, "$g_encountered_party_2",0), #Normal encounter. Not battle or siege.
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
#(assign, reg0, "$g_encountered_party"),
#(display_message, "@party_id: {reg0}"),
(jump_to_menu, "mnu_castle_outside"),
(else_try),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle),
(jump_to_menu, "mnu_castle_outside"),
(else_try),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_ship),
(jump_to_menu, "mnu_ship_reembark"),
(else_try),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(jump_to_menu, "mnu_village"),
(else_try),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_cattle_herd),
(jump_to_menu, "mnu_cattle_herd"),
(else_try),
(is_between, "$g_encountered_party", training_grounds_begin, training_grounds_end),
(jump_to_menu, "mnu_training_ground"),
(else_try),
(eq, "$g_encountered_party", "p_zendar"),
(jump_to_menu, "mnu_zendar"),
(else_try),
(eq, "$g_encountered_party", "p_salt_mine"),
(jump_to_menu, "mnu_salt_mine"),
(else_try),
(eq, "$g_encountered_party", "p_four_ways_inn"),
(jump_to_menu, "mnu_four_ways_inn"),
(else_try),
(eq, "$g_encountered_party", "p_test_scene"),
(jump_to_menu, "mnu_test_scene"),
(else_try),
(eq, "$g_encountered_party", "p_battlefields"),
(jump_to_menu, "mnu_battlefields"),
(else_try),
(eq, "$g_encountered_party", "p_training_ground"),
(jump_to_menu, "mnu_tutorial"),
(else_try),
(eq, "$g_encountered_party", "p_camp_bandits"),
(jump_to_menu, "mnu_camp"),
(else_try),
(jump_to_menu, "mnu_simple_encounter"),
(try_end),
(else_try), #Battle or siege
(try_begin),
(this_or_next|party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle),
(try_begin),
(eq, "$auto_enter_town", "$g_encountered_party"),
(jump_to_menu, "mnu_town"),
(else_try),
(eq, "$auto_besiege_town", "$g_encountered_party"),
(jump_to_menu, "mnu_besiegers_camp_with_allies"),
(else_try),
(jump_to_menu, "mnu_join_siege_outside"),
(try_end),
(else_try),
(jump_to_menu, "mnu_pre_join"),
(try_end),
(try_end),
(assign,"$auto_enter_town",0),
(assign,"$auto_besiege_town",0),
]),
#script_game_event_simulate_battle:
# This script is called whenever the game simulates the battle between two parties on the map.
# INPUT:
# param1: Defender Party
# param2: Attacker Party
("game_event_simulate_battle",
[
(store_script_param_1, ":root_defender_party"),
(store_script_param_2, ":root_attacker_party"),
(try_begin),
(store_faction_of_party, ":defender_faction", ":root_defender_party"),
(store_faction_of_party, ":attacker_faction", ":root_attacker_party"),
(neq, ":defender_faction", "fac_player_faction"),
(neq, ":attacker_faction", "fac_player_faction"),
(store_relation, ":reln", ":defender_faction", ":attacker_faction"),
(ge, ":reln", 0),
(set_trigger_result, 1),
(else_try),
(assign, ":trigger_result", 0),
(try_begin),
(this_or_next|eq, "$g_battle_simulation_cancel_for_party", ":root_defender_party"),
(eq, "$g_battle_simulation_cancel_for_party", ":root_attacker_party"),
(assign, "$g_battle_simulation_cancel_for_party", -1),
(assign, "$auto_enter_town", "$g_battle_simulation_auto_enter_town_after_battle"),
(assign, ":trigger_result", 1),
(else_try),
(try_begin),
(this_or_next|party_slot_eq, ":root_defender_party", slot_party_retreat_flag, 1),
(party_slot_eq, ":root_attacker_party", slot_party_retreat_flag, 1),
(assign, ":trigger_result", 1), #End battle!
(try_end),
(party_set_slot, ":root_attacker_party", slot_party_retreat_flag, 0),
## (assign, ":cancel_attack", 0),
(party_collect_attachments_to_party, ":root_defender_party", "p_collective_ally"),
(party_collect_attachments_to_party, ":root_attacker_party", "p_collective_enemy"),
# (call_script, "script_party_count_fit_for_battle", "p_collective_ally"),
(call_script, "script_party_calculate_strength", "p_collective_ally", 0),
(assign, ":defender_strength", reg0),
# (call_script, "script_party_count_fit_for_battle", "p_collective_enemy"),
(call_script, "script_party_calculate_strength", "p_collective_enemy", 0),
(assign, ":attacker_strength", reg0),
(store_div, ":defender_strength", ":defender_strength", 20),
(val_min, ":defender_strength", 50),
(val_max, ":defender_strength", 1),
(store_div, ":attacker_strength", ":attacker_strength", 20),
(val_min, ":attacker_strength", 50),
(val_add, ":attacker_strength", 1),
(try_begin),
#For sieges increase attacker casualties and reduce defender casualties.
(this_or_next|party_slot_eq, ":root_defender_party", slot_party_type, spt_castle),
(party_slot_eq, ":root_defender_party", slot_party_type, spt_town),
(val_mul, ":defender_strength", 3),
(val_div, ":defender_strength", 2),
(val_div, ":attacker_strength", 2),
(try_end),
(try_begin),
(neg|is_currently_night), #Don't fight at night
(inflict_casualties_to_party_group, ":root_attacker_party", ":defender_strength", "p_temp_casualties"),
(party_collect_attachments_to_party, ":root_attacker_party", "p_collective_enemy"),
(try_end),
(call_script, "script_party_count_fit_for_battle", "p_collective_enemy", 0),
(assign, ":new_attacker_strength", reg0),
(try_begin),
(gt, ":new_attacker_strength", 0),
(neg|is_currently_night), #Don't fight at night
(inflict_casualties_to_party_group, ":root_defender_party", ":attacker_strength", "p_temp_casualties"),
(party_collect_attachments_to_party, ":root_defender_party", "p_collective_ally"),
(try_end),
(call_script, "script_party_count_fit_for_battle", "p_collective_ally", 0),
(assign, ":new_defender_strength", reg0),
(try_begin),
(this_or_next|eq, ":new_attacker_strength", 0),
(eq, ":new_defender_strength", 0),
# Battle concluded! determine winner
(try_begin),
(eq, ":new_attacker_strength", 0),
(eq, ":new_defender_strength", 0),
(assign, ":root_winner_party", -1),
(assign, ":root_defeated_party", -1),
(assign, ":collective_casualties", -1),
(else_try),
(eq, ":new_attacker_strength", 0),
(assign, ":root_winner_party", ":root_defender_party"),
(assign, ":root_defeated_party", ":root_attacker_party"),
(assign, ":collective_casualties", "p_collective_enemy"),
(else_try),
(assign, ":root_winner_party", ":root_attacker_party"),
(assign, ":root_defeated_party", ":root_defender_party"),
(assign, ":collective_casualties", "p_collective_ally"),
(try_end),
(try_begin),
(ge, ":root_winner_party", 0),
(call_script, "script_get_nonempty_party_in_group", ":root_winner_party"),
(assign, ":nonempty_winner_party", reg0),
(store_faction_of_party, ":faction_receiving_prisoners", ":nonempty_winner_party"),
(store_faction_of_party, ":defeated_faction", ":root_defeated_party"),
(else_try),
(assign, ":nonempty_winner_party", -1),
(try_end),
(try_begin),
(ge, ":collective_casualties", 0),
(party_get_num_companion_stacks, ":num_stacks", ":collective_casualties"),
(else_try),
(assign, ":num_stacks", 0),
(try_end),
(try_for_range, ":troop_iterator", 0, ":num_stacks"),
(party_stack_get_troop_id, ":cur_troop_id", ":collective_casualties", ":troop_iterator"),
(troop_is_hero, ":cur_troop_id"),
(call_script, "script_remove_troop_from_prison", ":cur_troop_id"),
(troop_set_slot, ":cur_troop_id", slot_troop_leaded_party, -1),
(store_random_in_range, ":rand", 0, 100),
(str_store_troop_name_link, s1, ":cur_troop_id"),
(str_store_faction_name_link, s2, ":faction_receiving_prisoners"),
(store_troop_faction, ":defeated_troop_faction", ":cur_troop_id"),
(str_store_faction_name_link, s3, ":defeated_troop_faction"),
(try_begin),
(ge, ":rand", hero_escape_after_defeat_chance),
(party_stack_get_troop_id, ":leader_troop_id", ":nonempty_winner_party", 0),
(is_between, ":leader_troop_id", kingdom_heroes_begin, kingdom_heroes_end), #disable non-kingdom parties capturing enemy lords
(party_add_prisoners, ":nonempty_winner_party", ":cur_troop_id", 1),
(gt, reg0, 0),
#(troop_set_slot, ":cur_troop_id", slot_troop_is_prisoner, 1),
(troop_set_slot, ":cur_troop_id", slot_troop_prisoner_of_party, ":nonempty_winner_party"),
(display_log_message, "str_hero_taken_prisoner"),
(else_try),
(display_message,"@{s1} of {s3} was defeated in battle but managed to escape."),
(try_end),
(try_begin),
(store_troop_faction, ":cur_troop_faction", ":cur_troop_id"),
(faction_slot_eq, ":cur_troop_faction", slot_faction_marshall, ":cur_troop_id"),
#Marshall is defeated, refresh ai.
(assign, "$g_recalculate_ais", 1),
(try_end),
(try_end),
(try_begin),
(ge, ":collective_casualties", 0),
(party_get_num_prisoner_stacks, ":num_stacks", ":collective_casualties"),
(else_try),
(assign, ":num_stacks", 0),
(try_end),
(try_for_range, ":troop_iterator", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":cur_troop_id", ":collective_casualties", ":troop_iterator"),
(troop_is_hero, ":cur_troop_id"),
(call_script, "script_remove_troop_from_prison", ":cur_troop_id"),
(store_troop_faction, ":cur_troop_faction", ":cur_troop_id"),
(str_store_troop_name_link, s1, ":cur_troop_id"),
(str_store_faction_name_link, s2, ":faction_receiving_prisoners"),
(str_store_faction_name_link, s3, ":cur_troop_faction"),
(display_log_message,"str_hero_freed"),
(try_end),
(try_begin),
(ge, ":collective_casualties", 0),
(party_clear, "p_temp_party"),
(assign, "$g_move_heroes", 0), #heroes are already processed above. Skip them here.
(call_script, "script_party_add_party_prisoners", "p_temp_party", ":collective_casualties"),
(call_script, "script_party_prisoners_add_party_companions", "p_temp_party", ":collective_casualties"),
(distribute_party_among_party_group, "p_temp_party", ":root_winner_party"),
(call_script, "script_clear_party_group", ":root_defeated_party"),
(try_end),
(assign, ":trigger_result", 1), #End battle!
#Center captured
(try_begin),
(ge, ":collective_casualties", 0),
(party_get_slot, ":cur_party_type", ":root_defeated_party", slot_party_type),
(this_or_next|eq, ":cur_party_type", spt_town),
(eq, ":cur_party_type", spt_castle),
(assign, "$g_recalculate_ais", 1),
(store_faction_of_party, ":winner_faction", ":root_winner_party"),
(store_faction_of_party, ":defeated_faction", ":root_defeated_party"),
(str_store_party_name, s1, ":root_defeated_party"),
(str_store_faction_name, s2, ":winner_faction"),
(str_store_faction_name, s3, ":defeated_faction"),
(display_log_message, "str_center_captured"),
(try_begin),
(eq, "$g_encountered_party", ":root_defeated_party"),
## (display_message, "@Player participation in siege called from g_encountered_party"),
(call_script, "script_add_log_entry", logent_player_participated_in_siege, "trp_player", "$g_encountered_party", 0, "$g_encountered_party_faction"),
(try_end),
## (try_begin),
## (eq, "$g_encountered_party_2", ":root_defeated_party"),
## (display_message, "@Player participation in siege called from game_event_simulate_battle thanks to g_encountered_party"),
## (try_end),
## (try_begin),
## (eq, "$g_enemy_party", ":root_defeated_party"),
## (display_message, "@Player participation in siege called from game_event_simulate_battle thanks to g_encountered_party"),
## (try_end),
(try_begin),
(party_get_num_companion_stacks, ":num_stacks", ":root_winner_party"),
(gt, ":num_stacks", 0),
(party_stack_get_troop_id, ":leader_troop_no", ":root_winner_party", 0),
(is_between, ":leader_troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(party_set_slot, ":root_defeated_party", slot_center_last_taken_by_troop, ":leader_troop_no"),
(else_try),
(party_set_slot, ":root_defeated_party", slot_center_last_taken_by_troop, -1),
(try_end),
(call_script, "script_lift_siege", ":root_defeated_party", 0),
(call_script, "script_give_center_to_faction", ":root_defeated_party", ":winner_faction"),
(try_begin),
(eq, ":defeated_faction", "fac_player_supporters_faction"),
(call_script, "script_add_notification_menu", "mnu_notification_center_lost", ":root_defeated_party", ":winner_faction"),
(try_end),
#Reduce prosperity of the center by 5
(call_script, "script_change_center_prosperity", ":root_defeated_party", -5),
(call_script, "script_order_best_besieger_party_to_guard_center", ":root_defeated_party", ":winner_faction"),
(call_script, "script_cf_reinforce_party", ":root_defeated_party"),
(call_script, "script_cf_reinforce_party", ":root_defeated_party"),
(try_end),
(try_end),
#ADD XP
(try_begin),
(party_slot_eq, ":root_attacker_party", slot_party_type, spt_kingdom_hero_party),
(store_random_in_range, ":random_num",0, 100),
(lt, ":random_num", 25),
(gt, ":new_attacker_strength", 0),
(call_script, "script_upgrade_hero_party", ":root_attacker_party", 1000),
(try_end),
(try_begin),
(party_slot_eq, ":root_defender_party", slot_party_type, spt_kingdom_hero_party),
(store_random_in_range, ":random_num",0, 100),
(lt, ":random_num", 25),
(gt, ":new_defender_strength", 0),
(call_script, "script_upgrade_hero_party", ":root_defender_party", 1000),
(try_end),
(store_random_in_range, ":random_num", 0, 100),
(try_begin),
(lt, ":random_num", 10),
## (this_or_next|lt, ":random_num", 10),
## (eq, ":cancel_attack", 1),
(assign, ":trigger_result", 1), #End battle!
(try_end),
(try_end),
(set_trigger_result, ":trigger_result"),
(try_end),
]),
#script_game_event_battle_end:
# This script is called whenever the game ends the battle between two parties on the map.
# INPUT:
# param1: Defender Party
# param2: Attacker Party
("game_event_battle_end",
[
## (store_script_param_1, ":root_defender_party"),
## (store_script_param_2, ":root_attacker_party"),
#Fixing deleted heroes
(try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(troop_get_slot, ":cur_prisoner_of_party", ":cur_troop", slot_troop_prisoner_of_party),
(try_begin),
(ge, ":cur_party", 0),
(assign, ":continue", 0),
(try_begin),
(neg|party_is_active, ":cur_party"),
(assign, ":continue", 1),
(else_try),
(party_count_companions_of_type, ":amount", ":cur_party", ":cur_troop"),
(le, ":amount", 0),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, s1, ":cur_troop"),
(display_message, "@DEBUG: {s1} no longer leads a party."),
(try_end),
(troop_set_slot, ":cur_troop", slot_troop_leaded_party, -1),
(try_end),
(try_begin),
(ge, ":cur_prisoner_of_party", 0),
(assign, ":continue", 0),
(try_begin),
(neg|party_is_active, ":cur_prisoner_of_party"),
(assign, ":continue", 1),
(else_try),
(party_count_prisoners_of_type, ":amount", ":cur_prisoner_of_party", ":cur_troop"),
(le, ":amount", 0),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, s1, ":cur_troop"),
(display_message, "@DEBUG: {s1} is no longer a prisoner."),
(try_end),
(call_script, "script_remove_troop_from_prison", ":cur_troop"),
#searching player
(try_begin),
(party_count_prisoners_of_type, ":amount", "p_main_party", ":cur_troop"),
(gt, ":amount", 0),
(troop_set_slot, ":cur_troop", slot_troop_prisoner_of_party, "p_main_party"),
(assign, ":continue", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, s1, ":cur_troop"),
(display_message, "@DEBUG: {s1} is now a prisoner of player."),
(try_end),
(try_end),
(eq, ":continue", 1),
#searching kingdom heroes
(try_for_range, ":cur_troop_2", kingdom_heroes_begin, kingdom_heroes_end),
(eq, ":continue", 1),
(troop_get_slot, ":cur_prisoner_of_party_2", ":cur_troop_2", slot_troop_leaded_party),
(party_is_active, ":cur_prisoner_of_party_2"),
(party_count_prisoners_of_type, ":amount", ":cur_prisoner_of_party_2", ":cur_troop"),
(gt, ":amount", 0),
(troop_set_slot, ":cur_troop", slot_troop_prisoner_of_party, ":cur_prisoner_of_party_2"),
(assign, ":continue", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, s1, ":cur_troop"),
(str_store_party_name, s2, ":cur_prisoner_of_party_2"),
(display_message, "@DEBUG: {s1} is now a prisoner of {s2}."),
(try_end),
(try_end),
#searching walled centers
(try_for_range, ":cur_prisoner_of_party_2", walled_centers_begin, walled_centers_end),
(eq, ":continue", 1),
(party_count_prisoners_of_type, ":amount", ":cur_prisoner_of_party_2", ":cur_troop"),
(gt, ":amount", 0),
(troop_set_slot, ":cur_troop", slot_troop_prisoner_of_party, ":cur_prisoner_of_party_2"),
(assign, ":continue", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, s1, ":cur_troop"),
(str_store_party_name, s2, ":cur_prisoner_of_party_2"),
(display_message, "@DEBUG: {s1} is now a prisoner of {s2}."),
(try_end),
(try_end),
(try_end),
(try_end),
]),
#script_order_best_besieger_party_to_guard_center:
# INPUT:
# param1: defeated_center, param2: winner_faction
# OUTPUT:
# none
("order_best_besieger_party_to_guard_center",
[
(store_script_param, ":defeated_center", 1),
(store_script_param, ":winner_faction", 2),
(assign, ":best_party", -1),
(assign, ":best_party_strength", 0),
(try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),
(troop_get_slot, ":kingdom_hero_party", ":kingdom_hero", slot_troop_leaded_party),
(gt, ":kingdom_hero_party", 0),
(store_distance_to_party_from_party, ":dist", ":kingdom_hero_party", ":defeated_center"),
(lt, ":dist", 5),
(store_faction_of_party, ":kingdom_hero_party_faction", ":kingdom_hero_party"),
(eq, ":winner_faction", ":kingdom_hero_party_faction"),
#If marshall has captured the castle, then do not leave him behind.
(neg|faction_slot_eq, ":winner_faction", slot_faction_marshall, ":kingdom_hero"),
(assign, ":has_besiege_ai", 0),
(try_begin),
(party_slot_eq, ":kingdom_hero_party", slot_party_ai_state, spai_besieging_center),
(party_slot_eq, ":kingdom_hero_party", slot_party_ai_object, ":defeated_center"),
(assign, ":has_besiege_ai", 1),
(else_try),
(party_slot_eq, ":kingdom_hero_party", slot_party_ai_state, spai_accompanying_army),
(party_get_slot, ":kingdom_hero_party_commander_party", ":kingdom_hero_party", slot_party_commander_party),
(party_slot_eq, ":kingdom_hero_party_commander_party", slot_party_ai_state, spai_besieging_center),
(party_slot_eq, ":kingdom_hero_party_commander_party", slot_party_ai_object, ":defeated_center"),
(assign, ":has_besiege_ai", 1),
(try_end),
(eq, ":has_besiege_ai", 1),
(party_get_slot, ":kingdom_hero_party_strength", ":kingdom_hero_party", slot_party_cached_strength),#recently calculated
(gt, ":kingdom_hero_party_strength", ":best_party_strength"),
(assign, ":best_party_strength", ":kingdom_hero_party_strength"),
(assign, ":best_party", ":kingdom_hero_party"),
(try_end),
(try_begin),
(gt, ":best_party", 0),
(call_script, "script_party_set_ai_state", ":best_party", spai_holding_center, ":defeated_center"),
(party_set_slot, ":best_party", slot_party_commander_party, -1),
(party_set_flags, ":best_party", pf_default_behavior, 1),
(try_end),
]),
#script_game_get_item_buy_price_factor:
# This script is called from the game engine for calculating the buying price of any item.
# INPUT:
# param1: item_kind_id
# OUTPUT:
# trigger_result and reg0 = price_factor
("game_get_item_buy_price_factor",
[
(store_script_param_1, ":item_kind_id"),
(assign, ":price_factor", 100),
(call_script, "script_get_trade_penalty", ":item_kind_id"),
(assign, ":trade_penalty", reg0),
(try_begin),
(is_between, "$g_encountered_party", centers_begin, centers_end),
(is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
(store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin),
(val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
(party_get_slot, ":price_factor", "$g_encountered_party", ":item_slot_no"),
(val_mul, ":price_factor", 100), #normalize price factor to range 0..100
(val_div, ":price_factor", average_price_factor),
(try_end),
(store_add, ":penalty_factor", 100, ":trade_penalty"),
(val_mul, ":price_factor", ":penalty_factor"),
(val_div, ":price_factor", 100),
(assign, reg0, ":price_factor"),
(set_trigger_result, reg0),
]),
#script_game_get_item_sell_price_factor:
# This script is called from the game engine for calculating the selling price of any item.
# INPUT:
# param1: item_kind_id
# OUTPUT:
# trigger_result and reg0 = price_factor
("game_get_item_sell_price_factor",
[
(store_script_param_1, ":item_kind_id"),
(assign, ":price_factor", 100),
(call_script, "script_get_trade_penalty", ":item_kind_id"),
(assign, ":trade_penalty", reg0),
(try_begin),
(is_between, "$g_encountered_party", centers_begin, centers_end),
(is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
(store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin),
(val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
(party_get_slot, ":price_factor", "$g_encountered_party", ":item_slot_no"),
(val_mul, ":price_factor", 100),#normalize price factor to range 0..100
(val_div, ":price_factor", average_price_factor),
(else_try),
#increase trade penalty while selling
(val_mul, ":trade_penalty", 4),
(try_end),
(store_add, ":penalty_divisor", 100, ":trade_penalty"),
(val_mul, ":price_factor", 100),
(val_div, ":price_factor", ":penalty_divisor"),
(assign, reg0, ":price_factor"),
(set_trigger_result, reg0),
]),
# script_get_trade_penalty
#
# Input:
# param1: troop_id,
# Output: reg0
("get_trade_penalty",
[
(store_script_param_1, ":item_kind_id"),
(assign, ":penalty",0),
(party_get_skill_level, ":trade_skill", "p_main_party", skl_trade),
(try_begin),
(is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
(assign, ":penalty",20),
(store_mul, ":skill_bonus", ":trade_skill", 1),
(val_sub, ":penalty", ":skill_bonus"),
(else_try),
(assign, ":penalty",100),
(store_mul, ":skill_bonus", ":trade_skill", 5),
(val_sub, ":penalty", ":skill_bonus"),
(try_end),
(assign, ":penalty_multiplier", 1000),
## # Apply penalty if player is hostile to merchants faction
## (store_relation, ":merchants_reln", "fac_merchants", "fac_player_supporters_faction"),
## (try_begin),
## (lt, ":merchants_reln", 0),
## (store_sub, ":merchants_reln_dif", 10, ":merchants_reln"),
## (store_mul, ":merchants_relation_penalty", ":merchants_reln_dif", 20),
## (val_add, ":penalty_multiplier", ":merchants_relation_penalty"),
## (try_end),
# Apply penalty if player is on bad terms with the town
(try_begin),
(is_between, "$g_encountered_party", centers_begin, centers_end),
(party_get_slot, ":center_relation", "$g_encountered_party", slot_center_player_relation),
(store_mul, ":center_relation_penalty", ":center_relation", -3),
(val_add, ":penalty_multiplier", ":center_relation_penalty"),
(try_begin),
(lt, ":center_relation", 0),
(store_sub, ":center_penalty_multiplier", 100, ":center_relation"),
(val_mul, ":penalty_multiplier", ":center_penalty_multiplier"),
(val_div, ":penalty_multiplier", 100),
(try_end),
(try_end),
# Apply penalty if player is on bad terms with the merchant (not currently used)
(call_script, "script_troop_get_player_relation", "$g_talk_troop"),
(assign, ":troop_reln", reg0),
#(troop_get_slot, ":troop_reln", "$g_talk_troop", slot_troop_player_relation),
(try_begin),
(lt, ":troop_reln", 0),
(store_sub, ":troop_reln_dif", 0, ":troop_reln"),
(store_mul, ":troop_relation_penalty", ":troop_reln_dif", 20),
(val_add, ":penalty_multiplier", ":troop_relation_penalty"),
(try_end),
(val_mul, ":penalty", ":penalty_multiplier"),
(val_div, ":penalty", 1000),
(val_max, ":penalty", 1),
(assign, reg0, ":penalty"),
]),
#script_game_event_buy_item:
# This script is called from the game engine when player buys an item.
# INPUT:
# param1: item_kind_id
("game_event_buy_item",
[
(store_script_param_1, ":item_kind_id"),
(store_script_param_2, ":reclaim_mode"),
(try_begin),
(is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
(store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin),
(val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
(party_get_slot, ":multiplier", "$g_encountered_party", ":item_slot_no"),
(try_begin),
(eq, ":reclaim_mode", 0),
(val_add, ":multiplier", 10),
(else_try),
(val_add, ":multiplier", 15),
(try_end),
(val_min, ":multiplier", maximum_price_factor),
(party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"),
(try_end),
]),
#script_game_event_sell_item:
# This script is called from the game engine when player sells an item.
# INPUT:
# param1: item_kind_id
("game_event_sell_item",
[
(store_script_param_1, ":item_kind_id"),
(store_script_param_2, ":return_mode"),
(try_begin),
(is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
(store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin),
(val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
(party_get_slot, ":multiplier", "$g_encountered_party", ":item_slot_no"),
(try_begin),
(eq, ":return_mode", 0),
(val_sub, ":multiplier", 15),
(else_try),
(val_sub, ":multiplier", 10),
(try_end),
(val_max, ":multiplier", minimum_price_factor),
(party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"),
(try_end),
]),
# script_game_get_troop_wage
# This script is called from the game engine for calculating troop wages.
# Input:
# param1: troop_id, param2: party-id
# Output: reg0: weekly wage
("game_get_troop_wage",
[
(store_script_param_1, ":troop_id"),
(store_script_param_2, ":unused"), #party id
(assign,":wage", 0),
(try_begin),
(this_or_next|eq, ":troop_id", "trp_player"),
(eq, ":troop_id", "trp_kidnapped_girl"),
(else_try),
(is_between, ":troop_id", pretenders_begin, pretenders_end),
(else_try),
(store_character_level, ":troop_level", ":troop_id"),
(assign, ":wage", ":troop_level"),
(val_add, ":wage", 3),
(val_mul, ":wage", ":wage"),
(val_div, ":wage", 25),
(try_end),
(try_begin), #mounted troops cost 65% more than the normal cost
(troop_is_mounted, ":troop_id"),
(val_mul, ":wage", 5),
(val_div, ":wage", 3),
(try_end),
(try_begin), #mercenaries cost %50 more than the normal cost
(is_between, ":troop_id", mercenary_troops_begin, mercenary_troops_end),
(val_mul, ":wage", 3),
(val_div, ":wage", 2),
(try_end),
(try_begin),
(is_between, ":troop_id", companions_begin, companions_end),
(val_mul, ":wage", 2),
(try_end),
(store_skill_level, ":leadership_level", "skl_leadership", "trp_player"),
(store_mul, ":leadership_bonus", 5, ":leadership_level"),
(store_sub, ":leadership_factor", 100, ":leadership_bonus"),
(val_mul, ":wage", ":leadership_factor"), #wage = wage * (100 - 5*leadership)/100
(val_div, ":wage", 100),
(try_begin),
(neq, ":troop_id", "trp_player"),
(neq, ":troop_id", "trp_kidnapped_girl"),
(neg|is_between, ":troop_id", pretenders_begin, pretenders_end),
(val_max, ":wage", 1),
(try_end),
(assign, reg0, ":wage"),
(set_trigger_result, reg0),
]),
# script_game_get_total_wage
# This script is called from the game engine for calculating total wage of the player party which is shown at the party window.
# Input: none
# Output: reg0: weekly wage
("game_get_total_wage",
[
(assign, ":total_wage", 0),
(party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "p_main_party", ":i_stack"),
(party_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
(call_script, "script_game_get_troop_wage", ":stack_troop", 0),
(val_mul, reg0, ":stack_size"),
(val_add, ":total_wage", reg0),
(try_end),
##############################
# Changed by Form Ranks kit
#
(party_get_num_attached_parties, ":array_num", "p_main_party"),
(try_for_range, ":side_array", 0, ":array_num"),
(party_get_attached_party_with_rank, ":array_party", "p_main_party", ":side_array"),
(party_get_num_companion_stacks, ":num_stacks", ":array_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", ":array_party", ":i_stack"),
(party_stack_get_size, ":stack_size", ":array_party", ":i_stack"),
(call_script, "script_game_get_troop_wage", ":stack_troop", 0),
(val_mul, reg0, ":stack_size"),
(val_add, ":total_wage", reg0),
(try_end),
(try_end),
#
# Change of Form Ranks kit end
################################
(assign, reg0, ":total_wage"),
(set_trigger_result, reg0),
]),
# script_game_get_join_cost
# This script is called from the game engine for calculating troop join cost.
# Input:
# param1: troop_id,
# Output: reg0: weekly wage
("game_get_join_cost",
[
(store_script_param_1, ":troop_id"),
(assign,":join_cost", 0),
(try_begin),
(troop_is_hero, ":troop_id"),
(else_try),
(store_character_level, ":troop_level", ":troop_id"),
(assign, ":join_cost", ":troop_level"),
(val_add, ":join_cost", 5),
(val_mul, ":join_cost", ":join_cost"),
(val_add, ":join_cost", 40),
(val_div, ":join_cost", 5),
(try_begin), #mounted troops cost %100 more than the normal cost
(troop_is_mounted, ":troop_id"),
(val_mul, ":join_cost", 2),
(try_end),
(try_end),
(assign, reg0, ":join_cost"),
(set_trigger_result, reg0),
]),
# script_game_get_prisoner_price
# This script is called from the game engine for calculating prisoner price
# Input:
# param1: troop_id,
# Output: reg0
("game_get_prisoner_price",
[
(store_script_param_1, ":troop_id"),
(assign, reg0, 50),
(try_begin),
(is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
(store_character_level, ":troop_level", ":troop_id"),
(assign, ":ransom_amount", ":troop_level"),
(val_add, ":ransom_amount", 10),
(val_mul, ":ransom_amount", ":ransom_amount"),
(val_div, ":ransom_amount", 6),
(try_end),
(set_trigger_result, reg0),
]),
# script_game_check_prisoner_can_be_sold
# This script is called from the game engine for checking if a given troop can be sold.
# Input:
# param1: troop_id,
# Output: reg0: 1= can be sold; 0= cannot be sold.
("game_check_prisoner_can_be_sold",
[
(store_script_param_1, ":troop_id"),
(assign, reg0, 0),
(try_begin),
(neg|troop_is_hero, ":troop_id"),
(assign, reg0, 1),
(try_end),
(set_trigger_result, reg0),
]),
#script_game_event_detect_party:
# This script is called from the game engine when player party inspects another party.
# INPUT:
# param1: Party-id
("game_event_detect_party",
[
(store_script_param_1, ":party_id"),
(try_begin),
(party_slot_eq, ":party_id", slot_party_type, spt_kingdom_hero_party),
(party_stack_get_troop_id, ":leader", ":party_id", 0),
(is_between, ":leader", kingdom_heroes_begin, kingdom_heroes_end),
(call_script, "script_update_troop_location_notes", ":leader", 0),
(else_try),
(is_between, ":party_id", walled_centers_begin, walled_centers_end),
(party_get_num_attached_parties, ":num_attached_parties", ":party_id"),
(try_for_range, ":attached_party_rank", 0, ":num_attached_parties"),
(party_get_attached_party_with_rank, ":attached_party", ":party_id", ":attached_party_rank"),
(party_stack_get_troop_id, ":leader", ":attached_party", 0),
(is_between, ":leader", kingdom_heroes_begin, kingdom_heroes_end),
(call_script, "script_update_troop_location_notes", ":leader", 0),
(try_end),
(try_end),
]),
#script_game_event_undetect_party:
# This script is called from the game engine when player party inspects another party.
# INPUT:
# param1: Party-id
("game_event_undetect_party",
[
(store_script_param_1, ":party_id"),
(try_begin),
(party_slot_eq, ":party_id", slot_party_type, spt_kingdom_hero_party),
(party_stack_get_troop_id, ":leader", ":party_id", 0),
(is_between, ":leader", kingdom_heroes_begin, kingdom_heroes_end),
(call_script, "script_update_troop_location_notes", ":leader", 0),
(try_end),
]),
#script_game_get_statistics_line:
# This script is called from the game engine when statistics page is opened.
# INPUT:
# param1: line_no
("game_get_statistics_line",
[
(store_script_param_1, ":line_no"),
(try_begin),
(eq, ":line_no", 0),
(get_player_agent_kill_count, reg1),
(str_store_string, s1, "str_number_of_troops_killed_reg1"),
(set_result_string, s1),
(else_try),
(eq, ":line_no", 1),
(get_player_agent_kill_count, reg1, 1),
(str_store_string, s1, "str_number_of_troops_wounded_reg1"),
(set_result_string, s1),
(else_try),
(eq, ":line_no", 2),
(get_player_agent_own_troop_kill_count, reg1),
(str_store_string, s1, "str_number_of_own_troops_killed_reg1"),
(set_result_string, s1),
(else_try),
(eq, ":line_no", 3),
(get_player_agent_own_troop_kill_count, reg1, 1),
(str_store_string, s1, "str_number_of_own_troops_wounded_reg1"),
(set_result_string, s1),
(try_end),
]),
#script_game_get_date_text:
# This script is called from the game engine when the date needs to be displayed.
# INPUT: arg1 = number of days passed since the beginning of the game
# OUTPUT: result string = date
("game_get_date_text",
[
(store_script_param_2, ":num_hours"),
(store_div, ":num_days", ":num_hours", 24),
(store_add, ":cur_day", ":num_days", 23),
(assign, ":cur_month", 3),
(assign, ":cur_year", 1257),
(assign, ":try_range", 99999),
(try_for_range, ":unused", 0, ":try_range"),
(try_begin),
(this_or_next|eq, ":cur_month", 1),
(this_or_next|eq, ":cur_month", 3),
(this_or_next|eq, ":cur_month", 5),
(this_or_next|eq, ":cur_month", 7),
(this_or_next|eq, ":cur_month", 8),
(this_or_next|eq, ":cur_month", 10),
(eq, ":cur_month", 12),
(assign, ":month_day_limit", 31),
(else_try),
(this_or_next|eq, ":cur_month", 4),
(this_or_next|eq, ":cur_month", 6),
(this_or_next|eq, ":cur_month", 9),
(eq, ":cur_month", 11),
(assign, ":month_day_limit", 30),
(else_try),
(try_begin),
(store_div, ":cur_year_div_4", ":cur_year", 4),
(val_mul, ":cur_year_div_4", 4),
(eq, ":cur_year_div_4", ":cur_year"),
(assign, ":month_day_limit", 29),
(else_try),
(assign, ":month_day_limit", 28),
(try_end),
(try_end),
(try_begin),
(gt, ":cur_day", ":month_day_limit"),
(val_sub, ":cur_day", ":month_day_limit"),
(val_add, ":cur_month", 1),
(try_begin),
(gt, ":cur_month", 12),
(val_sub, ":cur_month", 12),
(val_add, ":cur_year", 1),
(try_end),
(else_try),
(assign, ":try_range", 0),
(try_end),
(try_end),
(assign, reg1, ":cur_day"),
(assign, reg2, ":cur_year"),
(try_begin),
(eq, ":cur_month", 1),
(str_store_string, s1, "str_january_reg1_reg2"),
(else_try),
(eq, ":cur_month", 2),
(str_store_string, s1, "str_february_reg1_reg2"),
(else_try),
(eq, ":cur_month", 3),
(str_store_string, s1, "str_march_reg1_reg2"),
(else_try),
(eq, ":cur_month", 4),
(str_store_string, s1, "str_april_reg1_reg2"),
(else_try),
(eq, ":cur_month", 5),
(str_store_string, s1, "str_may_reg1_reg2"),
(else_try),
(eq, ":cur_month", 6),
(str_store_string, s1, "str_june_reg1_reg2"),
(else_try),
(eq, ":cur_month", 7),
(str_store_string, s1, "str_july_reg1_reg2"),
(else_try),
(eq, ":cur_month", 8),
(str_store_string, s1, "str_august_reg1_reg2"),
(else_try),
(eq, ":cur_month", 9),
(str_store_string, s1, "str_september_reg1_reg2"),
(else_try),
(eq, ":cur_month", 10),
(str_store_string, s1, "str_october_reg1_reg2"),
(else_try),
(eq, ":cur_month", 11),
(str_store_string, s1, "str_november_reg1_reg2"),
(else_try),
(eq, ":cur_month", 12),
(str_store_string, s1, "str_december_reg1_reg2"),
(try_end),
(set_result_string, s1),
]),
#script_game_get_money_text:
# This script is called from the game engine when an amount of money needs to be displayed.
# INPUT: arg1 = amount in units
# OUTPUT: result string = money in text
("game_get_money_text",
[
(store_script_param_1, ":amount"),
(try_begin),
(eq, ":amount", 1),
(str_store_string, s1, "str_1_denar"),
(else_try),
(assign, reg1, ":amount"),
(str_store_string, s1, "str_reg1_denars"),
(try_end),
(set_result_string, s1),
]),
#script_game_get_party_companion_limit:
# This script is called from the game engine when the companion limit is needed for a party.
# INPUT: arg1 = none
# OUTPUT: reg0 = companion_limit
("game_get_party_companion_limit",
[
(assign, ":troop_no", "trp_player"),
(assign, ":limit", 10),
(store_skill_level, ":skill", "skl_leadership", ":troop_no"),
(store_attribute_level, ":charisma", ":troop_no", ca_charisma),
(val_mul, ":skill", 5),
(val_add, ":limit", ":skill"),
(val_add, ":limit", ":charisma"),
(troop_get_slot, ":troop_renown", ":troop_no", slot_troop_renown),
(store_div, ":renown_bonus", ":troop_renown", 80), # Modified by Form Ranks kit,
# to ensure the whole player party (including arrays) dont exceed the original limit
(val_add, ":limit", ":renown_bonus"),
(assign, reg0, ":limit"),
(set_trigger_result, reg0),
]),
#script_game_reset_player_party_name:
# This script is called from the game engine when the player name is changed.
# INPUT: none
# OUTPUT: none
("game_reset_player_party_name",
[(str_store_troop_name, s5, "trp_player"),
(party_set_name, "p_main_party", s5),
]),
# script_party_get_ideal_size @used for NPC parties.
# Input: arg1 = party_no
# Output: reg0: ideal size
("party_get_ideal_size",
[
(store_script_param_1, ":party_no"),
(assign, ":limit", 30),
(try_begin),
(party_slot_eq, ":party_no", slot_party_type, spt_kingdom_hero_party),
(party_stack_get_troop_id, ":party_leader", ":party_no", 0),
(store_faction_of_party, ":faction_id", ":party_no"),
(assign, ":limit", 10),
(store_skill_level, ":skill", "skl_leadership", ":party_leader"),
(store_attribute_level, ":charisma", ":party_leader", ca_charisma),
(val_mul, ":skill", 5),
(val_add, ":limit", ":skill"),
(val_add, ":limit", ":charisma"),
(troop_get_slot, ":troop_renown", ":party_leader", slot_troop_renown),
(store_div, ":renown_bonus", ":troop_renown", 25),
(val_add, ":limit", ":renown_bonus"),
(try_begin),
(faction_slot_eq, ":faction_id", slot_faction_leader, ":party_leader"),
(val_add, ":limit", 100),
(try_end),
(try_end),
(store_character_level, ":level", "trp_player"), #increase limits a little bit as the game progresses.
(store_add, ":level_factor", 90, ":level"),
(val_mul, ":limit", ":level_factor"),
(val_div, ":limit", 90),
(assign, reg0, ":limit"),
]),
#script_game_get_party_prisoner_limit:
# This script is called from the game engine when the prisoner limit is needed for a party.
# INPUT: arg1 = party_no
# OUTPUT: reg0 = prisoner_limit
("game_get_party_prisoner_limit",
[
# (store_script_param_1, ":party_no"),
(assign, ":troop_no", "trp_player"),
(assign, ":limit", 0),
(store_skill_level, ":skill", "skl_prisoner_management", ":troop_no"),
(store_mul, ":limit", ":skill", 5),
(assign, reg0, ":limit"),
(set_trigger_result, reg0),
]),
#script_game_get_item_extra_text:
# This script is called from the game engine when an item's properties are displayed.
# INPUT: arg1 = item_no, arg2 = extra_text_id (this can be between 0-7 (7 included)), arg3 = item_modifier
# OUTPUT: result_string = item extra text, trigger_result = text color (0 for default)
("game_get_item_extra_text",
[
(store_script_param, ":item_no", 1),
(store_script_param, ":extra_text_id", 2),
(store_script_param, ":item_modifier", 3),
(try_begin),
(is_between, ":item_no", food_begin, food_end),
(try_begin),
(eq, ":extra_text_id", 0),
(assign, ":continue", 1),
(try_begin),
(eq, ":item_no", "itm_cattle_meat"),
(eq, ":item_modifier", imod_rotten),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(item_get_slot, ":food_bonus", ":item_no", slot_item_food_bonus),
(assign, reg1, ":food_bonus"),
(set_result_string, "@+{reg1} to party morale"),
(set_trigger_result, 0x4444FF),
(try_end),
(else_try),
(is_between, ":item_no", readable_books_begin, readable_books_end),
(try_begin),
(eq, ":extra_text_id", 0),
(item_get_slot, reg1, ":item_no", slot_item_intelligence_requirement),
(set_result_string, "@Requires {reg1} intelligence to read"),
(set_trigger_result, 0xFFEEDD),
(else_try),
(eq, ":extra_text_id", 1),
(item_get_slot, ":progress", ":item_no", slot_item_book_reading_progress),
(val_div, ":progress", 10),
(assign, reg1, ":progress"),
(set_result_string, "@Reading Progress: {reg1}%"),
(set_trigger_result, 0xFFEEDD),
(try_end),
(else_try),
(is_between, ":item_no", reference_books_begin, reference_books_end),
(try_begin),
(eq, ":extra_text_id", 0),
(try_begin),
(eq, ":item_no", "itm_book_wound_treatment_reference"),
(str_store_string, s1, "@wound treament"),
(else_try),
(eq, ":item_no", "itm_book_training_reference"),
(str_store_string, s1, "@trainer"),
(else_try),
(eq, ":item_no", "itm_book_surgery_reference"),
(str_store_string, s1, "@surgery"),
(try_end),
(set_result_string, "@+1 to {s1} while in inventory"),
(set_trigger_result, 0xFFEEDD),
(try_end),
(try_end),
]),
#script_game_on_disembark:
# This script is called from the game engine when the player reaches the shore with a ship.
# INPUT: pos0 = disembark position
# OUTPUT: none
("game_on_disembark",
[(jump_to_menu, "mnu_disembark"),
]),
#script_game_context_menu_get_buttons:
# This script is called from the game engine when the player clicks the right mouse button over a party on the map.
# INPUT: arg1 = party_no
# OUTPUT: none, fills the menu buttons
("game_context_menu_get_buttons",
[(store_script_param, ":party_no", 1),
(try_begin),
(neq, ":party_no", "p_main_party"),
(context_menu_add_item, "@Move here", cmenu_move),
(try_end),
(try_begin),
(is_between, ":party_no", centers_begin, centers_end),
(context_menu_add_item, "@View notes", 1),
(else_try),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", 0),
(party_stack_get_troop_id, ":troop_no", ":party_no", 0),
(is_between, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(context_menu_add_item, "@View notes", 2),
(try_end),
]),
#script_game_event_context_menu_button_clicked:
# This script is called from the game engine when the player clicks on a button at the right mouse menu.
# INPUT: arg1 = party_no, arg2 = button_value
# OUTPUT: none
("game_event_context_menu_button_clicked",
[(store_script_param, ":party_no", 1),
(store_script_param, ":button_value", 2),
(try_begin),
(eq, ":button_value", 1),
(change_screen_notes, 3, ":party_no"),
(else_try),
(eq, ":button_value", 2),
(party_stack_get_troop_id, ":troop_no", ":party_no", 0),
(change_screen_notes, 1, ":troop_no"),
(try_end),
]),
#script_game_get_skill_modifier_for_troop
# This script is called from the game engine when a skill's modifiers are needed
# INPUT: arg1 = troop_no, arg2 = skill_no
# OUTPUT: trigger_result = modifier_value
("game_get_skill_modifier_for_troop",
[(store_script_param, ":troop_no", 1),
(store_script_param, ":skill_no", 2),
(assign, ":modifier_value", 0),
(try_begin),
(eq, ":skill_no", "skl_wound_treatment"),
(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_wound_treatment_reference"),
(gt, reg0, 0),
(val_add, ":modifier_value", 1),
(else_try),
(eq, ":skill_no", "skl_trainer"),
(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"),
(gt, reg0, 0),
(val_add, ":modifier_value", 1),
(else_try),
(eq, ":skill_no", "skl_surgery"),
(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"),
(gt, reg0, 0),
(val_add, ":modifier_value", 1),
(else_try),
(eq, ":skill_no", "skl_athletics"),
(eq, ":troop_no", "trp_player"),
(store_party_size, ":num", "p_main_party"),
(val_div, ":num", 10),
(val_add, ":modifier_value", ":num"),
(try_end),
(set_trigger_result, ":modifier_value"),
]),
# Note to modders: Uncomment these if you'd like to use the following.
## #script_game_check_party_sees_party
## # This script is called from the game engine when a party is inside the range of another party
## # INPUT: arg1 = party_no_seer, arg2 = party_no_seen
## # OUTPUT: trigger_result = true or false (1 = true, 0 = false)
## ("game_check_party_sees_party",
## [
## (store_script_param, ":party_no_seer", 1),
## (store_script_param, ":party_no_seen", 2),
## (set_trigger_result, 1),
## ]),
##
## #script_game_get_party_speed_multiplier
## # This script is called from the game engine when a skill's modifiers are needed
## # INPUT: arg1 = party_no
## # OUTPUT: trigger_result = multiplier (scaled by 100, meaning that giving 100 as the trigger result does not change the party speed)
## ("game_get_party_speed_multiplier",
## [
## (store_script_param, ":party_no", 1),
## (set_trigger_result, 100),
## ]),
# script_npc_get_troop_wage
# This script is called from module system to calculate troop wages for npc parties.
# Input:
# param1: troop_id
# Output: reg0: weekly wage
("npc_get_troop_wage",
[
(store_script_param_1, ":troop_id"),
(assign,":wage", 0),
(try_begin),
(troop_is_hero, ":troop_id"),
(else_try),
(store_character_level, ":wage", ":troop_id"),
(val_mul, ":wage", ":wage"),
(val_add, ":wage", 50),
(val_div, ":wage", 30),
(troop_is_mounted, ":troop_id"),
(val_mul, ":wage", 5),
(val_div, ":wage", 4),
(try_end),
(assign, reg0, ":wage"),
]),
#script_setup_talk_info
# INPUT: $g_talk_troop, $g_talk_troop_relation
("setup_talk_info",
[
(talk_info_set_relation_bar, "$g_talk_troop_relation"),
(str_store_troop_name, s61, "$g_talk_troop"),
(str_store_string, s61, "@ {s61}"),
(assign, reg1, "$g_talk_troop_relation"),
(str_store_string, s62, "str_relation_reg1"),
(talk_info_set_line, 0, s61),
(talk_info_set_line, 1, s62),
(call_script, "script_describe_relation_to_s63", "$g_talk_troop_relation"),
(talk_info_set_line, 3, s63),
]),
#NPC companion changes begin
#script_setup_talk_info_companions
("setup_talk_info_companions",
[
(call_script, "script_npc_morale", "$g_talk_troop"),
(assign, ":troop_morale", reg0),
(talk_info_set_relation_bar, ":troop_morale"),
(str_store_troop_name, s61, "$g_talk_troop"),
(str_store_string, s61, "@ {s61}"),
(assign, reg1, ":troop_morale"),
(str_store_string, s62, "str_morale_reg1"),
(talk_info_set_line, 0, s61),
(talk_info_set_line, 1, s62),
(talk_info_set_line, 3, s63),
]),
#NPC companion changes end
#script_update_party_creation_random_limits
# INPUT: none
("update_party_creation_random_limits",
[
(store_character_level, ":player_level", "trp_player"),
(store_mul, ":upper_limit", ":player_level", 3),
(val_add, ":upper_limit", 25),
(val_min, ":upper_limit", 100),
(set_party_creation_random_limits, 0, ":upper_limit"),
(assign, reg0, ":upper_limit"),
]),
#script_set_trade_route_between_centers
# INPUT:
# param1: center_no_1
# param1: center_no_2
("set_trade_route_between_centers",
[(store_script_param, ":center_no_1", 1),
(store_script_param, ":center_no_2", 2),
(assign, ":center_1_added", 0),
(assign, ":center_2_added", 0),
(try_for_range, ":cur_slot", slot_town_trade_routes_begin, slot_town_trade_routes_end),
(try_begin),
(eq, ":center_1_added", 0),
(party_slot_eq, ":center_no_1", ":cur_slot", 0),
(party_set_slot, ":center_no_1", ":cur_slot", ":center_no_2"),
(assign, ":center_1_added", 1),
(try_end),
(try_begin),
(eq, ":center_2_added", 0),
(party_slot_eq, ":center_no_2", ":cur_slot", 0),
(party_set_slot, ":center_no_2", ":cur_slot", ":center_no_1"),
(assign, ":center_2_added", 1),
(try_end),
(try_end),
(try_begin),
(eq, ":center_1_added", 0),
(str_store_party_name, s1, ":center_no_1"),
(display_message, "@ERROR: More than 15 trade routes are given for {s1}."),
(try_end),
(try_begin),
(eq, ":center_2_added", 0),
(str_store_party_name, s1, ":center_no_2"),
(display_message, "@ERROR: More than 15 trade routes are given for {s1}."),
(try_end),
]),
#script_center_change_trade_good_production
# INPUT:
# param1: center_no
# param2: item_id
# param3: production_rate (should be between -100 (for net consumption) and 100 (for net production)
# param4: randomness (between 0-100)
("center_change_trade_good_production",
[
(store_script_param, ":center_no", 1),
(store_script_param, ":item_no", 2),
(store_script_param, ":production_rate", 3),
# (val_mul, ":production_rate", 5),
(store_script_param, ":randomness", 4),
(store_random_in_range, ":random_num", 0, ":randomness"),
(store_random_in_range, ":random_sign", 0, 2),
(try_begin),
(eq, ":random_sign", 0),
(val_add, ":production_rate", ":random_num"),
(else_try),
(val_sub, ":production_rate", ":random_num"),
(try_end),
(val_sub, ":item_no", trade_goods_begin),
(val_add, ":item_no", slot_town_trade_good_productions_begin),
(party_get_slot, ":old_production_rate", ":center_no", ":item_no"),
(val_add, ":production_rate", ":old_production_rate"),
(party_set_slot, ":center_no", ":item_no", ":production_rate"),
]),
#script_average_trade_good_productions
# INPUT: none
("average_trade_good_productions",
[
(store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin),
# (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
(try_for_range, ":center_no", towns_begin, towns_end),
(this_or_next|is_between, ":center_no", towns_begin, towns_end),
(is_between, ":center_no", villages_begin, villages_end),
(try_for_range, ":other_center", centers_begin, centers_end),
(this_or_next|is_between, ":center_no", towns_begin, towns_end),
(is_between, ":center_no", villages_begin, villages_end),
(neq, ":other_center", ":center_no"),
(store_distance_to_party_from_party, ":cur_distance", ":center_no", ":other_center"),
(lt, ":cur_distance", 110),
(store_sub, ":dist_factor", 110, ":cur_distance"),
(try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
(store_add, ":cur_good_slot", ":cur_good", ":item_to_slot"),
(party_get_slot, ":center_production", ":center_no", ":cur_good_slot"),
(party_get_slot, ":other_center_production", ":other_center", ":cur_good_slot"),
(store_sub, ":prod_dif", ":center_production", ":other_center_production"),
(gt, ":prod_dif", 0),
(store_mul, ":prod_dif_change", ":prod_dif", 1),
## (try_begin),
## (is_between, ":center_no", towns_begin, towns_end),
## (is_between, ":other_center", towns_begin, towns_end),
## (val_mul, ":cur_distance", 2),
## (try_end),
(val_mul ,":prod_dif_change", ":dist_factor"),
(val_div ,":prod_dif_change", 110),
(val_add, ":other_center_production", ":prod_dif_change"),
(party_set_slot, ":other_center", ":cur_good_slot", ":other_center_production"),
(try_end),
(try_end),
(try_end),
]),
#script_normalize_trade_good_productions
# INPUT: none
("normalize_trade_good_productions",
[
(store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin),
(try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
(assign, ":total_production", 0),
(assign, ":num_centers", 0),
(store_add, ":cur_good_slot", ":cur_good", ":item_to_slot"),
(try_for_range, ":center_no", centers_begin, centers_end),
(val_add, ":num_centers", 1),
(try_begin),
(is_between, ":center_no", towns_begin, towns_end), #each town is weighted as 5 villages...
(val_add, ":num_centers", 4),
(try_end),
(party_get_slot, ":center_production", ":center_no", ":cur_good_slot"),
(val_add, ":total_production", ":center_production"),
(try_end),
(store_div, ":new_production_difference", ":total_production", ":num_centers"),
(neq, ":new_production_difference", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(this_or_next|is_between, ":center_no", towns_begin, towns_end),
(is_between, ":center_no", villages_begin, villages_end),
(party_get_slot, ":center_production", ":center_no", ":cur_good_slot"),
(val_sub, ":center_production", ":new_production_difference"),
(party_set_slot, ":center_no", ":cur_good_slot", ":center_production"),
(try_end),
(try_end),
]),
#script_update_trade_good_prices
# INPUT: none
("update_trade_good_prices",
[
(try_for_range, ":center_no", centers_begin, centers_end),
(this_or_next|is_between, ":center_no", towns_begin, towns_end),
(is_between, ":center_no", villages_begin, villages_end),
(call_script, "script_update_trade_good_price_for_party", ":center_no"),
(try_end),
# (call_script, "script_update_trade_good_price_for_party", "p_zendar"),
# (call_script, "script_update_trade_good_price_for_party", "p_salt_mine"),
# (call_script, "script_update_trade_good_price_for_party", "p_four_ways_inn"),
]),
#script_update_trade_good_price_for_party
# INPUT: arg1 = party_no
("update_trade_good_price_for_party",
[
(store_script_param, ":center_no", 1),
(try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
(store_sub, ":cur_good_slot", ":cur_good", trade_goods_begin),
(val_add, ":cur_good_slot", slot_town_trade_good_productions_begin),
(store_sub, ":cur_good_price_slot", ":cur_good", trade_goods_begin),
(val_add, ":cur_good_price_slot", slot_town_trade_good_prices_begin),
(party_get_slot, ":production", ":center_no", ":cur_good_slot"),
(party_get_slot, ":cur_price", ":center_no", ":cur_good_price_slot"),
(try_begin),
(lt, ":production", 0), #demand is greater than supply
(store_mul, ":change_factor", ":production", -3), #price will be increased by his factor
(else_try),
(store_mul, ":change_factor", ":production", 3), #price will be decreased by this factor
(try_end),
# (val_mul, ":change_factor", 2),
(store_random_in_range, ":random_change", 0, ":change_factor"),
(try_begin),
(lt, ":production", 0), #demand is greater than supply
(val_add, ":cur_price", ":random_change"),
(else_try),
(val_sub, ":cur_price", ":random_change"),
(try_end),
#Move price towards average by 2%...
(store_sub, ":price_difference", ":cur_price", average_price_factor),
(val_mul, ":price_difference", 97),
(val_div, ":price_difference", 100),
(store_add, ":new_price", average_price_factor, ":price_difference"),
(val_clamp, ":new_price", minimum_price_factor, maximum_price_factor),
(party_set_slot, ":center_no", ":cur_good_price_slot", ":new_price"),
(try_end),
]),
#script_do_merchant_town_trade
# INPUT: arg1 = party_no (of the merchant), arg2 = center_no
("do_merchant_town_trade",
[
(store_script_param_1, ":party_no"),
(store_script_param_2, ":center_no"),
(call_script, "script_do_party_center_trade", ":party_no", ":center_no", 20), #change prices by 20%
(assign, ":total_change", reg0),
#Adding the earnings to the wealth (maximum changed price is the earning)
(val_div, ":total_change", 2),
(str_store_party_name, s1, ":party_no"),
(str_store_party_name, s2, ":center_no"),
(assign, reg1, ":total_change"),
## (try_begin),
## (eq, "$cheat_mode", 1),
## (display_message, "@Merchant {s1} traded with {s2} and earned {reg1} denars."),
## (try_end),
#Adding tax revenue to the center
(party_get_slot, ":accumulated_tariffs", ":center_no", slot_center_accumulated_tariffs),
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(store_add, ":tax_gain", ":prosperity", 10),
(val_mul, ":tax_gain", ":total_change"),
(val_div, ":tax_gain", 2200), #(10 + prosperity) / 110 * 5% of the merchant's revenue.
(val_add, ":accumulated_tariffs", ":tax_gain"),
(party_set_slot, ":center_no", slot_center_accumulated_tariffs, ":accumulated_tariffs"),
# (try_begin),
# (is_between, ":center_no", towns_begin, towns_end),
# (party_get_slot, ":merchant",":center_no",slot_town_merchant),
# (gt, ":merchant", 0),
# (store_mul, ":merchant_profit", ":total_change", 1),
# (val_div, ":merchant_profit", 2),
# (troop_add_gold, ":merchant", ":merchant_profit"),
# (try_end),
#Adding 1 to center prosperity
(try_begin),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 35),
(call_script, "script_change_center_prosperity", ":center_no", 1),
(try_end),
]),
#script_party_calculate_regular_strength:
# INPUT:
# param1: Party-id
("party_calculate_regular_strength",
[
(store_script_param_1, ":party"), #Party_id
(assign, reg(0),0),
(party_get_num_companion_stacks, ":num_stacks",":party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(store_character_level, ":stack_strength", ":stack_troop"),
(val_add, ":stack_strength", 12),
(val_mul, ":stack_strength", ":stack_strength"),
(val_div, ":stack_strength", 100),
(party_stack_get_size, ":stack_size",":party",":i_stack"),
(party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"),
(val_sub, ":stack_size", ":num_wounded"),
(val_mul, ":stack_strength", ":stack_size"),
(val_add,reg(0), ":stack_strength"),
(try_end),
]),
#script_party_calculate_strength:
# INPUT: arg1 = party_id, arg2 = exclude leader
# OUTPUT: reg0 = strength
("party_calculate_strength",
[
(store_script_param_1, ":party"), #Party_id
(store_script_param_2, ":exclude_leader"), #Party_id
(assign, reg(0),0),
(party_get_num_companion_stacks, ":num_stacks",":party"),
(assign, ":first_stack", 0),
(try_begin),
(neq, ":exclude_leader", 0),
(assign, ":first_stack", 1),
(try_end),
(try_for_range, ":i_stack", ":first_stack", ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
(store_character_level, ":stack_strength", ":stack_troop"),
(val_add, ":stack_strength", 12),
(val_mul, ":stack_strength", ":stack_strength"),
(val_div, ":stack_strength", 100),
(try_begin),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size",":party",":i_stack"),
(party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"),
(val_sub, ":stack_size", ":num_wounded"),
(val_mul, ":stack_strength", ":stack_size"),
(else_try),
(troop_is_wounded, ":stack_troop"), #hero...
(assign,":stack_strength",0),
(try_end),
(val_add,reg(0), ":stack_strength"),
(try_end),
(party_set_slot, ":party", slot_party_cached_strength, reg(0)),
]),
#script_loot_player_items:
# INPUT: arg1 = enemy_party_no
# Output: none
("loot_player_items",
[
(store_script_param, ":enemy_party_no", 1),
(troop_get_inventory_capacity, ":inv_cap", "trp_player"),
(try_for_range, ":i_slot", 0, ":inv_cap"),
(troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
(ge, ":item_id", 0),
(troop_get_inventory_slot_modifier, ":item_modifier", "trp_player", ":i_slot"),
(try_begin),
(is_between, ":item_id", trade_goods_begin, trade_goods_end),
(assign, ":randomness", 20),
(else_try),
(is_between, ":item_id", horses_begin, horses_end),
(assign, ":randomness", 15),
(else_try),
(this_or_next|is_between, ":item_id", weapons_begin, weapons_end),
(is_between, ":item_id", ranged_weapons_begin, ranged_weapons_end),
(assign, ":randomness", 5),
(else_try),
(this_or_next|is_between, ":item_id", armors_begin, armors_end),
(is_between, ":item_id", shields_begin, shields_end),
(assign, ":randomness", 5),
(try_end),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":randomness"),
(troop_remove_item, "trp_player", ":item_id"),
(try_begin),
(gt, ":enemy_party_no", 0),
(party_get_slot, ":cur_loot_slot", ":enemy_party_no", slot_party_next_looted_item_slot),
(val_add, ":cur_loot_slot", slot_party_looted_item_1),
(party_set_slot, ":enemy_party_no", ":cur_loot_slot", ":item_id"),
(val_sub, ":cur_loot_slot", slot_party_looted_item_1),
(val_add, ":cur_loot_slot", slot_party_looted_item_1_modifier),
(party_set_slot, ":enemy_party_no", ":cur_loot_slot", ":item_modifier"),
(val_sub, ":cur_loot_slot", slot_party_looted_item_1_modifier),
(val_add, ":cur_loot_slot", 1),
(val_mod, ":cur_loot_slot", num_party_loot_slots),
(party_set_slot, ":enemy_party_no", slot_party_next_looted_item_slot, ":cur_loot_slot"),
(try_end),
(try_end),
(store_troop_gold, ":cur_gold", "trp_player"),
(store_div, ":max_lost", ":cur_gold", 4),
(store_div, ":min_lost", ":cur_gold", 10),
(store_random_in_range, ":lost_gold", ":min_lost", ":max_lost"),
(troop_remove_gold, "trp_player", ":lost_gold"),
]),
#script_party_calculate_loot:
# INPUT:
# param1: Party-id
# Returns num looted items in reg(0)
("party_calculate_loot",
[
(store_script_param_1, ":enemy_party"), #Enemy Party_id
(call_script, "script_calculate_main_party_shares"),
(assign, ":num_player_party_shares", reg0),
# (assign, ":num_ally_shares", reg1),
# (store_add, ":num_shares", ":num_player_party_shares", ":num_ally_shares"),
#Calculate player loot probability
# (assign, ":loot_probability", 100),
# (val_mul, ":loot_probability", 10),
# (val_div, ":loot_probability", ":num_shares"),
(try_for_range, ":i_loot", 0, num_party_loot_slots),
(store_add, ":cur_loot_slot", ":i_loot", slot_party_looted_item_1),
(party_get_slot, ":item_no", "$g_enemy_party", ":cur_loot_slot"),
(gt, ":item_no", 0),
(party_set_slot, "$g_enemy_party", ":cur_loot_slot", 0),
(val_sub, ":cur_loot_slot", slot_party_looted_item_1),
(val_add, ":cur_loot_slot", slot_party_looted_item_1_modifier),
(party_get_slot, ":item_modifier", "$g_enemy_party", ":cur_loot_slot"),
(troop_add_item, "trp_temp_troop", ":item_no", ":item_modifier"),
(try_end),
(party_set_slot, "$g_enemy_party", slot_party_next_looted_item_slot, 0),
(assign, ":num_looted_items",0),
(try_begin),
(this_or_next|party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_caravan),
(party_slot_eq, "$g_enemy_party", slot_party_type, spt_village_farmer),
(store_mul, ":plunder_amount", player_loot_share, 30),
(val_mul, ":plunder_amount", "$g_strength_contribution_of_player"),
(val_div, ":plunder_amount", 100),
(val_div, ":plunder_amount", ":num_player_party_shares"),
(try_begin),
(party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_caravan),
# (val_clamp, ":plunder_amount", 1, 50),
(reset_item_probabilities, 100),
(assign, ":range_min", trade_goods_begin),
(assign, ":range_max", trade_goods_end),
(else_try),
(val_div, ":plunder_amount", 5),
# (val_clamp, ":plunder_amount", 1, 10),
(reset_item_probabilities, 1),
(assign, ":range_min", food_begin),
(assign, ":range_max", food_end),
(try_end),
(store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
(try_for_range, ":cur_goods", ":range_min", ":range_max"),
(store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
(party_get_slot, ":cur_price", "$g_enemy_party", ":cur_price_slot"),
(assign, ":cur_probability", 100),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(assign, reg0, ":cur_probability"),
(set_item_probability_in_merchandise, ":cur_goods", ":cur_probability"),
(try_end),
(troop_add_merchandise, "trp_temp_troop", itp_type_goods, ":plunder_amount"),
(assign, reg5, ":plunder_amount"),
(val_add, ":num_looted_items", ":plunder_amount"),
(try_end),
#Now loot the defeated party
(store_mul, ":loot_probability", player_loot_share, 3),
(val_mul, ":loot_probability", "$g_strength_contribution_of_player"),
(party_get_skill_level, ":player_party_looting", "p_main_party", "skl_looting"),
(val_add, ":player_party_looting", 10),
(val_mul, ":loot_probability", ":player_party_looting"),
(val_div, ":loot_probability", 10),
(val_div, ":loot_probability", ":num_player_party_shares"),
(party_get_num_companion_stacks, ":num_stacks",":enemy_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":enemy_party",":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size",":enemy_party",":i_stack"),
(try_for_range, ":unused", 0, ":stack_size"),
(troop_loot_troop,"trp_temp_troop",":stack_troop",":loot_probability"),
(try_end),
(try_end),
(troop_get_inventory_capacity, ":inv_cap", "trp_temp_troop"),
(try_for_range, ":i_slot", 0, ":inv_cap"),
(troop_get_inventory_slot, ":item_id", "trp_temp_troop", ":i_slot"),
(ge, ":item_id", 0),
(val_add, ":num_looted_items",1),
(try_end),
(assign, reg0, ":num_looted_items"),
]),
#script_calculate_main_party_shares:
# INPUT:
# Returns number of player party shares in reg0
("calculate_main_party_shares",
[
(assign, ":num_player_party_shares",player_loot_share),
# Add shares for player's party
(party_get_num_companion_stacks, ":num_stacks","p_main_party"),
(try_for_range, ":i_stack", 1, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
(try_begin),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size","p_main_party",":i_stack"),
(val_add, ":num_player_party_shares", ":stack_size"),
(else_try),
(val_add, ":num_player_party_shares", hero_loot_share),
(try_end),
(try_end),
(assign, reg0, ":num_player_party_shares"),
]),
#script_party_give_xp_and_gold:
# INPUT:
# param1: destroyed Party-id
# calculates and gives player paty's share of gold and xp.
("party_give_xp_and_gold",
[
(store_script_param_1, ":enemy_party"), #Party_id
(call_script, "script_calculate_main_party_shares"),
(assign, ":num_player_party_shares", reg0),
# (assign, ":num_ally_shares", reg1),
# (store_add, ":num_total_shares", ":num_player_party_shares", ":num_ally_shares"),
(assign, ":total_gain", 0),
(party_get_num_companion_stacks, ":num_stacks",":enemy_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":enemy_party",":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size",":enemy_party",":i_stack"),
(store_character_level, ":level", ":stack_troop"),
(store_add, ":gain", ":level", 10),
(val_mul, ":gain", ":gain"),
(val_div, ":gain", 10),
(store_mul, ":stack_gain", ":gain", ":stack_size"),
(val_add, ":total_gain", ":stack_gain"),
(try_end),
(val_mul, ":total_gain", "$g_strength_contribution_of_player"),
(val_div, ":total_gain", 100),
(val_min, ":total_gain", 40000), #eliminate negative results
# (store_mul, ":player_party_xp_gain", ":total_gain", ":num_player_party_shares"),
# (val_div, ":player_party_xp_gain", ":num_total_shares"),
(assign, ":player_party_xp_gain", ":total_gain"),
(store_random_in_range, ":r", 50, 100),
(val_mul, ":player_party_xp_gain", ":r"),
(val_div, ":player_party_xp_gain", 100),
(party_add_xp, "p_main_party", ":player_party_xp_gain"),
(store_mul, ":player_gold_gain", ":total_gain", player_loot_share),
(val_min, ":player_gold_gain", 60000), #eliminate negative results
(store_random_in_range, ":r", 50, 100),
(val_mul, ":player_gold_gain", ":r"),
(val_div, ":player_gold_gain", 100),
(val_div, ":player_gold_gain", ":num_player_party_shares"),
#add gold now
(party_get_num_companion_stacks, ":num_stacks","p_main_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
(try_begin),
(troop_is_hero, ":stack_troop"),
(call_script, "script_troop_add_gold", ":stack_troop", ":player_gold_gain"),
(try_end),
(try_end),
#Add morale
(assign, ":morale_gain", ":total_gain"),
(val_div, ":morale_gain", ":num_player_party_shares"),
(call_script, "script_change_player_party_morale", ":morale_gain"),
]),
#script_setup_troop_meeting:
# INPUT:
# param1: troop_id with which meeting will be made.
# param2: troop_dna (optional)
("setup_troop_meeting",
[
(store_script_param_1, ":meeting_troop"),
(store_script_param_2, ":troop_dna"),
(modify_visitors_at_site,"scn_conversation_scene"),(reset_visitors),
(set_visitor,0,"trp_player"),
# (party_stack_get_troop_dna,":troop_dna",":meeting_party",0),
(set_visitor,17,":meeting_troop",":troop_dna"),
(set_jump_mission,"mt_conversation_encounter"),
(jump_to_scene,"scn_conversation_scene"),
(change_screen_map_conversation, ":meeting_troop"),
]),
#script_setup_party_meeting:
# INPUT:
# param1: Party-id with which meeting will be made.
("setup_party_meeting",
[
(store_script_param_1, ":meeting_party"),
(try_begin),
(lt, "$g_encountered_party_relation", 0), #hostile
# (call_script, "script_music_set_situation_with_culture", mtf_sit_encounter_hostile),
(try_end),
(modify_visitors_at_site,"scn_conversation_scene"),(reset_visitors),
(set_visitor,0,"trp_player"),
(party_stack_get_troop_id, ":meeting_troop",":meeting_party",0),
(party_stack_get_troop_dna,":troop_dna",":meeting_party",0),
(set_visitor,17,":meeting_troop",":troop_dna"),
(set_jump_mission,"mt_conversation_encounter"),
(jump_to_scene,"scn_conversation_scene"),
(change_screen_map_conversation, ":meeting_troop"),
]),
#script_party_remove_all_companions:
# INPUT:
# param1: Party-id from which companions will be removed.
# "$g_move_heroes" : controls if heroes will also be removed.
("party_remove_all_companions",
[
(store_script_param_1, ":party"), #Source Party_id
(party_get_num_companion_stacks, ":num_companion_stacks",":party"),
(try_for_range_backwards, ":stack_no", 0, ":num_companion_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party",":stack_no"),
(this_or_next|neg|troop_is_hero, ":stack_troop"),
(eq, "$g_move_heroes", 1),
(party_stack_get_size, ":stack_size",":party",":stack_no"),
(party_remove_members, ":party", ":stack_troop", ":stack_size"),
(try_end),
]),
#script_party_remove_all_prisoners:
# INPUT:
# param1: Party-id from which prisoners will be removed.
# "$g_move_heroes" : controls if heroes will also be removed.
("party_remove_all_prisoners",
[
(store_script_param_1, ":party"), #Source Party_id
(party_get_num_prisoner_stacks, ":num_prisoner_stacks",":party"),
(try_for_range_backwards, ":stack_no", 0, ":num_prisoner_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop",":party",":stack_no"),
(this_or_next|neg|troop_is_hero, ":stack_troop"),
(eq, "$g_move_heroes", 1),
(party_prisoner_stack_get_size, ":stack_size",":party",":stack_no"),
(party_remove_prisoners, ":party", ":stack_troop", ":stack_size"),
(try_end),
]),
#script_party_add_party_companions:
# INPUT:
# param1: Party-id to add the second part
# param2: Party-id which will be added to the first one.
# "$g_move_heroes" : controls if heroes will also be added.
("party_add_party_companions",
[
(store_script_param_1, ":target_party"), #Target Party_id
(store_script_param_2, ":source_party"), #Source Party_id
(party_get_num_companion_stacks, ":num_stacks",":source_party"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"),
(this_or_next|neg|troop_is_hero, ":stack_troop"),
(eq, "$g_move_heroes", 1),
(party_stack_get_size, ":stack_size",":source_party",":stack_no"),
(party_add_members, ":target_party", ":stack_troop", ":stack_size"),
(party_stack_get_num_wounded, ":num_wounded", ":source_party", ":stack_no"),
(party_wound_members, ":target_party", ":stack_troop", ":num_wounded"),
(try_end),
]),
#script_party_add_party_prisoners:
# INPUT:
# param1: Party-id to add the second party
# param2: Party-id which will be added to the first one.
# "$g_move_heroes" : controls if heroes will also be added.
("party_add_party_prisoners",
[
(store_script_param_1, ":target_party"), #Target Party_id
(store_script_param_2, ":source_party"), #Source Party_id
(party_get_num_prisoner_stacks, ":num_stacks",":source_party"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"),
(this_or_next|neg|troop_is_hero, ":stack_troop"),
(eq, "$g_move_heroes", 1),
(party_prisoner_stack_get_size, ":stack_size",":source_party",":stack_no"),
(party_add_members, ":target_party", ":stack_troop", ":stack_size"),
(try_end),
]),
#script_party_prisoners_add_party_companions:
# INPUT:
# param1: Party-id to add the second part
# param2: Party-id which will be added to the first one.
# "$g_move_heroes" : controls if heroes will also be added.
("party_prisoners_add_party_companions",
[
(store_script_param_1, ":target_party"), #Target Party_id
(store_script_param_2, ":source_party"), #Source Party_id
(party_get_num_companion_stacks, ":num_stacks",":source_party"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"),
(this_or_next|neg|troop_is_hero, ":stack_troop"),
(eq, "$g_move_heroes", 1),
(party_stack_get_size, ":stack_size",":source_party",":stack_no"),
(party_add_prisoners, ":target_party", ":stack_troop", ":stack_size"),
(try_end),
]),
#script_party_prisoners_add_party_prisoners:
# INPUT:
# param1: Party-id to add the second part
# param2: Party-id which will be added to the first one.
# "$g_move_heroes" : controls if heroes will also be added.
("party_prisoners_add_party_prisoners",
[
(store_script_param_1, ":target_party"), #Target Party_id
(store_script_param_2, ":source_party"), #Source Party_id
(party_get_num_prisoner_stacks, ":num_stacks",":source_party"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"),
(this_or_next|neg|troop_is_hero, ":stack_troop"),
(eq, "$g_move_heroes", 1),
(party_prisoner_stack_get_size, ":stack_size",":source_party",":stack_no"),
(party_add_prisoners, ":target_party", ":stack_troop", ":stack_size"),
(try_end),
]),
# script_party_add_party:
# INPUT:
# param1: Party-id to add the second part
# param2: Party-id which will be added to the first one.
# "$g_move_heroes" : controls if heroes will also be added.
("party_add_party",
[
(store_script_param_1, ":target_party"), #Target Party_id
(store_script_param_2, ":source_party"), #Source Party_id
(call_script, "script_party_add_party_companions", ":target_party", ":source_party"),
(call_script, "script_party_prisoners_add_party_prisoners", ":target_party", ":source_party"),
]),
#script_party_copy:
# INPUT:
# param1: Party-id to copy the second party
# param2: Party-id which will be copied to the first one.
("party_copy",
[
(assign, "$g_move_heroes", 1),
(store_script_param_1, ":target_party"), #Target Party_id
(store_script_param_2, ":source_party"), #Source Party_id
(party_clear, ":target_party"),
(call_script, "script_party_add_party", ":target_party", ":source_party"),
]),
#script_clear_party_group:
# INPUT:
# param1: Party-id of the root of the group.
# This script will clear the root party and all parties attached to it recursively.
("clear_party_group",
[
(store_script_param_1, ":root_party"),
(party_clear, ":root_party"),
(party_get_num_attached_parties, ":num_attached_parties", ":root_party"),
(try_for_range, ":attached_party_rank", 0, ":num_attached_parties"),
(party_get_attached_party_with_rank, ":attached_party", ":root_party", ":attached_party_rank"),
(call_script, "script_clear_party_group", ":attached_party"),
(try_end),
]),
#script_get_nonempty_party_in_group:
# INPUT:
# param1: Party-id of the root of the group.
# OUTPUT: reg0: nonempy party-id
("get_nonempty_party_in_group",
[
(store_script_param_1, ":party_no"),
(party_get_num_companion_stacks, ":num_companion_stacks", ":party_no"),
(try_begin),
(gt, ":num_companion_stacks", 0),
(assign, reg0, ":party_no"),
(else_try),
(assign, reg0, -1),
(party_get_num_attached_parties, ":num_attached_parties", ":party_no"),
(try_for_range, ":attached_party_rank", 0, ":num_attached_parties"),
(lt, reg0, 0),
(party_get_attached_party_with_rank, ":attached_party", ":party_no", ":attached_party_rank"),
(call_script, "script_get_nonempty_party_in_group", ":attached_party"),
(try_end),
(try_end),
]),
#script_collect_prisoners_from_empty_parties:
# INPUT:
# param1: Party-id of the root of the group.
# param2: Party to collect prisoners in.
# make sure collection party is cleared before calling this.
("collect_prisoners_from_empty_parties",
[
(store_script_param_1, ":party_no"),
(store_script_param_2, ":collection_party"),
(party_get_num_companions, ":num_companions", ":party_no"),
(try_begin),
(eq, ":num_companions", 0), #party is empty (has no companions). Collect its prisoners.
(party_get_num_prisoner_stacks, ":num_stacks",":party_no"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop",":party_no",":stack_no"),
(troop_is_hero, ":stack_troop"),
(party_add_members, ":collection_party", ":stack_troop", 1),
(try_end),
(try_end),
(party_get_num_attached_parties, ":num_attached_parties", ":party_no"),
(try_for_range, ":attached_party_rank", 0, ":num_attached_parties"),
(party_get_attached_party_with_rank, ":attached_party", ":party_no", ":attached_party_rank"),
(call_script, "script_collect_prisoners_from_empty_parties", ":attached_party", ":collection_party"),
(try_end),
]),
#script_print_casualties_to_s0:
# INPUT:
# param1: Party_id, param2: 0 = use new line, 1 = use comma
#OUTPUT:
# string register 0.
("print_casualties_to_s0",
[(store_script_param, ":party_no", 1),
(store_script_param, ":use_comma", 2),
(str_clear, s0),
(assign, ":total_reported", 0),
(assign, ":total_wounded", 0),
(assign, ":total_killed", 0),
(party_get_num_companion_stacks, ":num_stacks",":party_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"),
(party_stack_get_size, ":stack_size",":party_no",":i_stack"),
(party_stack_get_num_wounded, ":num_wounded",":party_no",":i_stack"),
(store_sub, ":num_killed", ":stack_size", ":num_wounded"),
(val_add, ":total_killed", ":num_killed"),
(val_add, ":total_wounded", ":num_wounded"),
(try_begin),
(this_or_next|gt, ":num_killed", 0),
(gt, ":num_wounded", 0),
(store_add, reg3, ":num_killed", ":num_wounded"),
(str_store_troop_name_by_count, s1, ":stack_troop", reg3),
(try_begin),
(troop_is_hero, ":stack_troop"),
(assign, reg3, 0),
(try_end),
(try_begin),
(gt, ":num_killed", 0),
(gt, ":num_wounded", 0),
(assign, reg4, ":num_killed"),
(assign, reg5, ":num_wounded"),
(str_store_string, s2, "@{reg4} killed, {reg5} wounded"),
(else_try),
(gt, ":num_killed", 0),
(str_store_string, s2, "@killed"),
(else_try),
(str_store_string, s2, "@wounded"),
(try_end),
(try_begin),
(eq, ":use_comma", 1),
(try_begin),
(eq, ":total_reported", 0),
(str_store_string, s0, "@{reg3?{reg3}:} {s1} ({s2})"),
(else_try),
(str_store_string, s0, "@{s0}, {reg3?{reg3}:} {s1} ({s2})"),
(try_end),
(else_try),
(str_store_string, s0, "@{s0}^{reg3?{reg3}:} {s1} ({s2})"),
(try_end),
(val_add, ":total_reported", 1),
(try_end),
(try_end),
(try_begin),
(this_or_next|gt, ":total_killed", 0),
(gt, ":total_wounded", 0),
(store_add, reg3, ":total_killed", ":total_wounded"),
(try_begin),
(gt, ":total_killed", 0),
(gt, ":total_wounded", 0),
(assign, reg4, ":total_killed"),
(assign, reg5, ":total_wounded"),
(str_store_string, s2, "@{reg4} killed, {reg5} wounded"),
(else_try),
(gt, ":total_killed", 0),
(str_store_string, s2, "@killed"),
(else_try),
(str_store_string, s2, "@wounded"),
(try_end),
(str_store_string, s0, "@{s0}^TOTAL: {reg3} ({s2})"),
(else_try),
(try_begin),
(eq, ":use_comma", 1),
(str_store_string, s0, "@None"),
(else_try),
(str_store_string, s0, "@^None"),
(try_end),
(try_end),
]),
#script_write_fit_party_members_to_stack_selection
# INPUT:
# param1: party_no, exclude_leader
#OUTPUT:
# trp_stack_selection_amounts slots (slot 0 = number of stacks, 1 = number of men fit, 2..n = stack sizes (fit))
# trp_stack_selection_ids slots (2..n = stack troops)
("write_fit_party_members_to_stack_selection",
[
(store_script_param, ":party_no", 1),
(store_script_param, ":exclude_leader", 2),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(assign, ":slot_index", 2),
(assign, ":total_fit", 0),
(try_for_range, ":stack_index", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":stack_index"),
(assign, ":num_fit", 0),
(try_begin),
(troop_is_hero, ":stack_troop"),
(try_begin),
(neg|troop_is_wounded, ":stack_troop"),
(this_or_next|eq, ":exclude_leader", 0),
(neq, ":stack_index", 0),
(assign, ":num_fit",1),
(try_end),
(else_try),
(party_stack_get_size, ":num_fit", ":party_no", ":stack_index"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":stack_index"),
(val_sub, ":num_fit", ":num_wounded"),
(try_end),
(try_begin),
(gt, ":num_fit", 0),
(troop_set_slot, "trp_stack_selection_amounts", ":slot_index", ":num_fit"),
(troop_set_slot, "trp_stack_selection_ids", ":slot_index", ":stack_troop"),
(val_add, ":slot_index", 1),
(try_end),
(val_add, ":total_fit", ":num_fit"),
(try_end),
(val_sub, ":slot_index", 2),
(troop_set_slot, "trp_stack_selection_amounts", 0, ":slot_index"),
(troop_set_slot, "trp_stack_selection_amounts", 1, ":total_fit"),
]),
#script_remove_fit_party_member_from_stack_selection
# INPUT:
# param1: slot_index
#OUTPUT:
# reg0 = troop_no
# trp_stack_selection_amounts slots (slot 0 = number of stacks, 1 = number of men fit, 2..n = stack sizes (fit))
# trp_stack_selection_ids slots (2..n = stack troops)
("remove_fit_party_member_from_stack_selection",
[
(store_script_param, ":slot_index", 1),
(val_add, ":slot_index", 2),
(troop_get_slot, ":amount", "trp_stack_selection_amounts", ":slot_index"),
(troop_get_slot, ":troop_no", "trp_stack_selection_ids", ":slot_index"),
(val_sub, ":amount", 1),
(troop_set_slot, "trp_stack_selection_amounts", ":slot_index", ":amount"),
(troop_get_slot, ":total_amount", "trp_stack_selection_amounts", 1),
(val_sub, ":total_amount", 1),
(troop_set_slot, "trp_stack_selection_amounts", 1, ":total_amount"),
(try_begin),
(le, ":amount", 0),
(troop_get_slot, ":num_slots", "trp_stack_selection_amounts", 0),
(store_add, ":end_cond", ":num_slots", 2),
(store_add, ":begin_cond", ":slot_index", 1),
(try_for_range, ":index", ":begin_cond", ":end_cond"),
(store_sub, ":prev_index", ":index", 1),
(troop_get_slot, ":value", "trp_stack_selection_amounts", ":index"),
(troop_set_slot, "trp_stack_selection_amounts", ":prev_index", ":value"),
(troop_get_slot, ":value", "trp_stack_selection_ids", ":index"),
(troop_set_slot, "trp_stack_selection_ids", ":prev_index", ":value"),
(try_end),
(val_sub, ":num_slots", 1),
(troop_set_slot, "trp_stack_selection_amounts", 0, ":num_slots"),
(try_end),
(assign, reg0, ":troop_no"),
]),
#script_remove_random_fit_party_member_from_stack_selection
# INPUT:
# none
#OUTPUT:
# reg0 = troop_no
# trp_stack_selection_amounts slots (slot 0 = number of stacks, 1 = number of men fit, 2..n = stack sizes (fit))
# trp_stack_selection_ids slots (2..n = stack troops)
("remove_random_fit_party_member_from_stack_selection",
[
(troop_get_slot, ":total_amount", "trp_stack_selection_amounts", 1),
(store_random_in_range, ":random_troop", 0, ":total_amount"),
(troop_get_slot, ":num_slots", "trp_stack_selection_amounts", 0),
(store_add, ":end_cond", ":num_slots", 2),
(try_for_range, ":index", 2, ":end_cond"),
(troop_get_slot, ":amount", "trp_stack_selection_amounts", ":index"),
(val_sub, ":random_troop", ":amount"),
(lt, ":random_troop", 0),
(assign, ":end_cond", 0),
(store_sub, ":slot_index", ":index", 2),
(try_end),
(call_script, "script_remove_fit_party_member_from_stack_selection", ":slot_index"),
]),
#script_cf_training_ground_sub_routine_1_for_melee_details
# INPUT:
# value
#OUTPUT:
# none
("cf_training_ground_sub_routine_1_for_melee_details",
[
(store_script_param, ":value", 1),
(ge, "$temp_3", ":value"),
(val_add, ":value", 1),
(troop_get_slot, ":troop_id", "trp_stack_selection_ids", ":value"),
(str_store_troop_name, s0, ":troop_id"),
]),
#script_training_ground_sub_routine_2_for_melee_details
# INPUT:
# value
#OUTPUT:
# none
("training_ground_sub_routine_2_for_melee_details",
[
(store_script_param, ":value", 1),
(val_sub, ":value", 1),
(try_begin),
(lt, ":value", 0),
(call_script, "script_remove_random_fit_party_member_from_stack_selection"),
(else_try),
(call_script, "script_remove_fit_party_member_from_stack_selection", ":value"),
(try_end),
(assign, ":troop_id", reg0),
(store_sub, ":slot_index", "$temp_2", 1),
(troop_set_slot, "trp_temp_array_a", ":slot_index", ":troop_id"),
(try_begin),
(eq, "$temp", "$temp_2"),
(call_script, "script_start_training_at_training_ground", -1, "$temp"),
(else_try),
(val_add, "$temp_2", 1),
(jump_to_menu, "mnu_training_ground_selection_details_melee_2"),
(try_end),
]),
#script_cf_training_ground_sub_routine_for_training_result
# INPUT:
# arg1: troop_id, arg2: stack_no, arg3: troop_count, arg4: xp_ratio_to_add
#OUTPUT:
# none
("cf_training_ground_sub_routine_for_training_result",
[
(store_script_param, ":troop_id", 1),
(store_script_param, ":stack_no", 2),
(store_script_param, ":amount", 3),
(store_script_param, ":xp_ratio_to_add", 4),
(store_character_level, ":level", ":troop_id"),
(store_add, ":level_added", ":level", 5),
(store_mul, ":min_hardness", ":level_added", 3),
(val_min, ":min_hardness", 100),
(store_sub, ":hardness_dif", ":min_hardness", "$g_training_ground_training_hardness"),
(val_max, ":hardness_dif", 0),
(store_sub, ":hardness_dif", 100, ":hardness_dif"),
(val_mul, ":hardness_dif", ":hardness_dif"),
(val_div, ":hardness_dif", 10), # value over 1000
## (assign, reg0, ":hardness_dif"),
## (display_message, "@Hardness difference: {reg0}/1000"),
(store_mul, ":xp_ratio_to_add_for_stack", ":xp_ratio_to_add", ":hardness_dif"),
(val_div, ":xp_ratio_to_add_for_stack", 1000),
(try_begin),
(eq, ":troop_id", "trp_player"),
(val_mul, ":xp_ratio_to_add_for_stack", 1),
(else_try),
(try_begin),
(eq, "$g_mt_mode", ctm_melee),
(try_begin),
(this_or_next|troop_is_guarantee_ranged, ":troop_id"),
(troop_is_guarantee_horse, ":troop_id"),
(val_div, ":xp_ratio_to_add_for_stack", 4),
(try_end),
(else_try),
(eq, "$g_mt_mode", ctm_mounted),
(try_begin),
(neg|troop_is_guarantee_horse, ":troop_id"),
(assign, ":xp_ratio_to_add_for_stack", 0),
(try_end),
(else_try),
(neg|troop_is_guarantee_ranged, ":troop_id"),
(assign, ":xp_ratio_to_add_for_stack", 0),
(try_end),
(try_end),
(val_add, ":level", 1),
(store_mul, ":xp_to_add", 100, ":level"),
(val_mul, ":xp_to_add", ":amount"),
(val_div, ":xp_to_add", 20),
(val_mul, ":xp_to_add", ":xp_ratio_to_add_for_stack"),
(val_div, ":xp_to_add", 1000),
(store_mul, ":max_xp_to_add", ":xp_to_add", 3),
(val_div, ":max_xp_to_add", 2),
(store_div, ":min_xp_to_add", ":xp_to_add", 2),
(store_random_in_range, ":random_xp_to_add", ":min_xp_to_add", ":max_xp_to_add"),
(gt, ":random_xp_to_add", 0),
(try_begin),
(troop_is_hero, ":troop_id"),
(add_xp_to_troop, ":random_xp_to_add", ":troop_id"),
(store_div, ":proficiency_to_add", ":random_xp_to_add", 50),
(try_begin),
(gt, ":proficiency_to_add", 0),
(troop_raise_proficiency, ":troop_id", "$g_training_ground_used_weapon_proficiency", ":proficiency_to_add"),
(try_end),
(else_try),
(party_add_xp_to_stack, "p_main_party", ":stack_no", ":random_xp_to_add"),
(try_end),
(assign, reg0, ":random_xp_to_add"),
]),
## #script_cf_print_troop_name_with_stack_index_to_s0
## # INPUT:
## # param1: stack_index
##
## #OUTPUT:
## # string register 0.
## ("cf_print_troop_name_with_stack_index_to_s0",
## [
## (store_script_param_1, ":stack_index"),
## (party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
## (lt, ":stack_index", ":num_stacks"),
## (party_stack_get_troop_id, ":stack_troop", "p_main_party", ":stack_index"),
## (str_store_troop_name, s0, ":stack_troop"),
## ]),
#script_print_troop_owned_centers_in_numbers_to_s0
# INPUT:
# param1: troop_no
#OUTPUT:
# string register 0.
("print_troop_owned_centers_in_numbers_to_s0",
[
(store_script_param_1, ":troop_no"),
(str_store_string, s0, "@nothing"),
(assign, ":owned_towns", 0),
(assign, ":owned_castles", 0),
(assign, ":owned_villages", 0),
(try_for_range_backwards, ":cur_center", centers_begin, centers_end),
(party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"),
(try_begin),
(party_slot_eq, ":cur_center", slot_party_type, spt_town),
(val_add, ":owned_towns", 1),
(else_try),
(party_slot_eq, ":cur_center", slot_party_type, spt_castle),
(val_add, ":owned_castles", 1),
(else_try),
(val_add, ":owned_villages", 1),
(try_end),
(try_end),
(assign, ":num_types", 0),
(try_begin),
(gt, ":owned_villages", 0),
(assign, reg0, ":owned_villages"),
(store_sub, reg1, reg0, 1),
(str_store_string, s0, "@{reg0} village{reg1?s:}"),
(val_add, ":num_types", 1),
(try_end),
(try_begin),
(gt, ":owned_castles", 0),
(assign, reg0, ":owned_castles"),
(store_sub, reg1, reg0, 1),
(try_begin),
(eq, ":num_types", 0),
(str_store_string, s0, "@{reg0} castle{reg1?s:}"),
(else_try),
(str_store_string, s0, "@{reg0} castle{reg1?s:} and {s0}"),
(try_end),
(val_add, ":num_types", 1),
(try_end),
(try_begin),
(gt, ":owned_towns", 0),
(assign, reg0, ":owned_towns"),
(store_sub, reg1, reg0, 1),
(try_begin),
(eq, ":num_types", 0),
(str_store_string, s0, "@{reg0} town{reg1?s:}"),
(else_try),
(eq, ":num_types", 1),
(str_store_string, s0, "@{reg0} town{reg1?s:} and {s0}"),
(else_try),
(str_store_string, s0, "@{reg0} town{reg1?s:}, {s0}"),
(try_end),
(try_end),
(store_add, reg0, ":owned_villages", ":owned_castles"),
(val_add, reg0, ":owned_towns"),
]),
#script_get_random_melee_training_weapon
# INPUT: none
# OUTPUT: reg0 = weapon_1, reg1 = weapon_2
("get_random_melee_training_weapon",
[
(assign, ":weapon_1", -1),
(assign, ":weapon_2", -1),
(store_random_in_range, ":random_no", 0, 3),
(try_begin),
(eq, ":random_no", 0),
(assign, ":weapon_1", "itm_practice_staff"),
(else_try),
(eq, ":random_no", 1),
(assign, ":weapon_1", "itm_practice_sword"),
(assign, ":weapon_2", "itm_practice_shield"),
(else_try),
(assign, ":weapon_1", "itm_heavy_practice_sword"),
(try_end),
(assign, reg0, ":weapon_1"),
(assign, reg1, ":weapon_2"),
]),
#script_start_training_at_training_ground
# INPUT:
# param1: training_weapon_type, param2: training_param
("start_training_at_training_ground",
[
(val_add, "$g_training_ground_training_count", 1),
(store_script_param, ":mission_weapon_type", 1),
(store_script_param, ":training_param", 2),
(assign, ":training_default_weapon_1", -1),
(assign, ":training_default_weapon_2", -1),
(assign, ":training_default_weapon_3", -1),
(assign, "$scene_num_total_gourds_destroyed", 0),
(try_begin),
(eq, ":mission_weapon_type", itp_type_bow),
(assign, "$g_training_ground_used_weapon_proficiency", wpt_archery),
(assign, ":training_default_weapon_1", "itm_practice_bow"),
(try_begin),
(eq, "$g_mt_mode", ctm_mounted),
(assign, ":training_default_weapon_2", "itm_practice_arrows_100_amount"),
(else_try),
(assign, ":training_default_weapon_2", "itm_practice_arrows_10_amount"),
(try_end),
(else_try),
(eq, ":mission_weapon_type", itp_type_crossbow),
(assign, "$g_training_ground_used_weapon_proficiency", wpt_crossbow),
(assign, ":training_default_weapon_1", "itm_practice_crossbow"),
(assign, ":training_default_weapon_2", "itm_practice_bolts_9_amount"),
(else_try),
(eq, ":mission_weapon_type", itp_type_thrown),
(assign, "$g_training_ground_used_weapon_proficiency", wpt_throwing),
(try_begin),
(eq, "$g_mt_mode", ctm_mounted),
(assign, ":training_default_weapon_2", "itm_practice_throwing_daggers_100_amount"),
(else_try),
(assign, ":training_default_weapon_2", "itm_practice_throwing_daggers"),
(try_end),
(else_try),
(eq, ":mission_weapon_type", itp_type_one_handed_wpn),
(assign, "$g_training_ground_used_weapon_proficiency", wpt_one_handed_weapon),
(assign, ":training_default_weapon_1", "itm_practice_sword"),
(else_try),
(eq, ":mission_weapon_type", itp_type_polearm),
(assign, "$g_training_ground_used_weapon_proficiency", wpt_polearm),
(assign, ":training_default_weapon_1", "itm_practice_lance"),
(else_try),
#weapon_type comes as -1 when melee training is selected
(assign, "$g_training_ground_used_weapon_proficiency", wpt_one_handed_weapon),
(call_script, "script_get_random_melee_training_weapon"),
(assign, ":training_default_weapon_1", reg0),
(assign, ":training_default_weapon_2", reg1),
(try_end),
## (assign, "$g_training_ground_training_troop_stack_index", ":stack_index"),
(try_begin),
(eq, "$g_mt_mode", ctm_mounted),
(assign, ":training_default_weapon_3", "itm_practice_horse"),
(store_add, "$g_training_ground_training_scene", "scn_training_ground_horse_track_1", "$g_encountered_party"),
(val_sub, "$g_training_ground_training_scene", training_grounds_begin),
(else_try),
(store_add, "$g_training_ground_training_scene", "scn_training_ground_ranged_melee_1", "$g_encountered_party"),
(val_sub, "$g_training_ground_training_scene", training_grounds_begin),
(try_end),
(modify_visitors_at_site, "$g_training_ground_training_scene"),
(reset_visitors),
(set_visitor, 0, "trp_player"),
(assign, ":selected_weapon", -1),
(try_for_range, ":cur_slot", 0, 4),#equipment slots
(troop_get_inventory_slot, ":cur_item", "trp_player", ":cur_slot"),
(ge, ":cur_item", 0),
(item_get_type, ":item_type", ":cur_item"),
(try_begin),
(eq, ":item_type", ":mission_weapon_type"),
(eq, ":selected_weapon", -1),
(assign, ":selected_weapon", ":cur_item"),
(try_end),
(try_end),
(mission_tpl_entry_clear_override_items, "mt_training_ground_training", 0),
(mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, "itm_practice_boots"),
(try_begin),
(ge, ":training_default_weapon_1", 0),
(try_begin),
(ge, ":selected_weapon", 0),
(mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, ":selected_weapon"),
(else_try),
(mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, ":training_default_weapon_1"),
(try_end),
(try_end),
(try_begin),
(ge, ":training_default_weapon_2", 0),
(mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, ":training_default_weapon_2"),
(try_end),
(try_begin),
(ge, ":training_default_weapon_3", 0),
(mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, ":training_default_weapon_3"),
(try_end),
(assign, ":cur_visitor_point", 5),
(troop_get_slot, ":num_fit", "trp_stack_selection_amounts", 1),
(store_add, ":end_cond", 5, ":num_fit"),
(val_min, ":end_cond", 13),
(try_for_range, ":cur_visitor_point", 5, ":end_cond"),
(call_script, "script_remove_random_fit_party_member_from_stack_selection"),
(set_visitor, ":cur_visitor_point", reg0),
(val_add, ":cur_visitor_point", 1),
(try_end),
(try_begin),
(eq, "$g_mt_mode", ctm_melee),
(assign, ":total_difficulty", 0),
(try_for_range, ":i", 0, ":training_param"),
(troop_get_slot, ":cur_troop", "trp_temp_array_a", ":i"),
(store_add, ":cur_entry_point", ":i", 1),
(set_visitor, ":cur_entry_point", ":cur_troop"),
(mission_tpl_entry_clear_override_items, "mt_training_ground_training", ":cur_entry_point"),
(mission_tpl_entry_add_override_item, "mt_training_ground_training", ":cur_entry_point", "itm_practice_boots"),
(call_script, "script_get_random_melee_training_weapon"),
(mission_tpl_entry_add_override_item, "mt_training_ground_training", ":cur_entry_point", reg0),
(try_begin),
(ge, reg1, 0),
(mission_tpl_entry_add_override_item, "mt_training_ground_training", ":cur_entry_point", reg1),
(try_end),
(store_character_level, ":cur_troop_level", ":cur_troop"),
(val_add, ":cur_troop_level", 10),
(val_mul, ":cur_troop_level", ":cur_troop_level"),
(val_add, ":total_difficulty", ":cur_troop_level"),
(try_end),
(assign, "$g_training_ground_training_num_enemies", ":training_param"),
(assign, "$g_training_ground_training_hardness", ":total_difficulty"),
(store_add, ":number_multiplier", "$g_training_ground_training_num_enemies", 4),
(val_mul, "$g_training_ground_training_hardness", ":number_multiplier"),
(val_div, "$g_training_ground_training_hardness", 2400),
(str_store_string, s0, "@Your opponents are ready for the fight."),
(else_try),
(eq, "$g_mt_mode", ctm_mounted),
(try_begin),
(eq, ":mission_weapon_type", itp_type_bow),
(assign, "$g_training_ground_training_hardness", 350),
(assign, "$g_training_ground_training_num_gourds_to_destroy", 30),
(else_try),
(eq, ":mission_weapon_type", itp_type_thrown),
(assign, "$g_training_ground_training_hardness", 400),
(assign, "$g_training_ground_training_num_gourds_to_destroy", 30),
(else_try),
(eq, ":mission_weapon_type", itp_type_one_handed_wpn),
(assign, "$g_training_ground_training_hardness", 200),
(assign, "$g_training_ground_training_num_gourds_to_destroy", 45),
(else_try),
(eq, ":mission_weapon_type", itp_type_polearm),
(assign, "$g_training_ground_training_hardness", 280),
(assign, "$g_training_ground_training_num_gourds_to_destroy", 35),
(try_end),
(str_store_string, s0, "@Try to destroy as many targets as you can. You have two and a half minutes to clear the track."),
(else_try),
(eq, "$g_mt_mode", ctm_ranged),
(store_mul, "$g_training_ground_ranged_distance", ":training_param", 100),
(assign, ":hardness_modifier", ":training_param"),
(val_mul, ":hardness_modifier", ":hardness_modifier"),
(try_begin),
(eq, ":mission_weapon_type", itp_type_bow),
(val_mul, ":hardness_modifier", 3),
(val_div, ":hardness_modifier", 2),
(else_try),
(eq, ":mission_weapon_type", itp_type_thrown),
(val_mul, ":hardness_modifier", 5),
(val_div, ":hardness_modifier", 2),
(val_mul, ":hardness_modifier", ":training_param"),
(val_div, ":hardness_modifier", 2),
(try_end),
(store_mul, "$g_training_ground_training_hardness", 100, ":hardness_modifier"),
(val_div, "$g_training_ground_training_hardness", 6000),
(str_store_string, s0, "@Stay behind the line on the ground and shoot the targets. Try not to waste any shots."),
(try_end),
(jump_to_menu, "mnu_training_ground_description"),
]),
#script_print_party_to_s0:
# INPUT:
# param1: Party-id
#OUTPUT:
# string register 0.
## ("print_party_to_s0",
## [
## (store_script_param_1, ":party"), #Party_id
## (party_get_num_companion_stacks, ":num_stacks",":party"),
## (str_store_string, s50, "str_none"),
## (try_for_range, ":i_stack", 0, ":num_stacks"),
## (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
## (party_stack_get_size, ":stack_size",":party",":i_stack"),
## (str_store_troop_name_by_count, s61, ":stack_troop", ":stack_size"),
## (try_begin),
## (troop_is_hero, ":stack_troop"),
## (str_store_string_reg, s51, s61),
## (else_try),
## (assign, reg60, ":stack_size"),
## (str_store_string, s63, "str_reg60_s61"),
## (try_end),
## (try_begin),
## (eq, ":i_stack", 0),
## (str_store_string_reg, s50, s51),
## (else_try),
## (str_store_string, s50, "str_s50_comma_s51"),
## (try_end),
## (try_end),
## (str_store_string_reg, s0, s50),
## ]),
#script_party_count_fit_regulars:
# Returns the number of unwounded regular companions in a party
# INPUT:
# param1: Party-id
("party_count_fit_regulars",
[
(store_script_param_1, ":party"), #Party_id
(party_get_num_companion_stacks, ":num_stacks",":party"),
(assign, reg0, 0),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size",":party",":i_stack"),
(party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"),
(val_sub, ":stack_size", ":num_wounded"),
(val_add, reg0, ":stack_size"),
(try_end),
]),
#script_party_count_fit_for_battle:
# Returns the number of unwounded companions in a party
# INPUT:
# param1: Party-id
# OUTPUT: reg0 = result
("party_count_fit_for_battle",
[
(store_script_param_1, ":party"), #Party_id
(party_get_num_companion_stacks, ":num_stacks",":party"),
(assign, reg0, 0),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
(assign, ":num_fit",0),
(try_begin),
(troop_is_hero, ":stack_troop"),
# (store_troop_health, ":troop_hp", ":stack_troop"),
(try_begin),
(neg|troop_is_wounded, ":stack_troop"),
# (ge, ":troop_hp", 20),
(assign, ":num_fit",1),
(try_end),
(else_try),
(party_stack_get_size, ":num_fit",":party",":i_stack"),
(party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"),
(val_sub, ":num_fit", ":num_wounded"),
(try_end),
(val_add, reg0, ":num_fit"),
(try_end),
]),
#script_party_count_members_with_full_health
# Returns the number of unwounded regulars, and heroes other than player with 100% hitpoints in a party
# INPUT:
# param1: Party-id
# OUTPUT: reg0 = result
("party_count_members_with_full_health",
[
(store_script_param_1, ":party"), #Party_id
(party_get_num_companion_stacks, ":num_stacks",":party"),
(assign, reg0, 0),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
(assign, ":num_fit",0),
(try_begin),
(troop_is_hero, ":stack_troop"),
(neq, ":stack_troop", "trp_player"),
(store_troop_health, ":troop_hp", ":stack_troop"),
(try_begin),
(ge, ":troop_hp", 80),
(assign, ":num_fit",1),
(try_end),
(else_try),
(party_stack_get_size, ":num_fit",":party",":i_stack"),
(party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"),
(val_sub, ":num_fit", ":num_wounded"),
(val_max, ":num_fit", 0),
(try_end),
(val_add, reg0, ":num_fit"),
(try_end),
]),
## ("get_fit_stack_with_rank",
## [
## (store_script_param_1, ":party"), #Party_id
## (store_script_param_2, ":rank"), #Rank
## (party_get_num_companion_stacks, ":num_stacks",":party"),
## (assign, reg0, -1),
## (assign, ":num_total", 0),
## (try_for_range, ":i_stack", 0, ":num_stacks"),
## (eq, reg(0), -1), #continue only if we haven't found the result yet.
## (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
## (assign, ":num_fit",0),
## (try_begin),
## (troop_is_hero, ":stack_troop"),
## (store_troop_health, ":troop_hp", ":stack_troop"),
## (try_begin),
## (ge, ":troop_hp", 20),
## (assign, ":num_fit",1),
## (try_end),
## (else_try),
## (party_stack_get_size, ":num_fit",":party",":i_stack"),
## (party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"),
## (val_sub, ":num_fit", ":num_wounded"),
## (try_end),
## (val_add, ":num_total", ":num_fit"),
## (try_begin),
## (lt, ":rank", ":num_total"),
## (assign, reg(0), ":i_stack"),
## (try_end),
## (try_end),
## ]),
#script_get_stack_with_rank:
# Returns the stack no, containing unwounded regular companions with rank rank.
# INPUT:
# param1: Party-id
# param2: rank
("get_stack_with_rank",
[
(store_script_param_1, ":party"), #Party_id
(store_script_param_2, ":rank"), #Rank
(party_get_num_companion_stacks, ":num_stacks",":party"),
(assign, reg(0), -1),
(assign, ":num_total", 0),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(eq, reg(0), -1), #continue only if we haven't found the result yet.
(party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size",":party",":i_stack"),
(party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"),
(val_sub, ":stack_size", ":num_wounded"),
(val_add, ":num_total", ":stack_size"),
(try_begin),
(lt, ":rank", ":num_total"),
(assign, reg(0), ":i_stack"),
(try_end),
(try_end),
]),
#script_inflict_casualties_to_party:
# INPUT:
# param1: Party-id
# param2: number of rounds
#OUTPUT:
# This script doesn't return a value but populates the parties p_temp_wounded and p_temp_killed with the wounded and killed.
#Example:
# (script_inflict_casualties_to_party, "_p_main_party" ,50),
# Simulate 50 rounds of casualties to main_party.
("inflict_casualties_to_party",
[
(party_clear, "p_temp_casualties"),
(store_script_param_1, ":party"), #Party_id
(call_script, "script_party_count_fit_regulars", ":party"),
(assign, ":num_fit", reg(0)), #reg(47) = number of fit regulars.
(store_script_param_2, ":num_attack_rounds"), #number of attacks
(try_for_range, ":unused", 0, ":num_attack_rounds"),
(gt, ":num_fit", 0),
(store_random_in_range, ":attacked_troop_rank", 0 , ":num_fit"), #attack troop with rank reg(46)
(assign, reg1, ":attacked_troop_rank"),
(call_script, "script_get_stack_with_rank", ":party", ":attacked_troop_rank"),
(assign, ":attacked_stack", reg(0)), #reg(53) = stack no to attack.
(party_stack_get_troop_id, ":attacked_troop",":party",":attacked_stack"),
(store_character_level, ":troop_toughness", ":attacked_troop"),
(val_add, ":troop_toughness", 5), #troop-toughness = level + 5
(assign, ":casualty_chance", 10000),
(val_div, ":casualty_chance", ":troop_toughness"), #dying chance
(try_begin),
(store_random_in_range, ":rand_num", 0 ,10000),
(lt, ":rand_num", ":casualty_chance"), #check chance to be a casualty
(store_random_in_range, ":rand_num2", 0, 2), #check if this troop will be wounded or killed
(try_begin),
(troop_is_hero,":attacked_troop"), #currently troop can't be a hero, but no harm in keeping this.
(store_troop_health, ":troop_hp",":attacked_troop"),
(val_sub, ":troop_hp", 45),
(val_max, ":troop_hp", 1),
(troop_set_health, ":attacked_troop", ":troop_hp"),
(else_try),
(lt, ":rand_num2", 1), #wounded
(party_add_members, "p_temp_casualties", ":attacked_troop", 1),
(party_wound_members, "p_temp_casualties", ":attacked_troop", 1),
(party_wound_members, ":party", ":attacked_troop", 1),
(else_try), #killed
(party_add_members, "p_temp_casualties", ":attacked_troop", 1),
(party_remove_members, ":party", ":attacked_troop", 1),
(try_end),
(val_sub, ":num_fit", 1), #adjust number of fit regulars.
(try_end),
(try_end),
]),
#script_move_members_with_ratio:
# INPUT:
# param1: Source Party-id
# param2: Target Party-id
# pin_number = ratio of members to move, multiplied by 1000
#OUTPUT:
# This script doesn't return a value but moves some of the members of source party to target party according to the given ratio.
("move_members_with_ratio",
[
(store_script_param_1, ":source_party"), #Source Party_id
(store_script_param_2, ":target_party"), #Target Party_id
(party_get_num_prisoner_stacks, ":num_stacks",":source_party"),
(try_for_range_backwards, ":stack_no", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"),
(party_prisoner_stack_get_size, ":stack_size",":source_party",":stack_no"),
(store_mul, ":number_to_move",":stack_size","$pin_number"),
(val_div, ":number_to_move", 1000),
(party_remove_prisoners, ":source_party", ":stack_troop", ":number_to_move"),
(assign, ":number_moved", reg0),
(party_add_prisoners, ":target_party", ":stack_troop", ":number_moved"),
(try_end),
(party_get_num_companion_stacks, ":num_stacks",":source_party"),
(try_for_range_backwards, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"),
(party_stack_get_size, ":stack_size",":source_party",":stack_no"),
(store_mul, ":number_to_move",":stack_size","$pin_number"),
(val_div, ":number_to_move", 1000),
(party_remove_members, ":source_party", ":stack_troop", ":number_to_move"),
(assign, ":number_moved", reg0),
(party_add_members, ":target_party", ":stack_troop", ":number_moved"),
(try_end),
]),
# script_count_parties_of_faction_and_party_type:
# counts number of active parties with a template and faction.
# Input: arg1 = faction_no, arg2 = party_type
# Output: reg0 = count
("count_parties_of_faction_and_party_type",
[
(store_script_param_1, ":faction_no"),
(store_script_param_2, ":party_type"),
(assign, reg0, 0),
(try_for_parties, ":party_no"),
(party_is_active, ":party_no"),
(party_get_slot, ":cur_party_type", ":party_no", slot_party_type),
(store_faction_of_party, ":cur_faction", ":party_no"),
(eq, ":cur_party_type", ":party_type"),
(eq, ":cur_faction", ":faction_no"),
(val_add, reg0, 1),
(try_end),
]),
# script_faction_get_number_of_armies
# Input: arg1 = faction_no
# Output: reg0 = number_of_armies
("faction_get_number_of_armies",
[
(store_script_param_1, ":faction_no"),
(assign, ":num_armies", 0),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(store_troop_faction, ":hero_faction_no", ":troop_no"),
(eq, ":hero_faction_no", ":faction_no"),
(troop_get_slot, ":hero_party", ":troop_no", slot_troop_leaded_party),
(ge, ":hero_party", 0),
(call_script, "script_party_count_fit_regulars", ":hero_party"),
(assign, ":party_size", reg0),
(call_script, "script_party_get_ideal_size", ":hero_party"),
(assign, ":ideal_size", reg0),
(val_mul, ":ideal_size", 60),
(val_div, ":ideal_size", 100),
(gt, ":party_size", ":ideal_size"),
(val_add, ":num_armies", 1),
(try_end),
(assign, reg0, ":num_armies"),
]),
# script_faction_recalculate_strength
# Input: arg1 = faction_no
# Output: reg0 = strength
("faction_recalculate_strength",
[
(store_script_param_1, ":faction_no"),
(call_script, "script_faction_get_number_of_armies", ":faction_no"),
(assign, ":num_armies", reg0),
(assign, ":num_castles", 0),
(assign, ":num_towns", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", ":faction_no"),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(val_add, ":num_castles", 1),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(val_add, ":num_towns", 1),
(try_end),
(try_end),
(faction_set_slot, ":faction_no", slot_faction_num_armies, ":num_armies"),
(faction_set_slot, ":faction_no", slot_faction_num_castles, ":num_castles"),
(faction_set_slot, ":faction_no", slot_faction_num_towns, ":num_towns"),
]),
#script_select_random_town:
# This script selects a random town in range [towns_begin, towns_end)
# INPUTS:
# none
#OUTPUT:
# reg0: id of the selected random town
## ("select_random_town",
## [
## (assign, ":num_towns", towns_end),
## (val_sub,":num_towns", towns_begin),
## (store_random, ":random_town", ":num_towns"),
## (val_add,":random_town", towns_begin),
## (assign, reg0, ":random_town"),
## ]),
# ("select_random_spawn_point",
# [
# (assign, reg(20), spawn_points_end),
# (val_sub,reg(20), spawn_points_begin),
# (store_random, reg(21), reg(20)),
# (val_add,reg(21), spawn_points_begin),
# (assign, "$pout_town", reg(21)),
# ]),
#script_cf_select_random_town_with_faction:
# This script selects a random town in range [towns_begin, towns_end)
# such that faction of the town is equal to given_faction
# INPUT:
# arg1 = faction_no
#OUTPUT:
# This script may return false if there is no matching town.
# reg0 = town_no
("cf_select_random_town_with_faction",
[
(store_script_param_1, ":faction_no"),
(assign, ":result", -1),
# First count num matching spawn points
(assign, ":no_towns", 0),
(try_for_range,":cur_town", towns_begin, towns_end),
(store_faction_of_party, ":cur_faction", ":cur_town"),
(eq, ":cur_faction", ":faction_no"),
(val_add, ":no_towns", 1),
(try_end),
(gt, ":no_towns", 0), #Fail if there are no towns
(store_random_in_range, ":random_town", 0, ":no_towns"),
(assign, ":no_towns", 0),
(try_for_range,":cur_town", towns_begin, towns_end),
(eq, ":result", -1),
(store_faction_of_party, ":cur_faction", ":cur_town"),
(eq, ":cur_faction", ":faction_no"),
(val_add, ":no_towns", 1),
(gt, ":no_towns", ":random_town"),
(assign, ":result", ":cur_town"),
(try_end),
(assign, reg0, ":result"),
]),
#script_cf_select_random_village_with_faction:
# This script selects a random village in range [villages_begin, villages_end)
# such that faction of the village is equal to given_faction
# INPUT:
# arg1 = faction_no
#OUTPUT:
# This script may return false if there is no matching village.
# reg0 = village_no
("cf_select_random_village_with_faction",
[
(store_script_param_1, ":faction_no"),
(assign, ":result", -1),
# First count num matching spawn points
(assign, ":no_villages", 0),
(try_for_range,":cur_village", villages_begin, villages_end),
(store_faction_of_party, ":cur_faction", ":cur_village"),
(eq, ":cur_faction", ":faction_no"),
(val_add, ":no_villages", 1),
(try_end),
(gt, ":no_villages", 0), #Fail if there are no villages
(store_random_in_range, ":random_village", 0, ":no_villages"),
(assign, ":no_villages", 0),
(try_for_range,":cur_village", villages_begin, villages_end),
(eq, ":result", -1),
(store_faction_of_party, ":cur_faction", ":cur_village"),
(eq, ":cur_faction", ":faction_no"),
(val_add, ":no_villages", 1),
(gt, ":no_villages", ":random_village"),
(assign, ":result", ":cur_village"),
(try_end),
(assign, reg0, ":result"),
]),
#script_cf_select_random_walled_center_with_faction:
# This script selects a random center in range [centers_begin, centers_end)
# such that faction of the town is equal to given_faction
# INPUT:
# arg1 = faction_no
# arg2 = preferred_center_no
#OUTPUT:
# This script may return false if there is no matching town.
# reg0 = town_no (Can fail)
("cf_select_random_walled_center_with_faction",
[
(store_script_param, ":faction_no", 1),
(store_script_param, ":preferred_center_no", 2),
(assign, ":result", -1),
# First count num matching spawn points
(assign, ":no_centers", 0),
(try_for_range,":cur_center", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(eq, ":cur_faction", ":faction_no"),
(val_add, ":no_centers", 1),
(eq, ":cur_center", ":preferred_center_no"),
(val_add, ":no_centers", 99),
(try_end),
(gt, ":no_centers", 0), #Fail if there are no centers
(store_random_in_range, ":random_center", 0, ":no_centers"),
(try_for_range,":cur_center", walled_centers_begin, walled_centers_end),
(eq, ":result", -1),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(eq, ":cur_faction", ":faction_no"),
(val_sub, ":random_center", 1),
(try_begin),
(eq, ":cur_center", ":preferred_center_no"),
(val_sub, ":random_center", 99),
(try_end),
(lt, ":random_center", 0),
(assign, ":result", ":cur_center"),
(try_end),
(assign, reg0, ":result"),
]),
#script_cf_select_random_walled_center_with_faction_and_owner_priority_no_siege:
# INPUT:
# arg1 = faction_no
# arg2 = owner_troop_no
#OUTPUT:
# This script may return false if there is no matching town.
# reg0 = center_no (Can fail)
("cf_select_random_walled_center_with_faction_and_owner_priority_no_siege",
[
(store_script_param, ":faction_no", 1),
(store_script_param, ":troop_no", 2),
(assign, ":result", -1),
(assign, ":no_centers", 0),
(try_for_range,":cur_center", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(eq, ":cur_faction", ":faction_no"),
(party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
(val_add, ":no_centers", 1),
(party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"),
(val_add, ":no_centers", 1000),
(try_end),
(gt, ":no_centers", 0), #Fail if there are no centers
(store_random_in_range, ":random_center", 0, ":no_centers"),
(try_for_range,":cur_center", walled_centers_begin, walled_centers_end),
(eq, ":result", -1),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(eq, ":cur_faction", ":faction_no"),
(party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
(val_sub, ":random_center", 1),
(try_begin),
(party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"),
(val_sub, ":random_center", 1000),
(try_end),
(lt, ":random_center", 0),
(assign, ":result", ":cur_center"),
(try_end),
(assign, reg0, ":result"),
]),
#script_cf_select_random_walled_center_with_faction_and_less_strength_priority:
# This script selects a random center in range [centers_begin, centers_end)
# such that faction of the town is equal to given_faction
# INPUT:
# arg1 = faction_no
# arg2 = preferred_center_no
#OUTPUT:
# This script may return false if there is no matching town.
# reg0 = town_no (Can fail)
("cf_select_random_walled_center_with_faction_and_less_strength_priority",
[
(store_script_param, ":faction_no", 1),
(store_script_param, ":preferred_center_no", 2),
(assign, ":result", -1),
# First count num matching spawn points
(assign, ":no_centers", 0),
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(eq, ":cur_faction", ":faction_no"),
(party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
(val_add, ":no_centers", 1),
(try_begin),
(eq, ":cur_center", ":preferred_center_no"),
(val_add, ":no_centers", 99),
(try_end),
## (call_script, "script_party_calculate_regular_strength", ":cur_center"),
## (assign, ":strength", reg0),
## (lt, ":strength", 80),
## (store_sub, ":strength", 100, ":strength"),
## (val_div, ":strength", 20),
## (val_add, ":no_centers", ":strength"),
(try_end),
(gt, ":no_centers", 0), #Fail if there are no centers
(store_random_in_range, ":random_center", 0, ":no_centers"),
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(eq, ":result", -1),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(eq, ":cur_faction", ":faction_no"),
(party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
(val_sub, ":random_center", 1),
(try_begin),
(eq, ":cur_center", ":preferred_center_no"),
(val_sub, ":random_center", 99),
(try_end),
## (try_begin),
## (call_script, "script_party_calculate_regular_strength", ":cur_center"),
## (assign, ":strength", reg0),
## (lt, ":strength", 80),
## (store_sub, ":strength", 100, ":strength"),
## (val_div, ":strength", 20),
## (val_sub, ":random_center", ":strength"),
## (try_end),
(lt, ":random_center", 0),
(assign, ":result", ":cur_center"),
(try_end),
(assign, reg0, ":result"),
]),
#script_cf_select_random_town_at_peace_with_faction:
# This script selects a random town in range [towns_begin, towns_end)
# such that faction of the town is friendly to given_faction
# INPUT:
# arg1 = faction_no
#OUTPUT:
# This script may return false if there is no matching town.
# reg0 = town_no
("cf_select_random_town_at_peace_with_faction",
[
(store_script_param_1, ":faction_no"),
(assign, ":result", -1),
# First count num matching towns
(assign, ":no_towns", 0),
(try_for_range,":cur_town", towns_begin, towns_end),
(store_faction_of_party, ":cur_faction", ":cur_town"),
(store_relation,":reln", ":cur_faction", ":faction_no"),
(ge, ":reln", 0),
(val_add, ":no_towns", 1),
(try_end),
(gt, ":no_towns", 0), #Fail if there are no towns
(store_random_in_range, ":random_town", 0, ":no_towns"),
(assign, ":no_towns", 0),
(try_for_range,":cur_town", towns_begin, towns_end),
(eq, ":result", -1),
(store_faction_of_party, ":cur_faction", ":cur_town"),
(store_relation,":reln", ":cur_faction", ":faction_no"),
(ge, ":reln", 0),
(val_add, ":no_towns", 1),
(gt, ":no_towns", ":random_town"),
(assign, ":result", ":cur_town"),
(try_end),
(assign, reg0, ":result"),
]),
#script_cf_select_random_town_at_peace_with_faction_in_trade_route
# INPUT:
# arg1 = town_no
# arg2 = faction_no
#OUTPUT:
# This script may return false if there is no matching town.
# reg0 = town_no
("cf_select_random_town_at_peace_with_faction_in_trade_route",
[
(store_script_param, ":town_no", 1),
(store_script_param, ":faction_no", 2),
(assign, ":result", -1),
(assign, ":no_towns", 0),
(try_for_range, ":cur_slot", slot_town_trade_routes_begin, slot_town_trade_routes_end),
(party_get_slot, ":cur_town", ":town_no", ":cur_slot"),
(gt, ":cur_town", 0),
(store_faction_of_party, ":cur_faction", ":cur_town"),
(store_relation, ":reln", ":cur_faction", ":faction_no"),
(ge, ":reln", 0),
(val_add, ":no_towns", 1),
(try_end),
(gt, ":no_towns", 0), #Fail if there are no towns
(store_random_in_range, ":random_town", 0, ":no_towns"),
(try_for_range, ":cur_slot", slot_town_trade_routes_begin, slot_town_trade_routes_end),
(eq, ":result", -1),
(party_get_slot, ":cur_town", ":town_no", ":cur_slot"),
(gt, ":cur_town", 0),
(store_faction_of_party, ":cur_faction", ":cur_town"),
(store_relation, ":reln", ":cur_faction", ":faction_no"),
(ge, ":reln", 0),
(val_sub, ":random_town", 1),
(lt, ":random_town", 0),
(assign, ":result", ":cur_town"),
(try_end),
(assign, reg0, ":result"),
]),
## ("cf_select_faction_spawn_point",
## [
## # First count num matching spawn points
## (assign, reg(24), 0),
## (try_for_range,reg(25), spawn_points_begin, spawn_points_end),
## (store_faction_of_party, reg(23), reg(25)),
## (eq, reg(23), "$pin_faction"),
## (val_add, reg(24), 1),
## (end_try,0),
## # reg4 now holds num towns of this faction.
## (gt, reg(24), 0), #Fail if there are no towns
## (store_random, reg(26), reg(24)),
##
## (assign, reg(24), 0), # reg24 = num points of this faction.
## (try_for_range,reg(25), spawn_points_begin, spawn_points_end),
## (store_faction_of_party, reg(23), reg(25)),
## (eq, reg(23), "$pin_faction"),
## (try_begin,0),
## (eq, reg(24), reg(26)),
## (assign, "$pout_town", reg(25)), # result is this town
## (end_try,0),
## (val_add, reg(24), 1),
## (end_try,0),
## ]),
#script_spawn_party_at_random_town:
# This script selects a random town in range [towns_begin, towns_end)
# such that faction of the town is equal to given_faction
# and spawns a new party there.
# INPUT:
# $pin_faction: given_faction
# $pin_party_template: given_party_template
#OUTPUT:
# This script may return false if party cannot be spawned.
# $pout_party: id of the spawned party
## ("spawn_party_at_random_town",
## [
## (call_script,"script_select_random_spawn_point"),
## (set_spawn_radius,1),
## (spawn_around_party,"$pout_town","$pin_party_template"),
## (assign, "$pout_party", reg(0)),
## ]),
#script_cf_spawn_party_at_faction_town:
# This script selects a random town in range [towns_begin, towns_end)
# such that faction of the town is equal to given_faction
# and spawns a new party there.
# INPUT:
# $pin_faction: given_faction
# $pin_party_template: given_party_template
#OUTPUT:
# This script may return false if party cannot be spawned.
# $pout_party: id of the spawned party
## ("cf_spawn_party_at_faction_town",
## [
## (call_script,"script_cf_select_faction_spawn_point"),
## (set_spawn_radius,1),
## (spawn_around_party,"$pout_town","$pin_party_template"),
## (assign, "$pout_party", reg(0)),
## ]),
#script_spawn_party_at_random_town_if_below_limit:
# This script checks if number of parties
# of specified template is less than limit,
# If so, it selects a random town in range [towns_begin, towns_end)
# and spawns a new party there.
# INPUT:
# $pin_party_template: given_party_template
# $pin_limit: limit value
#OUTPUT:
# $pout_party: id of the spawned party
# $pout_town: id of the selected faction town
# Note:
# This script may return false if number of parties
# of specified template is greater or equal to limit,
# or if party cannot be spawned.
## ("cf_spawn_party_at_random_town_if_below_limit",
## [
## (store_num_parties_of_template, reg(22), "$pin_party_template"),
## (lt,reg(22),"$pin_limit"), #check if we are below limit.
## (call_script,"script_select_random_spawn_point"),
## (set_spawn_radius,1),
## (spawn_around_party,"$pout_town","$pin_party_template"),
## (assign, "$pout_party", reg(0)),
## ]),
## #script_spawn_party_at_faction_town_if_below_limit:
## # This script checks if number of parties
## # of specified template is less than limit,
## # If so, it selects a random town in range [towns_begin, towns_end)
## # such that faction of the town is equal to given_faction
## # and spawns a new party there.
## # INPUT:
## # $pin_faction: given_faction
## # $pin_party_template: given_party_template
## # $pin_limit: limit value
##
## #OUTPUT:
## # $pout_party: id of the spawned party
## # $pout_town: id of the selected faction town
## # Note:
## # This script may return false if number of parties
## # of specified template is greater or equal to limit,
## # or if party cannot be spawned.
## ("cf_spawn_party_at_faction_town_if_below_limit",
## [
## (store_num_parties_of_template, reg(22), "$pin_party_template"),
## (lt,reg(22),"$pin_limit"), #check if we are below limit.
## (call_script,"script_cf_select_faction_spawn_point"),
## (set_spawn_radius,1),
## (spawn_around_party,"$pout_town","$pin_party_template"),
## (assign, "$pout_party", reg(0)),
## ]),
# script_shuffle_troop_slots:
# Shuffles a range of slots of a given troop.
# Used for exploiting a troop as an array.
# Input: arg1 = troop_no, arg2 = slot_begin, arg3 = slot_end
("shuffle_troop_slots",
[
(store_script_param, ":troop_no", 1),
(store_script_param, ":slots_begin", 2),
(store_script_param, ":slots_end", 3),
(try_for_range, ":cur_slot_no", ":slots_begin", ":slots_end"),
(store_random_in_range, ":random_slot_no", ":slots_begin", ":slots_end"), #reg(58) = random slot. Now exchange slots reg(57) and reg(58)
(troop_get_slot, ":cur_slot_value", ":troop_no", ":cur_slot_no"), #temporarily store the value in slot reg(57) in reg(59)
(troop_get_slot, ":random_slot_value", ":troop_no", ":random_slot_no"), #temporarily store the value in slot reg(58) in reg(60)
(troop_set_slot, ":troop_no", ":cur_slot_no", ":random_slot_value"), # Now exchange the two...
(troop_set_slot, ":troop_no", ":random_slot_no", ":cur_slot_value"),
(try_end),
]),
# script_get_random_quest
# Input: arg1 = troop_no (of the troop in conversation), arg2 = min_importance (of the quest)
# Output: reg0 = quest_no (the slots of the quest will be filled after calling this script)
("get_random_quest",
[
(store_script_param_1, ":giver_troop"),
(store_character_level, ":player_level", "trp_player"),
(store_troop_faction, ":giver_faction_no", ":giver_troop"),
(troop_get_slot, ":giver_party_no", ":giver_troop", slot_troop_leaded_party),
(troop_get_slot, ":giver_reputation", ":giver_troop", slot_lord_reputation_type),
(assign, ":giver_center_no", -1),
(try_begin),
(gt, ":giver_party_no", 0),
(party_get_attached_to, ":giver_center_no", ":giver_party_no"),
(else_try),
(is_between, "$g_encountered_party", centers_begin, centers_end),
(assign, ":giver_center_no", "$g_encountered_party"),
(try_end),
(try_begin),
(troop_slot_eq, ":giver_troop", slot_troop_occupation, slto_kingdom_hero),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(assign, ":quests_begin", lord_quests_begin),
(assign, ":quests_end", lord_quests_end),
(else_try),
(assign, ":quests_begin", enemy_lord_quests_begin),
(assign, ":quests_end", enemy_lord_quests_end),
(try_end),
(else_try),
(is_between, ":giver_troop", village_elders_begin, village_elders_end),
(assign, ":quests_begin", village_elder_quests_begin),
(assign, ":quests_end", village_elder_quests_end),
(else_try),
(is_between, ":giver_troop", mayors_begin, mayors_end),
(assign, ":quests_begin", mayor_quests_begin),
(assign, ":quests_end", mayor_quests_end),
(else_try),
(assign, ":quests_begin", lady_quests_begin),
(assign, ":quests_end", lady_quests_end),
(try_end),
(assign, ":result", -1),
(try_for_range, ":unused", 0, 20), #Repeat trial twenty times
(eq, ":result", -1),
(assign, ":quest_target_troop", -1),
(assign, ":quest_target_center", -1),
(assign, ":quest_target_faction", -1),
(assign, ":quest_object_faction", -1),
(assign, ":quest_object_troop", -1),
(assign, ":quest_object_center", -1),
(assign, ":quest_target_party", -1),
(assign, ":quest_target_party_template", -1),
(assign, ":quest_target_amount", -1),
(assign, ":quest_target_dna", -1),
(assign, ":quest_target_item", -1),
(assign, ":quest_importance", 1),
(assign, ":quest_xp_reward", 0),
(assign, ":quest_gold_reward", 0),
(assign, ":quest_convince_value", 0),
(assign, ":quest_expiration_days", 0),
(assign, ":quest_dont_give_again_period", 0),
(store_random_in_range, ":quest_no", ":quests_begin", ":quests_end"),
#TODO: Remove this when test is done
# (assign, ":quest_no", "qst_meet_spy_in_enemy_town"),
#TODO: Remove this when test is done end
(neg|check_quest_active,":quest_no"),
(neg|quest_slot_ge, ":quest_no", slot_quest_dont_give_again_remaining_days, 1),
(try_begin),
# Village Elder quests
(eq, ":quest_no", "qst_deliver_grain"),
(try_begin),
(is_between, ":giver_center_no", villages_begin, villages_end),
#The quest giver is the village elder
(call_script, "script_get_troop_item_amount", ":giver_troop", "itm_grain"),
(eq, reg0, 0),
(neg|party_slot_ge, ":giver_center_no", slot_town_prosperity, 40),
(assign, ":quest_target_center", ":giver_center_no"),
(store_random_in_range, ":quest_target_amount", 4, 8),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 20),
(assign, ":result", ":quest_no"),
(try_end),
(else_try),
(eq, ":quest_no", "qst_deliver_cattle"),
(try_begin),
(is_between, ":giver_center_no", villages_begin, villages_end),
#The quest giver is the village elder
(party_get_slot, ":num_cattle", ":giver_center_no", slot_village_number_of_cattle),
(lt, ":num_cattle", 50),
(assign, ":quest_target_center", ":giver_center_no"),
(store_random_in_range, ":quest_target_amount", 5, 10),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 20),
(assign, ":result", ":quest_no"),
(try_end),
(else_try),
(eq, ":quest_no", "qst_train_peasants_against_bandits"),
(try_begin),
(is_between, ":giver_center_no", villages_begin, villages_end),
#The quest giver is the village elder
(store_skill_level, ":player_trainer", "skl_trainer", "trp_player"),
(gt, ":player_trainer", 0),
(store_random_in_range, ":quest_target_amount", 5, 8),
(assign, ":quest_target_center", ":giver_center_no"),
(assign, ":quest_expiration_days", 20),
(assign, ":quest_dont_give_again_period", 40),
(assign, ":result", ":quest_no"),
(try_end),
(else_try),
# Mayor quests
(eq, ":quest_no", "qst_escort_merchant_caravan"),
(is_between, ":giver_center_no", centers_begin, centers_end),
(store_random_party_in_range, ":quest_target_center", towns_begin, towns_end),
(store_distance_to_party_from_party, ":dist", ":giver_center_no",":quest_target_center"),
(assign, ":quest_gold_reward", ":dist"),
(val_add, ":quest_gold_reward", 25),
(val_mul, ":quest_gold_reward", 25),
(val_div, ":quest_gold_reward", 20),
(store_random_in_range, ":quest_target_amount", 6, 12),
(assign, "$escort_merchant_caravan_mode", 0),
(assign, ":result", ":quest_no"),
(else_try),
(eq, ":quest_no", "qst_deliver_wine"),
(is_between, ":giver_center_no", centers_begin, centers_end),
(store_random_party_in_range, ":quest_target_center", towns_begin, towns_end),
(store_random_in_range, ":random_no", 0, 2),
(try_begin),
(eq, ":random_no", 0),
(assign, ":quest_target_item", "itm_quest_wine"),
(else_try),
(assign, ":quest_target_item", "itm_quest_ale"),
(try_end),
(store_random_in_range, ":quest_target_amount", 6, 12),
(store_distance_to_party_from_party, ":dist", ":giver_center_no",":quest_target_center"),
(assign, ":quest_gold_reward", ":dist"),
(val_add, ":quest_gold_reward", 2),
(assign, ":multiplier", 5),
(val_add, ":multiplier", ":quest_target_amount"),
(val_mul, ":quest_gold_reward", ":multiplier"),
(val_div, ":quest_gold_reward", 100),
(val_mul, ":quest_gold_reward", 10),
(store_item_value,"$qst_deliver_wine_debt",":quest_target_item"),
(val_mul,"$qst_deliver_wine_debt",":quest_target_amount"),
(val_mul,"$qst_deliver_wine_debt", 6),
(val_div,"$qst_deliver_wine_debt",5),
(assign, ":quest_expiration_days", 7),
(assign, ":quest_dont_give_again_period", 20),
(assign, ":result", ":quest_no"),
(else_try),
(eq, ":quest_no", "qst_troublesome_bandits"),
(is_between, ":giver_center_no", centers_begin, centers_end),
(store_character_level, ":quest_gold_reward", "trp_player"),
(val_add, ":quest_gold_reward", 20),
(val_mul, ":quest_gold_reward", 35),
(val_div, ":quest_gold_reward",100),
(val_mul, ":quest_gold_reward", 10),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 30),
(assign, ":result", ":quest_no"),
(else_try),
(eq, ":quest_no", "qst_kidnapped_girl"),
(is_between, ":giver_center_no", centers_begin, centers_end),
(store_random_in_range, ":quest_target_center", villages_begin, villages_end),
(store_character_level, ":quest_target_amount"),
(val_add, ":quest_target_amount", 15),
(store_distance_to_party_from_party, ":dist", ":giver_center_no", ":quest_target_center"),
(val_add, ":dist", 15),
(val_mul, ":dist", 2),
(val_mul, ":quest_target_amount", ":dist"),
(val_div, ":quest_target_amount",100),
(val_mul, ":quest_target_amount",10),
(assign, ":quest_gold_reward", ":quest_target_amount"),
(val_div, ":quest_gold_reward", 40),
(val_mul, ":quest_gold_reward", 10),
(assign, ":quest_dont_give_again_period", 30),
(assign, ":result", ":quest_no"),
(else_try),
(eq, ":quest_no", "qst_move_cattle_herd"),
(is_between, ":giver_center_no", centers_begin, centers_end),
(call_script, "script_cf_select_random_town_at_peace_with_faction", ":giver_faction_no"),
(neq, ":giver_center_no", reg0),
(assign, ":quest_target_center", reg0),
(store_distance_to_party_from_party, ":dist",":giver_center_no",":quest_target_center"),
(assign, ":quest_gold_reward", ":dist"),
(val_add, ":quest_gold_reward", 25),
(val_mul, ":quest_gold_reward", 50),
(val_div, ":quest_gold_reward", 20),
(assign, ":quest_expiration_days", 20),
(assign, ":quest_dont_give_again_period", 20),
(assign, ":result", ":quest_no"),
(else_try),
(eq, ":quest_no", "qst_persuade_lords_to_make_peace"),
(is_between, ":giver_center_no", centers_begin, centers_end),
(store_faction_of_party, ":cur_object_faction", ":giver_center_no"),
(call_script, "script_cf_faction_get_random_enemy_faction", ":cur_object_faction"),
(assign, ":cur_target_faction", reg0),
(call_script, "script_cf_get_random_lord_except_king_with_faction", ":cur_object_faction"),
(assign, ":cur_object_troop", reg0),
(call_script, "script_cf_get_random_lord_except_king_with_faction", ":cur_target_faction"),
(assign, ":quest_target_troop", reg0),
(assign, ":quest_object_troop", ":cur_object_troop"),
(assign, ":quest_target_faction", ":cur_target_faction"),
(assign, ":quest_object_faction", ":cur_object_faction"),
(assign, ":quest_gold_reward", 12000),
(assign, ":quest_convince_value", 7000),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 100),
(assign, ":result", ":quest_no"),
(else_try),
(eq, ":quest_no", "qst_deal_with_looters"),
(is_between, ":player_level", 0, 15),
(is_between, ":giver_center_no", centers_begin, centers_end),
(store_faction_of_party, ":cur_object_faction", ":giver_center_no"),
(store_num_parties_destroyed_by_player, ":num_looters_destroyed", "pt_looters"),
(party_template_set_slot,"pt_looters",slot_party_template_num_killed,":num_looters_destroyed"),
(quest_set_slot,"$random_merchant_quest_no",slot_quest_current_state,0),
(quest_set_slot,"$random_merchant_quest_no",slot_quest_target_party_template,"pt_looters"),
(assign, ":quest_gold_reward", 500),
(assign, ":quest_xp_reward", 500),
(assign, ":quest_expiration_days", 20),
(assign, ":quest_dont_give_again_period", 30),
(assign, ":result", ":quest_no"),
(else_try),
(eq, ":quest_no", "qst_deal_with_night_bandits"),
(is_between, ":player_level", 0, 15),
(is_between, ":giver_center_no", centers_begin, centers_end),
(party_slot_ge, ":giver_center_no", slot_center_has_bandits, 1),
(assign, ":quest_target_center", ":giver_center_no"),
(assign, ":quest_expiration_days", 4),
(assign, ":quest_dont_give_again_period", 15),
(assign, ":result", ":quest_no"),
(else_try),
# Lady quests
(eq, ":quest_no", "qst_rescue_lord_by_replace"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(is_between, ":player_level", 5, 25),
(troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_father),
(try_begin),
(eq, ":cur_target_troop", 0),
(troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_spouse),
(try_end),
#(troop_slot_eq, ":cur_target_troop", slot_troop_is_prisoner, 1),#Skip if the lady's father/husband is not in prison
(troop_slot_ge, ":cur_target_troop", slot_troop_prisoner_of_party, 0),
(call_script, "script_search_troop_prisoner_of_party", ":cur_target_troop"),
(assign, ":cur_target_center", reg0),
(is_between, ":cur_target_center", towns_begin, towns_end),#Skip if he is not in a town
(assign, ":quest_target_center", ":cur_target_center"),
(assign, ":quest_target_troop", ":cur_target_troop"),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 73),
(assign, ":result", ":quest_no"),
(try_end),
(else_try),
(eq, ":quest_no", "qst_deliver_message_to_prisoner_lord"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(is_between, ":player_level", 5, 25),
(troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_father),
(try_begin),
(eq, ":cur_target_troop", 0),
(troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_spouse),
(try_end),
#(troop_slot_eq, ":cur_target_troop", slot_troop_is_prisoner, 1),#Skip if the lady's father/husband is not in prison
(troop_slot_ge, ":cur_target_troop", slot_troop_prisoner_of_party, 0),
(call_script, "script_search_troop_prisoner_of_party", ":cur_target_troop"),
(assign, ":cur_target_center", reg0),
(is_between, ":cur_target_center", towns_begin, towns_end),#Skip if he is not in a town
(assign, ":quest_target_center", ":cur_target_center"),
(assign, ":quest_target_troop", ":cur_target_troop"),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 30),
(assign, ":result", ":quest_no"),
(try_end),
(else_try),
(eq, ":quest_no", "qst_duel_for_lady"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(ge, ":player_level", 10),
(call_script, "script_cf_troop_get_random_enemy_troop_with_occupation", ":giver_troop", slto_kingdom_hero),#Can fail
(assign, ":cur_target_troop", reg0),
(neg|troop_slot_eq, ":giver_troop", slot_troop_spouse, ":cur_target_troop"), #must not be in the family
(neg|troop_slot_eq, ":giver_troop", slot_troop_father, ":cur_target_troop"),
#(troop_slot_eq, ":cur_target_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":cur_target_troop", slot_troop_prisoner_of_party, 0),
(troop_slot_ge, ":cur_target_troop", slot_troop_leaded_party, 0),
(neg|troop_slot_eq, ":cur_target_troop", slot_lord_reputation_type, lrep_goodnatured),
(neg|troop_slot_eq, ":cur_target_troop", slot_lord_reputation_type, lrep_upstanding),
(assign, ":quest_target_troop", ":cur_target_troop"),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 50),
(assign, ":result", ":quest_no"),
(try_end),
# Enemy Lord Quests
(else_try),
(eq, ":quest_no", "qst_lend_surgeon"),
(try_begin),
(eq, "$g_defending_against_siege", 0),#Skip if the center is under siege (because of resting)
(neq, ":giver_reputation", lrep_quarrelsome),
(neq, ":giver_reputation", lrep_debauched),
(assign, ":max_surgery_level", 0),
(assign, ":best_surgeon", -1),
(party_get_num_companion_stacks, ":num_stacks","p_main_party"),
(try_for_range, ":i_stack", 1, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
(troop_is_hero, ":stack_troop"),
(store_skill_level, ":cur_surgery_skill", skl_surgery, ":stack_troop"),
(gt, ":cur_surgery_skill", ":max_surgery_level"),
(assign, ":max_surgery_level", ":cur_surgery_skill"),
(assign, ":best_surgeon", ":stack_troop"),
(try_end),
(store_character_level, ":cur_level", "trp_player"),
(assign, ":required_skill", 5),
(val_div, ":cur_level", 10),
(val_add, ":required_skill", ":cur_level"),
(ge, ":max_surgery_level", ":required_skill"), #Skip if party skill level is less than the required value
(assign, ":quest_object_troop", ":best_surgeon"),
(assign, ":quest_importance", 1),
(assign, ":quest_xp_reward", 10),
(assign, ":quest_gold_reward", 10),
(assign, ":quest_dont_give_again_period", 50),
(assign, ":result", ":quest_no"),
(try_end),
# Lord Quests
(else_try),
(eq, ":quest_no", "qst_meet_spy_in_enemy_town"),
(try_begin),
(eq, "$players_kingdom", ":giver_faction_no"),
(neq, ":giver_reputation", lrep_goodnatured),
(call_script, "script_troop_get_player_relation", ":giver_troop"),
(assign, ":giver_relation", reg0),
(gt, ":giver_relation", 3),
(call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"),
(assign, ":enemy_faction", reg0),
(store_relation, ":reln", ":enemy_faction", "fac_player_supporters_faction"),
(lt, ":reln", 0),
(call_script, "script_cf_select_random_town_with_faction", ":enemy_faction"),
(assign, ":cur_target_center", reg0),
#Just to make sure that there is a free walker
(call_script, "script_cf_center_get_free_walker", ":cur_target_center"),
(assign, ":quest_target_center", ":cur_target_center"),
(store_random_in_range, ":quest_target_amount", secret_signs_begin, secret_signs_end),
(assign, ":result", ":quest_no"),
(assign, ":quest_gold_reward", 500),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 50),
(quest_set_slot, "qst_meet_spy_in_enemy_town", slot_quest_gold_reward, 500),
(try_end),
(else_try),
(eq, ":quest_no", "qst_raid_caravan_to_start_war"),
(try_begin),
(eq, "$players_kingdom", ":giver_faction_no"),
(this_or_next|eq, ":giver_reputation", lrep_cunning),
(this_or_next|eq, ":giver_reputation", lrep_quarrelsome),
( eq, ":giver_reputation", lrep_debauched),
(gt, ":player_level", 10),
(neg|faction_slot_eq, ":giver_faction_no", slot_faction_leader, ":giver_troop"),#Can not take the quest from the king
(call_script, "script_cf_faction_get_random_friendly_faction", ":giver_faction_no"),#Can fail
(assign, ":quest_target_faction", reg0),
(store_troop_faction, ":quest_object_faction", ":giver_troop"),
(assign, ":quest_target_party_template", "pt_kingdom_caravan_party"),
(assign, ":quest_target_amount", 2),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 100),
(try_end),
(else_try),
(eq, ":quest_no", "qst_deliver_message"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(lt, ":player_level", 20),
(call_script, "script_cf_get_random_lord_in_a_center_with_faction", ":giver_faction_no"),#Can fail
(assign, ":cur_target_troop", reg0),
(neq, ":cur_target_troop", ":giver_troop"),#Skip himself
(call_script, "script_get_troop_attached_party", ":cur_target_troop"),
(assign, ":cur_target_center", reg0),#cur_target_center will definitely be a valid center
(neq,":giver_center_no", ":cur_target_center"),#Skip current center
(assign, ":quest_target_center", ":cur_target_center"),
(assign, ":quest_target_troop", ":cur_target_troop"),
(assign, ":quest_xp_reward", 30),
(assign, ":quest_gold_reward", 40),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 30),
(try_end),
(else_try),
(eq, ":quest_no", "qst_escort_lady"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(ge, ":player_level", 10),
(troop_get_slot, ":cur_object_troop", ":giver_troop", slot_troop_daughter),
(store_random_in_range, ":random_no", 0, 2),
(try_begin),
(this_or_next|eq, ":cur_object_troop", 0),
(eq, ":random_no", 0),
(troop_get_slot, ":cur_object_troop_2", ":giver_troop", slot_troop_spouse),
(gt, ":cur_object_troop_2", 0),
(assign, ":cur_object_troop", ":cur_object_troop_2"),
(try_end),
(gt, ":cur_object_troop", 0),#Skip lords without a lady
(troop_get_type, ":cur_troop_gender", ":cur_object_troop"),
(eq, ":cur_troop_gender", 1),#Skip if it is not female
(gt, ":giver_center_no", 0),#Skip if lord is outside the center
(troop_slot_eq, ":cur_object_troop", slot_troop_cur_center, ":giver_center_no"),#Skip if the lady is not at the same center
(call_script, "script_cf_select_random_town_with_faction", ":giver_faction_no"),#Can fail
(assign, ":cur_target_center", reg0),
(neq, ":cur_target_center", ":giver_center_no"),
(hero_can_join),#Skip if player has no available slots
(assign, ":quest_object_troop", ":cur_object_troop"),
(assign, ":quest_target_center", ":cur_target_center"),
(assign, ":quest_expiration_days", 20),
(assign, ":quest_dont_give_again_period", 30),
(assign, ":result", ":quest_no"),
(try_end),
## (else_try),
## (eq, ":quest_no", "qst_hunt_down_raiders"),
## (try_begin),
## (gt, ":player_level", 10),
## (faction_slot_eq, ":giver_faction_no", slot_faction_leader, ":giver_troop"),
## (call_script, "script_cf_select_random_town_with_faction", ":giver_faction_no"),#Can fail
## (assign, ":cur_object_center", reg0),
## (neq, ":cur_object_center", ":giver_center_no"),#Skip current center
## (call_script, "script_get_random_enemy_center", ":giver_party_no"),
## (assign, ":cur_target_center", reg0),
## (ge, ":cur_target_center", 0),
## (store_faction_of_party, ":cur_target_faction", ":cur_target_center"),
## (is_between, ":cur_target_faction", kingdoms_begin, kingdoms_end),
##
## (assign, ":quest_object_center", ":cur_object_center"),
## (assign, ":quest_target_center", ":cur_target_center"),
## (assign, ":quest_importance", 1),
## (assign, ":quest_xp_reward", 1500),
## (assign, ":quest_gold_reward", 1000),
## (assign, ":result", ":quest_no"),
## (try_end),
## (else_try),
## (eq, ":quest_no", "qst_bring_back_deserters"),
## (try_begin),
## (gt, ":player_level", 5),
## (faction_get_slot, ":cur_target_party_template", ":giver_faction_no", slot_faction_deserter_party_template),
## (faction_get_slot, ":cur_target_troop", ":giver_faction_no", slot_faction_deserter_troop),
## (gt, ":cur_target_party_template", 0),#Skip factions with no deserter party templates
## (store_num_parties_of_template, ":num_deserters", ":cur_target_party_template"),
## (ge, ":num_deserters", 2),#Skip if there are less than 2 active deserter parties
##
## (assign, ":quest_target_troop", ":cur_target_troop"),
## (assign, ":quest_target_party_template", ":cur_target_party_template"),
## (assign, ":quest_target_amount", 5),
## (assign, ":quest_importance", 1),
## (assign, ":quest_xp_reward", 500),
## (assign, ":quest_gold_reward", 300),
## (assign, ":result", ":quest_no"),
## (try_end),
## (else_try),
## (eq, ":quest_no", "qst_deliver_supply_to_center_under_siege"),
## (try_begin),
## (gt, ":player_level", 10),
## (gt, ":giver_center_no", 0),#Skip if lord is outside the center
## (call_script, "script_cf_get_random_siege_location_with_faction", ":giver_faction_no"),#Can fail
## (assign, ":quest_target_center", reg0),
## (assign, ":quest_target_amount", 10),
## (assign, ":quest_importance", 1),
## (assign, ":quest_xp_reward", 500),
## (assign, ":quest_gold_reward", 300),
## (assign, ":result", ":quest_no"),
## (try_end),
## (else_try),
## (eq, ":quest_no", "qst_rescue_lady_under_siege"),
## (try_begin),
## (gt, ":player_level", 15),
## (troop_get_slot, ":cur_object_troop", ":giver_troop", slot_troop_daughter),
## (store_random_in_range, ":random_no", 0, 2),
## (try_begin),
## (this_or_next|eq, ":cur_object_troop", 0),
## (eq, ":random_no", 0),
## (troop_get_slot, ":cur_object_troop_2", ":giver_troop", slot_troop_spouse),
## (gt, ":cur_object_troop_2", 0),
## (assign, ":cur_object_troop", ":cur_object_troop_2"),
## (try_end),
## (gt, ":cur_object_troop", 0),#Skip lords without a lady
## (troop_get_type, ":cur_troop_gender", ":cur_object_troop"),
## (eq, ":cur_troop_gender", 1),#Skip if lady is not female
## (troop_get_slot, ":cur_target_center", ":cur_object_troop", slot_troop_cur_center),
## (is_between, ":cur_target_center", centers_begin, centers_end),#Skip if she is not in a center
## (neq,":giver_center_no", ":cur_target_center"),#Skip current center
## (call_script, "script_cf_get_random_siege_location_with_faction", ":giver_faction_no"),#Can fail
## (assign, ":cur_target_center", reg0),
## (troop_set_slot, ":cur_object_troop", slot_troop_cur_center, ":cur_target_center"),#Move lady to the siege location
## (assign, ":quest_object_troop", ":cur_object_troop"),
## (assign, ":quest_target_center", ":cur_target_center"),
## (assign, ":quest_target_troop", ":giver_troop"),
## (assign, ":quest_importance", 1),
## (assign, ":quest_xp_reward", 200),
## (assign, ":quest_gold_reward", 750),
## (assign, ":result", ":quest_no"),
## (try_end),
## (else_try),
## (eq, ":quest_no", "qst_deliver_message_to_lover"),
## (try_begin),
## (is_between, ":player_level", 5, 30),
## (troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_lover),
## (gt, ":cur_target_troop", 0),#Skip lords without a lover
## (troop_get_slot, ":cur_target_center", ":cur_target_troop", slot_troop_cur_center),
## (is_between, ":cur_target_center", centers_begin, centers_end),#Skip if she is not in a center
## (neq,":giver_center_no", ":cur_target_center"),#Skip current center
## (assign, ":quest_target_troop", ":cur_target_troop"),
## (assign, ":quest_target_center", ":cur_target_center"),
## (assign, ":result", ":quest_no"),
## (try_end),
## (else_try),
## (eq, ":quest_no", "qst_bring_reinforcements_to_siege"),
## (try_begin),
## (gt, ":player_level", 10),
## (call_script, "script_cf_get_random_siege_location_with_attacker_faction", ":giver_faction_no"),#Can fail
## (assign, ":cur_target_center", reg0),
## (store_random_in_range, ":random_no", 5, 11),
## (troops_can_join, ":random_no"),#Skip if the player doesn't have enough room
## (call_script, "script_cf_get_number_of_random_troops_from_party", ":giver_party_no", ":random_no"),#Can fail
## (assign, ":cur_object_troop", reg0),
## (party_get_battle_opponent, ":cur_target_party", ":cur_target_center"),
## (party_get_num_companion_stacks, ":num_stacks", ":cur_target_party"),
## (gt, ":num_stacks", 0),#Skip if the besieger party has no troops
## (party_stack_get_troop_id, ":cur_target_troop", ":cur_target_party", 0),
## (troop_is_hero, ":cur_target_troop"),#Skip if the besieger party has no heroes
## (neq, ":cur_target_troop", ":giver_troop"),#Skip if the quest giver is the same troop
## (assign, ":quest_target_troop", ":cur_target_troop"),
## (assign, ":quest_object_troop", ":cur_object_troop"),
## (assign, ":quest_target_party", ":cur_target_party"),
## (assign, ":quest_target_center", ":cur_target_center"),
## (assign, ":quest_target_amount", ":random_no"),
## (assign, ":quest_importance", 1),
## (assign, ":quest_xp_reward", 400),
## (assign, ":quest_gold_reward", 200),
## (assign, ":result", ":quest_no"),
## (try_end),
(else_try),
(eq, ":quest_no", "qst_deliver_message_to_enemy_lord"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(is_between, ":player_level", 5,25),
(call_script, "script_cf_get_random_lord_from_another_faction_in_a_center", ":giver_faction_no"),#Can fail
(assign, ":cur_target_troop", reg0),
(call_script, "script_get_troop_attached_party", ":cur_target_troop"),
(assign, ":quest_target_center", reg0),#quest_target_center will definitely be a valid center
(assign, ":quest_target_troop", ":cur_target_troop"),
(assign, ":quest_importance", 1),
(assign, ":quest_xp_reward", 200),
(assign, ":quest_gold_reward", 0),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 40),
(try_end),
## (else_try),
## (eq, ":quest_no", "qst_bring_prisoners_to_enemy"),
## (try_begin),
## (gt, ":player_level", 10),
## (is_between, ":giver_center_no", centers_begin, centers_end),#Skip if the quest giver is not at a center
## (store_random_in_range, ":random_no", 5, 11),
## (troops_can_join_as_prisoner, ":random_no"),#Skip if the player doesn't have enough room
## (call_script, "script_get_random_enemy_town", ":giver_center_no"),
## (assign, ":cur_target_center", reg0),
## (ge, ":cur_target_center", 0),#Skip if there are no enemy towns
## (store_faction_of_party, ":cur_target_faction", ":cur_target_center"),
## (faction_get_slot, ":cur_object_troop", ":cur_target_faction", slot_faction_tier_5_troop),
## (assign, ":quest_target_center", ":cur_target_center"),
## (assign, ":quest_object_troop", ":cur_object_troop"),
## (assign, ":quest_target_amount", ":random_no"),
## (assign, ":quest_importance", 1),
## (assign, ":quest_xp_reward", 300),
## (assign, ":quest_gold_reward", 200),
## (assign, ":result", ":quest_no"),
## (try_end),
(else_try),
(eq, ":quest_no", "qst_deal_with_bandits_at_lords_village"),
(try_begin),
(neq, ":giver_reputation", lrep_debauched),
(neq, ":giver_reputation", lrep_quarrelsome),
(ge, "$g_talk_troop_faction_relation", 0),
(assign, ":end_cond", villages_end),
(assign, ":cur_target_center", -1),
(try_for_range, ":cur_village", villages_begin, ":end_cond"),
(party_slot_eq, ":cur_village", slot_town_lord, ":giver_troop"),
(party_slot_eq, ":cur_village", slot_village_infested_by_bandits, 1),
(assign, ":cur_target_center", ":cur_village"),
(assign, ":end_cond", 0),
(try_end),
(ge, ":cur_target_center", 0),
(neg|check_quest_active, "qst_eliminate_bandits_infesting_village"),
(assign, ":quest_target_center", ":cur_target_center"),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 30),
(try_end),
(else_try),
(eq, ":quest_no", "qst_raise_troops"),
(try_begin),
(neq, ":giver_reputation", lrep_martial),
(neq, ":giver_faction_no", "fac_player_supporters_faction"), #we need tier_1_troop a valid value
(ge, "$g_talk_troop_faction_relation", 0),
(store_character_level, ":cur_level", "trp_player"),
(gt, ":cur_level", 5),
(troop_slot_ge, "trp_player", slot_troop_renown, 100),
(store_random_in_range, ":quest_target_amount", 5, 8),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(le, ":quest_target_amount", ":free_capacity"),
(faction_get_slot, ":quest_object_troop", ":giver_faction_no", slot_faction_tier_1_troop),
(store_random_in_range, ":level_up", 20, 40),
(val_add, ":level_up", ":cur_level"),
(val_div, ":level_up", 10),
(store_mul, ":quest_gold_reward", ":quest_target_amount", 10),
(assign, ":quest_target_troop", ":quest_object_troop"),
(try_for_range, ":unused", 0, ":level_up"),
(troop_get_upgrade_troop, ":level_up_troop", ":quest_target_troop", 0),
(gt, ":level_up_troop", 0),
(assign, ":quest_target_troop", ":level_up_troop"),
(val_mul, ":quest_gold_reward", ":quest_gold_reward", 7),
(val_div, ":quest_gold_reward", ":quest_gold_reward", 4),
(try_end),
## (try_begin),
## (ge, ":cur_level", 15),
## (faction_get_slot, ":cur_target_troop", ":giver_faction_no", slot_faction_tier_5_troop),
## (assign, ":quest_gold_reward", 300),
## (else_try),
## (faction_get_slot, ":cur_target_troop", ":giver_faction_no", slot_faction_tier_4_troop),
## (assign, ":quest_gold_reward", 150),
## (try_end),
## (gt, ":cur_target_troop", 0),
(assign, ":quest_xp_reward", ":quest_gold_reward"),
(val_mul, ":quest_xp_reward", 3),
(val_div, ":quest_xp_reward", 10),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 120),
(assign, ":quest_dont_give_again_period", 15),
(try_end),
(else_try),
(eq, ":quest_no", "qst_collect_taxes"),
(try_begin),
(neq, ":giver_reputation", lrep_goodnatured),
(neq, ":giver_reputation", lrep_upstanding),
(ge, "$g_talk_troop_faction_relation", 0),
(call_script, "script_cf_troop_get_random_leaded_town_or_village_except_center", ":giver_troop", ":giver_center_no"),
(assign, ":quest_target_center", reg0),
(assign, ":quest_importance", 1),
(assign, ":quest_gold_reward", 0),
(assign, ":quest_xp_reward", 100),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 50),
(assign, ":quest_dont_give_again_period", 20),
(try_end),
(else_try),
(eq, ":quest_no", "qst_hunt_down_fugitive"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(call_script, "script_cf_select_random_village_with_faction", ":giver_faction_no"),
(assign, ":quest_target_center", reg0),
(store_random_in_range, ":quest_target_dna", 0, 1000000),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 30),
(try_end),
## (else_try),
## (eq, ":quest_no", "qst_capture_messenger"),
## (try_begin),
## (call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"),
## (assign, ":cur_target_faction", reg0),
## (faction_get_slot, ":cur_target_troop", ":cur_target_faction", slot_faction_messenger_troop),
## (gt, ":cur_target_troop", 0),#Checking the validiy of cur_target_troop
## (store_num_parties_destroyed_by_player, ":quest_target_amount", "pt_messenger_party"),
##
## (assign, ":quest_target_troop", ":cur_target_troop"),
## (assign, ":quest_target_party_template", ":cur_target_party_template"),
## (assign, ":quest_importance", 1),
## (assign, ":quest_xp_reward", 700),
## (assign, ":quest_gold_reward", 400),
## (assign, ":result", ":quest_no"),
## (try_end),
(else_try),
(eq, ":quest_no", "qst_kill_local_merchant"),
(try_begin),
(this_or_next|eq, ":giver_reputation", lrep_quarrelsome),
(this_or_next|eq, ":giver_reputation", lrep_cunning),
( eq, ":giver_reputation", lrep_debauched),
(neg|faction_slot_eq, ":giver_faction_no", slot_faction_leader, ":giver_troop"),#Can not take the quest from the king
(ge, "$g_talk_troop_faction_relation", 0),
(gt, ":player_level", 5),
(is_between, ":giver_center_no", towns_begin, towns_end),
(assign, ":quest_importance", 1),
(assign, ":quest_xp_reward", 300),
(assign, ":quest_gold_reward", 1000),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 10),
(assign, ":quest_dont_give_again_period", 30),
(try_end),
(else_try),
(eq, ":quest_no", "qst_bring_back_runaway_serfs"),
(try_begin),
(neq, ":giver_reputation", lrep_goodnatured),
(neq, ":giver_reputation", lrep_upstanding),
(ge, "$g_talk_troop_faction_relation", 0),
(ge, ":player_level", 5),
(gt, ":giver_center_no", 0),#Skip if lord is outside the center
(eq, "$g_defending_against_siege", 0),#Skip if the center is under siege (because of resting)
(assign, ":cur_object_center", -1),
(try_for_range, ":cur_village", villages_begin, villages_end),
(party_slot_eq, ":cur_village", slot_town_lord, ":giver_troop"),
(store_distance_to_party_from_party, ":dist", ":cur_village", ":giver_center_no"),
(lt, ":dist", 25),
(assign, ":cur_object_center", ":cur_village"),
(try_end),
(ge, ":cur_object_center", 0),#Skip if the quest giver is not the owner of any villages around the center
(call_script, "script_cf_select_random_town_with_faction", ":giver_faction_no"),
(assign, ":cur_target_center", reg0),
(neq, ":cur_target_center", ":giver_center_no"),#Skip current center
(store_distance_to_party_from_party, ":dist", ":cur_target_center", ":giver_center_no"),
(ge, ":dist", 20),
(assign, ":quest_target_party_template", "pt_runaway_serfs"),
(assign, ":quest_object_center", ":cur_object_center"),
(assign, ":quest_target_center", ":cur_target_center"),
(assign, ":quest_importance", 1),
(assign, ":quest_xp_reward", 200),
(assign, ":quest_gold_reward", 150),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 20),
(assign, "$qst_bring_back_runaway_serfs_num_parties_returned", 0),
(assign, "$qst_bring_back_runaway_serfs_num_parties_fleed", 0),
(try_end),
(else_try),
(eq, ":quest_no", "qst_follow_spy"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(neq, ":giver_reputation", lrep_goodnatured),
(party_get_skill_level, ":tracking_skill", "p_main_party", "skl_tracking"),
(ge, ":tracking_skill", 2),
(ge, ":player_level", 10),
(eq, "$g_defending_against_siege", 0), #Skip if the center is under siege (because of resting)
(gt, ":giver_party_no", 0), #Skip if the quest giver doesn't have a party
(gt, ":giver_center_no", 0), #skip if the quest giver is not in a center
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town), #skip if we are not in a town.
(party_get_position, pos2, "p_main_party"),
(assign, ":min_distance", 99999),
(try_for_range, ":unused_2", 0, 10),
(call_script, "script_cf_get_random_enemy_center", ":giver_party_no"),
(assign, ":random_object_center", reg0),
(party_get_position, pos3, ":random_object_center"),
(map_get_random_position_around_position, pos4, pos3, 6),
(get_distance_between_positions, ":cur_distance", pos2, pos4),
(lt, ":cur_distance", ":min_distance"),
(assign, ":min_distance", ":cur_distance"),
(assign, ":cur_object_center", ":random_object_center"),
(copy_position, pos63, pos4), #Do not change pos63 until quest is accepted
(try_end),
(gt, ":cur_object_center", 0), #Skip if there are no enemy centers
(assign, ":quest_object_center", ":cur_object_center"),
(assign, ":quest_dont_give_again_period", 50),
(assign, ":result", ":quest_no"),
(assign, "$qst_follow_spy_run_away", 0),
(assign, "$qst_follow_spy_meeting_state", 0),
(assign, "$qst_follow_spy_meeting_counter", 0),
(assign, "$qst_follow_spy_spy_back_in_town", 0),
(assign, "$qst_follow_spy_partner_back_in_town", 0),
(assign, "$qst_follow_spy_no_active_parties", 0),
(try_end),
(else_try),
(eq, ":quest_no", "qst_capture_enemy_hero"),
(try_begin),
(eq, "$players_kingdom", ":giver_faction_no"),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
(ge, ":player_level", 15),
(call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"),#Can fail
(assign, ":quest_target_faction", reg0),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 80),
(assign, ":quest_gold_reward", 2000),
(assign, ":result", ":quest_no"),
(try_end),
(else_try),
(eq, ":quest_no", "qst_lend_companion"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(assign, ":total_heroes", 0),
(party_get_num_companion_stacks, ":num_stacks","p_main_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
(troop_is_hero, ":stack_troop"),
(is_between, ":stack_troop", companions_begin, companions_end),
(store_character_level, ":stack_level", ":stack_troop"),
(ge, ":stack_level", 15),
(assign, ":is_quest_hero", 0),
(try_for_range, ":i_quest", 0, all_quests_end),
(check_quest_active, ":i_quest"),
(this_or_next|quest_slot_eq, ":i_quest", slot_quest_target_troop, ":stack_troop"),
(quest_slot_eq, ":i_quest", slot_quest_object_troop, ":stack_troop"),
(assign, ":is_quest_hero", 1),
(try_end),
(eq, ":is_quest_hero", 0),
(val_add, ":total_heroes", 1),
(try_end),
(gt, ":total_heroes", 0),#Skip if party has no eligible heroes
(store_random_in_range, ":random_hero", 0, ":total_heroes"),
(assign, ":total_heroes", 0),
(assign, ":cur_target_troop", -1),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(eq, ":cur_target_troop", -1),
(party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
(troop_is_hero, ":stack_troop"),
(neq, ":stack_troop", "trp_player"),
(store_character_level, ":stack_level", ":stack_troop"),
(ge, ":stack_level", 15),
(assign, ":is_quest_hero", 0),
(try_for_range, ":i_quest", 0, all_quests_end),
(check_quest_active, ":i_quest"),
(this_or_next|quest_slot_eq, ":i_quest", slot_quest_target_troop, ":stack_troop"),
(quest_slot_eq, ":i_quest", slot_quest_object_troop, ":stack_troop"),
(assign, ":is_quest_hero", 1),
(try_end),
(eq, ":is_quest_hero", 0),
(val_add, ":total_heroes", 1),
(gt, ":total_heroes", ":random_hero"),
(assign, ":cur_target_troop", ":stack_troop"),
(try_end),
(assign, ":quest_target_troop", ":cur_target_troop"),
(store_current_day, ":quest_target_amount"),
(val_add, ":quest_target_amount", 8),
(assign, ":quest_importance", 1),
(assign, ":quest_xp_reward", 300),
(assign, ":quest_gold_reward", 400),
(assign, ":result", ":quest_no"),
(assign, ":quest_dont_give_again_period", 30),
(try_end),
(else_try),
(eq, ":quest_no", "qst_collect_debt"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
# Find a vassal (within the same kingdom?)
(call_script, "script_cf_get_random_lord_in_a_center_with_faction", ":giver_faction_no"),#Can fail
(assign, ":quest_target_troop", reg0),
(neq, ":quest_target_troop", ":giver_troop"),#Skip himself
(call_script, "script_get_troop_attached_party", ":quest_target_troop"),
(assign, ":quest_target_center", reg0),#cur_target_center will definitely be a valid center
(neq,":giver_center_no", ":quest_target_center"),#Skip current center
(assign, ":quest_xp_reward", 30),
(assign, ":quest_gold_reward", 40),
(assign, ":result", ":quest_no"),
(store_random_in_range, ":quest_target_amount", 6, 9),
(val_mul, ":quest_target_amount", 500),
(store_div, ":quest_convince_value", ":quest_target_amount", 5),
(assign, ":quest_expiration_days", 90),
(assign, ":quest_dont_give_again_period", 20),
(try_end),
## (else_try),
## (eq, ":quest_no", "qst_capture_conspirators"),
## (try_begin),
## (eq, 1,0), #TODO: disable this for now
## (ge, ":player_level", 10),
## (is_between, ":giver_center_no", towns_begin, towns_end),#Skip if quest giver's center is not a town
## (party_slot_eq, ":giver_center_no", slot_town_lord, ":giver_troop"),#Skip if the current center is not ruled by the quest giver
## (call_script, "script_cf_get_random_kingdom_hero", ":giver_faction_no"),#Can fail
##
## (assign, ":quest_target_troop", reg0),
## (assign, ":quest_target_center", ":giver_center_no"),
## (assign, ":quest_importance", 1),
## (assign, ":quest_xp_reward", 10),
## (assign, ":quest_gold_reward", 10),
## (assign, ":result", ":quest_no"),
## (store_character_level, ":cur_level"),
## (val_div, ":cur_level", 5),
## (val_max, ":cur_level", 3),
## (store_add, ":max_parties", 4, ":cur_level"),
## (store_random_in_range, "$qst_capture_conspirators_num_parties_to_spawn", 4, ":max_parties"),
## (assign, "$qst_capture_conspirators_num_troops_to_capture", 0),
## (assign, "$qst_capture_conspirators_num_parties_spawned", 0),
## (assign, "$qst_capture_conspirators_leave_meeting_counter", 0),
## (assign, "$qst_capture_conspirators_party_1", 0),
## (assign, "$qst_capture_conspirators_party_2", 0),
## (assign, "$qst_capture_conspirators_party_3", 0),
## (assign, "$qst_capture_conspirators_party_4", 0),
## (assign, "$qst_capture_conspirators_party_5", 0),
## (assign, "$qst_capture_conspirators_party_6", 0),
## (assign, "$qst_capture_conspirators_party_7", 0),
## (try_end),
## (else_try),
## (eq, ":quest_no", "qst_defend_nobles_against_peasants"),
## (try_begin),
## (eq, 1,0), #TODO: disable this for now
## (ge, ":player_level", 10),
## (is_between, ":giver_center_no", towns_begin, towns_end),#Skip if quest giver's center is not a town
## (party_slot_eq, ":giver_center_no", slot_town_lord, ":giver_troop"),#Skip if the current center is not ruled by the quest giver
##
## (assign, ":quest_target_center", ":giver_center_no"),
## (assign, ":quest_importance", 1),
## (assign, ":quest_xp_reward", 10),
## (assign, ":quest_gold_reward", 10),
## (assign, ":result", ":quest_no"),
## (store_character_level, ":cur_level"),
## (val_div, ":cur_level", 5),
## (val_max, ":cur_level", 4),
## (store_add, ":max_parties", 4, ":cur_level"),
## (store_random_in_range, "$qst_defend_nobles_against_peasants_num_peasant_parties_to_spawn", 4, ":cur_level"),
## (store_random_in_range, "$qst_defend_nobles_against_peasants_num_noble_parties_to_spawn", 4, ":cur_level"),
## (assign, "$qst_defend_nobles_against_peasants_num_nobles_to_save", 0),
## (assign, "$qst_defend_nobles_against_peasants_num_nobles_saved", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_1", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_2", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_3", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_4", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_5", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_6", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_7", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_8", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_1", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_2", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_3", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_4", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_5", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_6", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_7", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_8", 0),
## (try_end),
(else_try),
(eq, ":quest_no", "qst_incriminate_loyal_commander"),
(try_begin),
(neq, ":giver_reputation", lrep_upstanding),
(neq, ":giver_reputation", lrep_goodnatured),
(eq, "$players_kingdom", ":giver_faction_no"),
(ge, ":player_level", 10),
(faction_slot_eq, ":giver_faction_no", slot_faction_leader, ":giver_troop"),
(assign, ":try_times", 1),
(assign, ":found", 0),
(try_for_range, ":unused", 0, ":try_times"),
(call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"),#Can fail
(assign, ":cur_target_faction", reg0),
(faction_get_slot, ":cur_target_troop", ":cur_target_faction", slot_faction_leader),
(assign, ":num_centerless_heroes", 0),
(try_for_range, ":cur_kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":cur_kingdom_hero", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":cur_kingdom_hero", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":cur_kingdom_hero", slot_troop_prisoner_of_party, 0),
(neq, ":cur_target_troop", ":cur_kingdom_hero"),
(store_troop_faction, ":cur_kingdom_hero_faction", ":cur_kingdom_hero"),
(eq, ":cur_target_faction", ":cur_kingdom_hero_faction"),
## (call_script, "script_get_number_of_hero_centers", ":cur_kingdom_hero"),
## (eq, reg0, 0),
(val_add, ":num_centerless_heroes", 1),
(try_end),
(gt, ":num_centerless_heroes", 0),
(assign, ":cur_object_troop", -1),
(store_random_in_range, ":random_kingdom_hero", 0, ":num_centerless_heroes"),
(try_for_range, ":cur_kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),
(eq, ":cur_object_troop", -1),
(troop_slot_eq, ":cur_kingdom_hero", slot_troop_occupation, slto_kingdom_hero),
(neq, ":cur_target_troop", ":cur_kingdom_hero"),
(store_troop_faction, ":cur_kingdom_hero_faction", ":cur_kingdom_hero"),
(eq, ":cur_target_faction", ":cur_kingdom_hero_faction"),
## (call_script, "script_get_number_of_hero_centers", ":cur_kingdom_hero"),
## (eq, reg0, 0),
(val_sub, ":random_kingdom_hero", 1),
(lt, ":random_kingdom_hero", 0),
(assign, ":cur_object_troop", ":cur_kingdom_hero"),
(try_end),
(assign, ":cur_target_center", -1),
(call_script, "script_get_troop_attached_party", ":cur_target_troop"),
(is_between, reg0, towns_begin, towns_end),
(party_slot_eq, reg0, slot_town_lord, ":cur_target_troop"),
(assign, ":cur_target_center", reg0),
(assign, ":try_times", -1),#Exit the second loop
(assign, ":found", 1),
(try_end),
(eq, ":found", 1),
(assign, "$incriminate_quest_sacrificed_troop", 0),
(party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":i_stack", 1, ":num_stacks"),
(eq ,"$incriminate_quest_sacrificed_troop", 0),
(party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(store_character_level, ":stack_troop_level", ":stack_troop"),
(ge, ":stack_troop_level", 25),
(assign, "$incriminate_quest_sacrificed_troop", ":stack_troop"),
(try_end),
(gt, "$incriminate_quest_sacrificed_troop", 0),
(assign, ":quest_target_troop", ":cur_target_troop"),
(assign, ":quest_object_troop", ":cur_object_troop"),
(assign, ":quest_target_center", ":cur_target_center"),
(assign, ":quest_target_faction", ":cur_target_faction"),
(assign, ":quest_importance", 1),
(assign, ":quest_xp_reward", 700),
(assign, ":quest_gold_reward", 1000),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 30),
(assign, ":quest_dont_give_again_period", 180),
(try_end),
(else_try),
(eq, ":quest_no", "qst_capture_prisoners"),
(try_begin),
(eq, "$players_kingdom", ":giver_faction_no"),
(call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"),#Can fail
(assign, ":cur_target_faction", reg0),
(store_add, ":max_tier_no", slot_faction_tier_5_troop, 1),
(store_random_in_range, ":random_tier_no", slot_faction_tier_2_troop, ":max_tier_no"),
(faction_get_slot, ":cur_target_troop", ":cur_target_faction", ":random_tier_no"),
(gt, ":cur_target_troop", 0),
(store_random_in_range, ":quest_target_amount", 3, 7),
(assign, ":quest_target_troop", ":cur_target_troop"),
(assign, ":quest_target_faction", ":cur_target_faction"),
(assign, ":quest_importance", 1),
(store_character_level, ":quest_gold_reward", ":cur_target_troop"),
(val_add, ":quest_gold_reward", 5),
(val_mul, ":quest_gold_reward", ":quest_gold_reward"),
(val_div, ":quest_gold_reward", 5),
(val_mul, ":quest_gold_reward", ":quest_target_amount"),
(assign, ":quest_xp_reward", ":quest_gold_reward"),
(assign, ":result", ":quest_no"),
(assign, ":quest_expiration_days", 90),
(assign, ":quest_dont_give_again_period", 20),
(try_end),
(try_end),
(try_end),
(try_begin),
(neq, ":result", -1),
(try_begin),
(ge, ":quest_target_center", 0),
(store_faction_of_party, ":quest_target_faction", ":quest_target_center"),
(try_end),
(quest_set_slot, ":result", slot_quest_target_troop, ":quest_target_troop"),
(quest_set_slot, ":result", slot_quest_target_center, ":quest_target_center"),
(quest_set_slot, ":result", slot_quest_object_troop, ":quest_object_troop"),
(quest_set_slot, ":result", slot_quest_target_faction, ":quest_target_faction"),
(quest_set_slot, ":result", slot_quest_object_faction, ":quest_object_faction"),
(quest_set_slot, ":result", slot_quest_object_center, ":quest_object_center"),
(quest_set_slot, ":result", slot_quest_target_party, ":quest_target_party"),
(quest_set_slot, ":result", slot_quest_target_party_template, ":quest_target_party_template"),
(quest_set_slot, ":result", slot_quest_target_amount, ":quest_target_amount"),
(quest_set_slot, ":result", slot_quest_importance, ":quest_importance"),
(quest_set_slot, ":result", slot_quest_xp_reward, ":quest_xp_reward"),
(quest_set_slot, ":result", slot_quest_gold_reward, ":quest_gold_reward"),
(quest_set_slot, ":result", slot_quest_convince_value, ":quest_convince_value"),
(quest_set_slot, ":result", slot_quest_expiration_days, ":quest_expiration_days"),
(quest_set_slot, ":result", slot_quest_dont_give_again_period, ":quest_dont_give_again_period"),
(quest_set_slot, ":result", slot_quest_current_state, 0),
(quest_set_slot, ":result", slot_quest_giver_troop, ":giver_troop"),
(quest_set_slot, ":result", slot_quest_giver_center, ":giver_center_no"),
(quest_set_slot, ":result", slot_quest_target_dna, ":quest_target_dna"),
(quest_set_slot, ":result", slot_quest_target_item, ":quest_target_item"),
(try_end),
(assign, reg0, ":result"),
]),
# script_cf_get_random_enemy_center_within_range
# Input: arg1 = party_no, arg2 = range (in kms)
# Output: reg0 = center_no
("cf_get_random_enemy_center_within_range",
[
(store_script_param, ":party_no", 1),
(store_script_param, ":range", 2),
(assign, ":num_centers", 0),
(store_faction_of_party, ":faction_no", ":party_no"),
(try_for_range, ":cur_center", centers_begin, centers_end),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(store_relation, ":cur_relation", ":faction_no", ":cur_faction"),
(lt, ":cur_relation", 0),
(store_distance_to_party_from_party, ":dist", ":party_no", ":cur_center"),
(le, ":dist", ":range"),
(val_add, ":num_centers", 1),
(try_end),
(gt, ":num_centers", 0),
(store_random_in_range, ":random_center", 0, ":num_centers"),
(assign, ":end_cond", centers_end),
(try_for_range, ":cur_center", centers_begin, ":end_cond"),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(store_relation, ":cur_relation", ":faction_no", ":cur_faction"),
(lt, ":cur_relation", 0),
(store_distance_to_party_from_party, ":dist", ":party_no", ":cur_center"),
(le, ":dist", ":range"),
(val_sub, ":random_center", 1),
(lt, ":random_center", 0),
(assign, ":result", ":cur_center"),
(assign, ":end_cond", 0),#break
(try_end),
(assign, reg0, ":result"),
]),
# script_cf_faction_get_random_enemy_faction
# Input: arg1 = faction_no
# Output: reg0 = faction_no (Can fail)
("cf_faction_get_random_enemy_faction",
[
(store_script_param_1, ":faction_no"),
(assign, ":result", -1),
(assign, ":count_factions", 0),
(try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
(store_relation, ":cur_relation", ":faction_no", ":cur_faction"),
(le, ":cur_relation", -1),
(val_add, ":count_factions", 1),
(try_end),
(store_random_in_range,":random_faction",0,":count_factions"),
(assign, ":count_factions", 0),
(try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
(eq, ":result", -1),
(faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
(store_relation, ":cur_relation", ":faction_no", ":cur_faction"),
(le, ":cur_relation", -1),
(val_add, ":count_factions", 1),
(gt, ":count_factions", ":random_faction"),
(assign, ":result", ":cur_faction"),
(try_end),
(neq, ":result", -1),
(assign, reg0, ":result"),
]),
# script_cf_faction_get_random_friendly_faction
# Input: arg1 = faction_no
# Output: reg0 = faction_no (Can fail)
("cf_faction_get_random_friendly_faction",
[
(store_script_param_1, ":faction_no"),
(assign, ":result", -1),
(assign, ":count_factions", 0),
(try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
(neq, ":cur_faction", ":faction_no"),
(store_relation, ":cur_relation", ":faction_no", ":cur_faction"),
(ge, ":cur_relation", 0),
(val_add, ":count_factions", 1),
(try_end),
(store_random_in_range,":random_faction",0,":count_factions"),
(assign, ":count_factions", 0),
(try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
(eq, ":result", -1),
(faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
(neq, ":cur_faction", ":faction_no"),
(store_relation, ":cur_relation", ":faction_no", ":cur_faction"),
(ge, ":cur_relation", 0),
(val_add, ":count_factions", 1),
(gt, ":count_factions", ":random_faction"),
(assign, ":result", ":cur_faction"),
(try_end),
(neq, ":result", -1),
(assign, reg0, ":result"),
]),
# script_cf_troop_get_random_enemy_troop_with_occupation
# Input: arg1 = troop_no,
# Output: reg0 = enemy_troop_no (Can fail)
("cf_troop_get_random_enemy_troop_with_occupation",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":occupation"),
(assign, ":result", -1),
(assign, ":count_enemies", 0),
(try_for_range, ":cur_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
(troop_get_slot, ":cur_enemy", ":troop_no", ":cur_slot"),
(gt, ":cur_enemy", 0),
(troop_slot_eq, ":cur_enemy", slot_troop_occupation, ":occupation"),
(val_add, ":count_enemies", 1),
(try_end),
(store_random_in_range,":random_enemy",0,":count_enemies"),
(assign, ":count_enemies", 0),
(try_for_range, ":cur_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
(eq, ":result", -1),
(troop_get_slot, ":cur_enemy", ":troop_no", ":cur_slot"),
(gt, ":cur_enemy", 0),
(troop_slot_eq, ":cur_enemy", slot_troop_occupation, ":occupation"),
(val_add, ":count_enemies", 1),
(gt, ":count_enemies", ":random_enemy"),
(assign, ":result", ":cur_enemy"),
(try_end),
(neq, ":result", -1),
(assign, reg0, ":result"),
]),
## # script_cf_troop_get_random_enemy_troop_as_a_town_lord
## # Input: arg1 = troop_no
## # Output: reg0 = enemy_troop_no (Can fail)
## ("cf_troop_get_random_enemy_troop_as_a_town_lord",
## [
## (store_script_param_1, ":troop_no"),
##
## (assign, ":result", -1),
## (assign, ":count_enemies", 0),
## (try_for_range, ":cur_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
## (troop_get_slot, ":cur_enemy", ":troop_no", ":cur_slot"),
## (gt, ":cur_enemy", 0),
## (troop_slot_eq, ":cur_enemy", slot_troop_occupation, slto_kingdom_hero),
## (call_script, "script_get_number_of_hero_centers", ":cur_enemy"),
## (gt, reg0, 0),
## (val_add, ":count_enemies", 1),
## (try_end),
## (store_random_in_range,":random_enemy",0,":count_enemies"),
## (assign, ":count_enemies", 0),
## (try_for_range, ":cur_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
## (eq, ":result", -1),
## (troop_get_slot, ":cur_enemy", ":troop_no", ":cur_slot"),
## (gt, ":cur_enemy", 0),
## (troop_slot_eq, ":cur_enemy", slot_troop_occupation, slto_kingdom_hero),
## (call_script, "script_get_number_of_hero_centers", ":cur_enemy"),
## (gt, reg0, 0),
## (val_add, ":count_enemies", 1),
## (gt, ":count_enemies", ":random_enemy"),
## (assign, ":result", ":cur_enemy"),
## (try_end),
## (neq, ":result", -1),
## (assign, reg0, ":result"),
## ]),
## # script_cf_get_random_enemy_with_valid_slot
## # Input: arg1 = faction_no, arg2 = slot_no
## # Output: reg0 = faction_no (Can fail)
## ("cf_get_random_enemy_with_valid_slot",
## [
## (store_script_param_1, ":faction_no"),
## (store_script_param_2, ":slot_no"),
##
## (assign, ":result", -1),
## (assign, ":count_factions", 0),
## (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
## (store_relation, ":cur_relation", ":faction_no", ":cur_faction"),
## (le, ":cur_relation", -10),
## (faction_get_slot, ":cur_value", ":cur_faction", ":slot_no"),
## (gt, ":cur_value", 0),#Checking validity
## (val_add, ":count_factions", 1),
## (try_end),
## (store_random_in_range,":random_faction",0,":count_factions"),
## (assign, ":count_factions", 0),
## (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
## (eq, ":result", -1),
## (store_relation, ":cur_relation", ":faction_no", ":cur_faction"),
## (le, ":cur_relation", -10),
## (faction_get_slot, ":cur_value", ":cur_faction", ":slot_no"),
## (gt, ":cur_value", 0),#Checking validity
## (val_add, ":count_factions", 1),
## (gt, ":count_factions", ":random_faction"),
## (assign, ":result", ":cur_faction"),
## (try_end),
##
## (neq, ":result", -1),
## (assign, reg0, ":result"),
## ]),
## # script_cf_get_random_kingdom_hero
## # Input: arg1 = faction_no
## # Output: reg0 = troop_no (Can fail)
## ("cf_get_random_kingdom_hero",
## [
## (store_script_param_1, ":faction_no"),
## (assign, ":count_heroes", 0),
## (try_for_range, ":center_no", centers_begin, centers_end),
## (store_faction_of_party, ":cur_faction", ":center_no"),
## (eq, ":cur_faction", ":faction_no"),
## (party_get_slot, ":cur_lord", ":center_no", slot_town_lord),
## (is_between, ":cur_lord", heroes_begin, heroes_end),
## (val_add, ":count_heroes", 1),
## (try_end),
## (store_random_in_range, ":random_hero", 0, ":count_heroes"),
## (assign, ":result", -1),
## (assign, ":count_heroes", 0),
## (try_for_range, ":center_no", centers_begin, centers_end),
## (eq, ":result", -1),
## (store_faction_of_party, ":cur_faction", ":center_no"),
## (eq, ":cur_faction", ":faction_no"),
## (party_get_slot, ":cur_lord", ":center_no", slot_town_lord),
## (is_between, ":cur_lord", heroes_begin, heroes_end),
## (val_add, ":count_heroes", 1),
## (lt, ":random_hero", ":count_heroes"),
## (assign, ":result", ":cur_lord"),
## (try_end),
## (neq, ":result", -1),
## (assign, reg0, ":result"),
## ]),
# script_cf_get_random_kingdom_hero_as_lover
# Input: arg1 = troop_no (of the lady)
# Output: reg0 = troop_no (of the hero) (Can fail)
("cf_get_random_kingdom_hero_as_lover",
[
# (store_script_param_1, ":cur_lady"),
# (troop_get_slot, ":cur_father", ":cur_lady", slot_troop_father),
# (troop_get_slot, ":fathers_rank", ":cur_father", slot_troop_kingdom_rank),
(assign, ":result", -1),
(assign, ":count_heroes", 0),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":troop_no", slot_troop_lover, 0),
(troop_slot_eq, ":troop_no", slot_troop_spouse, 0),
# (troop_get_slot, ":cur_rank", ":troop_no", slot_troop_kingdom_rank),
# (lt, ":cur_rank", ":fathers_rank"), # Only heroes with lower ranks may be the lovers of the daughters
(val_add, ":count_heroes", 1),
(try_end),
(store_random_in_range,":random_hero",0,":count_heroes"),
(assign, ":count_heroes", 0),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(eq, ":result", -1),
(troop_slot_eq, ":troop_no", slot_troop_lover, 0),
(troop_slot_eq, ":troop_no", slot_troop_spouse, 0),
# (troop_get_slot, ":cur_rank", ":troop_no", slot_troop_kingdom_rank),
# (lt, ":cur_rank", ":fathers_rank"), # Only heroes with lower ranks may be the lovers of the daughters
(val_add, ":count_heroes", 1),
(gt, ":count_heroes", ":random_hero"),
(assign, ":result", ":troop_no"),
(try_end),
(neq, ":result", -1),
(assign, reg0, ":result"),
]),
## # script_cf_get_random_siege_location_with_faction
## # Input: arg1 = faction_no
## # Output: reg0 = center_no, Can Fail!
## ("cf_get_random_siege_location_with_faction",
## [
## (store_script_param_1, ":faction_no"),
## (assign, ":result", -1),
## (assign, ":count_sieges", 0),
## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
## (party_get_battle_opponent, ":besieger_party", ":center_no"),
## (gt, ":besieger_party", 0),
## (store_faction_of_party, ":cur_faction_no", ":center_no"),
## (eq, ":cur_faction_no", ":faction_no"),
## (val_add, ":count_sieges", 1),
## (try_end),
## (store_random_in_range,":random_center",0,":count_sieges"),
## (assign, ":count_sieges", 0),
## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
## (eq, ":result", -1),
## (party_get_battle_opponent, ":besieger_party", ":center_no"),
## (gt, ":besieger_party", 0),
## (store_faction_of_party, ":cur_faction_no", ":center_no"),
## (eq, ":cur_faction_no", ":faction_no"),
## (val_add, ":count_sieges", 1),
## (gt, ":count_sieges", ":random_center"),
## (assign, ":result", ":center_no"),
## (try_end),
## (neq, ":result", -1),
## (assign, reg0, ":result"),
## ]),
## # script_cf_get_random_siege_location_with_attacker_faction
## # Input: arg1 = faction_no
## # Output: reg0 = center_no, Can Fail!
## ("cf_get_random_siege_location_with_attacker_faction",
## [
## (store_script_param_1, ":faction_no"),
## (assign, ":result", -1),
## (assign, ":count_sieges", 0),
## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
## (party_get_battle_opponent, ":besieger_party", ":center_no"),
## (gt, ":besieger_party", 0),
## (store_faction_of_party, ":cur_faction_no", ":besieger_party"),
## (eq, ":cur_faction_no", ":faction_no"),
## (val_add, ":count_sieges", 1),
## (try_end),
## (store_random_in_range,":random_center",0,":count_sieges"),
## (assign, ":count_sieges", 0),
## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
## (eq, ":result", -1),
## (party_get_battle_opponent, ":besieger_party", ":center_no"),
## (gt, ":besieger_party", 0),
## (store_faction_of_party, ":cur_faction_no", ":besieger_party"),
## (eq, ":cur_faction_no", ":faction_no"),
## (val_add, ":count_sieges", 1),
## (gt, ":count_sieges", ":random_center"),
## (assign, ":result", ":center_no"),
## (try_end),
## (neq, ":result", -1),
## (assign, reg0, ":result"),
## ]),
## # script_cf_get_number_of_random_troops_from_party
## # Input: arg1 = party_no, arg2 = number of troops to remove
## # Output: reg0 = troop_no, Can fail if there are no slots having the required number of units!
## ("cf_get_number_of_random_troops_from_party",
## [
## (store_script_param_1, ":party_no"),
## (store_script_param_2, ":no_to_remove"),
##
## (assign, ":result", -1),
## (assign, ":count_stacks", 0),
##
## (party_get_num_companion_stacks, ":num_stacks",":party_no"),
## (try_for_range, ":i_stack", 0, ":num_stacks"),
## (party_stack_get_size, ":stack_size",":party_no",":i_stack"),
## (party_stack_get_num_wounded, ":num_wounded",":party_no",":i_stack"),
## (val_sub, ":stack_size", ":num_wounded"),
## (ge, ":stack_size", ":no_to_remove"),
## (party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"),
## (neg|troop_is_hero, ":stack_troop"),
## (val_add, ":count_stacks", 1),
## (try_end),
## (store_random_in_range,":random_stack",0,":count_stacks"),
## (assign, ":count_stacks", 0),
## (try_for_range, ":i_stack", 0, ":num_stacks"),
## (eq, ":result", -1),
## (party_stack_get_size, ":stack_size",":party_no",":i_stack"),
## (party_stack_get_num_wounded, ":num_wounded",":party_no",":i_stack"),
## (val_sub, ":stack_size", ":num_wounded"),
## (ge, ":stack_size", ":no_to_remove"),
## (party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"),
## (neg|troop_is_hero, ":stack_troop"),
## (val_add, ":count_stacks", 1),
## (gt, ":count_stacks", ":random_stack"),
## (assign, ":result", ":stack_troop"),
## (try_end),
##
## (neq, ":result", -1),
## (assign, reg0, ":result"),
## ]),
# script_cf_get_random_lord_in_a_center_with_faction
# Input: arg1 = faction_no
# Output: reg0 = troop_no, Can Fail!
("cf_get_random_lord_in_a_center_with_faction",
[
(store_script_param_1, ":faction_no"),
(assign, ":result", -1),
(assign, ":count_lords", 0),
(try_for_range, ":lord_no", heroes_begin, heroes_end),
(store_troop_faction, ":lord_faction_no", ":lord_no"),
(eq, ":faction_no", ":lord_faction_no"),
(troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party),
(ge, ":lord_party", 0),
(party_get_attached_to, ":lord_attachment", ":lord_party"),
(is_between, ":lord_attachment", centers_begin, centers_end), #is troop in a center?
(val_add, ":count_lords", 1),
(try_end),
(store_random_in_range, ":random_lord", 0, ":count_lords"),
(assign, ":count_lords", 0),
(try_for_range, ":lord_no", heroes_begin, heroes_end),
(eq, ":result", -1),
(store_troop_faction, ":lord_faction_no", ":lord_no"),
(eq, ":faction_no", ":lord_faction_no"),
(troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party),
(ge, ":lord_party", 0),
(party_get_attached_to, ":lord_attachment", ":lord_party"),
(is_between, ":lord_attachment", centers_begin, centers_end), #is troop in a center?
(val_add, ":count_lords", 1),
(lt, ":random_lord", ":count_lords"),
(assign, ":result", ":lord_no"),
(try_end),
(neq, ":result", -1),
(assign, reg0, ":result"),
]),
# script_cf_get_random_lord_except_king_with_faction
# Input: arg1 = faction_no
# Output: reg0 = troop_no, Can Fail!
("cf_get_random_lord_except_king_with_faction",
[
(store_script_param_1, ":faction_no"),
(assign, ":result", -1),
(assign, ":count_lords", 0),
(try_for_range, ":lord_no", heroes_begin, heroes_end),
(store_troop_faction, ":lord_faction_no", ":lord_no"),
(eq, ":faction_no", ":lord_faction_no"),
(neg|faction_slot_eq, ":faction_no", slot_faction_leader, ":lord_no"),
(troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party),
(ge, ":lord_party", 0),
(val_add, ":count_lords", 1),
(try_end),
(store_random_in_range, ":random_lord", 0, ":count_lords"),
(assign, ":count_lords", 0),
(try_for_range, ":lord_no", heroes_begin, heroes_end),
(eq, ":result", -1),
(store_troop_faction, ":lord_faction_no", ":lord_no"),
(eq, ":faction_no", ":lord_faction_no"),
(neg|faction_slot_eq, ":faction_no", slot_faction_leader, ":lord_no"),
(troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party),
(ge, ":lord_party", 0),
(val_add, ":count_lords", 1),
(lt, ":random_lord", ":count_lords"),
(assign, ":result", ":lord_no"),
(try_end),
(neq, ":result", -1),
(assign, reg0, ":result"),
]),
# script_cf_get_random_lord_from_another_faction_in_a_center
# Input: arg1 = faction_no
# Output: reg0 = troop_no, Can Fail!
("cf_get_random_lord_from_another_faction_in_a_center",
[
(store_script_param_1, ":faction_no"),
(assign, ":result", -1),
(assign, ":count_lords", 0),
(try_for_range, ":lord_no", heroes_begin, heroes_end),
(store_troop_faction, ":lord_faction_no", ":lord_no"),
(neq, ":lord_faction_no", ":faction_no"),
(store_relation, ":our_relation", ":lord_faction_no", "fac_player_supporters_faction"),
(store_relation, ":lord_relation", ":lord_faction_no", ":faction_no"),
(lt, ":lord_relation", 0),
(ge, ":our_relation", 0),
(troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party),
(ge, ":lord_party", 0),
(party_get_attached_to, ":lord_attachment", ":lord_party"),
(is_between, ":lord_attachment", centers_begin, centers_end), #is troop in a center?
(val_add, ":count_lords", 1),
(try_end),
(store_random_in_range, ":random_lord", 0, ":count_lords"),
(assign, ":count_lords", 0),
(try_for_range, ":lord_no", heroes_begin, heroes_end),
(eq, ":result", -1),
(store_troop_faction, ":lord_faction_no", ":lord_no"),
(neq, ":lord_faction_no", ":faction_no"),
(store_relation, ":our_relation", ":lord_faction_no", "fac_player_supporters_faction"),
(store_relation, ":lord_relation", ":lord_faction_no", ":faction_no"),
(lt, ":lord_relation", 0),
(ge, ":our_relation", 0),
(troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party),
(ge, ":lord_party", 0),
(party_get_attached_to, ":lord_attachment", ":lord_party"),
(is_between, ":lord_attachment", centers_begin, centers_end), #is troop in a center?
(val_add, ":count_lords", 1),
(lt, ":random_lord", ":count_lords"),
(assign, ":result", ":lord_no"),
(try_end),
(neq, ":result", -1),
(assign, reg0, ":result"),
]),
# script_get_closest_walled_center
# Input: arg1 = party_no
# Output: reg0 = center_no (closest)
("get_closest_walled_center",
[
(store_script_param_1, ":party_no"),
(assign, ":min_distance", 9999999),
(assign, reg0, -1),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"),
(lt, ":party_distance", ":min_distance"),
(assign, ":min_distance", ":party_distance"),
(assign, reg0, ":center_no"),
(try_end),
]),
# script_get_closest_center
# Input: arg1 = party_no
# Output: reg0 = center_no (closest)
("get_closest_center",
[
(store_script_param_1, ":party_no"),
(assign, ":min_distance", 9999999),
(assign, reg0, -1),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"),
(lt, ":party_distance", ":min_distance"),
(assign, ":min_distance", ":party_distance"),
(assign, reg0, ":center_no"),
(try_end),
]),
# script_get_closest_center_of_faction
# Input: arg1 = party_no, arg2 = kingdom_no
# Output: reg0 = center_no (closest)
("get_closest_center_of_faction",
[
(store_script_param_1, ":party_no"),
(store_script_param_2, ":kingdom_no"),
(assign, ":min_distance", 99999),
(assign, ":result", -1),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":faction_no", ":center_no"),
(eq, ":faction_no", ":kingdom_no"),
(store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"),
(lt, ":party_distance", ":min_distance"),
(assign, ":min_distance", ":party_distance"),
(assign, ":result", ":center_no"),
(try_end),
(assign, reg0, ":result"),
]),
# script_get_closest_walled_center_of_faction
# Input: arg1 = party_no, arg2 = kingdom_no
# Output: reg0 = center_no (closest)
("get_closest_walled_center_of_faction",
[
(store_script_param_1, ":party_no"),
(store_script_param_2, ":kingdom_no"),
(assign, ":min_distance", 99999),
(assign, ":result", -1),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":faction_no", ":center_no"),
(eq, ":faction_no", ":kingdom_no"),
(store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"),
(lt, ":party_distance", ":min_distance"),
(assign, ":min_distance", ":party_distance"),
(assign, ":result", ":center_no"),
(try_end),
(assign, reg0, ":result"),
]),
## # script_get_closest_town_of_faction
## # Input: arg1 = party_no, arg2 = kingdom_no
## # Output: reg0 = center_no (closest)
## ("get_closest_town_of_faction",
## [
## (store_script_param_1, ":party_no"),
## (store_script_param_2, ":kingdom_no"),
## (assign, ":min_distance", 9999999),
## (assign, ":result", -1),
## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
## (store_faction_of_party, ":faction_no", ":center_no"),
## (eq, ":faction_no", ":kingdom_no"),
## (party_slot_eq, ":center_no", slot_party_type, spt_town),
## (store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"),
## (lt, ":party_distance", ":min_distance"),
## (assign, ":min_distance", ":party_distance"),
## (assign, ":result", ":center_no"),
## (try_end),
## (assign, reg0, ":result"),
## ]),
# script_let_nearby_parties_join_current_battle
# Input: arg1 = besiege_mode, arg2 = dont_add_friends
# Output: none
("let_nearby_parties_join_current_battle",
[
(store_script_param, ":besiege_mode", 1),
(store_script_param, ":dont_add_friends", 2),
(assign, ":join_distance", 5),
(try_begin),
(is_currently_night),
(assign, ":join_distance", 3),
(try_end),
(try_for_parties, ":party_no"),
(party_get_battle_opponent, ":opponent",":party_no"),
(lt, ":opponent", 0), #party is not itself involved in a battle
(party_get_attached_to, ":attached_to",":party_no"),
(lt, ":attached_to", 0), #party is not attached to another party
(get_party_ai_behavior, ":behavior", ":party_no"),
(neq, ":behavior", ai_bhvr_in_town),
(store_distance_to_party_from_party, ":distance", ":party_no", "p_main_party"),
(lt, ":distance", ":join_distance"),
(store_faction_of_party, ":faction_no", ":party_no"),
(store_faction_of_party, ":enemy_faction", "$g_enemy_party"),
(try_begin),
(eq, ":faction_no", "fac_player_supporters_faction"),
(assign, ":reln_with_player", 100),
(else_try),
(store_relation, ":reln_with_player", ":faction_no", "fac_player_supporters_faction"),
(try_end),
(try_begin),
(eq, ":faction_no", ":enemy_faction"),
(assign, ":reln_with_enemy", 100),
(else_try),
(store_relation, ":reln_with_enemy", ":faction_no", ":enemy_faction"),
(try_end),
(assign, ":enemy_side", 1),
(try_begin),
(neq, "$g_enemy_party", "$g_encountered_party"),
(assign, ":enemy_side", 2),
(try_end),
(try_begin),
(eq, ":besiege_mode", 0),
(lt, ":reln_with_player", 0),
(gt, ":reln_with_enemy", 0),
(party_get_slot, ":party_type", ":party_no"),
(eq, ":party_type", spt_kingdom_hero_party),
(get_party_ai_behavior, ":ai_bhvr", ":party_no"),
(neq, ":ai_bhvr", ai_bhvr_avoid_party),
(party_quick_attach_to_current_battle, ":party_no", ":enemy_side"), #attach as enemy
(str_store_party_name, s1, ":party_no"),
(display_message, "str_s1_joined_battle_enemy"),
(else_try),
(eq, ":dont_add_friends", 0),
(gt, ":reln_with_player", 0),
(lt, ":reln_with_enemy", 0),
(assign, ":do_join", 1),
(try_begin),
(eq, ":besiege_mode", 1),
(assign, ":do_join", 0),
(eq, ":faction_no", "$players_kingdom"),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
(assign, ":do_join", 1),
(try_end),
(eq, ":do_join", 1),
(party_get_slot, ":party_type", ":party_no"),
(eq, ":party_type", spt_kingdom_hero_party),
(party_stack_get_troop_id, ":leader", ":party_no", 0),
# (troop_get_slot, ":player_relation", ":leader", slot_troop_player_relation),
(call_script, "script_troop_get_player_relation", ":leader"),
(assign, ":player_relation", reg0),
(ge, ":player_relation", 0),
(party_quick_attach_to_current_battle, ":party_no", 0), #attach as friend
(str_store_party_name, s1, ":party_no"),
(display_message, "str_s1_joined_battle_friend"),
(try_end),
(try_end),
]),
# script_party_wound_all_members_aux
# Input: arg1 = party_no
("party_wound_all_members_aux",
[
(store_script_param_1, ":party_no"),
(party_get_num_companion_stacks, ":num_stacks",":party_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"),
(try_begin),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size",":party_no",":i_stack"),
(party_wound_members, ":party_no", ":stack_troop", ":stack_size"),
(else_try),
(troop_set_health, ":stack_troop", 0),
(try_end),
(try_end),
(party_get_num_attached_parties, ":num_attached_parties", ":party_no"),
(try_for_range, ":attached_party_rank", 0, ":num_attached_parties"),
(party_get_attached_party_with_rank, ":attached_party", ":party_no", ":attached_party_rank"),
(call_script, "script_party_wound_all_members_aux", ":attached_party"),
(try_end),
]),
# script_party_wound_all_members
# Input: arg1 = party_no
("party_wound_all_members",
[
(store_script_param_1, ":party_no"),
(call_script, "script_party_wound_all_members_aux", ":party_no"),
]),
# script_calculate_battle_advantage
# Output: reg0 = battle advantage
("calculate_battle_advantage",
[
(call_script, "script_party_count_fit_for_battle", "p_collective_friends"),
(assign, ":friend_count", reg(0)),
(party_get_skill_level, ":player_party_tactics", "p_main_party", skl_tactics),
(party_get_skill_level, ":ally_party_tactics", "p_collective_friends", skl_tactics),
(val_max, ":player_party_tactics", ":ally_party_tactics"),
(call_script, "script_party_count_fit_for_battle", "p_collective_enemy"),
(assign, ":enemy_count", reg(0)),
(party_get_skill_level, ":enemy_party_tactics", "p_collective_enemy", skl_tactics),
(val_add, ":friend_count", 1),
(val_add, ":enemy_count", 1),
(try_begin),
(ge, ":friend_count", ":enemy_count"),
(val_mul, ":friend_count", 100),
(store_div, ":ratio", ":friend_count", ":enemy_count"),
(store_sub, ":raw_advantage", ":ratio", 100),
(else_try),
(val_mul, ":enemy_count", 100),
(store_div, ":ratio", ":enemy_count", ":friend_count"),
(store_sub, ":raw_advantage", 100, ":ratio"),
(try_end),
(val_mul, ":raw_advantage", 2),
(val_mul, ":player_party_tactics", 30),
(val_mul, ":enemy_party_tactics", 30),
(val_add, ":raw_advantage", ":player_party_tactics"),
(val_sub, ":raw_advantage", ":enemy_party_tactics"),
(val_div, ":raw_advantage", 100),
(assign, reg0, ":raw_advantage"),
(display_message, "@Battle Advantage = {reg0}.", 0xFFFFFFFF),
]),
# script_cf_check_enemies_nearby
# Input: none
# Output: none, fails when enemies are nearby
("cf_check_enemies_nearby",
[
(get_player_agent_no, ":player_agent"),
(agent_is_alive, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(assign, ":result", 0),
(set_fixed_point_multiplier, 100),
(try_for_agents,":cur_agent"),
(neq, ":cur_agent", ":player_agent"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(neg|agent_is_ally, ":cur_agent"),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 1500), #15 meters
(assign, ":result", 1),
(try_end),
(eq, ":result", 0),
]),
# script_get_heroes_attached_to_center_aux
# For internal use only
("get_heroes_attached_to_center_aux",
[
(store_script_param_1, ":center_no"),
(store_script_param_2, ":party_no_to_collect_heroes"),
(party_get_num_companion_stacks, ":num_stacks",":center_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":center_no",":i_stack"),
(troop_is_hero, ":stack_troop"),
(party_add_members, ":party_no_to_collect_heroes", ":stack_troop", 1),
(try_end),
(party_get_num_attached_parties, ":num_attached_parties", ":center_no"),
(try_for_range, ":attached_party_rank", 0, ":num_attached_parties"),
(party_get_attached_party_with_rank, ":attached_party", ":center_no", ":attached_party_rank"),
(call_script, "script_get_heroes_attached_to_center_aux", ":attached_party", ":party_no_to_collect_heroes"),
(try_end),
]),
# script_get_heroes_attached_to_center
# Input: arg1 = center_no, arg2 = party_no_to_collect_heroes
# Output: none, adds heroes to the party_no_to_collect_heroes party
("get_heroes_attached_to_center",
[
(store_script_param_1, ":center_no"),
(store_script_param_2, ":party_no_to_collect_heroes"),
(party_clear, ":party_no_to_collect_heroes"),
(call_script, "script_get_heroes_attached_to_center_aux", ":center_no", ":party_no_to_collect_heroes"),
#rebellion changes begin -Arma
(try_for_range, ":pretender", pretenders_begin, pretenders_end),
(neq, ":pretender", "$supported_pretender"),
(troop_slot_eq, ":pretender", slot_troop_cur_center, ":center_no"),
(party_add_members, ":party_no_to_collect_heroes", ":pretender", 1),
(try_end),
# (try_for_range, ":rebel_faction", rebel_factions_begin, rebel_factions_end),
# (faction_slot_eq, ":rebel_faction", slot_faction_state, sfs_inactive_rebellion),
# (faction_slot_eq, ":rebel_faction", slot_faction_inactive_leader_location, ":center_no"),
# (faction_get_slot, ":pretender", ":rebel_faction", slot_faction_leader),
# (party_add_members, ":party_no_to_collect_heroes", ":pretender", 1),
# (try_end),
#rebellion changes end
]),
# script_get_heroes_attached_to_center_as_prisoner_aux
# For internal use only
("get_heroes_attached_to_center_as_prisoner_aux",
[
(store_script_param_1, ":center_no"),
(store_script_param_2, ":party_no_to_collect_heroes"),
(party_get_num_prisoner_stacks, ":num_stacks",":center_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop",":center_no",":i_stack"),
(troop_is_hero, ":stack_troop"),
(party_add_members, ":party_no_to_collect_heroes", ":stack_troop", 1),
(try_end),
(party_get_num_attached_parties, ":num_attached_parties", ":center_no"),
(try_for_range, ":attached_party_rank", 0, ":num_attached_parties"),
(party_get_attached_party_with_rank, ":attached_party", ":center_no", ":attached_party_rank"),
(call_script, "script_get_heroes_attached_to_center_as_prisoner_aux", ":attached_party", ":party_no_to_collect_heroes"),
(try_end),
]),
# script_get_heroes_attached_to_center_as_prisoner
# Input: arg1 = center_no, arg2 = party_no_to_collect_heroes
# Output: none, adds heroes to the party_no_to_collect_heroes party
("get_heroes_attached_to_center_as_prisoner",
[
(store_script_param_1, ":center_no"),
(store_script_param_2, ":party_no_to_collect_heroes"),
(party_clear, ":party_no_to_collect_heroes"),
(call_script, "script_get_heroes_attached_to_center_as_prisoner_aux", ":center_no", ":party_no_to_collect_heroes"),
]),
##
## # script_cf_get_party_leader
## # Input: arg1 = party_no
## # Output: reg0 = troop_no of the leader (Can fail)
## ("cf_get_party_leader",
## [
## (store_script_param_1, ":party_no"),
##
## (party_get_num_companion_stacks, ":num_stacks",":party_no"),
## (gt, ":num_stacks", 0),
## (party_stack_get_troop_id, ":stack_troop", ":party_no", 0),
## (troop_is_hero, ":stack_troop"),
## (assign, reg0, ":stack_troop"),
## ]),
# script_give_center_to_faction
# Input: arg1 = center_no, arg2 = faction
("give_center_to_faction",
[
(store_script_param_1, ":center_no"),
(store_script_param_2, ":faction_no"),
(try_begin),
(check_quest_active, "qst_join_siege_with_army"),
(quest_slot_eq, "qst_join_siege_with_army", slot_quest_target_center, ":center_no"),
(call_script, "script_abort_quest", "qst_join_siege_with_army", 0),
#Reactivating follow army quest
(faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall),
(str_store_troop_name_link, s9, ":faction_marshall"),
(setup_quest_text, "qst_follow_army"),
(str_store_string, s2, "@{s9} wants you to resume following his army until further notice."),
(call_script, "script_start_quest", "qst_follow_army", ":faction_marshall"),
(assign, "$g_player_follow_army_warnings", 0),
(try_end),
(store_faction_of_party, ":old_faction", ":center_no"),
(call_script, "script_give_center_to_faction_aux", ":center_no", ":faction_no"),
(call_script, "script_update_village_market_towns"),
(try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
(call_script, "script_faction_recalculate_strength", ":cur_faction"),
(try_end),
(assign, "$g_recalculate_ais", 1),
(call_script, "script_activate_deactivate_player_faction", ":old_faction"),
(try_begin),
(eq, ":faction_no", "fac_player_supporters_faction"),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(call_script, "script_give_center_to_lord", ":center_no", "trp_player", 0),
(try_for_range, ":cur_village", villages_begin, villages_end),
(store_faction_of_party, ":cur_village_faction", ":cur_village"),
(eq, ":cur_village_faction", "fac_player_supporters_faction"),
(neg|party_slot_eq, ":cur_village", slot_town_lord, "trp_player"),
(call_script, "script_give_center_to_lord", ":cur_village", "trp_player", 0),
(try_end),
(try_end),
]),
# script_give_center_to_faction_aux
# Input: arg1 = center_no, arg2 = faction
("give_center_to_faction_aux",
[
(store_script_param_1, ":center_no"),
(store_script_param_2, ":faction_no"),
(store_faction_of_party, ":old_faction", ":center_no"),
(party_set_slot, ":center_no", slot_center_ex_faction, ":old_faction"),
(party_set_faction, ":center_no", ":faction_no"),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(party_get_slot, ":farmer_party", ":center_no", slot_village_farmer_party),
(gt, ":farmer_party", 0),
(party_is_active, ":farmer_party"),
(party_set_faction, ":farmer_party", ":faction_no"),
(try_end),
(party_get_slot, ":old_town_lord", ":center_no", slot_town_lord),
(party_set_slot, ":center_no", slot_town_lord, stl_unassigned),
(party_set_banner_icon, ":center_no", 0),#Removing banner
(call_script, "script_update_faction_notes", ":old_faction"),
(call_script, "script_update_faction_notes", ":faction_no"),
(call_script, "script_update_center_notes", ":center_no"),
(try_begin),
(ge, ":old_town_lord", 0),
(call_script, "script_update_troop_notes", ":old_town_lord"),
(try_end),
(try_for_range, ":other_center", centers_begin, centers_end),
(party_slot_eq, ":other_center", slot_village_bound_center, ":center_no"),
(call_script, "script_give_center_to_faction_aux", ":other_center", ":faction_no"),
(try_end),
]),
# script_change_troop_faction
# Input: arg1 = troop_no, arg2 = faction
("change_troop_faction",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":faction_no"),
(try_begin),
#Reactivating inactive or defeated faction
(is_between, ":faction_no", kingdoms_begin, kingdoms_end),
(neg|faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(faction_set_slot, ":faction_no", slot_faction_state, sfs_active),
(call_script, "script_store_average_center_value_per_faction"),
(try_end),
(troop_set_faction, ":troop_no", ":faction_no"),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),
(party_set_faction, ":center_no", ":faction_no"),
(try_for_range, ":village_no", villages_begin, villages_end),
(party_slot_eq, ":village_no", slot_village_bound_center, ":center_no"),
(party_set_faction, ":village_no", ":faction_no"),
(party_get_slot, ":farmer_party_no", ":village_no", slot_village_farmer_party),
(try_begin),
(gt, ":farmer_party_no", 0),
(party_is_active, ":farmer_party_no"),
(party_set_faction, ":farmer_party_no", ":faction_no"),
(try_end),
(try_begin),
(party_get_slot, ":old_town_lord", ":village_no", slot_town_lord),
(neq, ":old_town_lord", ":troop_no"),
(party_set_slot, ":village_no", slot_town_lord, stl_unassigned),
(try_end),
(try_end),
(try_end),
(try_for_range, ":village_no", villages_begin, villages_end),
(party_slot_eq, ":village_no", slot_town_lord, ":troop_no"),
(store_faction_of_party, ":village_faction", ":village_no"),
(try_begin),
(neq, ":village_faction", ":faction_no"),
(party_set_slot, ":village_no", slot_town_lord, stl_unassigned),
(try_end),
(try_end),
(try_begin),
(troop_get_slot, ":leaded_party", ":troop_no", slot_troop_leaded_party),
(ge, ":leaded_party", 0),
(party_set_faction, ":leaded_party", ":faction_no"),
(party_get_num_prisoner_stacks, ":num_stacks", ":leaded_party"),
(try_for_range_backwards, ":troop_iterator", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":cur_troop_id", ":leaded_party", ":troop_iterator"),
(store_troop_faction, ":cur_faction", ":cur_troop_id"),
(troop_is_hero, ":cur_troop_id"),
(eq, ":cur_faction", ":faction_no"),
(call_script, "script_remove_troop_from_prison", ":cur_troop_id"),
(party_remove_prisoners, ":leaded_party", ":cur_troop_id", 1),
(try_end),
(try_end),
(call_script, "script_update_all_notes"),
(call_script, "script_update_village_market_towns"),
(assign, "$g_recalculate_ais", 1),
]),
# script_give_center_to_lord
# Input: arg1 = center_no, arg2 = lord_troop, arg3 = add_garrison_to_center
("give_center_to_lord",
[
(store_script_param, ":center_no", 1),
(store_script_param, ":lord_troop_id", 2),
(store_script_param, ":add_garrison", 3),
(party_get_slot, ":old_lord_troop_id", ":center_no", slot_town_lord),
(store_troop_faction, ":lord_troop_faction", ":lord_troop_id"),
(try_begin),
(eq, ":lord_troop_id", "trp_player"),
(gt, "$players_kingdom", 0),
(party_set_faction, ":center_no", "$players_kingdom"),
(else_try),
(eq, ":lord_troop_id", "trp_player"),
(le, "$players_kingdom", 0),
(party_set_faction, ":center_no", "fac_player_supporters_faction"),
(else_try),
(party_set_faction, ":center_no", ":lord_troop_faction"),
(try_end),
(party_set_slot, ":center_no", slot_town_lord, ":lord_troop_id"),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(party_get_slot, ":farmer_party_no", ":center_no", slot_village_farmer_party),
(gt, ":farmer_party_no", 0),
(party_is_active, ":farmer_party_no"),
(store_faction_of_party, ":center_faction", ":center_no"),
(party_set_faction, ":farmer_party_no", ":center_faction"),
(try_end),
(try_begin),
(this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
#normal_banner_begin
(troop_get_slot, ":cur_banner", ":lord_troop_id", slot_troop_banner_scene_prop),
(gt, ":cur_banner", 0),
(val_sub, ":cur_banner", banner_scene_props_begin),
(val_add, ":cur_banner", banner_map_icons_begin),
(party_set_banner_icon, ":center_no", ":cur_banner"),
# custom_banner_begin
# (troop_get_slot, ":flag_icon", ":lord_troop_id", slot_troop_custom_banner_map_flag_type),
# (ge, ":flag_icon", 0),
# (val_add, ":flag_icon", custom_banner_map_icons_begin),
# (party_set_banner_icon, ":center_no", ":flag_icon"),
(try_end),
(try_begin),
(eq, ":lord_troop_id", "trp_player"),
(neq, ":old_lord_troop_id", "trp_player"),
(party_get_slot, ":center_relation", ":center_no", slot_center_player_relation),
(is_between, ":center_relation", -4, 5),
(call_script, "script_change_player_relation_with_center", ":center_no", 5),
(gt, ":old_lord_troop_id", 0),
(call_script, "script_change_player_relation_with_troop", ":old_lord_troop_id", -25),
(try_end),
(call_script, "script_update_troop_notes", ":lord_troop_id"),
(call_script, "script_update_center_notes", ":center_no"),
(call_script, "script_update_faction_notes", ":lord_troop_faction"),
(try_begin),
(ge, ":old_lord_troop_id", 0),
(call_script, "script_update_troop_notes", ":old_lord_troop_id"),
(store_troop_faction, ":old_lord_troop_faction", ":old_lord_troop_id"),
(call_script, "script_update_faction_notes", ":old_lord_troop_faction"),
(try_end),
(try_begin),
(eq, ":add_garrison", 1),
(this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(assign, ":garrison_strength", 3),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(assign, ":garrison_strength", 9),
(try_end),
(try_for_range, ":unused", 0, ":garrison_strength"),
(call_script, "script_cf_reinforce_party", ":center_no"),
(try_end),
## ADD some XP initially
(try_for_range, ":unused", 0, 7),
(store_random_in_range, ":xp", 1500, 2000),
(party_upgrade_with_xp, ":center_no", ":xp", 0),
(try_end),
(try_end),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(try_for_range, ":cur_village", villages_begin, villages_end),
(party_slot_eq, ":cur_village", slot_village_bound_center, ":center_no"),
(call_script, "script_give_center_to_lord", ":cur_village", ":lord_troop_id", 0),
(try_end),
(try_end),
]),
## # script_give_town_to_besiegers
## # Input: arg1 = center_no, arg2 = besieger_party
## ("give_town_to_besiegers",
## [
## (store_script_param_1, ":center_no"),
## (store_script_param_2, ":besieger_party"),
## (store_faction_of_party, ":besieger_faction", ":besieger_party"),
##
## (try_begin),
## (call_script, "script_cf_get_party_leader", ":besieger_party"),
## (assign, ":new_leader", reg0),
## (else_try),
## (call_script, "script_select_kingdom_hero_for_new_center", ":besieger_faction"),
## (assign, ":new_leader", reg0),
## (try_end),
##
## (call_script, "script_give_center_to_lord", ":center_no", ":new_leader"),
##
## (try_for_parties, ":party_no"),
## (get_party_ai_object, ":object", ":party_no"),
## (get_party_ai_behavior, ":behavior", ":party_no"),
## (eq, ":object", ":center_no"),
## (this_or_next|eq, ":behavior", ai_bhvr_travel_to_party),
## (eq, ":behavior", ai_bhvr_attack_party),
## (party_set_ai_behavior, ":party_no", ai_bhvr_hold),
## (party_set_slot, ":party_no", slot_party_ai_state, spai_undefined),
## (party_set_flags, ":party_no", pf_default_behavior, 0),
## (try_end),
##
## #Staying at the center for a while
## (party_set_ai_behavior, ":besieger_party", ai_bhvr_hold),
## (party_set_slot, ":besieger_party", slot_party_ai_state, spai_undefined),
## (party_set_flags, ":besieger_party", pf_default_behavior, 0),
##
## (faction_get_slot, ":reinforcement_a", ":besieger_faction", slot_faction_reinforcements_a),
## (faction_get_slot, ":reinforcement_b", ":besieger_faction", slot_faction_reinforcements_b),
## (party_add_template, ":center_no", ":reinforcement_a"),
## (party_add_template, ":center_no", ":reinforcement_b"),
## ]),
##
# script_get_number_of_hero_centers
# Input: arg1 = troop_no
# Output: reg0 = number of centers that are ruled by the hero
("get_number_of_hero_centers",
[
(store_script_param_1, ":troop_no"),
(assign, ":result", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),
(val_add, ":result", 1),
(try_end),
(assign, reg0, ":result"),
]),
## # script_cf_get_new_center_leader_chance_for_troop
## # Input: arg1 = troop_no
## # Output: reg0 = chance of the troop to rule a new center
## ("cf_get_new_center_leader_chance_for_troop",
## [
## (store_script_param_1, ":troop_no"),
## (troop_get_slot, ":troop_rank", ":troop_no", slot_troop_kingdom_rank),
## (try_begin),
## (eq, ":troop_rank", 4),
## (assign, ":troop_chance", 1000),
## (else_try),
## (eq, ":troop_rank", 3),
## (assign, ":troop_chance", 800),
## (else_try),
## (eq, ":troop_rank", 2),
## (assign, ":troop_chance", 400),
## (else_try),
## (eq, ":troop_rank", 1),
## (assign, ":troop_chance", 100),
## (else_try),
## (assign, ":troop_chance", 10),
## (try_end),
##
## (call_script, "script_get_number_of_hero_centers", ":troop_no"),
## (assign, ":number_of_hero_centers", reg0),
## (try_begin),
## (gt, ":number_of_hero_centers", 0),
## (val_mul, ":number_of_hero_centers", 2),
## (val_mul, ":number_of_hero_centers", ":number_of_hero_centers"),
## (val_div, ":troop_chance", ":number_of_hero_centers"),
## (try_end),
## (assign, reg0, ":troop_chance"),
## (eq, reg0, 0),
## (assign, reg0, 1),
## ]),
## # script_select_kingdom_hero_for_new_center
## # Input: arg1 = faction_no
## # Output: reg0 = troop_no as the new leader
## ("select_kingdom_hero_for_new_center",
## [
## (store_script_param_1, ":kingdom"),
##
## (assign, ":min_num_centers", -1),
## (assign, ":min_num_centers_troop", -1),
##
## (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
## (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
## (store_troop_faction, ":troop_faction", ":troop_no"),
## (eq, ":troop_faction", ":kingdom"),
## (call_script, "script_get_number_of_hero_centers", ":troop_no"),
## (assign, ":num_centers", reg0),
## (try_begin),
## (lt, ":num_centers", ":min_num_centers"),
## (assign, ":min_num_centers", ":num_centers"),
## (assign, ":min_num_centers_troop", ":troop_no"),
## (try_end),
## (try_end),
## (assign, reg0, ":min_num_centers_troop"),
## ]),
# script_cf_get_random_enemy_center
# Input: arg1 = party_no
# Output: reg0 = center_no
("cf_get_random_enemy_center",
[
(store_script_param_1, ":party_no"),
(assign, ":result", -1),
(assign, ":total_enemy_centers", 0),
(store_faction_of_party, ":party_faction", ":party_no"),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(store_relation, ":party_relation", ":center_faction", ":party_faction"),
(lt, ":party_relation", 0),
(val_add, ":total_enemy_centers", 1),
(try_end),
(gt, ":total_enemy_centers", 0),
(store_random_in_range, ":random_center", 0, ":total_enemy_centers"),
(assign, ":total_enemy_centers", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(eq, ":result", -1),
(store_faction_of_party, ":center_faction", ":center_no"),
(store_relation, ":party_relation", ":center_faction", ":party_faction"),
(lt, ":party_relation", 0),
(val_sub, ":random_center", 1),
(lt, ":random_center", 0),
(assign, ":result", ":center_no"),
(try_end),
(assign, reg0, ":result"),
]),
## # script_get_random_enemy_town
## # Input: arg1 = party_no
## # Output: reg0 = center_no
## ("get_random_enemy_town",
## [
## (store_script_param_1, ":party_no"),
##
## (assign, ":result", -1),
## (assign, ":total_enemy_centers", 0),
## (store_faction_of_party, ":party_faction", ":party_no"),
##
## (try_for_range, ":center_no", towns_begin, towns_end),
## (store_faction_of_party, ":center_faction", ":center_no"),
## (neq, ":center_faction", ":party_faction"),
## (val_add, ":total_enemy_centers", 1),
## (try_end),
##
## (try_begin),
## (eq, ":total_enemy_centers", 0),
## (else_try),
## (store_random_in_range, ":random_center", 0, ":total_enemy_centers"),
## (assign, ":total_enemy_centers", 0),
## (try_for_range, ":center_no", towns_begin, towns_end),
## (eq, ":result", -1),
## (store_faction_of_party, ":center_faction", ":center_no"),
## (neq, ":center_faction", ":party_faction"),
## (store_relation, ":party_relation", ":center_faction", ":party_faction"),
## (le, ":party_relation", -10),
## (val_add, ":total_enemy_centers", 1),
## (lt, ":random_center", ":total_enemy_centers"),
## (assign, ":result", ":center_no"),
## (try_end),
## (try_end),
## (assign, reg0, ":result"),
## ]),
# script_find_travel_location
# Input: arg1 = center_no
# Output: reg0 = new_center_no (to travel within the same faction)
("find_travel_location",
[
(store_script_param_1, ":center_no"),
(store_faction_of_party, ":faction_no", ":center_no"),
(assign, ":total_weight", 0),
(try_for_range, ":cur_center_no", centers_begin, centers_end),
(neq, ":center_no", ":cur_center_no"),
(store_faction_of_party, ":center_faction_no", ":cur_center_no"),
(eq, ":faction_no", ":center_faction_no"),
(store_distance_to_party_from_party, ":cur_distance", ":center_no", ":cur_center_no"),
(val_add, ":cur_distance", 1),
(assign, ":new_weight", 100000),
(val_div, ":new_weight", ":cur_distance"),
(val_add, ":total_weight", ":new_weight"),
(try_end),
(assign, reg0, -1),
(try_begin),
(eq, ":total_weight", 0),
(else_try),
(store_random_in_range, ":random_weight", 0 , ":total_weight"),
(assign, ":total_weight", 0),
(assign, ":done", 0),
(try_for_range, ":cur_center_no", centers_begin, centers_end),
(eq, ":done", 0),
(neq, ":center_no", ":cur_center_no"),
(store_faction_of_party, ":center_faction_no", ":cur_center_no"),
(eq, ":faction_no", ":center_faction_no"),
(store_distance_to_party_from_party, ":cur_distance", ":center_no", ":cur_center_no"),
(val_add, ":cur_distance", 1),
(assign, ":new_weight", 100000),
(val_div, ":new_weight", ":cur_distance"),
(val_add, ":total_weight", ":new_weight"),
(lt, ":random_weight", ":total_weight"),
(assign, reg0, ":cur_center_no"),
(assign, ":done", 1),
(try_end),
(try_end),
]),
# script_get_relation_between_parties
# Input: arg1 = party_no_1, arg2 = party_no_2
# Output: reg0 = relation between parties
("get_relation_between_parties",
[
(store_script_param_1, ":party_no_1"),
(store_script_param_2, ":party_no_2"),
(store_faction_of_party, ":party_no_1_faction", ":party_no_1"),
(store_faction_of_party, ":party_no_2_faction", ":party_no_2"),
(try_begin),
(eq, ":party_no_1_faction", ":party_no_2_faction"),
(assign, reg0, 100),
(else_try),
(store_relation, ":relation", ":party_no_1_faction", ":party_no_2_faction"),
(assign, reg0, ":relation"),
(try_end),
]),
# script_calculate_weekly_party_wage
# Input: arg1 = party_no
# Output: reg0 = weekly wage
("calculate_weekly_party_wage",
[
(store_script_param_1, ":party_no"),
(assign, ":result", 0),
(party_get_num_companion_stacks, ":num_stacks",":party_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"),
(party_stack_get_size, ":stack_size",":party_no",":i_stack"),
(call_script, "script_npc_get_troop_wage", ":stack_troop", ":party_no"),
(assign, ":cur_wage", reg0),
(val_mul, ":cur_wage", ":stack_size"),
(val_add, ":result", ":cur_wage"),
(try_end),
(assign, reg0, ":result"),
]),
# script_calculate_player_faction_wage
# Input: arg1 = party_no
# Output: reg0 = weekly wage
("calculate_player_faction_wage",
[(assign, ":nongarrison_wages", 0),
(assign, ":garrison_wages", 0),
(try_for_parties, ":party_no"),
(assign, ":garrison_troop", 0),
(try_begin),
(this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_town),
(party_slot_eq, ":party_no", slot_party_type, spt_castle),
(party_slot_eq, ":party_no", slot_town_lord, "trp_player"),
(assign, ":garrison_troop", 1),
(try_end),
(party_get_attached_to, ":attached_party", ":party_no"),
(this_or_next|eq, ":party_no", "p_main_party"),
(this_or_next|eq, ":attached_party", "p_main_party"), # Added by Form Ranks kit
(eq, ":garrison_troop", 1),
(party_get_num_companion_stacks, ":num_stacks",":party_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"),
(party_stack_get_size, ":stack_size",":party_no",":i_stack"),
(call_script, "script_game_get_troop_wage", ":stack_troop", ":party_no"),
(assign, ":cur_wage", reg0),
(val_mul, ":cur_wage", ":stack_size"),
(try_begin),
(eq, ":garrison_troop", 1),
(val_add, ":garrison_wages", ":cur_wage"),
(else_try),
(val_add, ":nongarrison_wages", ":cur_wage"),
(try_end),
(try_end),
(try_end),
(val_div, ":garrison_wages", 2),#Half payment for garrisons
(store_sub, ":total_payment", 14, "$g_cur_week_half_daily_wage_payments"), #between 0 and 7
(val_mul, ":nongarrison_wages", ":total_payment"),
(val_div, ":nongarrison_wages", 14),
(store_add, reg0, ":nongarrison_wages", ":garrison_wages"),
]),
# script_calculate_hero_weekly_net_income_and_add_to_wealth
# Input: arg1 = troop_no
# Output: none
("calculate_hero_weekly_net_income_and_add_to_wealth",
[
(store_script_param_1, ":troop_no"),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(troop_get_slot, ":cur_wealth", ":troop_no", slot_troop_wealth),
(assign, ":weekly_income", 750), #let every hero receive 750 denars by default
(store_character_level, ":troop_level", ":troop_no"),
(store_mul, ":level_income", ":troop_level", 10),
(val_add, ":weekly_income", ":level_income"),
(store_troop_faction,":faction_no", ":troop_no"),
(try_begin), #check if troop is kingdom leader
(faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"),
(val_add, ":weekly_income", 1500),
(try_end),
(assign, ":cur_weekly_wage", 0),
(try_begin),
(gt, ":party_no",0),
(call_script, "script_calculate_weekly_party_wage", ":party_no"),
(assign, ":cur_weekly_wage", reg0),
(try_end),
(val_sub, ":weekly_income", ":cur_weekly_wage"),
(val_add, ":cur_wealth", ":weekly_income"),
(val_max, ":cur_wealth", 0),
(troop_set_slot, ":troop_no", slot_troop_wealth, ":cur_wealth"),
]),
# script_cf_reinforce_party
# Input: arg1 = party_no,
# Output: none
# Adds reinforcement to party according to its type and faction
("cf_reinforce_party",
[
(store_script_param_1, ":party_no"),
(store_faction_of_party, ":party_faction", ":party_no"),
(party_get_slot, ":party_type",":party_no", slot_party_type),
#Rebellion changes begin:
(try_begin),
(eq, ":party_type", spt_kingdom_hero_party),
(party_stack_get_troop_id, ":leader", ":party_no"),
(troop_get_slot, ":party_faction", ":leader", slot_troop_original_faction),
# (this_or_next|is_between, ":party_faction", rebel_factions_begin, rebel_factions_end),
# (faction_get_slot, ":target_faction", ":party_faction", slot_faction_rebellion_target),
# (assign, ":party_faction", ":target_faction"),
# (assign, ":party_faction", "fac_kingdom_1"),
(try_end),
#Rebellion changes end
(try_begin),
(eq, ":party_faction", "fac_player_supporters_faction"),
(party_get_slot, ":town_lord", ":party_no", slot_town_lord),
(try_begin),
(gt, ":town_lord", 0),
(troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),
(else_try),
(party_get_slot, ":party_faction", ":party_no", slot_center_original_faction),
(try_end),
(try_end),
(faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a),
(faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b),
(faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c),
(assign, ":party_template", 0),
(store_random_in_range, ":rand", 0, 100),
(try_begin),
(this_or_next|eq, ":party_type", spt_town),
(eq, ":party_type", spt_castle), #CASTLE OR TOWN
(try_begin),
(lt, ":rand", 65),
(assign, ":party_template", ":party_template_a"),
(else_try),
(assign, ":party_template", ":party_template_b"),
(try_end),
(else_try),
(eq, ":party_type", spt_kingdom_hero_party),
(try_begin),
(lt, ":rand", 50),
(assign, ":party_template", ":party_template_a"),
(else_try),
(lt, ":rand", 75),
(assign, ":party_template", ":party_template_b"),
(else_try),
(assign, ":party_template", ":party_template_c"),
(try_end),
(else_try),
(try_end),
(try_begin),
(gt, ":party_template", 0),
(party_add_template, ":party_no", ":party_template"),
(try_end),
]),
# script_hire_men_to_kingdom_hero_party
# Input: arg1 = troop_no (hero of the party)
# Output: none
("hire_men_to_kingdom_hero_party",
[
(store_script_param_1, ":troop_no"),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(troop_get_slot, ":cur_wealth", ":troop_no", slot_troop_wealth),
(assign, ":hiring_budget", ":cur_wealth"),
(val_mul, ":hiring_budget", 3),
(val_div, ":hiring_budget", 4),
(assign, ":num_rounds", 1),
(call_script, "script_party_get_ideal_size", ":party_no"),
(assign, ":ideal_size", reg0),
(store_mul, ":ideal_top_size", ":ideal_size", 3),
(val_div, ":ideal_top_size", 2),
(party_get_num_companions, ":party_size", ":party_no"),
(try_for_range, ":unused", 0 , ":num_rounds"),
(try_begin),
(lt, ":party_size", ":ideal_size"),
(gt, ":hiring_budget", reinforcement_cost),
(gt, ":party_no", 0),
(call_script, "script_cf_reinforce_party", ":party_no"),
(val_sub, ":cur_wealth", reinforcement_cost),
(troop_set_slot, ":troop_no", slot_troop_wealth, ":cur_wealth"),
(else_try),
(gt, ":party_size", ":ideal_top_size"),
(store_troop_faction, ":troop_faction", ":troop_no"),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(assign, ":total_regulars", 0),
(assign, ":total_regular_levels", 0),
(try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size", ":party_no", ":i_stack"),
(store_character_level, ":stack_level", ":stack_troop"),
(store_troop_faction, ":stack_faction", ":stack_troop"),
(try_begin),
(eq, ":troop_faction", ":stack_faction"),
(val_mul, ":stack_level", 3), #reducing the chance of the faction troops' removal
(try_end),
(val_mul, ":stack_level", ":stack_size"),
(val_add, ":total_regulars", ":stack_size"),
(val_add, ":total_regular_levels", ":stack_level"),
(try_end),
(gt, ":total_regulars", 0),
(store_div, ":average_level", ":total_regular_levels", ":total_regulars"),
(try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size", ":party_no", ":i_stack"),
(store_character_level, ":stack_level", ":stack_troop"),
(store_troop_faction, ":stack_faction", ":stack_troop"),
(try_begin),
(eq, ":troop_faction", ":stack_faction"),
(val_mul, ":stack_level", 3),
(try_end),
(store_sub, ":level_dif", ":average_level", ":stack_level"),
(val_div, ":level_dif", 3),
(store_add, ":prune_chance", 10, ":level_dif"),
(gt, ":prune_chance", 0),
(call_script, "script_get_percentage_with_randomized_round", ":stack_size", ":prune_chance"),
(gt, reg0, 0),
(party_remove_members, ":party_no", ":stack_troop", reg0),
(try_end),
(try_end),
(try_end),
]),
# script_get_percentage_with_randomized_round
# Input: arg1 = value, arg2 = percentage
# Output: none
("get_percentage_with_randomized_round",
[
(store_script_param, ":value", 1),
(store_script_param, ":percentage", 2),
(store_mul, ":result", ":value", ":percentage"),
(val_div, ":result", 100),
(store_mul, ":used_amount", ":result", 100),
(val_div, ":used_amount", ":percentage"),
(store_sub, ":left_amount", ":value", ":used_amount"),
(try_begin),
(gt, ":left_amount", 0),
(store_mul, ":chance", ":left_amount", ":percentage"),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":chance"),
(val_add, ":result", 1),
(try_end),
(assign, reg0, ":result"),
]),
# script_cf_create_merchant_party
# Input: arg1 = troop_no,
# Output: $pout_party = party_no
## ("cf_create_merchant_party",
## [
## (store_script_param_1, ":troop_no"),
## (store_troop_faction, ":troop_faction", ":troop_no"),
##
## (call_script, "script_cf_select_random_town_at_peace_with_faction", ":troop_faction"),
## (assign, ":center_no", reg0),
##
## (assign, "$pout_party", -1),
## (set_spawn_radius,0),
## (spawn_around_party,":center_no", "pt_merchant_party"),
## (assign, "$pout_party", reg0),
##
## (party_set_faction, "$pout_party", ":troop_faction"),
## (party_set_slot, "$pout_party", slot_party_type, spt_merchant_caravan),
## (party_set_slot, "$pout_party", slot_party_ai_state, spai_undefined),
## (troop_set_slot, ":troop_no", slot_troop_leaded_party, "$pout_party"),
## (party_add_leader, "$pout_party", ":troop_no"),
## (str_store_troop_name, s5, ":troop_no"),
## (party_set_name, "$pout_party", "str_s5_s_caravan"),
## (party_set_ai_behavior, "$pout_party", ai_bhvr_travel_to_party),
## (party_set_ai_object, "$pout_party", ":center_no"),
## (party_set_flags, "$pout_party", pf_default_behavior, 0),
## (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
## (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
## (store_add, ":cur_goods_price_slot", ":cur_goods", ":item_to_price_slot"),
## (party_set_slot, "$pout_party", ":cur_goods_price_slot", average_price_factor),
## (try_end),
## (troop_set_slot, ":troop_no", slot_troop_wealth, 2000),
## ]),
# script_create_cattle_herd
# Input: arg1 = center_no, arg2 = amount (0 = default)
# Output: reg0 = party_no
("create_cattle_herd",
[
(store_script_param_1, ":center_no"),
(store_script_param_2, ":amount"),
(assign, ":herd_party", -1),
(set_spawn_radius,1),
(spawn_around_party,":center_no", "pt_cattle_herd"),
(assign, ":herd_party", reg0),
(party_get_position, pos1, ":center_no"),
(call_script, "script_map_get_random_position_around_position_within_range", 1, 2),
(party_set_position, ":herd_party", pos2),
(party_set_slot, ":herd_party", slot_party_type, spt_cattle_herd),
(party_set_slot, ":herd_party", slot_party_ai_state, spai_undefined),
(party_set_ai_behavior, ":herd_party", ai_bhvr_hold),
(party_set_slot, ":herd_party", slot_party_commander_party, -1), #we need this because 0 is player's party!
(try_begin),
(gt, ":amount", 0),
(party_clear, ":herd_party"),
(party_add_members, ":herd_party", "trp_cattle", ":amount"),
(try_end),
(assign, reg0, ":herd_party"),
]),
#script_buy_cattle_from_village
# Input: arg1 = village_no, arg2 = amount, arg3 = single_cost
# Output: reg0 = party_no
("buy_cattle_from_village",
[
(store_script_param, ":village_no", 1),
(store_script_param, ":amount", 2),
(store_script_param, ":single_cost", 3),
#Changing price of the cattle
(try_for_range, ":unused", 0, ":amount"),
(call_script, "script_game_event_buy_item", "itm_cattle_meat", 0),
(call_script, "script_game_event_buy_item", "itm_cattle_meat", 0),
(try_end),
(party_get_slot, ":num_cattle", ":village_no", slot_village_number_of_cattle),
(val_sub, ":num_cattle", ":amount"),
(party_set_slot, ":village_no", slot_village_number_of_cattle, ":num_cattle"),
(store_mul, ":cost", ":single_cost", ":amount"),
(troop_remove_gold, "trp_player", ":cost"),
(assign, ":continue", 1),
(try_for_parties, ":cur_party"),
(eq, ":continue", 1),
(party_slot_eq, ":cur_party", slot_party_type, spt_cattle_herd),
(store_distance_to_party_from_party, ":dist", ":village_no", ":cur_party"),
(lt, ":dist", 6),
(assign, ":subcontinue", 1),
(try_begin),
(check_quest_active, "qst_move_cattle_herd"),
(quest_slot_eq, "qst_move_cattle_herd", slot_quest_target_party, ":cur_party"),
(assign, ":subcontinue", 0),
(try_end),
(eq, ":subcontinue", 1),
(party_add_members, ":cur_party", "trp_cattle", ":amount"),
(assign, ":continue", 0),
(assign, reg0, ":cur_party"),
(try_end),
(try_begin),
(eq, ":continue", 1),
(call_script, "script_create_cattle_herd", ":village_no", ":amount"),
(try_end),
]),
#script_kill_cattle_from_herd
# Input: arg1 = party_no, arg2 = amount
# Output: none (fills trp_temp_troop's inventory)
("kill_cattle_from_herd",
[
(store_script_param_1, ":party_no"),
(store_script_param_2, ":amount"),
(troop_clear_inventory, "trp_temp_troop"),
(store_mul, ":meat_amount", ":amount", 2),
(troop_add_items, "trp_temp_troop", "itm_cattle_meat", ":meat_amount"),
(troop_get_inventory_capacity, ":inv_size", "trp_temp_troop"),
(try_for_range, ":i_slot", 0, ":inv_size"),
(troop_get_inventory_slot, ":item_id", "trp_temp_troop", ":i_slot"),
(eq, ":item_id", "itm_cattle_meat"),
(troop_set_inventory_slot_modifier, "trp_temp_troop", ":i_slot", imod_fresh),
(try_end),
(party_get_num_companions, ":num_cattle", ":party_no"),
(try_begin),
(ge, ":amount", ":num_cattle"),
(remove_party, ":party_no"),
(else_try),
(party_remove_members, ":party_no", "trp_cattle", ":amount"),
(try_end),
]),
# script_create_kingdom_hero_party
# Input: arg1 = troop_no, arg2 = center_no
# Output: $pout_party = party_no
("create_kingdom_hero_party",
[
(store_script_param, ":troop_no", 1),
(store_script_param, ":center_no", 2),
(store_troop_faction, ":troop_faction_no", ":troop_no"),
(assign, "$pout_party", -1),
(set_spawn_radius,0),
(spawn_around_party,":center_no", "pt_kingdom_hero_party"),
(assign, "$pout_party", reg0),
(party_set_faction, "$pout_party", ":troop_faction_no"),
(party_set_slot, "$pout_party", slot_party_type, spt_kingdom_hero_party),
(call_script, "script_party_set_ai_state", "$pout_party", spai_undefined, -1),
(troop_set_slot, ":troop_no", slot_troop_leaded_party, "$pout_party"),
(party_add_leader, "$pout_party", ":troop_no"),
(str_store_troop_name, s5, ":troop_no"),
(party_set_name, "$pout_party", "str_s5_s_party"),
(party_set_slot, "$pout_party", slot_party_commander_party, -1), #we need this because 0 is player's party!
#Setting the flag icon
#normal_banner_begin
(troop_get_slot, ":cur_banner", ":troop_no", slot_troop_banner_scene_prop),
(try_begin),
(gt, ":cur_banner", 0),
(val_sub, ":cur_banner", banner_scene_props_begin),
(val_add, ":cur_banner", banner_map_icons_begin),
(party_set_banner_icon, "$pout_party", ":cur_banner"),
#custom_banner_begin
# (troop_get_slot, ":flag_icon", ":troop_no", slot_troop_custom_banner_map_flag_type),
# (try_begin),
# (ge, ":flag_icon", 0),
# (val_add, ":flag_icon", custom_banner_map_icons_begin),
# (party_set_banner_icon, "$pout_party", ":flag_icon"),
(try_end),
(try_begin),
(troop_slot_eq, ":troop_no", slot_troop_spawned_before, 0),
(troop_set_slot, ":troop_no", slot_troop_spawned_before, 1),
(assign, ":num_tries", 20),
(try_begin),
(store_troop_faction, ":troop_kingdom", ":troop_no"),
(faction_slot_eq, ":troop_kingdom", slot_faction_leader, ":troop_no"),
(assign, ":num_tries", 50),
(try_end),
(try_for_range, ":unused", 0, ":num_tries"),
(call_script, "script_hire_men_to_kingdom_hero_party", ":troop_no"),
(try_end),
(store_random_in_range, ":xp_rounds", 2, 6),
(troop_get_slot, ":renown", ":troop_no", slot_troop_renown),
(store_div, ":renown_xp_rounds", ":renown", 100),
(val_add, ":xp_rounds", ":renown_xp_rounds"),
(try_for_range, ":unused", 0, ":xp_rounds"),
(call_script, "script_upgrade_hero_party", "$pout_party", 4000),
(try_end),
(try_end),
]),
# script_create_kingdom_party_if_below_limit
# Input: arg1 = faction_no, arg2 = party_type (variables beginning with spt_)
# Output: reg0 = party_no
("create_kingdom_party_if_below_limit",
[
(store_script_param_1, ":faction_no"),
(store_script_param_2, ":party_type"),
(call_script, "script_count_parties_of_faction_and_party_type", ":faction_no", ":party_type"),
(assign, ":party_count", reg0),
(assign, ":party_count_limit", 0),
(try_begin),
## (eq, ":party_type", spt_forager),
## (assign, ":party_count_limit", 1),
## (else_try),
## (eq, ":party_type", spt_scout),
## (assign, ":party_count_limit", 1),
## (else_try),
## (eq, ":party_type", spt_patrol),
## (assign, ":party_count_limit", 1),
## (else_try),
## (eq, ":party_type", spt_messenger),
## (assign, ":party_count_limit", 1),
## (else_try),
(eq, ":party_type", spt_kingdom_caravan),
(assign, ":party_count_limit", 5),
## (else_try),
## (eq, ":party_type", spt_prisoner_train),
## (assign, ":party_count_limit", 1),
(try_end),
(assign, reg0, -1),
(try_begin),
(lt, ":party_count", ":party_count_limit"),
(call_script,"script_cf_create_kingdom_party", ":faction_no", ":party_type"),
(try_end),
]),
# script_cf_create_kingdom_party
# Input: arg1 = faction_no, arg2 = party_type (variables beginning with spt_)
# Output: reg0 = party_no
("cf_create_kingdom_party",
[
(store_script_param_1, ":faction_no"),
(store_script_param_2, ":party_type"),
(str_store_faction_name, s7, ":faction_no"),
(assign, ":party_name_str", "str_no_string"),
## (faction_get_slot, ":reinforcements_a", ":faction_no", slot_faction_reinforcements_a),
(faction_get_slot, ":reinforcements_b", ":faction_no", slot_faction_reinforcements_b),
## (faction_get_slot, ":reinforcements_c", ":faction_no", slot_faction_reinforcements_c),
(try_begin),
## (eq, ":party_type", spt_forager),
## (assign, ":party_template", "pt_forager_party"),
# (assign, ":party_name_str", "str_s7_foragers"),
## (else_try),
## (eq, ":party_type", spt_scout),
## (assign, ":party_template", "pt_scout_party"),
# (assign, ":party_name_str", "str_s7_scouts"),
## (else_try),
## (eq, ":party_type", spt_patrol),
## (assign, ":party_template", "pt_patrol_party"),
# (assign, ":party_name_str", "str_s7_patrol"),
## (else_try),
(eq, ":party_type", spt_kingdom_caravan),
(assign, ":party_template", "pt_kingdom_caravan_party"),
# (assign, ":party_name_str", "str_s7_caravan"),
## (else_try),
## (eq, ":party_type", spt_messenger),
## (assign, ":party_template", "pt_messenger_party"),
# (assign, ":party_name_str", "str_s7_messenger"),
## (else_try),
## (eq, ":party_type", spt_raider),
## (assign, ":party_template", "pt_raider_party"),
## (assign, ":party_name_str", "str_s7_raiders"),
## (else_try),
## (eq, ":party_type", spt_prisoner_train),
## (assign, ":party_template", "pt_prisoner_train_party"),
# (assign, ":party_name_str", "str_s7_prisoner_train"),
(try_end),
(assign, ":result", -1),
(try_begin),
(try_begin),
(eq, ":party_type", spt_kingdom_caravan),
(call_script,"script_cf_select_random_town_with_faction", ":faction_no", -1),
(set_spawn_radius, 0),
(else_try), #not used at the moment
(call_script,"script_cf_select_random_walled_center_with_faction", ":faction_no", -1),
(set_spawn_radius, 1),
(try_end),
(assign, ":spawn_center", reg0),
(is_between, ":spawn_center", centers_begin, centers_end),
(spawn_around_party,":spawn_center",":party_template"),
(assign, ":result", reg0),
(party_set_faction, ":result", ":faction_no"),
(try_begin),
(eq, ":party_type", spt_kingdom_caravan),
(party_set_slot, ":result", slot_party_home_center, ":spawn_center"),
(try_end),
(party_set_slot, ":result", slot_party_type, ":party_type"),
(party_set_slot, ":result", slot_party_ai_state, spai_undefined),
(try_begin),
(neq, ":party_name_str", "str_no_string"),
(party_set_name, ":result", ":party_name_str"),
(try_end),
(try_begin),
## (eq, ":party_type", spt_forager),
## (party_add_template, ":result", ":reinforcements_a"),
## (else_try),
## (eq, ":party_type", spt_scout),
## (party_add_template, ":result", ":reinforcements_c"),
## (else_try),
## (eq, ":party_type", spt_patrol),
## (party_add_template, ":result", ":reinforcements_a"),
## (party_add_template, ":result", ":reinforcements_b"),
## (else_try),
(eq, ":party_type", spt_kingdom_caravan),
(party_add_template, ":result", ":reinforcements_b"),
(party_add_template, ":result", ":reinforcements_b"),
(party_set_ai_behavior,":result",ai_bhvr_travel_to_party),
(party_set_ai_object,":result",":spawn_center"),
(party_set_flags, ":result", pf_default_behavior, 1),
(store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
(try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
(store_add, ":cur_goods_price_slot", ":cur_goods", ":item_to_price_slot"),
(party_set_slot, ":result", ":cur_goods_price_slot", average_price_factor),
(try_end),
## (else_try),
## (eq, ":party_type", spt_messenger),
## (faction_get_slot, ":messenger_troop", ":faction_no", slot_faction_messenger_troop),
## (party_add_leader, ":result", ":messenger_troop"),
## (party_set_ai_behavior,":result",ai_bhvr_travel_to_party),
## (party_set_ai_object,":result",":spawn_center"),
## (party_set_flags, ":result", pf_default_behavior, 0),
## (else_try),
## (eq, ":party_type", spt_raider),
## (party_add_template, ":result", ":reinforcements_c"),
## (party_add_template, ":result", ":reinforcements_b"),
## (party_add_template, ":result", "pt_raider_captives"),
## (else_try),
## (eq, ":party_type", spt_prisoner_train),
## (party_add_template, ":result", ":reinforcements_b"),
## (party_add_template, ":result", ":reinforcements_a"),
## (try_begin),
## (call_script,"script_cf_faction_get_random_enemy_faction",":faction_no"),
## (store_random_in_range,":r",0,3),
## (try_begin),
## (lt, ":r", 1),
## (faction_get_slot, ":captive_reinforcements", reg0, slot_faction_reinforcements_b),
## (else_try),
## (faction_get_slot, ":captive_reinforcements", reg0, slot_faction_reinforcements_a),
## (try_end),
## (party_add_template, ":result", ":captive_reinforcements",1),
## (else_try),
## (party_add_template, ":result", "pt_default_prisoners"),
## (try_end),
(try_end),
(try_end),
(ge, ":result", 0),
(assign, reg0, ":result"),
]),
# script_get_troop_attached_party
# Input: arg1 = troop_no
# Output: reg0 = party_no (-1 if troop's party is not attached to a party)
("get_troop_attached_party",
[
(store_script_param_1, ":troop_no"),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(assign, ":attached_party_no", -1),
(try_begin),
(ge, ":party_no", 0),
(party_get_attached_to, ":attached_party_no", ":party_no"),
(try_end),
(assign, reg0, ":attached_party_no"),
]),
# script_center_get_food_consumption
# Input: arg1 = center_no
# Output: reg0: food consumption (1 food item counts as 100 units)
("center_get_food_consumption",
[
(store_script_param_1, ":center_no"),
(assign, ":food_consumption", 0),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(assign, ":food_consumption", 500),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(assign, ":food_consumption", 50),
(try_end),
(assign, reg0, ":food_consumption"),
]),
# script_center_get_food_store_limit
# Input: arg1 = center_no
# Output: reg0: food consumption (1 food item counts as 100 units)
("center_get_food_store_limit",
[
(store_script_param_1, ":center_no"),
(assign, ":food_store_limit", 0),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(assign, ":food_store_limit", 50000),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(assign, ":food_store_limit", 1500),
(try_end),
(assign, reg0, ":food_store_limit"),
]),
# script_refresh_village_merchant_inventory
# Input: arg1 = village_no
# Output: none
("refresh_village_merchant_inventory",
[
(store_script_param_1, ":village_no"),
(party_get_slot, ":merchant_troop", ":village_no", slot_town_elder),
(reset_item_probabilities,0),
(store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
(try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
(store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
(party_get_slot, ":cur_price", ":village_no", ":cur_price_slot"),
(assign, ":cur_probability", 100),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(val_mul, ":cur_probability", average_price_factor),
(val_div, ":cur_probability", ":cur_price"),
(set_item_probability_in_merchandise, ":cur_goods", ":cur_probability"),
(try_end),
(set_item_probability_in_merchandise, "itm_spice", 0),
(set_item_probability_in_merchandise, "itm_velvet", 0),
(troop_add_merchandise, ":merchant_troop", itp_type_goods, 3),
(troop_ensure_inventory_space, ":merchant_troop", 80),
#Adding 1 prosperity to the village while reducing each 3000 gold from the elder
(store_troop_gold, ":gold",":merchant_troop"),
(try_begin),
(gt, ":gold", 3500),
(store_div, ":prosperity_added", ":gold", 3000),
(store_mul, ":gold_removed", ":prosperity_added", 3000),
(troop_remove_gold, ":merchant_troop", ":gold_removed"),
(call_script, "script_change_center_prosperity", ":village_no", ":prosperity_added"),
(try_end),
]),
# script_refresh_village_defenders
# Input: arg1 = village_no
# Output: none
("refresh_village_defenders",
[
(store_script_param_1, ":village_no"),
(assign, ":ideal_size", 50),
(try_begin),
(party_get_num_companions, ":party_size", ":village_no"),
(lt, ":party_size", ":ideal_size"),
(party_add_template, ":village_no", "pt_village_defenders"),
(try_end),
]),
# script_village_set_state
# Input: arg1 = center_no arg2:new_state
# Output: reg0: food consumption (1 food item counts as 100 units)
("village_set_state",
[
(store_script_param_1, ":village_no"),
(store_script_param_2, ":new_state"),
# (party_get_slot, ":old_state", ":village_no", slot_village_state),
(try_begin),
(eq, ":new_state", 0),
(party_set_extra_text, ":village_no", "str_empty_string"),
(party_set_slot, ":village_no", slot_village_raided_by, -1),
(else_try),
(eq, ":new_state", svs_being_raided),
(party_set_extra_text, ":village_no", "@(Being Raided)"),
(else_try),
(eq, ":new_state", svs_looted),
(party_set_extra_text, ":village_no", "@(Looted)"),
(party_set_slot, ":village_no", slot_village_raided_by, -1),
(call_script, "script_change_center_prosperity", ":village_no", -30),
(else_try),
(eq, ":new_state", svs_under_siege),
(party_set_extra_text, ":village_no", "@(Under Siege)"),
(try_end),
(party_set_slot, ":village_no", slot_village_state, ":new_state"),
]),
# script_process_village_raids
# Input: none
# Output: none
# called from triggers every two hours
("process_village_raids",
[
(try_for_range, ":village_no", villages_begin, villages_end),
(party_get_slot, ":village_raid_progress", ":village_no", slot_village_raid_progress),
(try_begin),
(party_slot_eq, ":village_no", slot_village_state, 0), #village is normal
(val_sub, ":village_raid_progress", 5),
(val_max, ":village_raid_progress", 0),
(party_set_slot, ":village_no", slot_village_raid_progress, ":village_raid_progress"),
(else_try),
(party_slot_eq, ":village_no", slot_village_state, svs_being_raided), #village is being raided
# End raid unless there is an enemy party nearby
(assign, ":raid_ended", 1),
(party_get_slot, ":raider_party", ":village_no", slot_village_raided_by),
(try_begin),
(ge, ":raider_party", 0),
(party_is_active, ":raider_party"),
(this_or_next|neq, ":raider_party", "p_main_party"),
(eq, "$g_player_is_captive", 0),
(store_distance_to_party_from_party, ":distance", ":village_no", ":raider_party"),
(lt, ":distance", raid_distance),
(assign, ":raid_ended", 0),
(try_end),
(try_begin),
(eq, ":raid_ended", 1),
(call_script, "script_village_set_state", ":village_no", 0), #clear raid flag
(party_set_slot, ":village_no", slot_village_smoke_added, 0),
(party_clear_particle_systems, ":village_no"),
(else_try),
(assign, ":raid_progress_increase", 11),
(party_get_slot, ":looter_party", ":village_no", slot_village_raided_by),
(try_begin),
(party_get_skill_level, ":looting_skill", ":looter_party", "skl_looting"),
(val_add, ":raid_progress_increase", ":looting_skill"),
(try_end),
(try_begin),
(party_slot_eq, ":village_no", slot_center_has_watch_tower, 1),
(val_mul, ":raid_progress_increase", 75),
(val_div, ":raid_progress_increase", 100),
(try_end),
(val_add, ":village_raid_progress", ":raid_progress_increase"),
(party_set_slot, ":village_no", slot_village_raid_progress, ":village_raid_progress"),
(try_begin),
(ge, ":village_raid_progress", 50),
(party_slot_eq, ":village_no", slot_village_smoke_added, 0),
(party_add_particle_system, ":village_no", "psys_map_village_fire"),
(party_add_particle_system, ":village_no", "psys_map_village_fire_smoke"),
(party_set_icon, ":village_no", "icon_village_burnt_a"),
(party_set_slot, ":village_no", slot_village_smoke_added, 1),
(try_end),
(try_begin),
(gt, ":village_raid_progress", 100),
(str_store_party_name_link, s1, ":village_no"),
(party_stack_get_troop_id, ":raid_leader", ":looter_party"),
(ge, ":raid_leader", 0),
(str_store_party_name, s2, ":looter_party"),
(display_log_message, "@The village of {s1} has been looted by {s2}."),
(call_script, "script_village_set_state", ":village_no", svs_looted),
(party_set_slot, ":village_no", slot_village_raid_progress, 0),
(party_set_slot, ":village_no", slot_village_recover_progress, 0),
(try_begin),
(store_faction_of_party, ":village_faction", ":village_no"),
(this_or_next|party_slot_eq, ":village_no", slot_town_lord, "trp_player"),
(eq, ":village_faction", "fac_player_supporters_faction"),
(call_script, "script_add_notification_menu", "mnu_notification_village_raided", ":village_no", ":raid_leader"),
(try_end),
(call_script, "script_add_log_entry", logent_village_raided, ":raid_leader", ":village_no", -1, -1),
(try_end),
(try_end),
(else_try),
(party_slot_eq, ":village_no", slot_village_state, svs_looted), #village is looted
(party_get_slot, ":recover_progress", ":village_no", slot_village_recover_progress),
(val_add, ":recover_progress", 1),
(party_set_slot, ":village_no", slot_village_recover_progress, ":recover_progress"), #village looted
(try_begin),
(ge, ":recover_progress", 10),
(party_slot_eq, ":village_no", slot_village_smoke_added, 1),
(party_clear_particle_systems, ":village_no"),
(party_add_particle_system, ":village_no", "psys_map_village_looted_smoke"),
(party_set_slot, ":village_no", slot_village_smoke_added, 2),
(try_end),
(try_begin),
(gt, ":recover_progress", 50),
(party_slot_eq, ":village_no", slot_village_smoke_added, 2),
(party_clear_particle_systems, ":village_no"),
(party_set_slot, ":village_no", slot_village_smoke_added, 3),
(party_set_icon, ":village_no", "icon_village_deserted_a"),
(try_end),
(try_begin),
(gt, ":recover_progress", 100),
(call_script, "script_village_set_state", ":village_no", 0),#village back to normal
(party_set_slot, ":village_no", slot_village_recover_progress, 0),
(party_clear_particle_systems, ":village_no"),
(party_set_slot, ":village_no", slot_village_smoke_added, 0),
(party_set_icon, ":village_no", "icon_village_a"),
(try_end),
(try_end),
(try_end),
]),
# script_process_sieges
# Input: none
# Output: none
#called from triggers
("process_sieges",
[
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
#Reducing siege hardness every day by 20
(party_get_slot, ":siege_hardness", ":center_no", slot_center_siege_hardness),
(val_sub, ":siege_hardness", 20),
(val_max, ":siege_hardness", 0),
(party_set_slot, ":center_no", slot_center_siege_hardness, ":siege_hardness"),
(party_get_slot, ":town_food_store", ":center_no", slot_party_food_store),
(call_script, "script_center_get_food_store_limit", ":center_no"),
(assign, ":food_store_limit", reg0),
(try_begin),
(party_get_slot, ":besieger_party", ":center_no", slot_center_is_besieged_by),
(ge, ":besieger_party", 0), #town is under siege
#Reduce prosperity of besieged center by -1 with a 33% chance every day.
(try_begin),
(store_random_in_range, ":random_no", 0, 3),
(eq, ":random_no", 0),
(call_script, "script_change_center_prosperity", ":center_no", -1),
(try_end),
(store_faction_of_party, ":center_faction", ":center_no"),
# Lift siege unless there is an enemy party nearby
(assign, ":siege_lifted", 0),
(try_begin),
(try_begin),
(neg|party_is_active, ":besieger_party"),
(assign, ":siege_lifted", 1),
(else_try),
(store_distance_to_party_from_party, ":besieger_distance", ":center_no", ":besieger_party"),
(gt, ":besieger_distance", 5),
(assign, ":siege_lifted", 1),
(try_end),
(eq, ":siege_lifted", 1),
(try_for_range, ":enemy_hero", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":enemy_hero", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":enemy_party", ":enemy_hero", slot_troop_leaded_party),
(ge, ":enemy_party", 0),
(party_is_active, ":enemy_party"),
(store_faction_of_party, ":party_faction", ":enemy_party"),
(store_relation, ":reln", ":party_faction", ":center_faction"),
(lt, ":reln", 0),
(store_distance_to_party_from_party, ":distance", ":center_no", ":enemy_party"),
(lt, ":distance", 4),
(assign, ":besieger_party", ":enemy_party"),
(party_set_slot, ":center_no", slot_center_is_besieged_by, ":enemy_party"),
(assign, ":siege_lifted", 0),
(try_end),
(try_end),
(try_begin),
(eq, ":siege_lifted", 1),
(call_script, "script_lift_siege", ":center_no", 1),
(else_try),
(call_script, "script_center_get_food_consumption", ":center_no"),
(assign, ":food_consumption", reg0),
(val_sub, ":town_food_store", ":food_consumption"), # reduce food only under siege???
(try_begin),
(le, ":town_food_store", 0), #town is starving
(store_random_in_range, ":r", 0, 100),
(lt, ":r", 10),
(call_script, "script_party_wound_all_members", ":center_no"), # town falls with 10% chance if starving
(try_end),
(try_end),
(else_try),
#town is not under siege...
(val_add, ":town_food_store", 30), #add 30 food (significant for castles only.
(try_end),
(val_min, ":town_food_store", ":food_store_limit"),
(val_max, ":town_food_store", 0),
(party_set_slot, ":center_no", slot_party_food_store, ":town_food_store"),
(try_end),
]),
# script_lift_siege
# Input: arg1 = center_no, arg2 = display_message
# Output: none
#called from triggers
("lift_siege",
[
(store_script_param, ":center_no", 1),
(store_script_param, ":display_message", 2),
(party_set_slot, ":center_no", slot_center_is_besieged_by, -1), #clear siege
(call_script, "script_village_set_state", ":center_no", 0), #clear siege flag
(try_begin),
(eq, ":center_no", "$g_player_besiege_town"),
(assign, "$g_siege_method", 0), #remove siege progress
(try_end),
(try_begin),
(eq, ":display_message", 1),
(str_store_party_name_link, s3, ":center_no"),
(display_message, "@{s3} is no longer under siege."),
(try_end),
]),
# script_process_alarms
# Input: none
# Output: none
#called from triggers
("process_alarms",
[(try_for_range, ":center_no", centers_begin, centers_end),
(party_set_slot, ":center_no", slot_center_last_spotted_enemy, -1),
(try_end),
(assign, ":spotting_range", 2),
(try_begin),
(is_currently_night),
(assign, ":spotting_range", 1),
(try_end),
(try_begin),
(party_slot_eq, ":center_no", slot_center_has_watch_tower, 1),
(val_mul, ":spotting_range", 2),
(try_end),
(try_for_parties, ":party_no"),
(party_slot_eq, ":party_no", slot_party_type, spt_kingdom_hero_party),
(neg|party_is_in_any_town, ":party_no"),
(store_faction_of_party, ":party_faction", ":party_no"),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_distance_to_party_from_party, ":distance", ":party_no", ":center_no"),
(le, ":distance", ":spotting_range"),
(store_faction_of_party, ":center_faction", ":center_no"),
(store_relation, ":reln", ":center_faction", ":party_faction"),
(lt, ":reln", 0),
(party_set_slot, ":center_no", slot_center_last_spotted_enemy, ":party_no"),
(try_end),
(try_end),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(this_or_next|party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(eq, ":center_faction", "$players_kingdom"),
(party_get_slot, ":enemy_party", ":center_no", slot_center_last_spotted_enemy),
(ge, ":enemy_party", 0),
(store_distance_to_party_from_party, ":dist", "p_main_party", ":center_no"),
(assign, ":has_messenger", 0),
(try_begin),
(this_or_next|party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_slot_eq, ":center_no", slot_center_has_messenger_post, 1),
(assign, ":has_messenger", 1),
(try_end),
(this_or_next|lt, ":dist", 30),
(eq, ":has_messenger", 1),
(str_store_party_name_link, s1, ":center_no"),
(display_message, "@Enemies spotted near {s1}."),
(try_end),
]),
# script_party_set_ai_state
# Input: arg1 = party_no, arg2 = new_ai_state, arg3 = action_object (if necessary)
# Output: none (Can fail)
("party_set_ai_state",
[
(store_script_param, ":party_no", 1),
(store_script_param, ":new_ai_state", 2),
(store_script_param, ":new_ai_object", 3),
(party_get_slot, ":old_ai_state", ":party_no", slot_party_ai_state),
(party_get_slot, ":old_ai_object", ":party_no", slot_party_ai_object),
(party_get_attached_to, ":attached_to_party", ":party_no"),
(assign, ":party_is_in_town", 0),
(try_begin),
(is_between, ":attached_to_party", centers_begin, centers_end),
(assign, ":party_is_in_town", ":attached_to_party"),
(try_end),
(party_set_slot, ":party_no", slot_party_follow_me, 0),
(try_begin),
(eq, ":old_ai_state", ":new_ai_state"),
(eq, ":old_ai_object", ":new_ai_object"),
#do nothing. Nothing is changed.
(else_try),
(try_begin),
(eq, ":new_ai_state", spai_accompanying_army),
(party_set_ai_behavior, ":party_no", ai_bhvr_escort_party),
(party_set_ai_object, ":party_no", ":new_ai_object"),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(try_begin),
(gt, ":party_is_in_town", 0),
(party_detach, ":party_no"),
(try_end),
(else_try),
(eq, ":new_ai_state", spai_besieging_center),
(party_get_position, pos1, ":new_ai_object"),
(map_get_random_position_around_position, pos2, pos1, 2),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point),
(party_set_ai_target_position, ":party_no", pos2),
(party_set_ai_object, ":party_no", ":new_ai_object"),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(party_set_slot, ":party_no", slot_party_follow_me, 1),
(party_set_slot, ":party_no", slot_party_ai_substate, 0),
(try_begin),
(gt, ":party_is_in_town", 0),
(neq, ":party_is_in_town", ":new_ai_object"),
(party_detach, ":party_no"),
(try_end),
(else_try),
(eq, ":new_ai_state", spai_holding_center),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party),
(party_set_ai_object, ":party_no", ":new_ai_object"),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(try_begin),
(gt, ":party_is_in_town", 0),
(neq, ":party_is_in_town", ":new_ai_object"),
(party_detach, ":party_no"),
(try_end),
(else_try),
(eq, ":new_ai_state", spai_patrolling_around_center),
(party_get_position, pos1, ":new_ai_object"),
(map_get_random_position_around_position, pos2, pos1, 1),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point),
(party_set_ai_target_position, ":party_no", pos2),
(party_set_ai_object, ":party_no", ":new_ai_object"),
(party_set_ai_patrol_radius, ":party_no", 5),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(party_set_slot, ":party_no", slot_party_follow_me, 1),
(party_set_slot, ":party_no", slot_party_ai_substate, 0),
(try_begin),
(gt, ":party_is_in_town", 0),
(party_detach, ":party_no"),
(try_end),
(else_try),
(eq, ":new_ai_state", spai_recruiting_troops),
(party_get_position, pos1, ":new_ai_object"),
(map_get_random_position_around_position, pos2, pos1, 2),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point),
(party_set_ai_target_position, ":party_no", pos2),
(party_set_ai_object, ":party_no", ":new_ai_object"),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(party_set_slot, ":party_no", slot_party_ai_substate, 0),
(try_begin),
(gt, ":party_is_in_town", 0),
(neq, ":party_is_in_town", ":new_ai_object"),
(party_detach, ":party_no"),
(try_end),
(else_try),
(eq, ":new_ai_state", spai_raiding_around_center),
(party_get_position, pos1, ":new_ai_object"),
(map_get_random_position_around_position, pos2, pos1, 1),
(party_set_ai_behavior, ":party_no", ai_bhvr_patrol_location),
(party_set_ai_patrol_radius, ":party_no", 10),
(party_set_ai_target_position, ":party_no", pos2),
(party_set_ai_object, ":party_no", ":new_ai_object"),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(party_set_slot, ":party_no", slot_party_follow_me, 1),
(party_set_slot, ":party_no", slot_party_ai_substate, 0),
(try_begin),
(gt, ":party_is_in_town", 0),
(neq, ":party_is_in_town", ":new_ai_object"),
(party_detach, ":party_no"),
(try_end),
(else_try),
## (eq, ":new_ai_state", spai_raiding_village),
## (party_get_position, pos1, ":new_ai_object"),
## (map_get_random_position_around_position, pos2, pos1, 1),
## (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point),
## (party_set_ai_target_position, ":party_no", pos2),
## (party_set_ai_object, ":party_no", ":new_ai_object"),
## (party_set_flags, ":party_no", pf_default_behavior, 0),
## (party_set_slot, ":party_no", slot_party_follow_me, 1),
## (try_begin),
## (gt, ":party_is_in_town", 0),
## (neq, ":party_is_in_town", ":new_ai_object"),
## (party_detach, ":party_no"),
## (try_end),
## (else_try),
(eq, ":new_ai_state", spai_engaging_army),
(party_set_ai_behavior, ":party_no", ai_bhvr_attack_party),
(party_set_ai_object, ":party_no", ":new_ai_object"),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(try_begin),
(gt, ":party_is_in_town", 0),
(party_detach, ":party_no"),
(try_end),
(else_try),
(eq, ":new_ai_state", spai_retreating_to_center),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party),
(party_set_ai_object, ":party_no", ":new_ai_object"),
(party_set_flags, ":party_no", pf_default_behavior, 1),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(try_begin),
(gt, ":party_is_in_town", 0),
(neq, ":party_is_in_town", ":new_ai_object"),
(party_detach, ":party_no"),
(try_end),
(else_try),
(eq, ":new_ai_state", spai_undefined),
(party_set_ai_behavior, ":party_no", ai_bhvr_hold),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(try_end),
(try_end),
(party_set_slot, ":party_no", slot_party_ai_state, ":new_ai_state"),
(party_set_slot, ":party_no", slot_party_ai_object, ":new_ai_object"),
]),
# script_decide_kingdom_party_ais
# Input: none
# Output: none
#called from triggers
("decide_kingdom_party_ais",
[
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(neq, ":faction_no", "fac_player_supporters_faction"),
(faction_get_slot, ":faction_ai_state", ":faction_no", slot_faction_ai_state),
(neq, ":faction_ai_state", sfai_default),
(faction_get_slot, ":faction_ai_object", ":faction_no", slot_faction_ai_object),
(faction_get_slot, ":faction_marshall", ":faction_no", slot_faction_marshall),
(gt, ":faction_marshall", 0),
(neq, ":faction_marshall", "trp_player"),
(troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party),
(gt, ":faction_marshall_party", 0),
(try_begin),
(eq, ":faction_ai_state", sfai_gathering_army),
(call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_undefined, -1),
(party_set_ai_initiative, ":faction_marshall_party", 100),
(else_try),
(eq, ":faction_ai_state", sfai_attacking_center),
(call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_besieging_center, ":faction_ai_object"),
(party_set_ai_initiative, ":faction_marshall_party", 50),
(else_try),
(eq, ":faction_ai_state", sfai_raiding_village),
(call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_raiding_around_center, ":faction_ai_object"),
(party_set_ai_initiative, ":faction_marshall_party", 50),
(else_try),
(eq, ":faction_ai_state", sfai_attacking_enemies_around_center),
(call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_patrolling_around_center, ":faction_ai_object"),
(party_set_ai_initiative, ":faction_marshall_party", 50),
(else_try),
(eq, ":faction_ai_state", sfai_attacking_enemy_army),
(call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_engaging_army, ":faction_ai_object"),
(party_set_ai_initiative, ":faction_marshall_party", 50),
(try_end),
(party_set_slot, ":faction_marshall_party", slot_party_commander_party, -1),
(try_end),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(try_begin),
(store_troop_faction, ":troop_faction", ":troop_no"),
(neg|faction_slot_eq, ":troop_faction", slot_faction_marshall, ":troop_no"),
(troop_get_slot, ":troop_party", ":troop_no", slot_troop_leaded_party),
(gt, ":troop_party", 0),
(party_is_active, ":troop_party"),
(party_set_ai_initiative, ":troop_party", 100),
(try_end),
(call_script, "script_calculate_troop_ai", ":troop_no"),
(try_end),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(call_script, "script_calculate_troop_ai_under_command", ":troop_no"),
(try_end),
]),
# script_party_decide_next_ai_state_under_command
# Input: arg1 = party_no
# Output: none
#called from triggers
("party_decide_next_ai_state_under_command",
[
(store_script_param_1, ":party_no"),
(party_get_slot, ":commander_party", ":party_no", slot_party_commander_party),
(try_begin),
(party_is_active, ":commander_party"),
(party_get_slot, ":commander_ai_state", ":commander_party", slot_party_ai_state),
(party_get_slot, ":commander_ai_object", ":commander_party", slot_party_ai_object),
(store_faction_of_party, ":faction_no", ":party_no"),
(store_distance_to_party_from_party, ":distance_to_commander", ":party_no", ":commander_party"),
(try_begin),
(gt, ":distance_to_commander", 5),
(call_script, "script_party_set_ai_state", ":party_no", spai_accompanying_army, ":commander_party"),
(else_try),
(try_begin),
(eq, ":commander_party", "p_main_party"),
(call_script, "script_party_set_ai_state", ":party_no", spai_accompanying_army, "p_main_party"),
(else_try),
(eq, ":commander_ai_state", spai_besieging_center),
(store_distance_to_party_from_party, ":distance_to_object", ":party_no", ":commander_ai_object"),
(le, ":distance_to_object", 5),
(call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, ":commander_ai_object"),
(else_try),
#find current center
(party_get_attached_to, ":cur_center_no", ":commander_party"),
(assign, ":handled", 0),
(try_begin),
(lt, ":cur_center_no", 0),
(party_get_cur_town, ":cur_center_no", ":commander_party"),
(try_end),
(try_begin),
(eq, ":commander_ai_state", spai_holding_center),
(call_script, "script_party_set_ai_state", ":party_no", spai_holding_center, ":commander_ai_object"),
(assign, ":handled", 1),
(else_try),
(eq, ":commander_ai_state", spai_undefined),
(is_between, ":cur_center_no", centers_begin, centers_end),
(call_script, "script_party_set_ai_state", ":party_no", spai_holding_center, ":cur_center_no"),
(assign, ":handled", 1),
(try_end),
(eq, ":handled", 1),
(else_try),
(faction_get_slot, ":faction_marshall", ":faction_no", slot_faction_marshall),
(ge, ":faction_marshall", 0),
(troop_slot_eq, ":faction_marshall", slot_troop_leaded_party, ":commander_party"),
(call_script, "script_party_set_ai_state", ":party_no", spai_accompanying_army, ":commander_party"),
(else_try),
(this_or_next|eq, ":commander_ai_state", spai_patrolling_around_center),
(this_or_next|eq, ":commander_ai_state", spai_raiding_around_center),
(eq, ":commander_ai_state", spai_engaging_army),
(call_script, "script_party_set_ai_state", ":party_no", spai_accompanying_army, ":commander_party"),
(else_try),
#Commander doesn't need accompany. Cancel
(call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(try_end),
(try_end),
(try_end),
]),
# script_kingdom_hero_decide_next_ai_state_follow_or_not
# Input: arg1 = troop_no
# Output: none
#called from triggers
("kingdom_hero_decide_next_ai_state_follow_or_not",
[
(store_script_param_1, ":troop_no"),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(try_begin),
(party_get_slot, ":old_ai_state", ":party_no", slot_party_ai_state),
(assign, ":cancel", 0),
(try_begin), #if we are retreating to a center keep retreating
(eq, ":old_ai_state", spai_retreating_to_center),
(neg|party_is_in_any_town, ":party_no"),
(assign, ":cancel", 1),
(try_end),
(eq, ":cancel", 0),
(party_get_slot, ":our_strength", ":party_no", slot_party_cached_strength),
(store_div, ":min_strength_behind", ":our_strength", 2),
(assign, ":under_siege", 0),
#find current center
(party_get_attached_to, ":cur_center_no", ":party_no"),
(try_begin),
(lt, ":cur_center_no", 0),
(party_get_cur_town, ":cur_center_no", ":party_no"),
(try_end),
(try_begin),
(neg|is_between, ":cur_center_no", centers_begin, centers_end),
(assign, ":cur_center_no", -1),
(assign, ":cur_center_nearby_strength", 0),
(store_sub, ":cur_center_left_strength", 1000000),#must be higher than our strength
(else_try),
(party_get_slot, ":cur_center_nearby_strength", ":cur_center_no", slot_party_nearby_friend_strength),
(store_sub, ":cur_center_left_strength", ":cur_center_nearby_strength", ":our_strength"),
(party_get_slot, ":besieger_party", ":cur_center_no", slot_center_is_besieged_by),
(gt, ":besieger_party", 0),
(party_is_active, ":besieger_party"),
(assign, ":under_siege", 1),
(try_end),
(store_troop_faction, ":faction_no", ":troop_no"),
(faction_get_slot, ":faction_ai_state", ":faction_no", slot_faction_ai_state),
(party_get_slot, ":commander_party", ":party_no", slot_party_commander_party),
(try_begin),
(ge, ":commander_party", 0),
(try_begin),
(party_is_active, ":commander_party"),
(try_begin),
(store_faction_of_party, ":commander_faction", ":commander_party"),
(neq, ":faction_no", ":commander_faction"),
(assign, ":continue", 0),
(try_begin),
(neq, ":commander_party", "p_main_party"),
(assign, ":continue", 1),
(else_try),
(neq, "$players_kingdom", ":faction_no"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(assign, ":commander_party", -1),
(try_end),
(else_try),
(assign, ":commander_party", -1),
(try_end),
(try_end),
(faction_get_slot, ":num_towns", ":faction_no", slot_faction_num_towns),
(store_mul, ":faction_center_value", ":num_towns", 2),
(faction_get_slot, ":num_castles", ":faction_no", slot_faction_num_castles),
(val_add, ":faction_center_value", ":num_castles"),
(val_mul, ":faction_center_value", 10),
(val_max, ":faction_center_value", 5),
(troop_get_slot, ":readiness", ":troop_no", slot_troop_readiness_to_join_army),
(assign, ":chance_to_follow_other_party", 0),
(assign, ":target_to_follow_other_party", -1),
(try_begin), #follow other party
(eq, ":under_siege", 0),
(ge, ":cur_center_left_strength", ":min_strength_behind"),
(assign, ":continue", 0),
(try_begin),
(ge, ":commander_party", 0),
(gt, "$party_relative_strength", 30),
(assign, ":continue", 1),
(else_try),
(gt, "$party_relative_strength", 50),
(lt, "$ratio_of_prisoners", 50),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(try_begin),
(eq, ":faction_no", "fac_player_supporters_faction"),
(neg|troop_slot_eq, ":troop_no", slot_troop_player_order_state, spai_undefined),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(faction_get_slot, ":faction_marshall", ":faction_no", slot_faction_marshall),
(ge, ":faction_marshall", 0),
#(troop_slot_eq, ":faction_marshall", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":faction_marshall", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party),
(neq, ":faction_marshall", ":troop_no"),
(ge, ":faction_marshall_party", 0),
(try_begin),
(eq, ":faction_ai_state", sfai_gathering_army),
(assign, ":old_target_to_follow_other_party", -1),
(try_begin),
(ge, ":commander_party", 0),
(assign, ":old_target_to_follow_other_party", ":commander_party"),
(try_end),
(assign, ":continue", 0),
(try_begin),
(ge, ":readiness", 60),
(assign, ":continue", 1),
(else_try),
(ge, ":readiness", 10),
(eq, ":old_target_to_follow_other_party", ":faction_marshall_party"),
(assign, ":continue", 1),
(try_end),
(try_begin),
(eq, ":continue", 1),
(store_distance_to_party_from_party, ":dist", ":faction_marshall_party", ":party_no"),
(store_sub, ":chance", 120, ":dist"),
## (val_mul, ":chance", 3),
## (val_div, ":chance", 2),
(val_min, ":chance", 100),
(val_max, ":chance", 20),
(store_sub, ":faction_advantage_effect", "$g_average_center_value_per_faction", ":faction_center_value"),
(val_mul, ":faction_advantage_effect", 2),
(val_add, ":chance", ":faction_advantage_effect"),
(val_max, ":chance", 10),
(assign, ":target_to_follow_other_party", ":faction_marshall_party"),
(assign, ":chance_to_follow_other_party", ":chance"),
(try_begin),
(eq, ":old_target_to_follow_other_party", ":target_to_follow_other_party"),
(val_mul, ":chance_to_follow_other_party", 1000),
(try_end),
(try_end),
(else_try),
(this_or_next|eq, ":faction_ai_state", sfai_attacking_center),
(this_or_next|eq, ":faction_ai_state", sfai_raiding_village),
(this_or_next|eq, ":faction_ai_state", sfai_attacking_enemies_around_center),
(eq, ":faction_ai_state", sfai_attacking_enemy_army),
(eq, ":commander_party", ":faction_marshall_party"),
(ge, ":readiness", 10),
(assign, ":target_to_follow_other_party", ":faction_marshall_party"),
(assign, ":chance_to_follow_other_party", 100000),
(try_end),
(try_end),
(try_begin), #follow other party with initiative
(le, ":chance_to_follow_other_party", 0),
(eq, ":under_siege", 0),
(ge, ":cur_center_left_strength", ":min_strength_behind"),
(assign, ":continue", 0),
(try_begin),
(ge, ":commander_party", 0),
(gt, "$party_relative_strength", 40),
(assign, ":continue", 1),
(else_try),
(gt, "$party_relative_strength", 75),
(lt, "$ratio_of_prisoners", 50),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(try_begin),
(eq, ":faction_no", "fac_player_supporters_faction"),
(neg|troop_slot_eq, ":troop_no", slot_troop_player_order_state, spai_undefined),
(neg|troop_slot_eq, ":troop_no", slot_troop_player_order_state, spai_accompanying_army),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(neg|faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"),
(assign, ":old_target_to_follow_other_party", -1),
(try_begin),
(ge, ":commander_party", 0),
(assign, ":old_target_to_follow_other_party", ":commander_party"),
(try_end),
(troop_get_slot, ":hero_renown", ":troop_no", slot_troop_renown),
(assign, ":num_available_to_follow", 0),
(try_begin),
(eq, "p_main_party", ":old_target_to_follow_other_party"),
(val_add, ":num_available_to_follow", 1),
(eq, "p_main_party", ":old_target_to_follow_other_party"),
(val_add, ":num_available_to_follow", 999),
(try_end),
(try_for_range, ":other_hero", kingdom_heroes_begin, kingdom_heroes_end),
(neq, ":other_hero", ":troop_no"),
(store_troop_faction, ":troop_faction", ":other_hero"),
(eq, ":troop_faction", ":faction_no"),
(troop_get_slot, ":other_party", ":other_hero", slot_troop_leaded_party),
(ge, ":other_party", 0),
(troop_get_slot, ":other_hero_renown", ":other_hero", slot_troop_renown),
(lt, ":hero_renown", ":other_hero_renown"),
(neg|party_slot_ge, ":other_party", slot_party_commander_party, 0), #other party is not under command itself.
(store_distance_to_party_from_party, ":dist", ":other_party", ":party_no"),
(lt, ":dist", 25),
(party_slot_eq, ":other_party", slot_party_follow_me, 1),
(val_add, ":num_available_to_follow", 1),
(eq, ":other_party", ":old_target_to_follow_other_party"),
(val_add, ":num_available_to_follow", 999),
(try_end),
(gt, ":num_available_to_follow", 0),
(store_random_in_range, ":random_party_to_follow", 0, ":num_available_to_follow"),
(try_begin),
(eq, "p_main_party", ":old_target_to_follow_other_party"),
(val_sub, ":random_party_to_follow", 1),
(try_begin),
(eq, "p_main_party", ":old_target_to_follow_other_party"),
(val_sub, ":random_party_to_follow", 999),
(try_end),
(lt, ":random_party_to_follow", 0),
(store_mul, ":chance", 100, "$g_average_center_value_per_faction"),#this value is calculated at the beginning of the game
(val_div, ":chance", ":faction_center_value"),
(val_max, ":chance", 10),
(assign, ":chance_to_follow_other_party", ":chance"),
(val_mul, ":chance_to_follow_other_party", 2),#trp_player is always the leader
(assign, ":target_to_follow_other_party", "p_main_party"),
(eq, ":old_target_to_follow_other_party", ":target_to_follow_other_party"),
(val_mul, ":chance_to_follow_other_party", 100),
(try_end),
(try_for_range, ":other_hero", kingdom_heroes_begin, kingdom_heroes_end),
(eq, ":target_to_follow_other_party", -1),
(neq, ":other_hero", ":troop_no"),
(store_troop_faction, ":troop_faction", ":other_hero"),
(eq, ":troop_faction", ":faction_no"),
(troop_get_slot, ":other_party", ":other_hero", slot_troop_leaded_party),
(ge, ":other_party", 0),
(troop_get_slot, ":other_hero_renown", ":other_hero", slot_troop_renown),
(lt, ":hero_renown", ":other_hero_renown"),
(neg|party_slot_ge, ":other_party", slot_party_commander_party, 0), #other party is not under command itself.
(store_distance_to_party_from_party, ":dist", ":other_party", ":party_no"),
(lt, ":dist", 25),
(party_slot_eq, ":other_party", slot_party_follow_me, 1),
(val_sub, ":random_party_to_follow", 1),
(try_begin),
(eq, ":other_party", ":old_target_to_follow_other_party"),
(val_sub, ":random_party_to_follow", 999),
(try_end),
(lt, ":random_party_to_follow", 0),
(store_mul, ":chance", 100, "$g_average_center_value_per_faction"),#this value is calculated at the beginning of the game
(val_div, ":chance", ":faction_center_value"),
(val_max, ":chance", 10),
(assign, ":chance_to_follow_other_party", ":chance"),
(try_begin),
(faction_slot_eq, ":faction_no", slot_faction_leader, ":other_hero"),
(val_mul, ":chance_to_follow_other_party", 2),
(try_end),
(assign, ":target_to_follow_other_party", ":other_party"),
(eq, ":old_target_to_follow_other_party", ":target_to_follow_other_party"),
(val_mul, ":chance_to_follow_other_party", 100),
(try_end),
(try_end),
(assign, ":sum_chances", ":chance_to_follow_other_party"),
(val_add, ":sum_chances", 600),
(store_random_in_range, ":random_no", 0, ":sum_chances"),
(try_begin),
(val_sub, ":random_no", ":chance_to_follow_other_party"),
(lt, ":random_no", 0),
(party_set_slot, ":party_no", slot_party_commander_party, ":target_to_follow_other_party"),
(else_try),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(try_end),
(try_end),
]),
# script_kingdom_hero_decide_next_ai_state
# Input: arg1 = troop_no
# Output: none
#called from triggers
("kingdom_hero_decide_next_ai_state",
[
(store_script_param_1, ":troop_no"),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(try_begin),
(party_get_slot, ":our_strength", ":party_no", slot_party_cached_strength),
(store_div, ":min_strength_behind", ":our_strength", 2),
(party_get_slot, ":our_follower_strength", ":party_no", slot_party_follower_strength),
(store_troop_faction, ":faction_no", ":troop_no"),
#find current center
(assign, ":besieger_party", -1),
(party_get_attached_to, ":cur_center_no", ":party_no"),
(try_begin),
(lt, ":cur_center_no", 0),
(party_get_cur_town, ":cur_center_no", ":party_no"),
(try_end),
(try_begin),
(neg|is_between, ":cur_center_no", centers_begin, centers_end),
(assign, ":cur_center_no", -1),
(assign, ":cur_center_nearby_strength", 0),
(store_sub, ":cur_center_left_strength", 1000000),#must be higher than our strength
(else_try),
(party_get_slot, ":cur_center_nearby_strength", ":cur_center_no", slot_party_nearby_friend_strength),
(store_sub, ":cur_center_left_strength", ":cur_center_nearby_strength", ":our_strength"),
(party_get_slot, ":besieger_party", ":cur_center_no", slot_center_is_besieged_by),
(try_begin),
(neg|party_is_active, ":besieger_party"),
(assign, ":besieger_party", -1),
(try_end),
(store_faction_of_party, ":cur_center_faction", ":cur_center_no"),
(store_relation, ":cur_center_relation", ":cur_center_faction", ":faction_no"),
(try_end),
(party_get_slot, ":old_ai_state", ":party_no", slot_party_ai_state),
(party_get_slot, ":old_ai_object", ":party_no", slot_party_ai_object),
(assign, ":cancel", 0),
(try_begin), #if we are retreating to a center keep retreating
(eq, ":old_ai_state", spai_retreating_to_center),
(neg|party_is_in_any_town, ":party_no"),
(assign, ":cancel", 1),
(try_end),
(eq, ":cancel", 0),
## (faction_get_slot, ":faction_ai_state", ":faction_no", slot_faction_ai_state),
## (faction_get_slot, ":faction_ai_object", ":faction_no", slot_faction_ai_object),
(faction_get_slot, ":num_towns", ":faction_no", slot_faction_num_towns),
(store_mul, ":faction_center_value", ":num_towns", 2),
(faction_get_slot, ":num_castles", ":faction_no", slot_faction_num_castles),
(val_add, ":faction_center_value", ":num_castles"),
(val_mul, ":faction_center_value", 10),
(val_max, ":faction_center_value", 5),
(assign, ":chance_move_to_home_center", 0),
(assign, ":target_move_to_home_center", -1),
(assign, ":chance_move_to_other_center", 0),
(assign, ":target_move_to_other_center", -1),
(assign, ":chance_besiege_enemy_center", 0),
(assign, ":target_besiege_enemy_center", -1),
(assign, ":chance_patrol_around_center", 0),
(assign, ":target_patrol_around_center", -1),
(assign, ":chance_raid_around_center", 0),
(assign, ":target_raid_around_center", -1),
(assign, ":chance_recruit_troops", 0),
(assign, ":target_recruit_troops", -1),
(try_begin),#Moving to home center
(eq, ":besieger_party", -1),
(assign, ":old_target_move_to_home_center", -1),
(try_begin),
(eq, ":old_ai_state", spai_holding_center),
(assign, ":old_target_move_to_home_center", ":old_ai_object"),
(try_end),
(try_begin),
(is_between, ":cur_center_no", centers_begin, centers_end), #already in our center
(party_slot_eq, ":cur_center_no", slot_town_lord, ":troop_no"),
(assign, ":target_move_to_home_center", ":cur_center_no"),
(assign, ":chance_move_to_home_center", 100),
(try_end),
(try_begin),
(eq, ":target_move_to_home_center", -1),
(this_or_next|gt, "$party_relative_strength", 20),#stay inside if strength is too low
(eq, ":cur_center_no", -1),
(ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low
(call_script, "script_cf_troop_get_random_leaded_walled_center_with_less_strength_priority", ":troop_no", ":old_target_move_to_home_center"),#Can fail
(assign, ":target_move_to_home_center", reg0),
(assign, ":chance_move_to_home_center", 50),
(try_begin),
(eq, ":old_target_move_to_home_center", ":target_move_to_home_center"),
(val_mul, ":chance_move_to_home_center", 100),
(try_end),
(try_end),
(try_end),
(try_begin),#Moving to other center
(try_begin),
(ge, ":besieger_party", 0),
(ge, ":cur_center_relation", 0),
(assign, ":chance_move_to_other_center", 50000),
(assign, ":target_move_to_other_center", ":cur_center_no"),
(else_try),
(assign, ":old_target_move_to_other_center", -1),
(try_begin),
(eq, ":old_ai_state", spai_holding_center),
(assign, ":old_target_move_to_other_center", ":old_ai_object"),
(try_end),
## (try_begin),
## (party_slot_eq, ":party_no", slot_party_ai_state, spai_holding_center),
## (party_get_slot, ":target_move_to_other_center", ":party_no", slot_party_ai_object),
## (try_begin),
## (call_script, "script_party_calculate_regular_strength", ":target_move_to_other_center"),
## (assign, ":strength", reg0),
## (le, ":strength", 10),
## (assign, ":chance_move_to_other_center", 500),
## (else_try),
## (assign, ":chance_move_to_other_center", 30),
## (try_end),
## (try_end),
(try_begin),
(eq, ":target_move_to_other_center", -1),
(try_begin),
(this_or_next|le, "$party_relative_strength", 20),#stay inside if strength is too low
(lt, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low
(is_between, ":cur_center_no", centers_begin, centers_end),
(ge, ":cur_center_relation", 0),
(assign, ":chance_move_to_other_center", 500),
(assign, ":target_move_to_other_center", ":cur_center_no"),
(else_try),
(call_script, "script_cf_select_random_walled_center_with_faction_and_less_strength_priority", ":faction_no", ":old_target_move_to_other_center"),
(assign, ":target_move_to_other_center", reg0),
(assign, ":chance_move_to_other_center", 10),
(party_get_slot, ":lord_of_center", ":target_move_to_other_center", slot_town_lord),
(try_begin),
(call_script, "script_cf_troop_check_troop_is_enemy", ":troop_no", ":lord_of_center"),
(assign, ":chance_move_to_other_center", 1),
(try_end),
(try_begin),
(eq, ":old_target_move_to_other_center", ":target_move_to_other_center"),
(val_mul, ":chance_move_to_other_center", 1000),
(try_end),
(try_end),
(try_end),
(try_end),
(try_end),
(try_begin),
(lt, "$party_relative_strength", 50),
(store_sub, ":factor", 100, "$party_relative_strength"),
(try_begin),
(gt, ":chance_move_to_home_center", 0),
(val_mul, ":chance_move_to_home_center", 200),
(val_div, ":chance_move_to_home_center", ":factor"),
(else_try),
(val_mul, ":chance_move_to_other_center", 200),
(val_div, ":chance_move_to_other_center", ":factor"),
(try_end),
(try_end),
(try_begin),
(gt, "$ratio_of_prisoners", 50),
(try_begin),
(gt, ":chance_move_to_home_center", 0),
(val_mul, ":chance_move_to_home_center", 2),
(else_try),
(val_mul, ":chance_move_to_other_center", 2),
(try_end),
(try_end),
(try_begin), #Recruiting troops
(eq, ":besieger_party", -1),
(ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low
(assign, ":old_target_recruit_troops", -1),
(try_begin),
(eq, ":old_ai_state", spai_recruiting_troops),
(assign, ":old_target_recruit_troops", ":old_ai_object"),
(try_end),
(troop_get_slot, ":original_faction", ":troop_no", slot_troop_original_faction),
(faction_get_slot, ":original_faction_culture", ":original_faction", slot_faction_culture),
(assign, ":num_villages", 0),
(try_for_range, ":village_no", villages_begin, villages_end),
(store_faction_of_party, ":village_faction_no", ":village_no"),
(store_relation, ":reln", ":village_faction_no", ":faction_no"),
(this_or_next|ge, ":reln", 0),
(party_slot_eq, ":village_no", slot_center_culture, ":original_faction_culture"),
(assign, ":faction_factor", 1),
(try_begin),
(eq, ":village_faction_no", ":faction_no"),
(assign, ":faction_factor", 20),
(try_end),
(assign, ":amount_factor", 1),
(party_get_slot, ":volunteer_amount", ":village_no", slot_center_npc_volunteer_troop_amount),
(try_begin),
(gt, ":volunteer_amount", 0),
(val_add, ":volunteer_amount", 5),
(val_add, ":amount_factor", ":volunteer_amount"),
(try_end),
(store_distance_to_party_from_party, ":dist", ":village_no", ":party_no"),
(store_sub, ":dist_factor", 100, ":dist"),
(val_max, ":dist_factor", 10),
(assign, ":raid_factor", 100),
(try_begin),
(party_slot_eq, ":village_no", slot_village_state, svs_being_raided),
(assign, ":raid_factor", 1),
(try_end),
(store_mul, ":village_point", ":faction_factor", ":dist_factor"),
(val_mul, ":village_point", ":raid_factor"),
(val_mul, ":village_point", ":amount_factor"),
(try_begin),
(eq, ":village_no", ":old_target_recruit_troops"),
(val_mul, ":village_point", 100),
(try_end),
(val_add, ":num_villages", ":village_point"),
(try_end),
(gt, ":num_villages", 0),
(store_random_in_range, ":random_village_no", 0, ":num_villages"),
(try_for_range, ":village_no", villages_begin, villages_end),
(eq, ":target_recruit_troops", -1),
(store_faction_of_party, ":village_faction_no", ":village_no"),
(store_relation, ":reln", ":village_faction_no", ":faction_no"),
(this_or_next|ge, ":reln", 0),
(party_slot_eq, ":village_no", slot_center_culture, ":original_faction_culture"),
(assign, ":faction_factor", 1),
(try_begin),
(eq, ":village_faction_no", ":faction_no"),
(assign, ":faction_factor", 20),
(try_end),
(assign, ":amount_factor", 1),
(party_get_slot, ":volunteer_amount", ":village_no", slot_center_npc_volunteer_troop_amount),
(try_begin),
(gt, ":volunteer_amount", 0),
(val_add, ":volunteer_amount", 5),
(val_add, ":amount_factor", ":volunteer_amount"),
(try_end),
(store_distance_to_party_from_party, ":dist", ":village_no", ":party_no"),
(store_sub, ":dist_factor", 100, ":dist"),
(val_max, ":dist_factor", 10),
(assign, ":raid_factor", 100),
(try_begin),
(party_slot_eq, ":village_no", slot_village_state, svs_being_raided),
(assign, ":raid_factor", 1),
(try_end),
(store_mul, ":village_point", ":faction_factor", ":dist_factor"),
(val_mul, ":village_point", ":raid_factor"),
(val_mul, ":village_point", ":amount_factor"),
(try_begin),
(eq, ":village_no", ":old_target_recruit_troops"),
(val_mul, ":village_point", 100),
(try_end),
(val_sub, ":random_village_no", ":village_point"),
(lt, ":random_village_no", 0),
(assign, ":target_recruit_troops", ":village_no"),
(assign, ":chance_recruit_troops", 3),
(try_begin),
(eq, ":old_target_recruit_troops", ":target_recruit_troops"),
(val_mul, ":chance_recruit_troops", 1000),
(try_end),
(try_end),
(try_end),
(try_begin), #raid villages
(eq, ":besieger_party", -1),
(ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low
(gt, "$party_relative_strength", 75),
(lt, "$ratio_of_prisoners", 50),
(assign, ":old_target_raid_around_center", -1),
(try_begin),
(eq, ":old_ai_state", spai_raiding_around_center),
(assign, ":old_target_raid_around_center", ":old_ai_object"),
(try_end),
(assign, ":num_villages", 0),
(try_for_range, ":enemy_village_no", villages_begin, villages_end),
(call_script, "script_get_center_faction_relation_including_player", ":enemy_village_no", ":faction_no"),
(lt, reg0, 0),
(assign, ":raided_by_self", 0),
(try_begin),
(party_slot_eq, ":enemy_village_no", slot_village_state, svs_being_raided),
(party_slot_eq, ":enemy_village_no", slot_village_raided_by, ":party_no"),
(assign, ":raided_by_self", 1),
(try_end),
(this_or_next|party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided
(eq, ":raided_by_self", 1),
(store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":party_no"),
(store_sub, ":dist_factor", 75, ":dist"),
(val_max, ":dist_factor", 3),
(val_add, ":num_villages", ":dist_factor"),
(eq, ":enemy_village_no", ":old_target_raid_around_center"),
(val_add, ":num_villages", 10000),
(try_end),
(gt, ":num_villages", 0),
(store_random_in_range, ":random_village_no", 0, ":num_villages"),
(try_for_range, ":enemy_village_no", villages_begin, villages_end),
(eq, ":target_raid_around_center", -1),
(call_script, "script_get_center_faction_relation_including_player", ":enemy_village_no", ":faction_no"),
(lt, reg0, 0),
(assign, ":raided_by_self", 0),
(try_begin),
(party_slot_eq, ":enemy_village_no", slot_village_state, svs_being_raided),
(party_slot_eq, ":enemy_village_no", slot_village_raided_by, ":party_no"),
(assign, ":raided_by_self", 1),
(try_end),
(this_or_next|party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided
(eq, ":raided_by_self", 1),
(store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":party_no"),
(store_sub, ":dist_factor", 75, ":dist"),
(val_max, ":dist_factor", 3),
(val_sub, ":random_village_no", ":dist_factor"),
(try_begin),
(eq, ":enemy_village_no", ":old_target_raid_around_center"),
(val_sub, ":random_village_no", 10000),
(try_end),
(lt, ":random_village_no", 0),
(assign, ":target_raid_around_center", ":enemy_village_no"),
(assign, ":chance_raid_around_center", 30),
(try_begin),
(eq, ":old_target_raid_around_center", ":target_raid_around_center"),
(val_mul, ":chance_raid_around_center", 100),
(try_end),
(try_end),
(try_end),
(try_begin), #besiege center
(eq, ":besieger_party", -1),
(ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low
(assign, ":continue", 0),
(try_begin),
(eq, ":old_ai_state", spai_besieging_center),
(gt, "$party_relative_strength", 30),
(assign, ":continue", 1),
(else_try),
(gt, "$party_relative_strength", 75),
(lt, "$ratio_of_prisoners", 50),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(assign, ":our_estimated_str", ":our_follower_strength"),
(val_add, ":our_estimated_str", ":our_strength"),
(assign, ":old_target_besiege_enemy_center", -1),
(try_begin),
(eq, ":old_ai_state", spai_besieging_center),
(assign, ":old_target_besiege_enemy_center", ":old_ai_object"),
(try_end),
(assign, ":best_besiege_center", -1),
(assign, ":best_besiege_center_score", 0),
(try_for_range, ":enemy_walled_center", walled_centers_begin, walled_centers_end),
(party_get_slot, ":other_besieger_party", ":enemy_walled_center", slot_center_is_besieged_by),
(assign, ":besieger_own_faction", 0),
(try_begin),
(ge, ":other_besieger_party", 0),
(party_is_active, ":other_besieger_party"),
(store_faction_of_party, ":besieger_faction", ":other_besieger_party"),
(eq, ":besieger_faction", ":faction_no"),
(assign, ":besieger_own_faction", 1),
(try_end),
(this_or_next|eq, ":other_besieger_party", -1),
(eq, ":besieger_own_faction", 1),
(call_script, "script_get_center_faction_relation_including_player", ":enemy_walled_center", ":faction_no"),
(assign, ":reln", reg0),
(lt, ":reln", 0),
(val_mul, ":reln", -1),
(val_add, ":reln", 50),
(store_distance_to_party_from_party, ":dist", ":enemy_walled_center", ":party_no"),
(store_sub, ":dist_factor", 75, ":dist"),
(val_max, ":dist_factor", 3),
(party_get_slot, ":center_str", ":enemy_walled_center", slot_party_cached_strength),
(party_get_slot, ":center_near_str", ":enemy_walled_center", slot_party_nearby_friend_strength),
(val_add, ":center_str", ":center_near_str"),
(store_mul, ":relative_center_str", ":center_str", 100),
(val_div, ":relative_center_str", ":our_estimated_str"),
(store_sub, ":center_score", 1000, ":relative_center_str"),
(val_max, ":center_score", 1),
(val_mul, ":center_score", ":reln"),
(val_mul, ":center_score", ":dist_factor"),
(try_begin),
(party_slot_eq, ":enemy_walled_center", slot_town_lord, "trp_player"),
(call_script, "script_troop_get_player_relation", ":troop_no"),
(assign, ":player_relation", reg0),
#(troop_get_slot, ":player_relation", ":troop_no", slot_troop_player_relation),
(lt, ":player_relation", 0),
(store_sub, ":multiplier", 50, ":player_relation"),
(val_mul, ":center_score", ":multiplier"),
(val_div, ":center_score", 50),
(try_end),
(try_begin),
(eq, ":enemy_walled_center", ":old_target_besiege_enemy_center"),
(val_mul, ":center_score", 100),
(try_end),
(try_begin),
(gt, ":center_score", ":best_besiege_center_score"),
(assign, ":best_besiege_center_score", ":center_score"),
(assign, ":best_besiege_center", ":enemy_walled_center"),
(try_end),
(try_end),
(ge, ":best_besiege_center", 0),
(assign, ":chance_besiege_enemy_center", 20),
(assign, ":target_besiege_enemy_center", ":best_besiege_center"),
(try_begin),
(eq, ":old_target_besiege_enemy_center", ":target_besiege_enemy_center"),
(val_mul, ":chance_besiege_enemy_center", 100),
(try_end),
(try_end),
(try_begin), #patrol alarmed center.
(eq, ":besieger_party", -1),
(ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low
(ge, "$party_relative_strength", 60),
(try_begin),
(party_slot_eq, ":party_no", slot_party_ai_state, spai_patrolling_around_center),
(party_get_slot, ":target_patrol_around_center", ":party_no", slot_party_ai_object),
(try_end),
(assign, ":old_target_patrol_around_center", -1),
(try_begin),
(eq, ":old_ai_state", spai_patrolling_around_center),
(assign, ":old_target_patrol_around_center", ":old_ai_object"),
(try_end),
(assign, ":best_patrol_score", 0),
(assign, ":best_patrol_target", -1),
(try_for_range, ":center_no", centers_begin, centers_end), #find closest center that has spotted enemies.
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", ":faction_no"),
(store_distance_to_party_from_party, ":distance", ":party_no", ":center_no"),
(store_sub, ":this_center_score", 100, ":distance"),
(val_max, ":this_center_score", 1),
(try_begin),
(party_slot_ge, ":center_no", slot_center_last_spotted_enemy, 0),
(val_mul, ":this_center_score", 100),
(try_end),
(try_begin),
(party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),
(val_mul, ":this_center_score", 2),
(try_end),
(try_begin),
(eq, ":center_no", ":old_target_patrol_around_center"),
(val_mul, ":this_center_score", 1000),
(try_end),
(try_begin),
(gt, ":this_center_score", ":best_patrol_score"),
(assign, ":best_patrol_score", ":this_center_score"),
(assign, ":best_patrol_target", ":center_no"),
(try_end),
(try_end),
(try_begin),
(gt, ":best_patrol_score", 0),
(assign, ":target_patrol_around_center", ":best_patrol_target"),
(try_end),
(try_begin),
(is_between, ":target_patrol_around_center", centers_begin, centers_end),
(assign, ":chance_patrol_around_center", 80),
(try_end),
(try_begin),
(troop_slot_ge, ":troop_no", slot_troop_change_to_faction, 1),
(val_mul, ":chance_patrol_around_center", 10),
(try_end),
(try_begin),
(eq, ":old_target_patrol_around_center", ":target_patrol_around_center"),
(val_mul, ":chance_patrol_around_center", 100),
(try_end),
(try_end),
## (try_begin), #cancel actions
## (party_get_slot, ":ai_state", ":party_no", slot_party_ai_state),
## (party_get_slot, ":ai_object", ":party_no", slot_party_ai_object),
## (neq, ":ai_state", spai_undefined),
## (assign, ":cancel_cur_action", 0),
## (try_begin),
## (eq, ":ai_state", spai_patrolling_around_center),
## (neg|party_slot_ge, ":ai_object", slot_center_last_spotted_enemy, 0),
## (store_random_in_range, ":rand", 0, 100),
## (lt, ":rand", 25),
## (assign, ":cancel_cur_action", 1),
## (else_try),
## (this_or_next|eq, ":ai_state", spai_besieging_center),
## (eq, ":ai_state", spai_raiding_around_center),
## (store_faction_of_party, ":ai_object_faction", ":ai_object"),
## (store_relation, ":ai_object_relation", ":ai_object_faction", ":faction_no"),
## (ge, ":ai_object_relation", 0),
## (assign, ":cancel_cur_action", 1),
## (try_end),
## (eq, ":cancel_cur_action", 0),
## (assign, ":chance_stay", 100),
## (try_end),
## (try_begin),
## (eq, ":siege_going_badly", 1),
## (assign, ":chance_besiege_enemy_center", 0),
## (assign, ":chance_stay", 0),
## (try_end),
## (try_begin),
## (eq, ":siege_going_well", 1),
## (assign, ":chance_move_to_home_center", 0),
## (assign, ":chance_move_to_other_center", 0),
## (assign, ":chance_patrol_around_center", 0),
## (assign, ":chance_besiege_enemy_center", 0),
## (assign, ":chance_help_besieged_center", 0),
## (try_end),
(assign, ":sum_chances", ":chance_move_to_home_center"),
(val_add, ":sum_chances", ":chance_move_to_other_center"),
(val_add, ":sum_chances", ":chance_recruit_troops"),
(val_add, ":sum_chances", ":chance_raid_around_center"),
(val_add, ":sum_chances", ":chance_besiege_enemy_center"),
(val_add, ":sum_chances", ":chance_patrol_around_center"),
## (val_add, ":sum_chances", ":chance_stay"),
(val_max, ":sum_chances", 1),
(store_random_in_range, ":random_no", 0, ":sum_chances"),
(try_begin),
(val_sub, ":random_no", ":chance_move_to_home_center"),
(lt, ":random_no", 0),
(call_script, "script_party_set_ai_state", ":party_no", spai_holding_center, ":target_move_to_home_center"),
(party_set_flags, ":party_no", pf_default_behavior, 1),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(else_try),
(val_sub, ":random_no", ":chance_move_to_other_center"),
(lt, ":random_no", 0),
(call_script, "script_party_set_ai_state", ":party_no", spai_holding_center, ":target_move_to_other_center"),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(else_try),
(val_sub, ":random_no", ":chance_recruit_troops"),
(lt, ":random_no", 0),
(call_script, "script_party_set_ai_state", ":party_no", spai_recruiting_troops, ":target_recruit_troops"),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(else_try),
(val_sub, ":random_no", ":chance_raid_around_center"),
(lt, ":random_no", 0),
(call_script, "script_party_set_ai_state", ":party_no", spai_raiding_around_center, ":target_raid_around_center"),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(else_try),
(val_sub, ":random_no", ":chance_besiege_enemy_center"),
(lt, ":random_no", 0),
(call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, ":target_besiege_enemy_center"),
(else_try),
(val_sub, ":random_no", ":chance_patrol_around_center"),
(lt, ":random_no", 0),
(call_script, "script_party_set_ai_state", ":party_no", spai_patrolling_around_center, ":target_patrol_around_center"),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(else_try),
(call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(try_end),
(try_end),
]),
# script_process_kingdom_parties_ai
# This is called more frequently than decide_kingdom_parties_ai
# Input: none
# Output: none
#called from triggers
("process_kingdom_parties_ai",
[
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(gt, ":party_no", 0),
(call_script, "script_process_hero_ai", ":troop_no"),
(try_end),
]),
# script_process_hero_ai
# This is called more frequently than script_decide_kingdom_party_ais
# Input: none
# Output: none
#called from triggers
("process_hero_ai",
[
(store_script_param_1, ":troop_no"),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(store_faction_of_party, ":faction_no", ":party_no"),
(party_get_slot, ":ai_state", ":party_no", slot_party_ai_state),
(party_get_slot, ":ai_object", ":party_no", slot_party_ai_object),
(try_begin),
(eq, ":ai_state", spai_besieging_center),
(try_begin),
(party_slot_eq, ":ai_object", slot_center_is_besieged_by, -1),
(store_distance_to_party_from_party, ":distance", ":party_no", ":ai_object"),
(lt, ":distance", 3),
(try_begin),
(party_slot_ge, ":party_no", slot_party_commander_party, 0),
(party_get_slot, ":commander_party", ":party_no", slot_party_commander_party),
(party_set_slot, ":ai_object", slot_center_is_besieged_by, ":commander_party"),
(else_try),
(party_set_slot, ":ai_object", slot_center_is_besieged_by, ":party_no"),
(try_end),
(store_current_hours, ":cur_hours"),
(party_set_slot, ":ai_object", slot_center_siege_begin_hours, ":cur_hours"),
(str_store_party_name_link, s1, ":ai_object"),
(str_store_troop_name_link, s2, ":troop_no"),
(str_store_faction_name_link, s3, ":faction_no"),
(display_log_message, "@{s1} has been besieged by {s2} of {s3}."),
(try_begin),
(store_faction_of_party, ":ai_object_faction", ":ai_object"),
(this_or_next|party_slot_eq, ":ai_object", slot_town_lord, "trp_player"),
(eq, ":ai_object_faction", "fac_player_supporters_faction"),
(call_script, "script_add_notification_menu", "mnu_notification_center_under_siege", ":ai_object", ":troop_no"),
(try_end),
(call_script, "script_village_set_state", ":ai_object", svs_under_siege),
(assign, "$g_recalculate_ais", 1),
(try_end),
(else_try),
(eq, ":ai_state", spai_recruiting_troops),
(try_begin),
(store_distance_to_party_from_party, ":distance", ":party_no", ":ai_object"),
(lt, ":distance", 3),
(store_current_hours, ":cur_hours"),
(party_get_slot, ":substate", ":party_no", slot_party_ai_substate),
(val_add, ":substate", 1),
(party_set_slot, ":party_no", slot_party_ai_substate, ":substate"),
(try_begin),
(ge, ":substate", 4),
(party_set_slot, ":party_no", slot_party_ai_substate, ":cur_hours"),
(call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(party_get_slot, ":troop_type", ":ai_object", slot_center_npc_volunteer_troop_type),
(party_get_slot, ":troop_amount", ":ai_object", slot_center_npc_volunteer_troop_amount),
(party_set_slot, ":ai_object", slot_center_npc_volunteer_troop_amount, -1),
(party_add_members, ":party_no", ":troop_type", ":troop_amount"),
(try_end),
(try_end),
(else_try),
(eq, ":ai_state", spai_raiding_around_center),
(party_slot_eq, ":party_no", slot_party_ai_substate, 0),
(assign, ":selected_village", 0),
(try_for_range, ":enemy_village_no", villages_begin, villages_end),
(eq, ":selected_village", 0),
(store_faction_of_party, ":enemy_village_faction", ":enemy_village_no"),
(try_begin),
(party_slot_eq, ":enemy_village_no", slot_town_lord, "trp_player"),
(store_relation, ":reln", "fac_player_supporters_faction", ":faction_no"),
(else_try),
(store_relation, ":reln", ":enemy_village_faction", ":faction_no"),
(try_end),
(lt, ":reln", 0),
(store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":party_no"),
(lt, ":dist", 15),
(party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided
#CHANGE STATE TO RAID THIS VILLAGE
(assign, ":selected_village", ":enemy_village_no"),
(try_end),
(try_begin),
(eq, ":selected_village", 0),
(is_between, ":ai_object", villages_begin, villages_end),
(assign, ":selected_village", ":ai_object"),
(try_end),
(try_begin),
(gt, ":selected_village", 0),
(call_script, "script_party_set_ai_state", ":party_no", spai_raiding_around_center, ":selected_village"),
(try_begin),
(faction_slot_eq, ":faction_no", slot_faction_marshall, ":troop_no"),
(faction_slot_eq, ":faction_no", slot_faction_ai_state, sfai_raiding_village),
(faction_set_slot, ":faction_no", slot_faction_ai_object, ":selected_village"),
(try_end),
(party_get_position, pos1, ":selected_village"),
(map_get_random_position_around_position, pos2, pos1, 1),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point),
(party_set_ai_target_position, ":party_no", pos2),
(party_set_ai_object, ":party_no", ":selected_village"),
(party_set_slot, ":party_no", slot_party_ai_substate, 1),
(try_end),
(else_try),
(eq, ":ai_state", spai_raiding_around_center),#substate is 1
(try_begin),
(store_distance_to_party_from_party, ":distance", ":party_no", ":ai_object"),
(lt, ":distance", 2),
(try_begin),
(party_slot_eq, ":ai_object", slot_village_state, 0),
(call_script, "script_village_set_state", ":ai_object", svs_being_raided),
(party_set_slot, ":ai_object", slot_village_raided_by, ":party_no"),
(try_begin),
(store_faction_of_party, ":village_faction", ":ai_object"),
(this_or_next|party_slot_eq, ":ai_object", slot_town_lord, "trp_player"),
(eq, ":village_faction", "fac_player_supporters_faction"),
(store_distance_to_party_from_party, ":dist", "p_main_party", ":ai_object"),
(this_or_next|lt, ":dist", 30),
(party_slot_eq, ":ai_object", slot_center_has_messenger_post, 1),
(call_script, "script_add_notification_menu", "mnu_notification_village_raid_started", ":ai_object", ":troop_no"),
(try_end),
(else_try),
(party_slot_eq, ":ai_object", slot_village_state, svs_being_raided),
(else_try),
#if anything other than being_raided leave
(party_set_slot, ":party_no", slot_party_ai_substate, 0),
(try_end),
(try_end),
(else_try),
(eq, ":ai_state", spai_retreating_to_center),
(try_begin),
(party_get_battle_opponent, ":enemy_party", ":party_no"),
(ge, ":enemy_party", 0), #we are in a battle! we may be caught in a loop!
(call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(try_end),
(else_try),
(eq, ":ai_state", spai_patrolling_around_center),
(try_begin),
(party_slot_eq, ":party_no", slot_party_ai_substate, 0),
(store_distance_to_party_from_party, ":distance", ":party_no", ":ai_object"),
(lt, ":distance", 3),
(party_set_slot, ":party_no", slot_party_ai_substate, 1),
(party_set_ai_behavior, ":party_no", ai_bhvr_patrol_party),
(party_set_ai_object, ":party_no", ":ai_object"),
(try_end),
(else_try),
(eq, ":ai_state", spai_holding_center),
(party_get_attached_to, ":cur_town", ":party_no"),
# Make the party sortie outside, so that it will drive away any enemies??
(try_begin),
(is_between, ":cur_town", walled_centers_begin, walled_centers_end),
(assign, ":sortie_chance", 50),
(try_begin),
(party_get_attached_to, ":cur_town", ":party_no"),
(party_slot_ge, ":party_no", slot_center_is_besieged_by, 0), #town is under siege
(assign, ":sortie_chance", 5),
(try_end),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", ":sortie_chance"),
(assign, ":enemies_nearby", 0),
(call_script, "script_party_calculate_regular_strength", ":party_no"),
(assign, ":our_strength", reg0),
(try_for_range, ":enemy_hero", kingdom_heroes_begin, kingdom_heroes_end),
(store_troop_faction, ":enemy_hero_faction", ":enemy_hero"),
(store_relation, ":reln", ":enemy_hero_faction", ":faction_no"),
(lt, ":reln", 0),
(troop_get_slot, ":enemy_party", ":enemy_hero", slot_troop_leaded_party),
(gt, ":enemy_party", 0),
(party_is_active, ":enemy_party"),
(store_distance_to_party_from_party, ":dist", ":enemy_party", ":party_no"),
(lt, ":dist", 7),
(call_script, "script_party_calculate_regular_strength", "p_collective_enemy"),
(gt, reg0, ":our_strength"),
(assign, ":enemies_nearby", 1),
(try_end),
(eq, ":enemies_nearby", 0),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party),
(party_set_ai_object, ":party_no", ":ai_object"),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(party_detach, ":party_no"),
(try_end),
(try_end),
]),
# script_select_faction_marshall
# Input: arg1: faction_no
# Output: none
#called from triggers
("select_faction_marshall",
[
(store_script_param_1, ":faction_no"),
(faction_get_slot, ":faction_leader", ":faction_no", slot_faction_leader),
(faction_get_slot, ":old_faction_marshall", ":faction_no", slot_faction_marshall),
(assign, ":total_renown", 0),
(try_for_range, ":loop_var", "trp_kingdom_heroes_including_player_begin", kingdom_heroes_end),
(assign, ":cur_troop", ":loop_var"),
(assign, ":continue", 0),
(try_begin),
(eq, ":loop_var", "trp_kingdom_heroes_including_player_begin"),
(assign, ":cur_troop", "trp_player"),
(try_begin),
(eq, ":faction_no", "$players_kingdom"),
(assign, ":continue", 1),
(try_end),
(else_try),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":cur_faction", ":cur_troop"),
(eq, ":cur_faction", ":faction_no"),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(gt, ":cur_party", 0),
(party_is_active, ":cur_party"),
(call_script, "script_party_count_fit_for_battle", ":cur_party"),
(assign, ":party_fit_for_battle", reg0),
(call_script, "script_party_get_ideal_size", ":cur_party"),
(assign, ":ideal_size", reg0),
(store_mul, ":relative_strength", ":party_fit_for_battle", 100),
(val_div, ":relative_strength", ":ideal_size"),
(ge, ":relative_strength", 25),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(troop_get_slot, ":renown", ":cur_troop", slot_troop_renown),
(try_begin),
(eq, ":cur_troop", "trp_player"),
(neq, ":old_faction_marshall", "trp_player"),
(assign, ":renown", 0),
(try_end),
(try_begin),
(eq, ":cur_troop", ":faction_leader"),
(val_mul, ":renown", 3),
(val_div, ":renown", 4),
(try_end),
(try_begin),
(eq, ":cur_troop", ":old_faction_marshall"),
(val_mul, ":renown", 1000),
(try_end),
(val_add, ":total_renown", ":renown"),
(try_end),
(assign, ":result", -1),
(try_begin),
(gt, ":total_renown", 0),
(store_random_in_range, ":random_renown", 0, ":total_renown"),
(try_for_range, ":loop_var", "trp_kingdom_heroes_including_player_begin", kingdom_heroes_end),
(eq, ":result", -1),
(assign, ":cur_troop", ":loop_var"),
(assign, ":continue", 0),
(try_begin),
(eq, ":loop_var", "trp_kingdom_heroes_including_player_begin"),
(assign, ":cur_troop", "trp_player"),
(try_begin),
(eq, ":faction_no", "$players_kingdom"),
(assign, ":continue", 1),
(try_end),
(else_try),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":cur_faction", ":cur_troop"),
(eq, ":cur_faction", ":faction_no"),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(gt, ":cur_party", 0),
(party_is_active, ":cur_party"),
(call_script, "script_party_count_fit_for_battle", ":cur_party"),
(assign, ":party_fit_for_battle", reg0),
(call_script, "script_party_get_ideal_size", ":cur_party"),
(assign, ":ideal_size", reg0),
(store_mul, ":relative_strength", ":party_fit_for_battle", 100),
(val_div, ":relative_strength", ":ideal_size"),
(ge, ":relative_strength", 25),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(troop_get_slot, ":renown", ":cur_troop", slot_troop_renown),
(try_begin),
(eq, ":cur_troop", "trp_player"),
(neq, ":old_faction_marshall", "trp_player"),
(assign, ":renown", 0),
(try_end),
(try_begin),
(eq, ":cur_troop", ":faction_leader"),
(val_mul, ":renown", 3),
(val_div, ":renown", 4),
(try_end),
(try_begin),
(eq, ":cur_troop", ":old_faction_marshall"),
(val_mul, ":renown", 1000),
(try_end),
(val_sub, ":random_renown", ":renown"),
(lt, ":random_renown", 0),
(assign, ":result", ":cur_troop"),
(try_end),
(try_end),
(try_begin),
(eq, "$cheat_mode", 1),
(ge, ":result", 0),
(str_store_troop_name, s1, ":result"),
(str_store_faction_name, s2, ":faction_no"),
(display_message, "@{s1} is chosen as the marshall of {s2}."),
(try_end),
(assign, reg0, ":result"),
]),
# script_get_center_faction_relation_including_player
# Input: arg1: center_no, arg2: target_faction_no
# Output: reg0: relation
#called from triggers
("get_center_faction_relation_including_player",
[
(store_script_param, ":center_no", 1),
(store_script_param, ":target_faction_no", 2),
(store_faction_of_party, ":center_faction", ":center_no"),
(store_relation, ":reln", ":center_faction", ":target_faction_no"),
(try_begin),
(party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(store_relation, ":reln", "fac_player_supporters_faction", ":target_faction_no"),
(try_end),
(assign, reg0, ":reln"),
]),
# script_decide_faction_ai
# Input: arg1: faction_no
# Output: none
#called from triggers
("decide_faction_ai",
[
(store_script_param_1, ":faction_no"),
(faction_get_slot, ":old_faction_ai_state", ":faction_no", slot_faction_ai_state),
(faction_get_slot, ":old_faction_ai_object", ":faction_no", slot_faction_ai_object),
(faction_get_slot, ":old_faction_ai_last_offensive_time", ":faction_no", slot_faction_ai_last_offensive_time),
(assign, ":faction_marshall_party", -1),
(assign, ":faction_marshall_army_strength", 1),#0 might cause division by zero problems
(assign, ":faction_marshall_num_followers", 1),
(call_script, "script_select_faction_marshall", ":faction_no"),
(assign, ":faction_marshall", reg0),
(assign, ":marshall_changed", 0),
(try_begin),
(neg|faction_slot_eq, ":faction_no", slot_faction_marshall, ":faction_marshall"),
(assign, ":marshall_changed", 1),
(eq, "$players_kingdom", ":faction_no"),
(str_store_troop_name_link, s1, ":faction_marshall"),
(str_store_faction_name_link, s2, ":faction_no"),
(display_message, "@{s1} is the new marshall of {s2}."),
(call_script, "script_check_and_finish_active_army_quests_for_faction", ":faction_no"),
(try_end),
(faction_set_slot, ":faction_no", slot_faction_marshall, ":faction_marshall"),
(try_begin),
(gt, ":faction_marshall", 0),
(troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party),
(gt, ":faction_marshall_party", 0),
(party_get_slot, ":faction_marshall_army_strength", ":faction_marshall_party", slot_party_cached_strength),
(party_get_slot, ":follower_strength", ":faction_marshall_party", slot_party_follower_strength),
(val_add, ":faction_marshall_army_strength", ":follower_strength"),
(try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(gt, ":cur_party", 0),
(party_is_active, ":cur_party"),
(party_slot_eq, ":cur_party", slot_party_commander_party, ":faction_marshall_party"),
(val_add, ":faction_marshall_num_followers", 1),
(try_end),
(try_end),
(faction_get_slot, ":marshall_num_old_followers", ":faction_no", slot_faction_ai_offensive_max_followers),
(val_max, ":marshall_num_old_followers", 1),
(store_mul, ":offensive_rating", ":faction_marshall_num_followers", 100),
(val_mul, ":offensive_rating", ":faction_marshall_num_followers"),
(val_div, ":offensive_rating", ":marshall_num_old_followers"),
(val_div, ":offensive_rating", ":marshall_num_old_followers"),
(val_min, ":offensive_rating", 100),#Max 100% efficiency
(faction_get_slot, ":num_armies", ":faction_no", slot_faction_num_armies),
(faction_get_slot, ":num_castles", ":faction_no", slot_faction_num_castles),
(faction_get_slot, ":num_towns", ":faction_no", slot_faction_num_towns),
(store_current_hours, ":cur_hours"),
(store_sub, ":offensive_hours", ":cur_hours", ":old_faction_ai_last_offensive_time"),
(assign, ":num_enemies", 0),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(store_relation, ":reln", ":cur_kingdom", ":faction_no"),
(lt, ":reln", 0),
(val_add, ":num_enemies", 1),
(try_end),
(assign, ":chance_defend", 0),
(assign, ":chance_gathering_army", 0),
(assign, ":chance_attacking_center", 0),
(assign, ":chance_raiding_village", 0),
(assign, ":chance_attacking_enemy_army", 0),
(assign, ":chance_attacking_enemies_around_center", 0),
(assign, ":target_attacking_center", -1),
(assign, ":target_raiding_village", -1),
(assign, ":target_attacking_enemy_army", -1),
(assign, ":target_attacking_enemies_around_center", -1),
(try_begin),#Defend
(eq, ":old_faction_ai_state", sfai_default),
(assign, ":chance_defend", 100),
(else_try),
(eq, ":old_faction_ai_state", sfai_gathering_army),
(gt, ":offensive_hours", 180),
(assign, ":chance_defend", 10000),#army can not be gathered, cancel
#else, keep it as 0
(else_try),
(store_div, ":chance_defend", ":offensive_hours", 10),
(store_mul, ":marshall_change_effect", ":marshall_changed", 300),
(val_add, ":chance_defend", ":marshall_change_effect"),
(try_end),
(try_begin),#Gathering army
(eq, ":old_faction_ai_state", sfai_default),
(gt, ":faction_marshall_party", 0),
(try_begin),
#No chance of gathering an army if there are no enemies
(gt, ":num_enemies", 0),
(store_mul, ":num_enemies_effect", ":num_enemies", 20),
(val_add, ":chance_gathering_army", ":num_enemies_effect"),
#Last offensive
(store_sub, ":last_offensive_effect", ":offensive_hours", 24 * 4),
(val_min, ":last_offensive_effect", 200),
(val_add, ":chance_gathering_army", ":last_offensive_effect"),
#Number of walled centers (inversely related)
(store_mul, ":center_value", ":num_towns", 2),
(val_add, ":center_value", ":num_castles"),
(val_mul, ":center_value", 10),
(val_max, ":center_value", 5),
(store_sub, ":num_centers_effect", "$g_average_center_value_per_faction", ":center_value"),
(val_add, ":chance_gathering_army", ":num_centers_effect"),
#Number of armies (inversely related)
(store_mul, ":num_armies_effect", ":num_armies", 4),
(store_sub, ":num_armies_effect", 80, ":num_armies_effect"),
(val_add, ":chance_gathering_army", ":num_armies_effect"),
#Number of walled centers under siege
(assign, ":num_centers_under_siege", 0),
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(party_slot_ge, ":cur_center", slot_center_is_besieged_by, 0),
(store_faction_of_party, ":center_faction", ":cur_center"),
(eq, ":center_faction", ":faction_no"),
(val_add, ":num_centers_under_siege", 1),
(try_end),
(store_mul, ":num_centers_under_siege_effect", ":num_centers_under_siege", 100),
(val_add, ":chance_gathering_army", ":num_centers_under_siege_effect"),
(try_end),
(else_try),
(eq, ":old_faction_ai_state", sfai_gathering_army),
(this_or_next|lt, ":offensive_hours", 60),
(lt, ":faction_marshall_num_followers", 4),
(assign, ":chance_gathering_army", 3000),
(try_end),
(try_begin),#Attacking center
(neq, ":old_faction_ai_state", sfai_default),
(gt, ":faction_marshall_party", 0),
(assign, ":old_target_attacking_center", -1),
(try_begin),
(eq, ":old_faction_ai_state", sfai_attacking_center),
(assign, ":old_target_attacking_center", ":old_faction_ai_object"),
(try_end),
(assign, ":best_besiege_center", -1),
(assign, ":best_besiege_center_score", 0),
(try_for_range, ":enemy_walled_center", walled_centers_begin, walled_centers_end),
(party_get_slot, ":besieger_party", ":enemy_walled_center", slot_center_is_besieged_by),
(assign, ":besieger_own_faction", 0),
(try_begin),
(ge, ":besieger_party", 0),
(party_is_active, ":besieger_party"),
(store_faction_of_party, ":besieger_faction", ":besieger_party"),
(eq, ":besieger_faction", ":faction_no"),
(assign, ":besieger_own_faction", 1),
(try_end),
(this_or_next|eq, ":besieger_party", -1),
(eq, ":besieger_own_faction", 1),
(call_script, "script_get_center_faction_relation_including_player", ":enemy_walled_center", ":faction_no"),
(assign, ":reln", reg0),
(lt, ":reln", 0),
(val_mul, ":reln", -1),
(val_add, ":reln", 50),
(store_distance_to_party_from_party, ":dist", ":enemy_walled_center", ":faction_marshall_party"),
(val_add, ":dist", 20),
(party_get_slot, ":center_str", ":enemy_walled_center", slot_party_cached_strength),
(party_get_slot, ":center_near_str", ":enemy_walled_center", slot_party_nearby_friend_strength),
(val_add, ":center_str", ":center_near_str"),
(val_add, ":center_str", 1),
(store_mul, ":center_score", 1000, ":faction_marshall_army_strength"),
(val_div, ":center_score", ":center_str"),
(gt, ":center_score", 1500),
(val_min, ":center_score", 20000),#20 times stronger means an easy victory, distance is more important
(try_begin),
(party_slot_eq, ":enemy_walled_center", slot_town_lord, "trp_player"),
(call_script, "script_troop_get_player_relation", ":faction_marshall"),
(assign, ":player_relation", reg0),
#(troop_get_slot, ":player_relation", ":faction_marshall", slot_troop_player_relation),
(lt, ":player_relation", 0),
(store_sub, ":multiplier", 50, ":player_relation"),
(val_mul, ":center_score", ":multiplier"),
(val_div, ":center_score", 50),
(try_end),
(try_begin),
(party_slot_eq, ":enemy_walled_center", slot_center_original_faction, ":faction_no"),
(val_mul, ":center_score", 2),
(try_end),
(try_begin),
(party_slot_eq, ":enemy_walled_center", slot_center_ex_faction, ":faction_no"),
(val_mul, ":center_score", 2),
(try_end),
(val_mul, ":center_score", ":reln"),
(val_div, ":center_score", ":dist"),
(try_begin),
(eq, ":enemy_walled_center", ":old_target_attacking_center"),
(val_mul, ":center_score", 100),
(try_end),
(try_begin),
(gt, ":center_score", ":best_besiege_center_score"),
(assign, ":best_besiege_center_score", ":center_score"),
(assign, ":best_besiege_center", ":enemy_walled_center"),
(try_end),
(try_end),
(ge, ":best_besiege_center", 0),
#Center with equal strength at 30 kms away will have a center_score of 1300 (with -40 reln)
(store_div, ":chance_attacking_center", ":best_besiege_center_score", 15),
(val_min, ":chance_attacking_center", 1000),
(assign, ":target_attacking_center", ":best_besiege_center"),
(try_begin),
(eq, ":old_target_attacking_center", ":target_attacking_center"),
(val_mul, ":chance_attacking_center", 100),
(try_end),
(val_mul, ":chance_attacking_center", ":offensive_rating"),
(val_div, ":chance_attacking_center", 100),
(try_end),
(try_begin),#Raiding village
(neq, ":old_faction_ai_state", sfai_default),
(gt, ":faction_marshall_party", 0),
(assign, ":old_target_raiding_village", -1),
(try_begin),
(eq, ":old_faction_ai_state", sfai_raiding_village),
(assign, ":old_target_raiding_village", ":old_faction_ai_object"),
(try_end),
(assign, ":num_village_points", 0),
(try_for_range, ":enemy_village_no", villages_begin, villages_end),
(call_script, "script_get_center_faction_relation_including_player", ":enemy_village_no", ":faction_no"),
(lt, reg0, 0),
(store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":faction_marshall_party"),
(lt, ":dist", 120),
(this_or_next|party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided
(party_slot_eq, ":enemy_village_no", slot_village_state, svs_being_raided),
(store_sub, ":dist_point", 150, ":dist"),
(val_add, ":num_village_points", ":dist_point"),
(eq, ":enemy_village_no", ":old_target_raiding_village"),
(val_add, ":num_village_points", 10000),
(try_end),
(gt, ":num_village_points", 0),
(store_random_in_range, ":random_village_no", 0, ":num_village_points"),
(try_for_range, ":enemy_village_no", villages_begin, villages_end),
(eq, ":target_raiding_village", -1),
(call_script, "script_get_center_faction_relation_including_player", ":enemy_village_no", ":faction_no"),
(lt, reg0, 0),
(store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":faction_marshall_party"),
(lt, ":dist", 120),
(this_or_next|party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided
(party_slot_eq, ":enemy_village_no", slot_village_state, svs_being_raided),
(store_sub, ":dist_point", 150, ":dist"),
(val_sub, ":random_village_no", ":dist_point"),
(try_begin),
(eq, ":enemy_village_no", ":old_target_raiding_village"),
(val_sub, ":random_village_no", 10000),
(try_end),
(lt, ":random_village_no", 0),
(assign, ":target_raiding_village", ":enemy_village_no"),
(assign, ":chance_raiding_village", 20),
(try_begin),
(eq, ":old_target_raiding_village", ":target_raiding_village"),
(val_mul, ":chance_raiding_village", 100),
(try_end),
(val_mul, ":chance_raiding_village", ":offensive_rating"),
(val_div, ":chance_raiding_village", 100),
(try_end),
(try_end),
(try_begin),#Attacking enemy army
(neq, ":old_faction_ai_state", sfai_default),
(gt, ":faction_marshall_party", 0),
(assign, ":old_target_attacking_enemy_army", -1),
(try_begin),
(eq, ":old_faction_ai_state", sfai_attacking_enemy_army),
(assign, ":old_target_attacking_enemy_army", ":old_faction_ai_object"),
(try_end),
(assign, ":best_attack_army", -1),
(assign, ":best_attack_army_score", 0),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(faction_get_slot, ":cur_kingdom_marshall", ":cur_kingdom", slot_faction_marshall),
(ge, ":cur_kingdom_marshall", 0),
(troop_slot_eq, ":cur_kingdom_marshall", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":cur_kingdom_marshall_party", ":cur_kingdom_marshall", slot_troop_leaded_party),
(ge, ":cur_kingdom_marshall_party", 0),
(party_is_active, ":cur_kingdom_marshall_party"),
(store_troop_faction, ":cur_kingdom_marshall_faction", ":cur_kingdom_marshall"),
(store_relation, ":rel", ":cur_kingdom_marshall_faction", ":faction_no"),
(lt, ":rel", 0),
(this_or_next|faction_slot_eq, ":cur_kingdom_marshall_faction", slot_faction_ai_state, sfai_attacking_center),
(faction_slot_eq, ":cur_kingdom_marshall_faction", slot_faction_ai_state, sfai_raiding_village),
(party_get_slot, ":cur_kingdom_marshall_party_follower_strength", ":cur_kingdom_marshall_party", slot_party_follower_strength),
(party_get_slot, ":cur_kingdom_marshall_party_strength", ":cur_kingdom_marshall_party", slot_party_cached_strength),
(val_add, ":cur_kingdom_marshall_party_strength", ":cur_kingdom_marshall_party_follower_strength"),
(store_mul, ":attack_army_score", ":cur_kingdom_marshall_party_strength", 1000),
(val_div, ":attack_army_score", ":faction_marshall_army_strength"),
(try_begin),
(gt, ":attack_army_score", 850),
(store_sub, ":attack_army_score", 1700, ":attack_army_score"),
(try_end),
(gt, ":attack_army_score", 0),
(val_mul, ":attack_army_score", 2),
(try_begin),
(faction_slot_eq, ":cur_kingdom_marshall_faction", slot_faction_ai_state, sfai_attacking_center),
(val_mul, ":attack_army_score", 10),
(else_try),
(faction_slot_eq, ":cur_kingdom_marshall_faction", slot_faction_ai_state, sfai_raiding_village),
(val_mul, ":attack_army_score", 3),
(try_end),
(try_begin),
(eq, ":old_target_attacking_enemy_army", ":cur_kingdom_marshall_party"),
(val_mul, ":attack_army_score", 100),
(try_end),
(store_distance_to_party_from_party, ":dist", ":cur_kingdom_marshall_party", ":faction_marshall_party"),
(val_add, ":dist", 20),
(val_div, ":attack_army_score", ":dist"),
(gt, ":attack_army_score", ":best_attack_army_score"),
(assign, ":best_attack_army", ":cur_kingdom_marshall_party"),
(assign, ":best_attack_army_score", ":attack_army_score"),
(try_end),
(ge, ":best_attack_army", 0),
#Army having with equal strength and 30 kms away will have a best_attack_army_score of 28
(store_mul, ":chance_attacking_enemy_army", ":best_attack_army_score", 2),
(val_min, ":chance_attacking_enemy_army", 1500),
(assign, ":target_attacking_enemy_army", ":best_attack_army"),
(try_begin),
(eq, ":old_target_attacking_enemy_army", ":target_attacking_enemy_army"),
(val_mul, ":chance_attacking_enemy_army", 100),
(try_end),
(val_mul, ":chance_attacking_enemy_army", ":offensive_rating"),
(val_div, ":chance_attacking_enemy_army", 100),
(try_end),
(try_begin),#Attacking enemies around center
(neq, ":old_faction_ai_state", sfai_default),
(gt, ":faction_marshall_party", 0),
(assign, ":old_target_attacking_enemies_around_center", -1),
(try_begin),
(eq, ":old_faction_ai_state", sfai_attacking_enemies_around_center),
(assign, ":old_target_attacking_enemies_around_center", ":old_faction_ai_object"),
(try_end),
(assign, ":best_attack_army_center", -1),
(assign, ":best_attack_army_score", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", ":faction_no"),
(party_get_slot, ":nearby_enemy_strength", ":center_no", slot_party_nearby_enemy_strength),
(store_mul, ":attack_army_score", ":nearby_enemy_strength", 1000),
(val_div, ":attack_army_score", ":faction_marshall_army_strength"),
(try_begin),
(gt, ":attack_army_score", 850),
(store_sub, ":attack_army_score", 1700, ":attack_army_score"),
(try_end),
(gt, ":attack_army_score", 0),
(val_mul, ":attack_army_score", 4),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(try_begin),
(party_slot_eq, ":center_no", slot_village_state, svs_being_raided),
(val_mul, ":attack_army_score", 3),
(try_end),
(else_try),
(try_begin),
(party_slot_ge, ":center_no", slot_center_is_besieged_by, 0),
(val_mul, ":attack_army_score", 10),
(try_end),
(try_end),
(try_begin),
(eq, ":old_target_attacking_enemies_around_center", ":center_no"),
(val_mul, ":attack_army_score", 100),
(try_end),
(store_distance_to_party_from_party, ":dist", ":center_no", ":faction_marshall_party"),
(val_add, ":dist", 20),
(val_div, ":attack_army_score", ":dist"),
(gt, ":attack_army_score", ":best_attack_army_score"),
(assign, ":best_attack_army_center", ":center_no"),
(assign, ":best_attack_army_score", ":attack_army_score"),
(try_end),
(ge, ":best_attack_army_center", 0),
#Center having enemies at equal strength and 30 kms away will have a best_attack_army_score of 56
(store_mul, ":chance_attacking_enemies_around_center", ":best_attack_army_score", 2),
(val_min, ":chance_attacking_enemies_around_center", 2000),
(assign, ":target_attacking_enemies_around_center", ":best_attack_army_center"),
(try_begin),
(eq, ":old_target_attacking_enemies_around_center", ":target_attacking_enemies_around_center"),
(val_mul, ":chance_attacking_enemies_around_center", 1000),
(try_end),
(val_mul, ":chance_attacking_enemies_around_center", ":offensive_rating"),
(val_div, ":chance_attacking_enemies_around_center", 100),
(try_begin),
(gt, ":chance_attacking_enemies_around_center", ":chance_attacking_enemy_army"),
(assign, ":end_cond", kingdoms_end),
(try_for_range, ":cur_kingdom", kingdoms_begin, ":end_cond"),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(faction_get_slot, ":cur_kingdom_marshall", ":cur_kingdom", slot_faction_marshall),
(ge, ":cur_kingdom_marshall", 0),
(troop_slot_eq, ":cur_kingdom_marshall", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":cur_kingdom_marshall_party", ":cur_kingdom_marshall", slot_troop_leaded_party),
(ge, ":cur_kingdom_marshall_party", 0),
(party_is_active, ":cur_kingdom_marshall_party"),
(store_troop_faction, ":cur_kingdom_marshall_faction", ":cur_kingdom_marshall"),
(store_relation, ":rel", ":cur_kingdom_marshall_faction", ":faction_no"),
(lt, ":rel", 0),
(store_distance_to_party_from_party, ":distance", ":cur_kingdom_marshall_party", ":target_attacking_enemies_around_center"),
(lt, ":distance", 10),
(assign, ":chance_attacking_enemy_army", ":chance_attacking_enemies_around_center"),
(assign, ":target_attacking_enemy_army", ":cur_kingdom_marshall_party"),
(assign, ":chance_attacking_enemies_around_center", 0),
(assign, ":target_attacking_enemies_around_center", -1),
(assign, ":end_cond", 0),#break
(try_end),
(try_end),
(try_end),
(assign, ":sum_weights", 0),
(val_add, ":sum_weights", ":chance_defend"),
(val_add, ":sum_weights", ":chance_gathering_army"),
(val_add, ":sum_weights", ":chance_attacking_center"),
(val_add, ":sum_weights", ":chance_raiding_village"),
(val_add, ":sum_weights", ":chance_attacking_enemy_army"),
(val_add, ":sum_weights", ":chance_attacking_enemies_around_center"),
(store_random_in_range, ":random_no", 0, ":sum_weights"),
(val_sub, ":random_no", ":chance_defend"),
(try_begin),
(lt, ":random_no", 0),
(faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_default),
(faction_set_slot, ":faction_no", slot_faction_ai_object, -1),
(try_begin),
(neq, ":old_faction_ai_state", sfai_default),
(call_script, "script_check_and_finish_active_army_quests_for_faction", ":faction_no"),
(faction_set_slot, ":faction_no", slot_faction_ai_last_offensive_time, ":cur_hours"),
(try_end),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_faction_name, s1, ":faction_no"),
(display_message, "@{s1} decided to do nothing."),
(try_end),
(else_try),
(val_sub, ":random_no", ":chance_gathering_army"),
(lt, ":random_no", 0),
(faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_gathering_army),
(faction_set_slot, ":faction_no", slot_faction_ai_object, -1),
(try_begin),
(neq, ":old_faction_ai_state", sfai_gathering_army),
(faction_set_slot, ":faction_no", slot_faction_ai_last_offensive_time, ":cur_hours"),
(faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, 1),
(try_end),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_faction_name, s1, ":faction_no"),
(display_message, "@{s1} decided to gather army."),
(try_end),
(else_try),
(val_sub, ":random_no", ":chance_attacking_center"),
(lt, ":random_no", 0),
(faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_attacking_center),
(faction_set_slot, ":faction_no", slot_faction_ai_object, ":target_attacking_center"),
(try_begin),
(gt, ":faction_marshall_num_followers", ":marshall_num_old_followers"),
(faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, ":faction_marshall_num_followers"),
(try_end),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_faction_name, s1, ":faction_no"),
(str_store_party_name, s2, ":target_attacking_center"),
(display_message, "@{s1} decided to besiege {s2}."),
(try_end),
(else_try),
(val_sub, ":random_no", ":chance_raiding_village"),
(lt, ":random_no", 0),
(faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_raiding_village),
(faction_set_slot, ":faction_no", slot_faction_ai_object, ":target_raiding_village"),
(try_begin),
(gt, ":faction_marshall_num_followers", ":marshall_num_old_followers"),
(faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, ":faction_marshall_num_followers"),
(try_end),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_faction_name, s1, ":faction_no"),
(str_store_party_name, s2, ":target_raiding_village"),
(display_message, "@{s1} decided to raid {s2}."),
(try_end),
(else_try),
(val_sub, ":random_no", ":chance_attacking_enemy_army"),
(lt, ":random_no", 0),
(faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_attacking_enemy_army),
(faction_set_slot, ":faction_no", slot_faction_ai_object, ":target_attacking_enemy_army"),
(try_begin),
(gt, ":faction_marshall_num_followers", ":marshall_num_old_followers"),
(faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, ":faction_marshall_num_followers"),
(try_end),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_faction_name, s1, ":faction_no"),
(str_store_party_name, s2, ":target_attacking_enemy_army"),
(display_message, "@{s1} decided to attack {s2}."),
(try_end),
(else_try),
(val_sub, ":random_no", ":chance_attacking_enemies_around_center"),
(lt, ":random_no", 0),
(faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_attacking_enemies_around_center),
(faction_set_slot, ":faction_no", slot_faction_ai_object, ":target_attacking_enemies_around_center"),
(try_begin),
(gt, ":faction_marshall_num_followers", ":marshall_num_old_followers"),
(faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, ":faction_marshall_num_followers"),
(try_end),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_faction_name, s1, ":faction_no"),
(str_store_party_name, s2, ":target_attacking_enemies_around_center"),
(display_message, "@{s1} decided to attack enemies around {s2}."),
(try_end),
(try_end),
(try_begin),
(eq, "$players_kingdom", ":faction_no"),
(neg|faction_slot_eq, ":faction_no", slot_faction_ai_state, sfai_attacking_center),
(check_quest_active, "qst_join_siege_with_army"),
(call_script, "script_abort_quest", "qst_join_siege_with_army", 0),
(try_end),
]),
# script_check_and_finish_active_army_quests_for_faction
# Input: faction_no
# Output: none
("check_and_finish_active_army_quests_for_faction",
[
(store_script_param_1, ":faction_no"),
(try_begin),
(eq, "$players_kingdom", ":faction_no"),
(try_begin),
(check_quest_active, "qst_report_to_army"),
(call_script, "script_cancel_quest", "qst_report_to_army"),
(try_end),
(assign, ":one_active", 0),
(try_for_range, ":quest_no", army_quests_begin, army_quests_end),
(check_quest_active, ":quest_no"),
(call_script, "script_cancel_quest", ":quest_no"),
(assign, ":one_active", 1),
(try_end),
(try_begin),
(check_quest_active, "qst_follow_army"),
(assign, ":one_active", 1),
(call_script, "script_end_quest", "qst_follow_army"),
(try_end),
(eq, ":one_active", 1),
(faction_get_slot, ":last_offensive_time", ":faction_no", slot_faction_ai_last_offensive_time),
(store_current_hours, ":cur_hours"),
(store_sub, ":total_time_served", ":cur_hours", ":last_offensive_time"),
(store_mul, ":xp_reward", ":total_time_served", 5),
(val_div, ":xp_reward", 50),
(val_mul, ":xp_reward", 50),
(val_add, ":xp_reward", 50),
(add_xp_as_reward, ":xp_reward"),
(try_end),
]),
# script_troop_get_player_relation
# Input: arg1 = troop_no
# Output: reg0 = effective relation (modified by troop reputation, honor, etc.)
("troop_get_player_relation",
[
(store_script_param_1, ":troop_no"),
(troop_get_slot, ":reputation", ":troop_no", slot_lord_reputation_type),
(troop_get_slot, ":effective_relation", ":troop_no", slot_troop_player_relation),
(assign, ":honor_bonus", 0),
(try_begin),
(eq, ":reputation", lrep_quarrelsome),
(val_add, ":effective_relation", -3),
(try_end),
(try_begin),
(ge, "$player_honor", 0),
(try_begin),
(this_or_next|eq, ":reputation", lrep_upstanding),
( eq, ":reputation", lrep_goodnatured),
(store_div, ":honor_bonus", "$player_honor", 3),
(try_end),
(try_end),
(try_begin),
(lt, "$player_honor", 0),
(try_begin),
(this_or_next|eq, ":reputation", lrep_upstanding),
( eq, ":reputation", lrep_goodnatured),
(store_div, ":honor_bonus", "$player_honor", 3),
(else_try),
(eq, ":reputation", lrep_martial),
(store_div, ":honor_bonus", "$player_honor", 5),
(try_end),
(try_end),
(val_add, ":effective_relation", ":honor_bonus"),
(assign, reg0, ":effective_relation"),
]),
# script_change_troop_renown
# Input: arg1 = troop_no, arg2 = relation difference
# Output: none
("change_troop_renown",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":renown_change"),
(troop_get_slot, ":old_renown", ":troop_no", slot_troop_renown),
(store_add, ":new_renown", ":old_renown", ":renown_change"),
(val_max, ":new_renown", 0),
(troop_set_slot, ":troop_no", slot_troop_renown, ":new_renown"),
(try_begin),
(eq, ":troop_no", "trp_player"),
(str_store_troop_name, s1, ":troop_no"),
(assign, reg12, ":renown_change"),
(val_abs, reg12),
(try_begin),
(gt, ":renown_change", 0),
(display_message, "@You gained {reg12} renown."),
(else_try),
(lt, ":renown_change", 0),
(display_message, "@You lose {reg12} renown."),
(try_end),
(try_end),
(call_script, "script_update_troop_notes", ":troop_no"),
]),
# script_change_player_relation_with_troop
# Input: arg1 = troop_no, arg2 = relation difference
# Output: none
("change_player_relation_with_troop",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":difference"),
(try_begin),
(neq, ":troop_no", "trp_player"),
(neg|is_between, ":troop_no", soldiers_begin, soldiers_end),
(neq, ":difference", 0),
(call_script, "script_troop_get_player_relation", ":troop_no"),
(assign, ":old_effective_relation", reg0),
(troop_get_slot, ":player_relation", ":troop_no", slot_troop_player_relation),
(val_add, ":player_relation", ":difference"),
(val_clamp, ":player_relation", -100, 101),
(try_begin),
(troop_set_slot, ":troop_no", slot_troop_player_relation, ":player_relation"),
(str_store_troop_name_link, s1, ":troop_no"),
(call_script, "script_troop_get_player_relation", ":troop_no"),
(assign, ":new_effective_relation", reg0),
(neq, ":old_effective_relation", ":new_effective_relation"),
(assign, reg1, ":old_effective_relation"),
(assign, reg2, ":new_effective_relation"),
(try_begin),
(gt, ":difference", 0),
(display_message, "str_troop_relation_increased"),
(else_try),
(lt, ":difference", 0),
(display_message, "str_troop_relation_detoriated"),
(try_end),
(try_begin),
(eq, ":troop_no", "$g_talk_troop"),
(assign, "$g_talk_troop_relation", ":new_effective_relation"),
(call_script, "script_setup_talk_info"),
(try_end),
(call_script, "script_update_troop_notes", ":troop_no"),
(try_end),
(try_end),
]),
# script_change_player_relation_with_center
# Input: arg1 = party_no, arg2 = relation difference
# Output: none
("change_player_relation_with_center",
[
(store_script_param_1, ":center_no"),
(store_script_param_2, ":difference"),
(party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
(assign, reg1, ":player_relation"),
(val_add, ":player_relation", ":difference"),
(val_clamp, ":player_relation", -100, 100),
(assign, reg2, ":player_relation"),
(party_set_slot, ":center_no", slot_center_player_relation, ":player_relation"),
(str_store_party_name_link, s1, ":center_no"),
(try_begin),
(gt, ":difference", 0),
(display_message, "@Your relation with {s1} has improved."),
(else_try),
(lt, ":difference", 0),
(display_message, "@Your relation with {s1} has deteriorated."),
(try_end),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(call_script, "script_update_volunteer_troops_in_village", ":center_no"),
(try_end),
(try_begin),
(this_or_next|is_between, "$g_talk_troop", village_elders_begin, village_elders_end),
(is_between, "$g_talk_troop", mayors_begin, mayors_end),
(assign, "$g_talk_troop_relation", ":player_relation"),
(call_script, "script_setup_talk_info"),
(try_end),
]),
# script_change_player_relation_with_faction
# Input: arg1 = faction_no, arg2 = relation difference
# Output: none
("change_player_relation_with_faction",
[
(store_script_param_1, ":faction_no"),
(store_script_param_2, ":difference"),
(store_relation, ":player_relation", ":faction_no", "fac_player_supporters_faction"),
(assign, reg1, ":player_relation"),
(val_add, ":player_relation", ":difference"),
(assign, reg2, ":player_relation"),
(set_relation, ":faction_no", "fac_player_faction", ":player_relation"),
(set_relation, ":faction_no", "fac_player_supporters_faction", ":player_relation"),
(str_store_faction_name_link, s1, ":faction_no"),
(try_begin),
(gt, ":difference", 0),
(display_message, "str_faction_relation_increased"),
(else_try),
(lt, ":difference", 0),
(display_message, "str_faction_relation_detoriated"),
(try_end),
(call_script, "script_update_all_notes"),
]),
# script_set_player_relation_with_faction
# Input: arg1 = faction_no, arg2 = relation
# Output: none
("set_player_relation_with_faction",
[
(store_script_param_1, ":faction_no"),
(store_script_param_2, ":relation"),
(store_relation, ":player_relation", ":faction_no", "fac_player_supporters_faction"),
(store_sub, ":reln_dif", ":relation", ":player_relation"),
(call_script, "script_change_player_relation_with_faction", ":faction_no", ":reln_dif"),
]),
# script_change_player_relation_with_faction_ex
# changes relations with other factions also (according to their relations between each other)
# Input: arg1 = faction_no, arg2 = relation difference
# Output: none
("change_player_relation_with_faction_ex",
[
(store_script_param_1, ":faction_no"),
(store_script_param_2, ":difference"),
(store_relation, ":player_relation", ":faction_no", "fac_player_supporters_faction"),
(assign, reg1, ":player_relation"),
(val_add, ":player_relation", ":difference"),
(assign, reg2, ":player_relation"),
(set_relation, ":faction_no", "fac_player_faction", ":player_relation"),
(set_relation, ":faction_no", "fac_player_supporters_faction", ":player_relation"),
(str_store_faction_name_link, s1, ":faction_no"),
(try_begin),
(gt, ":difference", 0),
(display_message, "str_faction_relation_increased"),
(else_try),
(lt, ":difference", 0),
(display_message, "str_faction_relation_detoriated"),
(try_end),
(try_for_range, ":other_faction", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":other_faction", slot_faction_state, sfs_active),
(neq, ":faction_no", ":other_faction"),
(store_relation, ":other_faction_relation", ":faction_no", ":other_faction"),
(store_relation, ":player_relation", ":other_faction", "fac_player_supporters_faction"),
(store_mul, ":relation_change", ":difference", ":other_faction_relation"),
(val_div, ":relation_change", 100),
(val_add, ":player_relation", ":relation_change"),
(set_relation, ":other_faction", "fac_player_faction", ":player_relation"),
(set_relation, ":other_faction", "fac_player_supporters_faction", ":player_relation"),
(try_end),
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
(try_for_range, ":kingdom_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":kingdom_no", slot_faction_state, sfs_active),
(call_script, "script_update_faction_notes", ":kingdom_no"),
(try_end),
(try_end),
]),
# script_cf_get_random_active_faction_except_player_faction_and_faction
# Input: arg1 = except_faction_no
# Output: reg0 = random_faction
("cf_get_random_active_faction_except_player_faction_and_faction",
[
(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"),
(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"),
(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_make_kingdom_hostile_to_player
# Input: arg1 = faction_no, arg2 = relation difference
# Output: none
("make_kingdom_hostile_to_player",
[
(store_script_param_1, ":kingdom_no"),
(store_script_param_2, ":difference"),
(try_begin),
(lt, ":difference", 0),
(store_relation, ":player_relation", ":kingdom_no", "fac_player_supporters_faction"),
(val_min, ":player_relation", 0),
(val_add, ":player_relation", ":difference"),
(call_script, "script_set_player_relation_with_faction", ":kingdom_no", ":player_relation"),
(try_end),
]),
# script_change_player_honor
# Input: arg1 = honor difference
# Output: none
("change_player_honor",
[
(store_script_param_1, ":honor_dif"),
(val_add, "$player_honor", ":honor_dif"),
(try_begin),
(gt, ":honor_dif", 0),
(display_message, "@You gain honour."),
(else_try),
(lt, ":honor_dif", 0),
(display_message, "@You lose honour."),
(try_end),
## (val_mul, ":honor_dif", 1000),
## (assign, ":temp_honor", 0),
## (assign, ":num_nonlinear_steps", 10),
## (try_begin),
## (gt, "$player_honor", 0),
## (lt, ":honor_dif", 0),
## (assign, ":num_nonlinear_steps", 0),
## (else_try),
## (lt, "$player_honor", 0),
## (gt, ":honor_dif", 0),
## (assign, ":num_nonlinear_steps", 3),
## (try_end),
##
## (try_begin),
## (ge, "$player_honor", 0),
## (assign, ":temp_honor", "$player_honor"),
## (else_try),
## (val_sub, ":temp_honor", "$player_honor"),
## (try_end),
## (try_for_range, ":unused",0,":num_nonlinear_steps"),
## (ge, ":temp_honor", 10000),
## (val_div, ":temp_honor", 2),
## (val_div, ":honor_dif", 2),
## (try_end),
## (val_add, "$player_honor", ":honor_dif"),
]),
# script_change_player_party_morale
# Input: arg1 = morale difference
# Output: none
("change_player_party_morale",
[
(store_script_param_1, ":morale_dif"),
(party_get_morale, ":cur_morale", "p_main_party"),
(store_add, ":new_morale", ":cur_morale", ":morale_dif"),
(val_clamp, ":new_morale", 0, 100),
(party_set_morale, "p_main_party", ":new_morale"),
(try_begin),
(lt, ":new_morale", ":cur_morale"),
(store_sub, reg1, ":cur_morale", ":new_morale"),
(display_message, "str_party_lost_morale"),
(else_try),
(gt, ":new_morale", ":cur_morale"),
(store_sub, reg1, ":new_morale", ":cur_morale"),
(display_message, "str_party_gained_morale"),
(try_end),
]),
# script_cf_player_has_item_without_modifier
# Input: arg1 = item_id, arg2 = modifier
# Output: none (can_fail)
("cf_player_has_item_without_modifier",
[
(store_script_param, ":item_id", 1),
(store_script_param, ":modifier", 2),
(player_has_item, ":item_id"),
#checking if any of the meat is not rotten
(assign, ":has_without_modifier", 0),
(troop_get_inventory_capacity, ":inv_size", "trp_player"),
(try_for_range, ":i_slot", 0, ":inv_size"),
(troop_get_inventory_slot, ":cur_item", "trp_player", ":i_slot"),
(eq, ":cur_item", ":item_id"),
(troop_get_inventory_slot_modifier, ":cur_modifier", "trp_player", ":i_slot"),
(neq, ":cur_modifier", ":modifier"),
(assign, ":has_without_modifier", 1),
(assign, ":inv_size", 0), #break
(try_end),
(eq, ":has_without_modifier", 1),
]),
# script_get_player_party_morale_values
# Output: reg0 = player_party_morale_target
("get_player_party_morale_values",
[
(party_get_num_companion_stacks, ":num_stacks","p_main_party"),
(assign, ":num_men", 0),
(try_for_range, ":i_stack", 1, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
(try_begin),
(troop_is_hero, ":stack_troop"),
(val_add, ":num_men", 3),
(else_try),
(party_stack_get_size, ":stack_size","p_main_party",":i_stack"),
(val_add, ":num_men", ":stack_size"),
(try_end),
(try_end),
###############################
# Changed by Form Ranks kit
#
(party_get_num_attached_parties, ":arrays", "p_main_party"),
(try_for_range, ":i", 0, ":arrays"),
(party_get_attached_party_with_rank, ":array_party", "p_main_party", ":i"),
(store_party_size, ":array_size", ":array_party"),
(val_div, ":array_size", 2),
(val_add, ":num_men", ":array_size"),
(try_end),
#
# Change of Form Ranks kit end
###############################
(assign, "$g_player_party_morale_modifier_party_size", ":num_men"),
(store_skill_level, ":player_leadership", "skl_leadership", "trp_player"),
(store_mul, "$g_player_party_morale_modifier_leadership", ":player_leadership", 7),
(assign, ":new_morale", "$g_player_party_morale_modifier_leadership"),
(val_sub, ":new_morale", "$g_player_party_morale_modifier_party_size"),
(val_add, ":new_morale", 50),
(assign, "$g_player_party_morale_modifier_food", 0),
(try_for_range, ":cur_edible", food_begin, food_end),
(call_script, "script_cf_player_has_item_without_modifier", ":cur_edible", imod_rotten),
(item_get_slot, ":food_bonus", ":cur_edible", slot_item_food_bonus),
(val_add, "$g_player_party_morale_modifier_food", ":food_bonus"),
(try_end),
(val_add, ":new_morale", "$g_player_party_morale_modifier_food"),
(try_begin),
(eq, "$g_player_party_morale_modifier_food", 0),
(assign, "$g_player_party_morale_modifier_no_food", 30),
(val_sub, ":new_morale", "$g_player_party_morale_modifier_no_food"),
(else_try),
(assign, "$g_player_party_morale_modifier_no_food", 0),
(try_end),
(assign, "$g_player_party_morale_modifier_debt", 0),
(try_begin),
(gt, "$g_player_debt_to_party_members", 0),
(call_script, "script_calculate_player_faction_wage"),
(assign, ":total_wages", reg0),
(store_mul, "$g_player_party_morale_modifier_debt", "$g_player_debt_to_party_members", 10),
(val_div, "$g_player_party_morale_modifier_debt", ":total_wages"),
(val_clamp, "$g_player_party_morale_modifier_debt", 1, 31),
(val_sub, ":new_morale", "$g_player_party_morale_modifier_debt"),
(try_end),
(val_clamp, ":new_morale", 0, 100),
(assign, reg0, ":new_morale"),
]),
# script_diplomacy_start_war_between_kingdoms
# Input: arg1 = kingdom_1, arg2 = kingdom_2, arg3 = initializing_war_peace_cond
# Output: none
("diplomacy_start_war_between_kingdoms", #sets relations between two kingdoms and their vassals.
[
(store_script_param, ":kingdom_a", 1),
(store_script_param, ":kingdom_b", 2),
(store_script_param, ":initializing_war_peace_cond", 3),
(store_relation, ":relation", ":kingdom_a", ":kingdom_b"),
(val_min, ":relation", -10),
(val_add, ":relation", -30),
(set_relation, ":kingdom_a", ":kingdom_b", ":relation"),
(try_begin),
(eq, "$players_kingdom", ":kingdom_a"),
(store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_b"),
(val_min, ":relation", -30),
(call_script, "script_set_player_relation_with_faction", ":kingdom_b", ":relation"),
(else_try),
(eq, "$players_kingdom", ":kingdom_b"),
(store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_a"),
(val_min, ":relation", -30),
(call_script, "script_set_player_relation_with_faction", ":kingdom_a", ":relation"),
(try_end),
(try_begin),
(eq, ":initializing_war_peace_cond", 1),
(try_begin),
(store_random_in_range, ":random_no", 0, 2),
(this_or_next|eq, ":kingdom_a", "fac_player_supporters_faction"),
(eq, ":random_no", 0),
(assign, ":local_temp", ":kingdom_a"),
(assign, ":kingdom_a", ":kingdom_b"),
(assign, ":kingdom_b", ":local_temp"),
(try_end),
(str_store_faction_name_link, s1, ":kingdom_a"),
(str_store_faction_name_link, s2, ":kingdom_b"),
(display_log_message, "@{s1} has declared war against {s2}."),
(call_script, "script_add_notification_menu", "mnu_notification_war_declared", ":kingdom_a", ":kingdom_b"),
(call_script, "script_update_faction_notes", ":kingdom_a"),
(call_script, "script_update_faction_notes", ":kingdom_b"),
(assign, "$g_recalculate_ais", 1),
(try_end),
]),
# script_party_calculate_and_set_nearby_friend_strength
# Input: party_no
# Output: none
("party_calculate_and_set_nearby_friend_strength",
[
(store_script_param, ":party_no", 1),
(assign, ":follower_strength", 0),
(assign, ":friend_strength", 0),
(assign, ":enemy_strength", 0),
(store_faction_of_party, ":party_faction", ":party_no"),
(store_add, ":end_cond", kingdom_heroes_end, 1),
(try_for_range, ":iteration", kingdom_heroes_begin, ":end_cond"),
(try_begin),
(eq, ":iteration", kingdom_heroes_end),
(assign, ":cur_troop", "trp_player"),
(else_try),
(assign, ":cur_troop", ":iteration"),
(try_end),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":cur_troop_party", ":cur_troop", slot_troop_leaded_party),
(ge, ":cur_troop_party", 0),
(party_is_active, ":cur_troop_party"),
(neq, ":party_no", ":cur_troop_party"),
(party_get_slot, ":str", ":cur_troop_party", slot_party_cached_strength),
(try_begin),
(party_get_slot, ":commander_party", ":cur_troop_party", slot_party_commander_party),
(eq, ":commander_party", ":party_no"),
(val_add, ":follower_strength", ":str"),
(try_end),
(store_distance_to_party_from_party, ":distance", ":cur_troop_party", ":party_no"),
(lt, ":distance", 10),
(store_troop_faction, ":army_faction", ":cur_troop"),
(store_relation, ":rel", ":army_faction", ":party_faction"),
(try_begin),
(this_or_next|eq, ":army_faction", ":party_faction"),
(gt, ":rel", 0),
(val_add, ":friend_strength", ":str"),
(else_try),
(lt, ":rel", 0),
(val_add, ":enemy_strength", ":str"),
(try_end),
(try_end),
(party_set_slot, ":party_no", slot_party_follower_strength, ":follower_strength"),
(party_set_slot, ":party_no", slot_party_nearby_friend_strength, ":friend_strength"),
(party_set_slot, ":party_no", slot_party_nearby_enemy_strength, ":enemy_strength"),
]),
# script_init_ai_calculation
# Input: none
# Output: none
("init_ai_calculation",
[
(try_for_range, ":cur_troop", heroes_begin, heroes_end),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(ge, ":cur_party", 0),
(call_script, "script_party_calculate_strength", ":cur_party", 0), #will update slot_party_cached_strength
(try_end),
(call_script, "script_party_calculate_strength", "p_main_party", 0), #will update slot_party_cached_strength
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(call_script, "script_party_calculate_strength", ":cur_center", 0), #will update slot_party_cached_strength
(try_end),
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(call_script, "script_party_calculate_and_set_nearby_friend_strength", ":cur_center"),
(try_end),
(try_for_range, ":cur_troop", heroes_begin, heroes_end),
(troop_get_slot, ":cur_troop_party", ":cur_troop", slot_troop_leaded_party),
(gt, ":cur_troop_party", 0),
(call_script, "script_party_calculate_and_set_nearby_friend_strength", ":cur_troop_party"),
(try_end),
(call_script, "script_party_calculate_and_set_nearby_friend_strength", "p_main_party"),
]),
# script_recalculate_ais
# Input: none
# Output: none
("recalculate_ais",
[
(call_script, "script_init_ai_calculation"),
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(neg|faction_slot_eq, ":faction_no", slot_faction_marshall, "trp_player"),
(call_script, "script_decide_faction_ai", ":faction_no"),
(try_end),
(call_script, "script_decide_kingdom_party_ais"),
]),
# script_recalculate_ai_for_troop
# Input: none
# Output: none
("recalculate_ai_for_troop",
[
(store_script_param, ":troop_no", 1),
(call_script, "script_init_ai_calculation"),
(call_script, "script_calculate_troop_ai", ":troop_no"),
(call_script, "script_calculate_troop_ai_under_command", ":troop_no"),
]),
# script_calculate_troop_ai
# Input: troop_no
# Output: none
("calculate_troop_ai",
[
(store_script_param, ":troop_no", 1),
(try_begin),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(gt, ":party_no", 0),
(party_slot_eq, ":party_no", slot_party_following_player, 0),
(store_faction_of_party, ":faction_no", ":party_no"),
(assign, ":continue", 1),
(try_begin),
(faction_slot_eq, ":faction_no", slot_faction_marshall, ":troop_no"), # do not calculate AI if troop is marshall.
(neg|faction_slot_eq, ":faction_no", slot_faction_ai_state, sfai_default),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(call_script, "script_party_count_fit_for_battle", ":party_no"),
(assign, ":party_fit_for_battle", reg0),
(call_script, "script_party_get_ideal_size", ":party_no"),
(assign, ":ideal_size", reg0),
(store_mul, "$party_relative_strength", ":party_fit_for_battle", 100),
(val_div, "$party_relative_strength", ":ideal_size"),
(try_begin),
(faction_slot_eq, ":faction_no", slot_faction_num_towns, 0),
(faction_slot_eq, ":faction_no", slot_faction_num_castles, 0),
(assign, "$ratio_of_prisoners", 0), #do not let prisoners have an effect on ai calculation
(else_try),
(party_get_num_prisoners, ":num_prisoners", ":party_no"),
(store_div, "$ratio_of_prisoners", ":num_prisoners", ":party_fit_for_battle"),
(try_end),
(call_script, "script_kingdom_hero_decide_next_ai_state_follow_or_not", ":troop_no"),
(party_slot_eq, ":party_no", slot_party_commander_party, -1),
(call_script, "script_kingdom_hero_decide_next_ai_state", ":troop_no"),
(try_end),
]),
# script_calculate_troop_ai_under_command
# Input: troop_no
# Output: none
("calculate_troop_ai_under_command",
[
(store_script_param, ":troop_no", 1),
(try_begin),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(gt, ":party_no", 0),
(party_slot_ge, ":party_no", slot_party_commander_party, 0),
(party_set_ai_initiative, ":party_no", 50),
(call_script, "script_party_decide_next_ai_state_under_command", ":party_no"),
(try_end),
]),
# script_diplomacy_start_peace_between_kingdoms
# Input: arg1 = kingdom_1, arg2 = kingdom_2, arg3 = initializing_war_peace_cond
# Output: none
("diplomacy_start_peace_between_kingdoms", #sets relations between two kingdoms
[
(store_script_param, ":kingdom_a", 1),
(store_script_param, ":kingdom_b", 2),
(store_script_param, ":initializing_war_peace_cond", 3),
(store_relation, ":relation", ":kingdom_a", ":kingdom_b"),
(val_max, ":relation", 0),
(set_relation, ":kingdom_a", ":kingdom_b", ":relation"),
(call_script, "script_exchange_prisoners_between_factions", ":kingdom_a", ":kingdom_b"),
(try_begin),
(eq, "$players_kingdom", ":kingdom_a"),
(store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_b"),
(val_max, ":relation", 0),
(call_script, "script_set_player_relation_with_faction", ":kingdom_b", ":relation"),
(call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_b", "fac_player_supporters_faction"),
(else_try),
(eq, "$players_kingdom", ":kingdom_b"),
(store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_a"),
(val_max, ":relation", 0),
(call_script, "script_set_player_relation_with_faction", ":kingdom_a", ":relation"),
(call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_a", "fac_player_supporters_faction"),
(try_end),
(try_begin),
(eq, ":initializing_war_peace_cond", 1),
(str_store_faction_name_link, s1, ":kingdom_a"),
(str_store_faction_name_link, s2, ":kingdom_b"),
(display_log_message, "@{s1} and {s2} have made peace with each other."),
(call_script, "script_update_faction_notes", ":kingdom_a"),
(call_script, "script_update_faction_notes", ":kingdom_b"),
(call_script, "script_add_notification_menu", "mnu_notification_peace_declared", ":kingdom_a", ":kingdom_b"),
(call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_a", ":kingdom_b"),
(call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_b", ":kingdom_a"),
(assign, "$g_recalculate_ais", 1),
(try_end),
]),
# script_event_kingdom_make_peace_with_kingdom
# Input: arg1 = source_kingdom, arg2 = target_kingdom
# Output: none
("event_kingdom_make_peace_with_kingdom",
[
(store_script_param_1, ":source_kingdom"),
(store_script_param_2, ":target_kingdom"),
(try_begin),
(check_quest_active, "qst_capture_prisoners"),
(try_begin),
(eq, "$players_kingdom", ":source_kingdom"),
(quest_slot_eq, "qst_capture_prisoners", slot_quest_target_faction, ":target_kingdom"),
(call_script, "script_cancel_quest", "qst_capture_prisoners"),
(else_try),
(eq, "$players_kingdom", ":target_kingdom"),
(quest_slot_eq, "qst_capture_prisoners", slot_quest_target_faction, ":source_kingdom"),
(call_script, "script_cancel_quest", "qst_capture_prisoners"),
(try_end),
(try_end),
]),
# script_randomly_start_war_peace
# Input: arg1 = initializing_war_peace_cond (1 = true, 0 = false)
# Output: none
("randomly_start_war_peace",
[
(store_script_param_1, ":initializing_war_peace_cond"),
(assign, ":total_resources", 0),
(assign, ":total_active_kingdoms", 0),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(val_add, ":total_active_kingdoms", 1),
(faction_get_slot, ":num_towns", ":cur_kingdom", slot_faction_num_towns),
(store_mul, ":kingdom_resources_value", ":num_towns", 2),
(faction_get_slot, ":num_castles", ":cur_kingdom", slot_faction_num_castles),
(val_add, ":kingdom_resources_value", ":num_castles"),
(val_mul, ":kingdom_resources_value", 10),
(val_max, ":kingdom_resources_value", 1),
(val_mul, ":kingdom_resources_value", 1000),
(faction_get_slot, ":num_armies", ":cur_kingdom", slot_faction_num_armies),
(val_max, ":num_armies", 1),
(val_div, ":kingdom_resources_value", ":num_armies"),
(val_add, ":total_resources", ":kingdom_resources_value"),
(try_end),
(val_max, ":total_active_kingdoms", 1),
(store_div, ":average_resources", ":total_resources", ":total_active_kingdoms"),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
## (neq, ":cur_kingdom", "fac_player_supporters_faction"),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(assign, ":num_ongoing_wars", 0),
(try_for_range, ":other_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":other_kingdom", slot_faction_state, sfs_active),
(store_relation, ":other_relation", ":cur_kingdom", ":other_kingdom"),
(lt, ":other_relation", 0),
(val_add, ":num_ongoing_wars", 1),
(try_end),
(faction_get_slot, ":num_towns", ":cur_kingdom", slot_faction_num_towns),
(store_mul, ":kingdom_1_resources_value", ":num_towns", 2),
(faction_get_slot, ":num_castles", ":cur_kingdom", slot_faction_num_castles),
(val_add, ":kingdom_1_resources_value", ":num_castles"),
(val_mul, ":kingdom_1_resources_value", 10),
(val_max, ":kingdom_1_resources_value", 1),
(val_mul, ":kingdom_1_resources_value", 1000),
(faction_get_slot, ":num_armies", ":cur_kingdom", slot_faction_num_armies),
(val_max, ":num_armies", 1),
(val_div, ":kingdom_1_resources_value", ":num_armies"),
(store_add, ":start_cond", ":cur_kingdom", 1),
(try_for_range, ":cur_kingdom_2", ":start_cond", kingdoms_end),
## (neq, ":cur_kingdom", "fac_player_supporters_faction"),
(faction_slot_eq, ":cur_kingdom_2", slot_faction_state, sfs_active),
(assign, ":num_ongoing_wars_2", 0),
(try_for_range, ":other_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":other_kingdom", slot_faction_state, sfs_active),
(store_relation, ":other_relation", ":cur_kingdom_2", ":other_kingdom"),
(lt, ":other_relation", 0),
(val_add, ":num_ongoing_wars_2", 1),
(try_end),
(store_add, ":total_ongoing_wars", ":num_ongoing_wars", ":num_ongoing_wars_2"),
(faction_get_slot, ":num_towns", ":cur_kingdom_2", slot_faction_num_towns),
(store_mul, ":kingdom_2_resources_value", ":num_towns", 2),
(faction_get_slot, ":num_castles", ":cur_kingdom_2", slot_faction_num_castles),
(val_add, ":kingdom_2_resources_value", ":num_castles"),
(val_mul, ":kingdom_2_resources_value", 10),
(val_max, ":kingdom_2_resources_value", 1),
(val_mul, ":kingdom_2_resources_value", 1000),
(faction_get_slot, ":num_armies", ":cur_kingdom_2", slot_faction_num_armies),
(val_max, ":num_armies", 1),
(val_div, ":kingdom_2_resources_value", ":num_armies"),
(assign, ":max_resources_value", ":kingdom_1_resources_value"),
(val_max, ":max_resources_value", ":kingdom_2_resources_value"),
(val_mul, ":max_resources_value", 100),
(val_div, ":max_resources_value", ":average_resources"),
(assign, ":cur_king", -1),
(try_begin),
(eq, ":cur_kingdom", "fac_player_supporters_faction"),
(faction_get_slot, ":cur_king", ":cur_kingdom_2", slot_faction_leader),
(assign, ":cur_relation", reg0),
(store_sub, ":relation_effect", 200, ":cur_relation"),
(val_mul, ":kingdom_1_resources_value", ":relation_effect"),
(val_div, ":kingdom_1_resources_value", 200),
(else_try),
(eq, ":cur_kingdom_2", "fac_player_supporters_faction"),
(faction_get_slot, ":cur_king", ":cur_kingdom", slot_faction_leader),
(try_end),
(try_begin),
(ge, ":cur_king", 0),
(call_script, "script_troop_get_player_relation", ":cur_king"),
(assign, ":cur_relation", reg0),
(store_sub, ":relation_effect", 200, ":cur_relation"),
(val_mul, ":max_resources_value", ":relation_effect"),
(val_div, ":max_resources_value", 200),
(try_end),
#max_resources_value is the obtained value that gives us how tempting the kingdom's values are
#average is 100
(val_clamp, ":max_resources_value", 20, 500),
#not letting more than 5 times higher chance of declaring war or peace
(store_random_in_range, ":random_no", 0, 10000),
(store_relation, ":cur_relation", ":cur_kingdom", ":cur_kingdom_2"),
(try_begin),
(lt, ":cur_relation", 0), #AT WAR
(store_mul, ":chance_to_make_peace", ":total_ongoing_wars", 50),
(val_mul, ":chance_to_make_peace", 100),
(val_div, ":chance_to_make_peace", ":max_resources_value"),
(try_begin),
#disable random peace for special conditions
(this_or_next|eq, ":cur_kingdom", "fac_player_supporters_faction"),
(eq, ":cur_kingdom_2", "fac_player_supporters_faction"),
(assign, ":continue", 0),
(try_begin),
(gt, "$supported_pretender", 0),
(this_or_next|eq, ":cur_kingdom", "$supported_pretender_old_faction"),
(eq, ":cur_kingdom_2", "$supported_pretender_old_faction"),
(assign, ":continue", 1),
(else_try),
(is_between, "$players_oath_renounced_against_kingdom", kingdoms_begin, kingdoms_end),
(this_or_next|eq, ":cur_kingdom", "$players_oath_renounced_against_kingdom"),
(eq, ":cur_kingdom_2", "$players_oath_renounced_against_kingdom"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(assign, ":chance_to_make_peace", 0),
(try_end),
(try_begin),
(lt, ":random_no", ":chance_to_make_peace"),
(assign, ":continue", 1),
(try_begin),
(check_quest_active, "qst_persuade_lords_to_make_peace"),
(quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
(quest_get_slot, ":quest_object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
(this_or_next|eq, ":cur_kingdom", ":quest_target_faction"),
(eq, ":cur_kingdom", ":quest_object_faction"),
(this_or_next|eq, ":cur_kingdom_2", ":quest_target_faction"),
(eq, ":cur_kingdom_2", ":quest_object_faction"),
(assign, ":continue", 0), #Do not declare war if the quest is active for the specific kingdoms
(try_end),
(eq, ":continue", 1),
(try_begin),
(eq, ":cur_kingdom", "fac_player_supporters_faction"),
(call_script, "script_add_notification_menu", "mnu_question_peace_offer", ":cur_kingdom_2", 0),
(else_try),
(eq, ":cur_kingdom_2", "fac_player_supporters_faction"),
(call_script, "script_add_notification_menu", "mnu_question_peace_offer", ":cur_kingdom", 0),
(else_try),
(call_script, "script_diplomacy_start_peace_between_kingdoms", ":cur_kingdom", ":cur_kingdom_2", ":initializing_war_peace_cond"),
(try_end),
(try_end),
(else_try), # AT PEACE
(assign, ":chance_to_declare_war", 6),
(val_sub, ":chance_to_declare_war", ":total_ongoing_wars"),
(val_mul, ":chance_to_declare_war", 50),
(val_mul, ":chance_to_declare_war", ":max_resources_value"),
(val_div, ":chance_to_declare_war", 100),
(try_begin),
(lt, ":random_no", ":chance_to_declare_war"),
(assign, ":continue", 1),
(try_begin),
(check_quest_active, "qst_raid_caravan_to_start_war"),
(quest_get_slot, ":quest_target_faction", "qst_raid_caravan_to_start_war", slot_quest_target_faction),
(quest_get_slot, ":quest_object_faction", "qst_raid_caravan_to_start_war", slot_quest_object_faction),
(this_or_next|eq, ":cur_kingdom", ":quest_target_faction"),
(eq, ":cur_kingdom", ":quest_object_faction"),
(this_or_next|eq, ":cur_kingdom_2", ":quest_target_faction"),
(eq, ":cur_kingdom_2", ":quest_object_faction"),
(assign, ":continue", 0), #Do not declare war if the quest is active for the specific kingdoms
(try_end),
(eq, ":continue", 1),
(call_script, "script_diplomacy_start_war_between_kingdoms", ":cur_kingdom", ":cur_kingdom_2", ":initializing_war_peace_cond"),
(try_end),
(try_end),
(try_end),
(try_end),
]),
# script_exchange_prisoners_between_factions
# Input: arg1 = faction_no_1, arg2 = faction_no_2
("exchange_prisoners_between_factions",
[
(store_script_param_1, ":faction_no_1"),
(store_script_param_2, ":faction_no_2"),
(assign, ":faction_no_3", -1),
(assign, ":faction_no_4", -1),
(try_begin),
(this_or_next|eq, "$players_kingdom", ":faction_no_1"),
(eq, "$players_kingdom", ":faction_no_2"),
(assign, ":faction_no_3", "fac_player_faction"),
(assign, ":faction_no_4", "fac_player_supporters_faction"),
(try_end),
(try_for_parties, ":party_no"),
(store_faction_of_party, ":party_faction", ":party_no"),
(this_or_next|eq, ":party_faction", ":faction_no_1"),
(this_or_next|eq, ":party_faction", ":faction_no_2"),
(this_or_next|eq, ":party_faction", ":faction_no_3"),
(eq, ":party_faction", ":faction_no_4"),
(party_get_num_prisoner_stacks, ":num_stacks", ":party_no"),
(try_for_range_backwards, ":troop_iterator", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":cur_troop_id", ":party_no", ":troop_iterator"),
(store_troop_faction, ":cur_faction", ":cur_troop_id"),
(this_or_next|eq, ":cur_faction", ":faction_no_1"),
(this_or_next|eq, ":cur_faction", ":faction_no_2"),
(this_or_next|eq, ":cur_faction", ":faction_no_3"),
(eq, ":cur_faction", ":faction_no_4"),
(try_begin),
(troop_is_hero, ":cur_troop_id"),
(call_script, "script_remove_troop_from_prison", ":cur_troop_id"),
(try_end),
(party_prisoner_stack_get_size, ":stack_size", ":party_no", ":troop_iterator"),
(party_remove_prisoners, ":party_no", ":cur_troop_id", ":stack_size"),
(try_end),
(try_end),
]),
# script_add_notification_menu
# Input: arg1 = menu_no, arg2 = menu_var_1, arg3 = menu_var_2
# Output: none
("add_notification_menu",
[
(store_script_param, ":menu_no", 1),
(store_script_param, ":menu_var_1", 2),
(store_script_param, ":menu_var_2", 3),
(assign, ":end_cond", 1),
(try_for_range, ":cur_slot", 0, ":end_cond"),
(try_begin),
(troop_slot_ge, "trp_notification_menu_types", ":cur_slot", 1),
(val_add, ":end_cond", 1),
(else_try),
(troop_set_slot, "trp_notification_menu_types", ":cur_slot", ":menu_no"),
(troop_set_slot, "trp_notification_menu_var1", ":cur_slot", ":menu_var_1"),
(troop_set_slot, "trp_notification_menu_var2", ":cur_slot", ":menu_var_2"),
(try_end),
(try_end),
]),
# script_finish_quest
# Input: arg1 = quest_no, arg2 = finish_percentage
# Output: none
("finish_quest",
[
(store_script_param_1, ":quest_no"),
(store_script_param_2, ":finish_percentage"),
(quest_get_slot, ":quest_giver", ":quest_no", slot_quest_giver_troop),
(quest_get_slot, ":quest_importance", ":quest_no", slot_quest_importance),
(quest_get_slot, ":quest_xp_reward", ":quest_no", slot_quest_xp_reward),
(quest_get_slot, ":quest_gold_reward", ":quest_no", slot_quest_gold_reward),
(try_begin),
(lt, ":finish_percentage", 100),
(val_mul, ":quest_xp_reward", ":finish_percentage"),
(val_div, ":quest_xp_reward", 100),
(val_mul, ":quest_gold_reward", ":finish_percentage"),
(val_div, ":quest_gold_reward", 100),
#Changing the relation factor. Negative relation if less than 75% of the quest is finished.
#Positive relation if more than 75% of the quest is finished.
(assign, ":importance_multiplier", ":finish_percentage"),
(val_sub, ":importance_multiplier", 75),
(val_mul, ":quest_importance", ":importance_multiplier"),
(val_div, ":quest_importance", 100),
(else_try),
(val_div, ":quest_importance", 4),
(val_add, ":quest_importance", 1),
(call_script, "script_change_player_relation_with_troop", ":quest_giver", ":quest_importance"),
(try_end),
(add_xp_as_reward, ":quest_xp_reward"),
(call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
(call_script, "script_end_quest", ":quest_no"),
]),
# script_get_information_about_troops_position
# Input: arg1 = troop_no, arg2 = time (0 if present tense, 1 if past tense)
# Output: s1 = String, reg0 = knows-or-not
("get_information_about_troops_position",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, reg3),
(troop_get_type, reg4, ":troop_no"),
(str_store_troop_name, s2, ":troop_no"),
(assign, ":found", 0),
(troop_get_slot, ":center_no", ":troop_no", slot_troop_cur_center),
(try_begin),
(gt, ":center_no", 0),
(is_between, ":center_no", centers_begin, centers_end),
(str_store_party_name_link, s3, ":center_no"),
(str_store_string, s1, "@{s2} {reg3?was:is currently} at {s3}."),
(assign, ":found", 1),
(else_try),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(gt, ":party_no", 0),
(call_script, "script_get_troop_attached_party", ":troop_no"),
(assign, ":center_no", reg0),
(try_begin),
(is_between, ":center_no", centers_begin, centers_end),
(str_store_party_name_link, s3, ":center_no"),
(str_store_string, s1, "@{s2} {reg3?was:is currently} at {s3}."),
(assign, ":found", 1),
(else_try),
(get_party_ai_behavior, ":ai_behavior", ":party_no"),
(eq, ":ai_behavior", ai_bhvr_travel_to_party),
(get_party_ai_object, ":ai_object", ":party_no"),
(is_between, ":ai_object", centers_begin, centers_end),
(call_script, "script_get_closest_center", ":party_no"),
(str_store_party_name_link, s4, reg0),
(str_store_party_name_link, s3, ":ai_object"),
(str_store_string, s1, "@{s2} {reg3?was:is} travelling to {s3} and {reg4?she:he} {reg3?was:should be} close to {s4}{reg3?: at the moment}."),
(assign, ":found", 1),
(else_try),
(call_script, "script_get_closest_center", ":party_no"),
(str_store_party_name_link, s3, reg0),
(str_store_string, s1, "@{s2} {reg3?was:is} in wilderness and {reg4?she:he} {reg3?was:should be} close to {s3}{reg3?: at the moment}."),
(assign, ":found", 1),
(try_end),
(else_try),
#(troop_slot_ge, ":troop_no", slot_troop_is_prisoner, 1),
(troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(party_count_prisoners_of_type, ":num_prisoners", ":center_no", ":troop_no"),
(gt, ":num_prisoners", 0),
(assign, ":found", 1),
(str_store_party_name_link, s3, ":center_no"),
(str_store_string, s1, "@{s2} {reg3?was:is} being held captive at {s3}."),
(try_end),
(try_begin),
(eq, ":found", 0),
(str_store_string, s1, "@{s2} {reg3?was:has been} taken captive by {reg4?her:his} enemies."),
(assign, ":found", 1),
(try_end),
(try_end),
(try_begin),
(eq, ":found", 0),
(str_store_string, s1, "@{reg3?{s2}'s location was unknown:I don't know where {s2} is}."),
(try_end),
(assign, reg0, ":found"),
]),
# script_recruit_troop_as_companion
# Input: arg1 = troop_no,
# Output: none
("recruit_troop_as_companion",
[
(store_script_param_1, ":troop_no"),
(troop_set_slot, ":troop_no", slot_troop_occupation, slto_player_companion),
(troop_set_slot, ":troop_no", slot_troop_cur_center, -1),
(troop_set_auto_equip, ":troop_no",0),
(party_add_members, "p_main_party", ":troop_no", 1),
(str_store_troop_name, s6, ":troop_no"),
(display_message, "@{s6} has joined your party"),
]),
# script_setup_random_scene
# Input: arg1 = center_no, arg2 = mission_template_no
# Output: none
("setup_random_scene",
[
(party_get_current_terrain, ":terrain_type", "p_main_party"),
(assign, ":scene_to_use", "scn_random_scene"),
(try_begin),
(eq, ":terrain_type", rt_steppe),
(assign, ":scene_to_use", "scn_random_scene_steppe"),
(else_try),
(eq, ":terrain_type", rt_plain),
(assign, ":scene_to_use", "scn_random_scene_plain"),
(else_try),
(eq, ":terrain_type", rt_snow),
(assign, ":scene_to_use", "scn_random_scene_snow"),
(else_try),
(eq, ":terrain_type", rt_desert),
(assign, ":scene_to_use", "scn_random_scene_desert"),
(else_try),
(eq, ":terrain_type", rt_steppe_forest),
(assign, ":scene_to_use", "scn_random_scene_steppe_forest"),
(else_try),
(eq, ":terrain_type", rt_forest),
(assign, ":scene_to_use", "scn_random_scene_plain_forest"),
(else_try),
(eq, ":terrain_type", rt_snow_forest),
(assign, ":scene_to_use", "scn_random_scene_snow_forest"),
(else_try),
(eq, ":terrain_type", rt_desert_forest),
(assign, ":scene_to_use", "scn_random_scene_desert_forest"),
(try_end),
(jump_to_scene,":scene_to_use"),
]),
# script_enter_dungeon
# Input: arg1 = center_no, arg2 = mission_template_no
# Output: none
("enter_dungeon",
[
(store_script_param_1, ":center_no"),
(store_script_param_2, ":mission_template_no"),
(set_jump_mission,":mission_template_no"),
(party_get_slot, ":dungeon_scene", ":center_no", slot_town_prison),
(modify_visitors_at_site,":dungeon_scene"),(reset_visitors),
(assign, ":cur_pos", 16),
(call_script, "script_get_heroes_attached_to_center_as_prisoner", ":center_no", "p_temp_party"),
(party_get_num_companion_stacks, ":num_stacks","p_temp_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_temp_party",":i_stack"),
(lt, ":cur_pos", 32), # spawn up to entry point 32
(set_visitor, ":cur_pos", ":stack_troop"),
(val_add,":cur_pos", 1),
(try_end),
(set_jump_entry, 0),
(jump_to_scene,":dungeon_scene"),
(scene_set_slot, ":dungeon_scene", slot_scene_visited, 1),
(change_screen_mission),
]),
# script_enter_court
# Input: arg1 = center_no
# Output: none
("enter_court",
[
(store_script_param_1, ":center_no"),
(assign, "$talk_context", tc_court_talk),
(set_jump_mission,"mt_visit_town_castle"),
(party_get_slot, ":castle_scene", ":center_no", slot_town_castle),
(modify_visitors_at_site,":castle_scene"),
(reset_visitors),
#Adding guards
(store_faction_of_party, ":center_faction", ":center_no"),
(faction_get_slot, ":guard_troop", ":center_faction", slot_faction_guard_troop),
(try_begin),
(le, ":guard_troop", 0),
(assign, ":guard_troop", "trp_swadian_sergeant"),
(try_end),
(set_visitor, 6, ":guard_troop"),
(set_visitor, 7, ":guard_troop"),
(assign, ":cur_pos", 16),
(call_script, "script_get_heroes_attached_to_center", ":center_no", "p_temp_party"),
(party_get_num_companion_stacks, ":num_stacks","p_temp_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_temp_party",":i_stack"),
(lt, ":cur_pos", 32), # spawn up to entry point 32
(set_visitor, ":cur_pos", ":stack_troop"),
(val_add,":cur_pos", 1),
(try_end),
(try_for_range, ":cur_troop", heroes_begin, heroes_end),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_lady),
(troop_slot_eq, ":cur_troop", slot_troop_cur_center, ":center_no"),
(lt, ":cur_pos", 32), # spawn up to entry point 32
(set_visitor, ":cur_pos", ":cur_troop"),
(val_add,":cur_pos", 1),
(try_end),
(jump_to_scene,":castle_scene"),
(scene_set_slot, ":castle_scene", slot_scene_visited, 1),
(change_screen_mission),
]),
# script_find_high_ground_around_pos1
# Input: pos1 should hold center_position_no
# arg1: team_no
# arg2: search_radius (in meters)
# Output: pos52 contains highest ground within <search_radius> meters of team leader
# Destroys position registers: pos10, pos11, pos15
("find_high_ground_around_pos1",
[
(store_script_param, ":team_no", 1),
(store_script_param, ":search_radius", 2),
(val_mul, ":search_radius", 100),
(get_scene_boundaries, pos10,pos11),
(team_get_leader, ":ai_leader", ":team_no"),
(agent_get_position, pos1, ":ai_leader"),
(set_fixed_point_multiplier, 100),
(position_get_x, ":o_x", pos1),
(position_get_y, ":o_y", pos1),
(store_sub, ":min_x", ":o_x", ":search_radius"),
(store_sub, ":min_y", ":o_y", ":search_radius"),
(store_add, ":max_x", ":o_x", ":search_radius"),
(store_add, ":max_y", ":o_y", ":search_radius"),
(position_get_x, ":scene_min_x", pos10),
(position_get_x, ":scene_max_x", pos11),
(position_get_y, ":scene_min_y", pos10),
(position_get_y, ":scene_max_y", pos11),
(val_max, ":min_x", ":scene_min_x"),
(val_max, ":min_y", ":scene_min_y"),
(val_min, ":max_x", ":scene_max_x"),
(val_min, ":max_y", ":scene_max_y"),
(store_div, ":min_x_meters", ":min_x", 100),
(store_div, ":min_y_meters", ":min_y", 100),
(store_div, ":max_x_meters", ":max_x", 100),
(store_div, ":max_y_meters", ":max_y", 100),
(assign, ":highest_pos_z", -10000),
(copy_position, pos52, pos1),
(init_position, pos15),
(try_for_range, ":i_x", ":min_x_meters", ":max_x_meters"),
(store_mul, ":i_x_cm", ":i_x", 100),
(try_for_range, ":i_y", ":min_y_meters", ":max_y_meters"),
(store_mul, ":i_y_cm", ":i_y", 100),
(position_set_x, pos15, ":i_x_cm"),
(position_set_y, pos15, ":i_y_cm"),
(position_set_z, pos15, 10000),
(position_set_z_to_ground_level, pos15),
(position_get_z, ":cur_pos_z", pos15),
(try_begin),
(gt, ":cur_pos_z", ":highest_pos_z"),
(copy_position, pos52, pos15),
(assign, ":highest_pos_z", ":cur_pos_z"),
(try_end),
(try_end),
(try_end),
]),
# script_select_battle_tactic
# Input: none
# Output: none
("select_battle_tactic",
[
(assign, "$ai_team_1_battle_tactic", 0),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(try_begin),
(num_active_teams_le, 2),
(try_begin),
(eq, ":player_team", 0),
(assign, "$ai_team_1", 1),
(else_try),
(assign, "$ai_team_1", 0),
(try_end),
(assign, "$ai_team_2", -1),
(else_try),
(try_begin),
(eq, ":player_team", 0),
(assign, "$ai_team_1", 1),
(else_try),
(assign, "$ai_team_1", 0),
(try_end),
(store_add, "$ai_team_2", ":player_team", 2),
(try_end),
(call_script, "script_select_battle_tactic_aux", "$ai_team_1"),
(assign, "$ai_team_1_battle_tactic", reg0),
(try_begin),
(ge, "$ai_team_2", 0),
(call_script, "script_select_battle_tactic_aux", "$ai_team_2"),
(assign, "$ai_team_2_battle_tactic", reg0),
(try_end),
]),
# script_select_battle_tactic_aux
# Input: team_no
# Output: battle_tactic
("select_battle_tactic_aux",
[
(store_script_param, ":team_no", 1),
(assign, ":battle_tactic", 0),
(assign, ":defense_not_an_option", 0),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(try_begin),
(eq, "$cant_leave_encounter", 1),
(teams_are_enemies, ":team_no", ":player_team"),
(assign, ":defense_not_an_option", 1),
(try_end),
(call_script, "script_team_get_class_percentages", ":team_no", 0),
# (assign, ":ai_perc_infantry", reg0),
(assign, ":ai_perc_archers", reg1),
(assign, ":ai_perc_cavalry", reg2),
(call_script, "script_team_get_class_percentages", ":team_no", 1),#enemies of the ai_team
# (assign, ":enemy_perc_infantry", reg0),
# (assign, ":enemy_perc_archers", reg1),
# (assign, ":enemy_perc_cavalry", reg2),
(store_random_in_range, ":rand", 0, 100),
(try_begin),
(this_or_next|lt, ":rand", 20),
(assign, ":continue", 0),
(try_begin),
(teams_are_enemies, ":team_no", ":player_team"),
(party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_hero_party),
(assign, ":continue", 1),
(else_try),
(neg|teams_are_enemies, ":team_no", ":player_team"),
(gt, "$g_ally_party", 0),
(party_slot_eq, "$g_ally_party", slot_party_type, spt_kingdom_hero_party),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(try_begin),
(eq, ":defense_not_an_option", 0),
(gt, ":ai_perc_archers", 50),
(lt, ":ai_perc_cavalry", 35),
(assign, ":battle_tactic", btactic_hold),
(else_try),
(lt, ":rand", 80),
(assign, ":battle_tactic", btactic_follow_leader),
(try_end),
(try_end),
(assign, reg0, ":battle_tactic"),
]),
# script_battle_tactic_init
# Input: none
# Output: none
("battle_tactic_init",
[
(call_script, "script_battle_tactic_init_aux", "$ai_team_1", "$ai_team_1_battle_tactic"),
(try_begin),
(ge, "$ai_team_2", 0),
(call_script, "script_battle_tactic_init_aux", "$ai_team_2", "$ai_team_2_battle_tactic"),
(try_end),
]),
# script_battle_tactic_init_aux
# Input: team_no, battle_tactic
# Output: none
("battle_tactic_init_aux",
[
(store_script_param, ":team_no", 1),
(store_script_param, ":battle_tactic", 2),
(team_get_leader, ":ai_leader", ":team_no"),
(try_begin),
(eq, ":battle_tactic", btactic_hold),
(agent_get_position, pos1, ":ai_leader"),
(call_script, "script_find_high_ground_around_pos1", ":team_no", 30),
(copy_position, pos1, pos52),
(call_script, "script_find_high_ground_around_pos1", ":team_no", 30), # call again just in case we are not at peak point.
(copy_position, pos1, pos52),
(call_script, "script_find_high_ground_around_pos1", ":team_no", 30), # call again just in case we are not at peak point.
(team_give_order, ":team_no", grc_everyone, mordr_hold),
(team_set_order_position, ":team_no", grc_everyone, pos52),
(team_give_order, ":team_no", grc_archers, mordr_advance),
(team_give_order, ":team_no", grc_archers, mordr_advance),
(else_try),
(eq, ":battle_tactic", btactic_follow_leader),
(team_get_leader, ":ai_leader", ":team_no"),
(agent_set_speed_limit, ":ai_leader", 8),
(agent_get_position, pos60, ":ai_leader"),
(team_give_order, ":team_no", grc_everyone, mordr_hold),
(team_set_order_position, ":team_no", grc_everyone, pos60),
(try_end),
]),
# script_battle_tactic_apply
# Input: none
# Output: none
("battle_tactic_apply",
[
(call_script, "script_battle_tactic_apply_aux", "$ai_team_1", "$ai_team_1_battle_tactic"),
(assign, "$ai_team_1_battle_tactic", reg0),
(try_begin),
(ge, "$ai_team_2", 0),
(call_script, "script_battle_tactic_apply_aux", "$ai_team_2", "$ai_team_2_battle_tactic"),
(assign, "$ai_team_2_battle_tactic", reg0),
(try_end),
]),
# script_battle_tactic_apply_aux
# Input: team_no, battle_tactic
# Output: battle_tactic
("battle_tactic_apply_aux",
[
(store_script_param, ":team_no", 1),
(store_script_param, ":battle_tactic", 2),
(store_mission_timer_a, ":mission_time"),
(try_begin),
(eq, ":battle_tactic", btactic_hold),
(copy_position, pos1, pos52),
(call_script, "script_get_closest3_distance_of_enemies_at_pos1", ":team_no", 1),
(assign, ":avg_dist", reg0),
(assign, ":min_dist", reg1),
(try_begin),
(this_or_next|lt, ":min_dist", 1000),
(lt, ":avg_dist", 4000),
(assign, ":battle_tactic", 0),
(team_give_order, ":team_no", grc_everyone, mordr_charge),
(try_end),
(else_try),
(eq, ":battle_tactic", btactic_follow_leader),
(team_get_leader, ":ai_leader", ":team_no"),
(agent_set_speed_limit, ":ai_leader", 9),
(call_script, "script_team_get_average_position_of_enemies", ":team_no"),
(copy_position, pos60, pos0),
(agent_get_position, pos61, ":ai_leader"),
(position_transform_position_to_local, pos62, pos61, pos60), #pos62 = vector to enemy w.r.t leader
(position_normalize_origin, ":distance_to_enemy", pos62),
(convert_from_fixed_point, ":distance_to_enemy"),
(assign, reg17, ":distance_to_enemy"),
(position_get_x, ":dir_x", pos62),
(position_get_y, ":dir_y", pos62),
(val_mul, ":dir_x", 23),
(val_mul, ":dir_y", 23), #move 23 meters
(position_set_x, pos62, ":dir_x"),
(position_set_y, pos62, ":dir_y"),
(position_transform_position_to_parent, pos63, pos61, pos62), #pos63 is 23m away from leader in the direction of the enemy.
(position_set_z_to_ground_level, pos63),
(team_give_order, ":team_no", grc_everyone, mordr_hold),
(team_set_order_position, ":team_no", grc_everyone, pos63),
# (team_give_order, ":team_no", grc_everyone, mordr_follow),
(agent_get_position, pos1, ":ai_leader"),
# (call_script, "script_get_closest3_distance_of_enemies_at_pos1", ":team_no"),
# (assign, ":avg_dist", reg0),
# (assign, ":min_dist", reg1),
(try_begin),
(lt, ":distance_to_enemy", 50),
(ge, ":mission_time", 30),
(assign, ":battle_tactic", 0),
(team_give_order, ":team_no", grc_everyone, mordr_charge),
(agent_set_speed_limit, ":ai_leader", 60),
(try_end),
(try_end),
(try_begin), # charge everyone after a while
(neq, ":battle_tactic", 0),
(ge, ":mission_time", 300),
(assign, ":battle_tactic", 0),
(team_give_order, ":team_no", grc_everyone, mordr_charge),
(team_get_leader, ":ai_leader", ":team_no"),
(agent_set_speed_limit, ":ai_leader", 60),
(try_end),
(assign, reg0, ":battle_tactic"),
]),
## # script_siege_defender_tactic_apply
## # Input: none
## # Output: none
## ("siege_defender_tactic_apply",
## [
## (try_begin),
## (eq, "$defender_team", 1),
## (ge, "$belfry_positioned", 2),
##
## (assign, ":enemy_too_weak", 0),
## (try_begin),
## (ge, "$attacker_reinforcement_stage", 2),
## (call_script, "script_calculate_team_strength", "$defender_team"),
## (assign, ":defender_strength", reg0),
## (call_script, "script_calculate_team_strength", "$attacker_team"),
## (assign, ":attacker_strength", reg0),
## (store_mul, ":attacker_strength_multiplied", ":attacker_strength", 2),
## (ge, ":defender_strength", ":attacker_strength_multiplied"),
## (assign, ":enemy_too_weak", 1),
## (try_end),
##
## (try_begin),
## (eq, ":enemy_too_weak", 1),
## (neq, "$ai_battle_tactic", btactic_charge),
## (assign, "$ai_battle_tactic", btactic_charge),
## (team_give_order, "$defender_team", grc_infantry, mordr_charge),
## (else_try),
## (neq, "$ai_battle_tactic", btactic_charge),
## (neq, "$ai_battle_tactic", btactic_hold),
## (assign, "$ai_battle_tactic", btactic_hold),
## (team_give_order, "$defender_team", grc_infantry, mordr_hold),
## (team_give_order, "$defender_team", grc_heroes, mordr_hold),
## (entry_point_get_position,pos1,10),
## (team_set_order_position, "$defender_team", grc_infantry, pos1),
## (team_set_order_position, "$defender_team", grc_heroes, pos1),
## (try_end),
## (try_end),
## ]),
# script_team_get_class_percentages
# Input: arg1: team_no, arg2: try for team's enemies
# Output: reg0: percentage infantry, reg1: percentage archers, reg2: percentage cavalry
("team_get_class_percentages",
[
(assign, ":num_infantry", 0),
(assign, ":num_archers", 0),
(assign, ":num_cavalry", 0),
(assign, ":num_total", 0),
(store_script_param, ":team_no", 1),
(store_script_param, ":negate", 2),
(try_for_agents,":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_get_team, ":agent_team", ":cur_agent"),
(assign, ":continue", 0),
(try_begin),
(eq, ":negate", 1),
(teams_are_enemies, ":agent_team", ":team_no"),
(assign, ":continue", 1),
(else_try),
(eq, ":negate", 0), # Changed by Form Ranks kit. This is a bug in native.
(eq, ":agent_team", ":team_no"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(val_add, ":num_total", 1),
(agent_get_class, ":agent_class", ":cur_agent"),
(try_begin),
(eq, ":agent_class", grc_infantry),
(val_add, ":num_infantry", 1),
(else_try),
(eq, ":agent_class", grc_archers),
(val_add, ":num_archers", 1),
(else_try),
(eq, ":agent_class", grc_cavalry),
(val_add, ":num_cavalry", 1),
(try_end),
(try_end),
(try_begin),
(eq, ":num_total", 0),
(assign, ":num_total", 1),
(try_end),
(store_mul, ":perc_infantry",":num_infantry",100),
(val_div, ":perc_infantry",":num_total"),
(store_mul, ":perc_archers",":num_archers",100),
(val_div, ":perc_archers",":num_total"),
(store_mul, ":perc_cavalry",":num_cavalry",100),
(val_div, ":perc_cavalry",":num_total"),
(assign, reg0, ":perc_infantry"),
(assign, reg1, ":perc_archers"),
(assign, reg2, ":perc_cavalry"),
]),
# script_get_closest3_distance_of_enemies_at_pos1
# Input: arg1: team_no, pos1
# Output: reg0: distance in cms.
("get_closest3_distance_of_enemies_at_pos1",
[
(assign, ":min_distance_1", 100000),
(assign, ":min_distance_2", 100000),
(assign, ":min_distance_3", 100000),
(store_script_param, ":team_no", 1),
(try_for_agents,":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_get_team, ":agent_team", ":cur_agent"),
(teams_are_enemies, ":agent_team", ":team_no"),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions,":cur_dist",pos2,pos1),
(try_begin),
(lt, ":cur_dist", ":min_distance_1"),
(assign, ":min_distance_3", ":min_distance_2"),
(assign, ":min_distance_2", ":min_distance_1"),
(assign, ":min_distance_1", ":cur_dist"),
(else_try),
(lt, ":cur_dist", ":min_distance_2"),
(assign, ":min_distance_3", ":min_distance_2"),
(assign, ":min_distance_2", ":cur_dist"),
(else_try),
(lt, ":cur_dist", ":min_distance_3"),
(assign, ":min_distance_3", ":cur_dist"),
(try_end),
(try_end),
(assign, ":total_distance", 0),
(assign, ":total_count", 0),
(try_begin),
(lt, ":min_distance_1", 100000),
(val_add, ":total_distance", ":min_distance_1"),
(val_add, ":total_count", 1),
(try_end),
(try_begin),
(lt, ":min_distance_2", 100000),
(val_add, ":total_distance", ":min_distance_2"),
(val_add, ":total_count", 1),
(try_end),
(try_begin),
(lt, ":min_distance_3", 100000),
(val_add, ":total_distance", ":min_distance_3"),
(val_add, ":total_count", 1),
(try_end),
(assign, ":average_distance", 100000),
(try_begin),
(gt, ":total_count", 0),
(store_div, ":average_distance", ":total_distance", ":total_count"),
(try_end),
(assign, reg0, ":average_distance"),
(assign, reg1, ":min_distance_1"),
(assign, reg2, ":min_distance_2"),
(assign, reg3, ":min_distance_3"),
]),
# script_team_get_average_position_of_enemies
# Input: arg1: team_no,
# Output: pos0: average position.
("team_get_average_position_of_enemies",
[
(store_script_param_1, ":team_no"),
(init_position, pos0),
(assign, ":num_enemies", 0),
(assign, ":accum_x", 0),
(assign, ":accum_y", 0),
(assign, ":accum_z", 0),
(try_for_agents,":enemy_agent"),
(agent_is_alive, ":enemy_agent"),
(agent_is_human, ":enemy_agent"),
(agent_get_team, ":enemy_team", ":enemy_agent"),
(teams_are_enemies, ":team_no", ":enemy_team"),
(agent_get_position, pos62, ":enemy_agent"),
(position_get_x, ":x", pos62),
(position_get_y, ":y", pos62),
(position_get_z, ":z", pos62),
(val_add, ":accum_x", ":x"),
(val_add, ":accum_y", ":y"),
(val_add, ":accum_z", ":z"),
(val_add, ":num_enemies", 1),
(try_end),
(store_div, ":average_x", ":accum_x", ":num_enemies"),
(store_div, ":average_y", ":accum_y", ":num_enemies"),
(store_div, ":average_z", ":accum_z", ":num_enemies"),
(position_set_x, pos0, ":average_x"),
(position_set_y, pos0, ":average_y"),
(position_set_z, pos0, ":average_z"),
(assign, reg0, ":num_enemies"),
]),
# script_search_troop_prisoner_of_party
# Input: arg1 = troop_no
# Output: reg0 = party_no (-1 if troop is not a prisoner.)
("search_troop_prisoner_of_party",
[
(store_script_param_1, ":troop_no"),
(assign, ":prisoner_of", -1),
(try_for_parties, ":party_no"),
(eq, ":prisoner_of", -1),
(this_or_next|eq, ":party_no", "p_main_party"),
(ge, ":party_no", centers_begin),
(party_count_prisoners_of_type, ":troop_found", ":party_no", ":troop_no"),
(gt, ":troop_found", 0),
(assign, ":prisoner_of", ":party_no"),
(try_end),
(assign, reg0, ":prisoner_of"),
]),
## # script_clear_last_quest
## # Input: arg1 = troop_no
## # Output: none
## ("clear_last_quest",
## [
## (store_script_param_1, ":troop_no"),
##
## (troop_set_slot, ":troop_no",slot_troop_last_quest, 0),
## (troop_set_slot, ":troop_no",slot_troop_last_quest_betrayed, 0)
## ]),
# script_change_debt_to_troop
# Input: arg1 = troop_no, arg2 = new debt amount
# Output: none
("change_debt_to_troop",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":new_debt"),
(troop_get_slot, ":cur_debt", ":troop_no", slot_troop_player_debt),
(assign, reg1, ":cur_debt"),
(val_add, ":cur_debt", ":new_debt"),
(assign, reg2, ":cur_debt"),
(troop_set_slot, ":troop_no", slot_troop_player_debt, ":cur_debt"),
(str_store_troop_name_link, s1, ":troop_no"),
(display_message, "@You now owe {reg2} denars to {s1}."),
]),
# script_abort_quest
# Input: arg1 = quest_no, arg2 = apply relation penalty
# Output: none
("abort_quest",
[
(store_script_param_1, ":quest_no"),
(store_script_param_2, ":abort_type"), #0=aborted by event, 1=abort by talking 2=abort by expire
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -2),
# (quest_get_slot, ":quest_object_troop", ":quest_no", slot_quest_object_troop),
(try_begin),
(this_or_next|eq, ":quest_no", "qst_deliver_message"),
(eq, ":quest_no", "qst_deliver_message_to_enemy_lord"),
(assign, ":quest_return_penalty", -2),
(assign, ":quest_expire_penalty", -3),
(else_try),
(eq, ":quest_no", "qst_escort_lady"),
(quest_get_slot, ":quest_object_troop", "qst_escort_lady", slot_quest_object_troop),
(party_remove_members, "p_main_party", ":quest_object_troop", 1),
(assign, ":quest_return_penalty", -2),
(assign, ":quest_expire_penalty", -3),
## (else_try),
## (eq, ":quest_no", "qst_rescue_lady_under_siege"),
## (party_remove_members, "p_main_party", ":quest_object_troop", 1),
## (else_try),
## (eq, ":quest_no", "qst_deliver_message_to_lover"),
## (else_try),
## (eq, ":quest_no", "qst_bring_prisoners_to_enemy"),
## (try_begin),
## (check_quest_succeeded, ":quest_no"),
## (quest_get_slot, ":quest_target_amount", ":quest_no", slot_quest_target_amount),
## (quest_get_slot, ":quest_object_troop", ":quest_no", slot_quest_object_troop),
## (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
## (call_script, "script_game_get_join_cost", ":quest_object_troop"),
## (assign, ":reward", reg0),
## (val_mul, ":reward", ":quest_target_amount"),
## (val_div, ":reward", 2),
## (else_try),
## (quest_get_slot, ":reward", ":quest_no", slot_quest_target_amount),
## (try_end),
## (call_script, "script_change_debt_to_troop", ":quest_giver_troop", ":reward"),
## (else_try),
## (eq, ":quest_no", "qst_bring_reinforcements_to_siege"),
## (quest_get_slot, ":quest_target_amount", ":quest_no", slot_quest_target_amount),
## (quest_get_slot, ":quest_object_troop", ":quest_no", slot_quest_object_troop),
## (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
## (call_script, "script_game_get_join_cost", ":quest_object_troop"),
## (assign, ":reward", reg0),
## (val_mul, ":reward", ":quest_target_amount"),
## (val_mul, ":reward", 2),
## (call_script, "script_change_debt_to_troop", ":quest_giver_troop", ":reward"),
## (else_try),
## (eq, ":quest_no", "qst_deliver_supply_to_center_under_siege"),
## (quest_get_slot, ":quest_target_amount", ":quest_no", slot_quest_target_amount),
## (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
## (store_item_value, ":reward", "itm_siege_supply"),
## (val_mul, ":reward", ":quest_target_amount"),
## (call_script, "script_change_debt_to_troop", ":quest_giver_troop", ":reward"),
(else_try),
(eq, ":quest_no", "qst_raise_troops"),
(quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
(call_script, "script_change_debt_to_troop", ":quest_giver_troop", 100),
(assign, ":quest_return_penalty", -4),
(assign, ":quest_expire_penalty", -5),
(else_try),
(eq, ":quest_no", "qst_deal_with_looters"),
(try_for_parties, ":cur_party_no"),
(party_get_template_id, ":cur_party_template", ":cur_party_no"),
(eq, ":cur_party_template", "pt_looters"),
(party_set_flags, ":cur_party_no", pf_quest_party, 0),
(try_end),
(assign, ":quest_return_penalty", -4),
(assign, ":quest_expire_penalty", -5),
(else_try),
(eq, ":quest_no", "qst_deal_with_bandits_at_lords_village"),
(quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
(call_script, "script_change_debt_to_troop", ":quest_giver_troop", 200),
(assign, ":quest_return_penalty", -5),
(assign, ":quest_expire_penalty", -6),
(else_try),
(eq, ":quest_no", "qst_collect_taxes"),
(quest_get_slot, ":gold_reward", ":quest_no", slot_quest_gold_reward),
(quest_set_slot, ":quest_no", slot_quest_gold_reward, 0),
(quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
(call_script, "script_change_debt_to_troop", ":quest_giver_troop", ":gold_reward"),
(assign, ":quest_return_penalty", -4),
(assign, ":quest_expire_penalty", -6),
## (else_try),
## (eq, ":quest_no", "qst_capture_messenger"),
## (else_try),
## (eq, ":quest_no", "qst_bring_back_deserters"),
(else_try),
(eq, ":quest_no", "qst_hunt_down_fugitive"),
(assign, ":quest_return_penalty", -3),
(assign, ":quest_expire_penalty", -4),
(else_try),
(eq, ":quest_no", "qst_kill_local_merchant"),
(else_try),
(eq, ":quest_no", "qst_bring_back_runaway_serfs"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -1),
(else_try),
(eq, ":quest_no", "qst_lend_companion"),
(else_try),
(eq, ":quest_no", "qst_collect_debt"),
(try_begin),
(quest_slot_eq, "qst_collect_debt", slot_quest_current_state, 1), #debt collected but not delivered
(quest_get_slot, ":debt", "qst_collect_debt", slot_quest_target_amount),
(quest_get_slot, ":quest_giver", "qst_collect_debt", slot_quest_giver_troop),
(call_script, "script_change_debt_to_troop", ":quest_giver", ":debt"),
(assign, ":quest_return_penalty", -3),
(assign, ":quest_expire_penalty", -6),
(else_try),
(assign, ":quest_return_penalty", -3),
(assign, ":quest_expire_penalty", -4),
(try_end),
(else_try),
(eq, ":quest_no", "qst_deal_with_bandits_at_lords_village"),
(assign, ":quest_return_penalty", -6),
(assign, ":quest_expire_penalty", -6),
(else_try),
(eq, ":quest_no", "qst_raid_caravan_to_start_war"),
(assign, ":quest_return_penalty", -10),
(assign, ":quest_expire_penalty", -13),
(else_try),
(eq, ":quest_no", "qst_persuade_lords_to_make_peace"),
(assign, ":quest_return_penalty", -10),
(assign, ":quest_expire_penalty", -13),
(else_try),
(eq, ":quest_no", "qst_deal_with_night_bandits"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -1),
(else_try),
(eq, ":quest_no", "qst_follow_spy"),
(assign, ":quest_return_penalty", -2),
(assign, ":quest_expire_penalty", -3),
(try_begin),
(party_is_active, "$qst_follow_spy_spy_party"),
(remove_party, "$qst_follow_spy_spy_party"),
(try_end),
(try_begin),
(party_is_active, "$qst_follow_spy_spy_partners_party"),
(remove_party, "$qst_follow_spy_spy_partners_party"),
(try_end),
(else_try),
(eq, ":quest_no", "qst_capture_enemy_hero"),
(assign, ":quest_return_penalty", -3),
(assign, ":quest_expire_penalty", -4),
## (else_try),
## (eq, ":quest_no", "qst_lend_companion"),
## (quest_get_slot, ":quest_target_troop", "qst_lend_companion", slot_quest_target_troop),
## (party_add_members, "p_main_party", ":quest_target_troop", 1),
## (else_try),
## (eq, ":quest_no", "qst_capture_conspirators"),
## (else_try),
## (eq, ":quest_no", "qst_defend_nobles_against_peasants"),
(else_try),
(eq, ":quest_no", "qst_incriminate_loyal_commander"),
(assign, ":quest_return_penalty", -5),
(assign, ":quest_expire_penalty", -6),
## (else_try),
## (eq, ":quest_no", "qst_hunt_down_raiders"),
## (else_try),
## (eq, ":quest_no", "qst_capture_prisoners"),
## #Enemy lord quests
(else_try),
(eq, ":quest_no", "qst_lend_surgeon"),
#Kingdom lady quests
(else_try),
(eq, ":quest_no", "qst_rescue_lord_by_replace"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -1),
(else_try),
(eq, ":quest_no", "qst_deliver_message_to_prisoner_lord"),
(assign, ":quest_return_penalty", 0),
(assign, ":quest_expire_penalty", -1),
(else_try),
(eq, ":quest_no", "qst_duel_for_lady"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -1),
#Kingdom Army quests
(else_try),
(eq, ":quest_no", "qst_follow_army"),
(assign, ":quest_return_penalty", -4),
(assign, ":quest_expire_penalty", -5),
(else_try),
(eq, ":quest_no", "qst_deliver_cattle_to_army"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -2),
(else_try),
(eq, ":quest_no", "qst_join_siege_with_army"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -2),
(else_try),
(eq, ":quest_no", "qst_scout_waypoints"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -2),
#Village Elder quests
(else_try),
(eq, ":quest_no", "qst_deliver_grain"),
(assign, ":quest_return_penalty", -6),
(assign, ":quest_expire_penalty", -7),
(else_try),
(eq, ":quest_no", "qst_deliver_cattle"),
(assign, ":quest_return_penalty", -3),
(assign, ":quest_expire_penalty", -4),
(else_try),
(eq, ":quest_no", "qst_train_peasants_against_bandits"),
(assign, ":quest_return_penalty", -4),
(assign, ":quest_expire_penalty", -5),
#Mayor quests
(else_try),
(eq, ":quest_no", "qst_deliver_wine"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -3),
(val_add, "$debt_to_merchants_guild", "$qst_deliver_wine_debt"),
(else_try),
(eq, ":quest_no", "qst_move_cattle_herd"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -3),
(else_try),
(eq, ":quest_no", "qst_escort_merchant_caravan"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -3),
(else_try),
(eq, ":quest_no", "qst_troublesome_bandits"),
(assign, ":quest_return_penalty", -1),
(assign, ":quest_expire_penalty", -2),
#Other quests
(else_try),
(eq, ":quest_no", "qst_join_faction"),
(assign, ":quest_return_penalty", -3),
(assign, ":quest_expire_penalty", -3),
(try_begin),
(call_script, "script_get_number_of_hero_centers", "trp_player"),
(gt, reg0, 0),
(call_script, "script_change_player_relation_with_faction", "$g_invite_faction", -10),
(try_end),
(assign, "$g_invite_faction", 0),
(assign, "$g_invite_faction_lord", 0),
(assign, "$g_invite_offered_center", 0),
(else_try),
(eq, ":quest_no", "qst_eliminate_bandits_infesting_village"),
(assign, ":quest_return_penalty", -3),
(assign, ":quest_expire_penalty", -3),
(try_end),
(try_begin),
(gt, ":abort_type", 0),
(quest_get_slot, ":quest_giver", ":quest_no", slot_quest_giver_troop),
(assign, ":relation_penalty", ":quest_return_penalty"),
(try_begin),
(eq, ":abort_type", 2),
(assign, ":relation_penalty", ":quest_expire_penalty"),
(try_end),
(try_begin),
(this_or_next|is_between, ":quest_giver", village_elders_begin, village_elders_end),
(is_between, ":quest_giver", mayors_begin, mayors_end),
(quest_get_slot, ":quest_giver_center", ":quest_no", slot_quest_giver_center),
(call_script, "script_change_player_relation_with_center", ":quest_giver_center", ":relation_penalty"),
(else_try),
(call_script, "script_change_player_relation_with_troop", ":quest_giver", ":relation_penalty"),
(try_end),
(try_end),
(fail_quest, ":quest_no"),
#NPC companion changes begin
(try_begin),
(gt, ":abort_type", 0),
(call_script, "script_objectionable_action", tmt_honest, "str_fail_quest"),
(try_end),
#NPC companion changes end
(call_script, "script_end_quest", ":quest_no"),
]),
## # script_event_center_captured
## # Input: arg1 = center_no, arg2 = old_faction_no
## # Output: none
## ("event_center_captured",
## [
## # (store_script_param_1, ":center_no"),
## # (store_script_param_2, ":old_faction_no"),
## # (store_faction_of_party, ":faction_no"),
##
## (try_begin),
## (check_quest_active, "qst_deliver_message"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_escort_lady"),
## (quest_slot_eq, "qst_escort_lady", slot_quest_target_center, ":center_no"),
## (call_script, "script_abort_quest", "qst_escort_lady"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_rescue_lady_under_siege"),
## (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_target_center, ":center_no"),
## (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_current_state, 0),
## (call_script, "script_abort_quest", "qst_rescue_lady_under_siege", 1),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_deliver_message_to_lover"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_deliver_message_to_enemy_lord"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_bring_prisoners_to_enemy"),
## (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_target_center, ":center_no"),
## (neg|check_quest_succeeded, "qst_bring_prisoners_to_enemy"),
## (call_script, "script_abort_quest", "qst_bring_prisoners_to_enemy"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_bring_reinforcements_to_siege"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_deliver_supply_to_center_under_siege"),
## (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_target_center, ":center_no"),
## (call_script, "script_abort_quest", "qst_deliver_supply_to_center_under_siege", 1),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_raise_troops"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_capture_messenger"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_bring_back_deserters"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_kill_local_merchant"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_bring_back_runaway_serfs"),
## (quest_slot_eq, "qst_bring_back_runaway_serfs", slot_quest_object_center, ":center_no"),
## (neg|check_quest_succeeded, "qst_bring_back_runaway_serfs"),
## (neg|check_quest_failed, "qst_bring_back_runaway_serfs"),
## (call_script, "script_abort_quest", "qst_bring_back_runaway_serfs"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_follow_spy"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_capture_enemy_hero"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_lend_companion"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_capture_conspirators"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_defend_nobles_against_peasants"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_incriminate_loyal_commander"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_hunt_down_raiders"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_capture_prisoners"),
## (try_end),
## #Enemy lord quests
## (try_begin),
## (check_quest_active, "qst_lend_surgeon"),
## (try_end),
## #Kingdom lady quests
## (try_begin),
## (check_quest_active, "qst_rescue_lord_by_replace"),
## (quest_get_slot, ":quest_target_troop", "qst_rescue_lord_by_replace", slot_quest_target_troop),
## (troop_slot_eq, ":quest_target_troop", slot_troop_is_prisoner, 0),
## (neg|check_quest_succeeded, "qst_rescue_lord_by_replace"),
## (call_script, "script_abort_quest", "qst_rescue_lord_by_replace"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_deliver_message_to_prisoner_lord"),
## (try_end),
## (try_begin),
## (check_quest_active, "qst_duel_for_lady"),
## (try_end),
## ]),
# script_cf_is_quest_troop
# Input: arg1 = troop_no
# Output: none (can fail)
("cf_is_quest_troop",
[
(store_script_param_1, ":troop_no"),
(assign, ":is_quest_troop", 0),
(try_for_range, ":cur_quest", all_quests_begin, all_quests_end),
(check_quest_active, ":cur_quest"),
(quest_get_slot, ":quest_troop_1", ":cur_quest", slot_quest_target_troop),
(quest_get_slot, ":quest_troop_2", ":cur_quest", slot_quest_object_troop),
(quest_get_slot, ":quest_troop_3", ":cur_quest", slot_quest_giver_troop),
(this_or_next|eq, ":quest_troop_1", ":troop_no"),
(this_or_next|eq, ":quest_troop_2", ":troop_no"),
(eq, ":quest_troop_3", ":troop_no"),
(assign, ":is_quest_troop", 1),
(try_end),
(eq, ":is_quest_troop", 1),
]),
## # script_calculate_team_strength
## # Input: arg1 = team_no
## # Output: strength
## ("calculate_team_strength",
## [
## (store_script_param_1, ":team_no"),
## (assign, ":total_strength", 0),
## (try_for_agents, ":cur_agent"),
## (agent_get_team, ":agent_team", ":cur_agent"),
## (eq, ":team_no", ":agent_team"),
## (agent_is_human, ":cur_agent"),
## (agent_is_alive, ":cur_agent"),
##
## (agent_get_troop_id, ":cur_troop", ":cur_agent"),
## (store_character_level, ":cur_level", ":cur_troop"),
## (val_add, ":cur_level", 5),
## (try_begin),
## (troop_is_hero, ":cur_troop"),
## (val_add, ":cur_level", 5),
## (try_end),
## (val_add, ":total_strength", ":cur_level"),
## (try_end),
## (assign, reg0, ":total_strength"),
## ]),
# script_check_friendly_kills
# Input: none
# Output: none (changes the morale of the player's party)
("check_friendly_kills",
[(get_player_agent_own_troop_kill_count, ":count"),
(try_begin),
(neq, "$g_player_current_own_troop_kills", ":count"),
(val_sub, ":count", "$g_player_current_own_troop_kills"),
(val_add, "$g_player_current_own_troop_kills", ":count"),
(val_mul, ":count", -1),
(call_script, "script_change_player_party_morale", ":count"),
(try_end),
]),
# script_simulate_retreat
# Input: arg1 = players_side_damage, arg2 = enemy_side_damage, s5 = title_string
# Output: none
("simulate_retreat",
[
(call_script, "script_music_set_situation_with_culture", mtf_sit_killed),
(set_show_messages, 0),
(store_script_param, ":players_side_damage", 1),
(store_script_param, ":enemy_side_damage", 2),
(assign, ":players_side_strength", 0),
(assign, ":enemy_side_strength", 0),
(assign, ":do_calculate", 1),
(try_begin),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_set_slot, ":cur_agent", slot_agent_is_alive_before_retreat, 1),#needed for simulation
(agent_get_troop_id, ":cur_troop", ":cur_agent"),
(store_character_level, ":cur_level", ":cur_troop"),
(val_add, ":cur_level", 5),
(try_begin),
(troop_is_hero, ":cur_troop"),
(val_add, ":cur_level", 5),
(try_end),
(try_begin),
(agent_is_ally, ":cur_agent"),
(val_add, ":players_side_strength", ":cur_level"),
(else_try),
(val_add, ":enemy_side_strength", ":cur_level"),
(try_end),
(try_end),
(eq, "$pin_player_fallen", 0),
(lt, ":enemy_side_strength", ":players_side_strength"),
(assign, ":do_calculate", 0),
(try_end),
(try_begin),
(eq, ":do_calculate", 1),
(assign, "$g_last_mission_player_damage", 0),
(party_clear, "p_temp_party"),
(party_clear, "p_temp_party_2"),
(call_script, "script_simulate_battle_with_agents_aux", 0, ":players_side_damage"),
(call_script, "script_simulate_battle_with_agents_aux", 1, ":enemy_side_damage"),
(assign, ":display_casualties", 0),
(try_begin),
(gt, "$g_last_mission_player_damage", 0),
(assign, ":display_casualties", 1),
(assign, reg1, "$g_last_mission_player_damage"),
(str_store_string, s12, "str_casualty_display_hp"),
(else_try),
(str_clear, s12),
(try_end),
(call_script, "script_print_casualties_to_s0", "p_temp_party", 1),
(try_begin),
(party_get_num_companion_stacks, ":num_stacks", "p_temp_party"),
(gt, ":num_stacks", 0),
(assign, ":display_casualties", 1),
(try_end),
(str_store_string_reg, s10, s0),
(call_script, "script_print_casualties_to_s0", "p_temp_party_2", 1),
(try_begin),
(party_get_num_companion_stacks, ":num_stacks", "p_temp_party_2"),
(gt, ":num_stacks", 0),
(assign, ":display_casualties", 1),
(try_end),
(str_store_string_reg, s11, s0),
(try_begin),
(eq, ":display_casualties", 1),
(dialog_box,"str_casualty_display", s5),
(try_end),
(try_end),
(set_show_messages, 1),
#Calculating morale penalty (can be between 0-30)
(assign, ":ally_casualties", 0),
(assign, ":enemy_casualties", 0),
(assign, ":total_allies", 0),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(try_begin),
(agent_is_ally, ":cur_agent"),
(val_add, ":total_allies", 1),
(try_begin),
(neg|agent_is_alive, ":cur_agent"),
(val_add, ":ally_casualties", 1),
(try_end),
(else_try),
(neg|agent_is_alive, ":cur_agent"),
(val_add, ":enemy_casualties", 1),
(try_end),
(try_end),
(store_add, ":total_casualties", ":ally_casualties", ":enemy_casualties"),
(try_begin),
(gt, ":total_casualties", 0),
(store_mul, ":morale_adder", ":ally_casualties", 100),
(val_div, ":morale_adder", ":total_casualties"),
(val_mul, ":morale_adder", ":ally_casualties"),
(val_div, ":morale_adder", ":total_allies"),
(val_mul, ":morale_adder", -30),
(val_div, ":morale_adder", 100),
(call_script, "script_change_player_party_morale", ":morale_adder"),
(try_end),
]),
# script_simulate_battle_with_agents_aux
# For internal use only
# Input: arg1 = attacker_side (0 = ally, 1 = enemy), arg2 = damage amount
# Output: none
("simulate_battle_with_agents_aux",
[
(store_script_param_1, ":attacker_side"),
(store_script_param_2, ":damage"),
(get_player_agent_no, ":player_agent"),
(try_for_agents, ":cur_agent"),
(neq, ":player_agent", ":cur_agent"),
(agent_is_human, ":cur_agent"),
#do not check agent_is_alive, check slot_agent_is_alive_before_retreat instead, so that dead agents can still hit enemies
(agent_slot_eq, ":cur_agent", slot_agent_is_alive_before_retreat, 1),
(try_begin),
(agent_is_ally, ":cur_agent"),
(assign, ":cur_agents_side", 0),
(else_try),
(assign, ":cur_agents_side", 1),
(try_end),
(eq, ":cur_agents_side", ":attacker_side"),
(agent_get_position, pos2, ":cur_agent"),
(assign, ":closest_agent", -1),
(assign, ":min_distance", 100000),
(try_for_agents, ":cur_agent_2"),
(agent_is_human, ":cur_agent_2"),
(agent_is_alive, ":cur_agent_2"),
(try_begin),
(agent_is_ally, ":cur_agent_2"),
(assign, ":cur_agents_side_2", 0),
(else_try),
(assign, ":cur_agents_side_2", 1),
(try_end),
(this_or_next|neq, ":cur_agent_2", ":player_agent"),
(eq, "$pin_player_fallen", 0),
(neq, ":attacker_side", ":cur_agents_side_2"),
(agent_get_position, pos3, ":cur_agent_2"),
(get_distance_between_positions, ":cur_distance", pos2, pos3),
(lt, ":cur_distance", ":min_distance"),
(assign, ":min_distance", ":cur_distance"),
(assign, ":closest_agent", ":cur_agent_2"),
(try_end),
(ge, ":closest_agent", 0),
#Fight
(agent_get_class, ":agent_class", ":cur_agent"),
(assign, ":agents_speed", 1),
(assign, ":agents_additional_hit", 0),
(try_begin),
(eq, ":agent_class", grc_archers),
(assign, ":agents_additional_hit", 2),
(else_try),
(eq, ":agent_class", grc_cavalry),
(assign, ":agents_speed", 2),
(try_end),
(agent_get_class, ":agent_class", ":closest_agent"),
(assign, ":agents_speed_2", 1),
(try_begin),
(eq, ":agent_class", grc_cavalry),
(assign, ":agents_speed_2", 2),
(try_end),
(assign, ":agents_hit", 18000),
(val_add, ":min_distance", 3000),
(val_div, ":agents_hit", ":min_distance"),
(val_mul, ":agents_hit", 2),# max 10, min 2 hits within 150 meters
(val_mul, ":agents_hit", ":agents_speed"),
(val_div, ":agents_hit", ":agents_speed_2"),
(val_add, ":agents_hit", ":agents_additional_hit"),
(assign, ":cur_damage", ":damage"),
(agent_get_troop_id, ":closest_troop", ":closest_agent"),
(agent_get_troop_id, ":cur_troop", ":cur_agent"),
(store_character_level, ":closest_level", ":closest_troop"),
(store_character_level, ":cur_level", ":cur_troop"),
(store_sub, ":level_dif", ":cur_level", ":closest_level"),
(val_div, ":level_dif", 5),
(val_add, ":cur_damage", ":level_dif"),
(try_begin),
(eq, ":closest_agent", ":player_agent"),
(val_div, ":cur_damage", 2),
(store_agent_hit_points, ":init_player_hit_points", ":player_agent", 1),
(try_end),
(try_for_range, ":unused", 0, ":agents_hit"),
(store_random_in_range, ":random_damage", 0, 100),
(lt, ":random_damage", ":cur_damage"),
(agent_deliver_damage_to_agent, ":cur_agent", ":closest_agent"),
(try_end),
(try_begin),
(eq, ":closest_agent", ":player_agent"),
(store_agent_hit_points, ":final_player_hit_points", ":player_agent", 1),
(store_sub, ":hit_points_difference", ":init_player_hit_points", ":final_player_hit_points"),
(val_add, "$g_last_mission_player_damage", ":hit_points_difference"),
(try_end),
(neg|agent_is_alive, ":closest_agent"),
(try_begin),
(eq, ":attacker_side", 1),
(party_add_members, "p_temp_party", ":closest_troop", 1),
(try_begin),
(agent_is_wounded, ":closest_agent"),
(party_wound_members, "p_temp_party", ":closest_troop", 1),
(try_end),
(else_try),
(party_add_members, "p_temp_party_2", ":closest_troop", 1),
(try_begin),
(agent_is_wounded, ":closest_agent"),
(party_wound_members, "p_temp_party_2", ":closest_troop", 1),
(try_end),
(try_end),
(try_end),
]),
# script_map_get_random_position_around_position_within_range
# Input: arg1 = minimum_distance in km, arg2 = maximum_distance in km, pos1 = origin position
# Output: pos2 = result position
("map_get_random_position_around_position_within_range",
[
(store_script_param_1, ":min_distance"),
(store_script_param_2, ":max_distance"),
(val_mul, ":min_distance", 100),
(assign, ":continue", 1),
(try_for_range, ":unused", 0, 20),
(eq, ":continue", 1),
(map_get_random_position_around_position, pos2, pos1, ":max_distance"),
(get_distance_between_positions, ":distance", pos2, pos1),
(ge, ":distance", ":min_distance"),
(assign, ":continue", 0),
(try_end),
]),
# script_get_number_of_unclaimed_centers_by_player
# Input: none
# Output: reg0 = number of unclaimed centers, reg1 = last unclaimed center_no
("get_number_of_unclaimed_centers_by_player",
[
(assign, ":unclaimed_centers", 0),
(assign, reg1, -1),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":faction_no", ":center_no"),
(eq, ":faction_no", "fac_player_supporters_faction"),
(party_slot_eq, ":center_no", slot_town_claimed_by_player, 0),
(party_get_num_companion_stacks, ":num_stacks", ":center_no"),
(ge, ":num_stacks", 1), #castle is garrisoned
(assign, reg1, ":center_no"),
(val_add, ":unclaimed_centers", 1),
(try_end),
(assign, reg0, ":unclaimed_centers"),
]),
# script_troop_count_number_of_enemy_troops
# Input: arg1 = troop_no
# Output: reg0 = number_of_enemy_troops
("troop_count_number_of_enemy_troops",
[
(store_script_param_1, ":troop_no"),
(assign, ":enemy_count", 0),
(try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
(troop_slot_ge, ":troop_no", ":i_enemy_slot", 1),
(val_add, ":enemy_count", 1),
(try_end),
(assign, reg0, ":enemy_count"),
]),
# script_cf_troop_check_troop_is_enemy
# Input: arg1 = troop_no, arg2 = checked_troop_no
# Output: none (Can fail)
("cf_troop_check_troop_is_enemy",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":checked_troop_no"),
(assign, ":result", 0),
(try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end),
(troop_slot_eq, ":troop_no", ":i_enemy_slot", ":checked_troop_no"),
(assign, ":result", 1),
(try_end),
(eq, ":result", 1),
]),
# script_troop_get_leaded_center_with_index
# Input: arg1 = troop_no, arg2 = center index within range between zero and the number of centers that troop owns
# Output: reg0 = center_no
("troop_get_leaded_center_with_index",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":random_center"),
(assign, ":result", -1),
(assign, ":center_count", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(eq, ":result", -1),
(party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),
(val_add, ":center_count", 1),
(gt, ":center_count", ":random_center"),
(assign, ":result", ":center_no"),
(try_end),
(assign, reg0, ":result"),
]),
# script_cf_troop_get_random_leaded_walled_center_with_less_strength_priority
# Input: arg1 = troop_no, arg2 = preferred_center_no
# Output: reg0 = center_no (Can fail)
("cf_troop_get_random_leaded_walled_center_with_less_strength_priority",
[
(store_script_param, ":troop_no", 1),
(store_script_param, ":preferred_center_no", 2),
(assign, ":num_centers", 0),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),
(party_slot_eq, ":center_no", slot_center_is_besieged_by, -1),
(val_add, ":num_centers", 1),
(try_begin),
(eq, ":center_no", ":preferred_center_no"),
(val_add, ":num_centers", 99),
(try_end),
## (call_script, "script_party_calculate_regular_strength", ":center_no"),
## (assign, ":strength", reg0),
## (lt, ":strength", 80),
## (store_sub, ":strength", 100, ":strength"),
## (val_div, ":strength", 20),
## (val_add, ":num_centers", ":strength"),
(try_end),
(gt, ":num_centers", 0),
(store_random_in_range, ":random_center", 0, ":num_centers"),
(assign, ":result", -1),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(eq, ":result", -1),
(party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),
(party_slot_eq, ":center_no", slot_center_is_besieged_by, -1),
(val_sub, ":random_center", 1),
(try_begin),
(eq, ":center_no", ":preferred_center_no"),
(val_sub, ":random_center", 99),
(try_end),
## (try_begin),
## (call_script, "script_party_calculate_regular_strength", ":center_no"),
## (assign, ":strength", reg0),
## (lt, ":strength", 80),
## (store_sub, ":strength", 100, ":strength"),
## (val_div, ":strength", 20),
## (val_sub, ":random_center", ":strength"),
## (try_end),
(lt, ":random_center", 0),
(assign, ":result", ":center_no"),
(try_end),
(assign, reg0, ":result"),
]),
# script_cf_troop_get_random_leaded_town_or_village_except_center
# Input: arg1 = troop_no, arg2 = except_center_no
# Output: reg0 = center_no (Can fail)
("cf_troop_get_random_leaded_town_or_village_except_center",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":except_center_no"),
(assign, ":num_centers", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(neg|party_slot_eq, ":center_no", slot_party_type, spt_castle),
(party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),
(neq, ":center_no", ":except_center_no"),
(val_add, ":num_centers", 1),
(try_end),
(gt, ":num_centers", 0),
(store_random_in_range, ":random_center", 0, ":num_centers"),
(assign, ":end_cond", centers_end),
(try_for_range, ":center_no", centers_begin, ":end_cond"),
(neg|party_slot_eq, ":center_no", slot_party_type, spt_castle),
(party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),
(neq, ":center_no", ":except_center_no"),
(val_sub, ":random_center", 1),
(lt, ":random_center", 0),
(assign, ":target_center", ":center_no"),
(assign, ":end_cond", 0),
(try_end),
(assign, reg0, ":target_center"),
]),
# script_troop_write_owned_centers_to_s2
# Input: arg1 = troop_no
# Output: none
("troop_write_owned_centers_to_s2",
[
(store_script_param_1, ":troop_no"),
(call_script, "script_get_number_of_hero_centers", ":troop_no"),
(assign, ":no_centers", reg0),
(str_store_troop_name, s5, ":troop_no"),
(try_begin),
(gt, ":no_centers", 1),
(try_for_range, ":i_center", 1, ":no_centers"),
(call_script, "script_troop_get_leaded_center_with_index", ":troop_no", ":i_center"),
(str_store_party_name_link, s50, reg0),
(try_begin),
(eq, ":i_center", 1),
(call_script, "script_troop_get_leaded_center_with_index", ":troop_no", 0),
(str_store_party_name_link, s51, reg0),
(str_store_string, s51, "str_s50_and_s51"),
(else_try),
(str_store_string, s51, "str_s50_comma_s51"),
(try_end),
(try_end),
(str_store_string, s2, "str_s5_is_the_ruler_of_s51"),
(else_try),
(eq, ":no_centers", 1),
(call_script, "script_troop_get_leaded_center_with_index", ":troop_no", 0),
(str_store_party_name_link, s51, reg0),
(str_store_string, s2, "str_s5_is_the_ruler_of_s51"),
(else_try),
(store_troop_faction, ":faction_no", ":troop_no"),
(str_store_faction_name_link, s6, ":faction_no"),
(str_store_string, s2, "str_s5_is_a_nobleman_of_s6"),
(try_end),
]),
# script_troop_write_family_relations_to_s1
# Input: arg1 = troop_no
# Output: none
("troop_write_family_relations_to_s1",
[
(store_script_param_1, ":troop_no"),
(assign, ":num_family", 0),
(try_for_range, ":slot_no", slot_troop_family_begin, slot_troop_family_end),
(troop_slot_ge, ":troop_no", ":slot_no", 1),
(val_add, ":num_family", 1),
(try_end),
(troop_get_type, ":gender", ":troop_no"),
(try_begin),
(eq, ":gender", 0),
(str_store_string, s5, "str_he"),
(else_try),
(str_store_string, s5, "str_she"),
(try_end),
(try_begin),
(gt, ":num_family", 1),
(try_for_range, ":i_family", 1, ":num_family"),
(call_script, "script_write_family_relation_as_s3s_s2_to_s4", ":troop_no", ":i_family"),
(str_store_string_reg, s50, s4),
(try_begin),
(eq, ":i_family", 1),
(call_script, "script_write_family_relation_as_s3s_s2_to_s4", ":troop_no", 0),
(str_store_string_reg, s51, s4),
(str_store_string, s51, "str_s50_and_s51"),
(else_try),
(str_store_string, s51, "str_s50_comma_s51"),
(try_end),
(try_end),
(str_store_string, s1, "str_s5_is_s51"),
(else_try),
(eq, ":num_family", 1),
(call_script, "script_write_family_relation_as_s3s_s2_to_s4", ":troop_no", 0),
(str_store_string_reg, s51, s4),
(str_store_string, s1, "str_s5_is_s51"),
(else_try),
(str_store_string, s1, "str_blank_string"),
(try_end),
]),
# script_write_family_relation_as_s3s_s2_to_s4
# Inputs: arg1 = troop_no, arg2 = family_no (valid slot no after slot_troop_family_begin)
# Outputs: s50 = s3s_s2 text
("write_family_relation_as_s3s_s2_to_s4",
[
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":family_no"),
(troop_get_type, ":gender", ":troop_no"),
(assign, ":slot_no", slot_troop_family_begin),
(try_for_range, ":unused", slot_troop_family_begin, slot_troop_family_end),
(this_or_next|gt, ":family_no", 0),
(troop_slot_eq, ":troop_no", ":slot_no", 0),
(try_begin),
(troop_slot_ge, ":troop_no", ":slot_no", 1),
(val_sub, ":family_no", 1),
(try_end),
(val_add, ":slot_no", 1),
(try_end),
(try_begin),
(eq, ":slot_no", slot_troop_spouse),
(try_begin),
(eq, ":gender", 0),
(str_store_string, s2, "str_husband"),
(else_try),
(str_store_string, s2, "str_wife"),
(try_end),
(else_try),
(this_or_next|eq, ":slot_no", slot_troop_son),
(eq, ":slot_no", slot_troop_daughter),
(try_begin),
(eq, ":gender", 0),
(str_store_string, s2, "str_father"),
(else_try),
(str_store_string, s2, "str_mother"),
(try_end),
(else_try),
(this_or_next|eq, ":slot_no", slot_troop_father),
(eq, ":slot_no", slot_troop_mother),
(try_begin),
(eq, ":gender", 0),
(str_store_string, s2, "str_son"),
(else_try),
(str_store_string, s2, "str_daughter"),
(try_end),
(else_try),
(eq, ":slot_no", slot_troop_sibling),
(try_begin),
(eq, ":gender", 0),
(str_store_string, s2, "str_brother"),
(else_try),
(str_store_string, s2, "str_sister"),
(try_end),
(try_end),
(troop_get_slot, ":cur_family", ":troop_no", ":slot_no"),
(str_store_troop_name_link, s3, ":cur_family"),
(str_store_string, s4, "str_s3s_s2"),
]),
# script_complete_family_relations
# Inputs: none
# Outputs: none
("complete_family_relations",
[
#Completing family relations
(try_for_range, ":troop_id", heroes_begin, heroes_end),
(troop_get_type, ":troop_gender", ":troop_id"),
(try_begin),
(troop_get_slot, ":cur_spouse", ":troop_id", slot_troop_spouse),
(gt, ":cur_spouse", 0),
(troop_set_slot, ":cur_spouse", slot_troop_spouse, ":troop_id"),
#Adding children from troop to new spouse
(troop_get_slot, ":cur_daughter", ":troop_id", slot_troop_daughter),
(troop_get_slot, ":cur_son", ":troop_id", slot_troop_son),
(try_begin),
(gt, ":cur_daughter", 0),
(troop_set_slot, ":cur_spouse", slot_troop_daughter, ":cur_daughter"),
(try_end),
(try_begin),
(gt, ":cur_son", 0),
(troop_set_slot, ":cur_spouse", slot_troop_son, ":cur_son"),
(try_end),
#Adding children from new spouse to troop
(troop_get_slot, ":cur_daughter", ":cur_spouse", slot_troop_daughter),
(troop_get_slot, ":cur_son", ":cur_spouse", slot_troop_son),
(try_begin),
(gt, ":cur_daughter", 0),
(troop_set_slot, ":troop_id", slot_troop_daughter, ":cur_daughter"),
(try_end),
(try_begin),
(gt, ":cur_son", 0),
(troop_set_slot, ":troop_id", slot_troop_son, ":cur_son"),
(try_end),
(try_end),
(try_begin),
(troop_get_slot, ":cur_sibling", ":troop_id", slot_troop_sibling),
(gt, ":cur_sibling", 0),
(troop_set_slot, ":cur_sibling", slot_troop_sibling, ":troop_id"),
#Adding parents from troop to new sibling
(troop_get_slot, ":cur_mother", ":troop_id", slot_troop_mother),
(troop_get_slot, ":cur_father", ":troop_id", slot_troop_father),
(try_begin),
(gt, ":cur_mother", 0),
(troop_set_slot, ":cur_sibling", slot_troop_mother, ":cur_mother"),
(try_end),
(try_begin),
(gt, ":cur_father", 0),
(troop_set_slot, ":cur_sibling", slot_troop_father, ":cur_father"),
(try_end),
#Adding parents from new sibling to troop
(troop_get_slot, ":cur_mother", ":cur_sibling", slot_troop_mother),
(troop_get_slot, ":cur_father", ":cur_sibling", slot_troop_father),
(try_begin),
(gt, ":cur_mother", 0),
(troop_set_slot, ":troop_id", slot_troop_mother, ":cur_mother"),
(try_end),
(try_begin),
(gt, ":cur_father", 0),
(troop_set_slot, ":troop_id", slot_troop_father, ":cur_father"),
(try_end),
(try_end),
(try_begin),
(troop_get_slot, ":cur_child", ":troop_id", slot_troop_son),
(gt, ":cur_child", 0),
(try_begin),
(eq, ":troop_gender", 0),
(troop_set_slot, ":cur_child", slot_troop_father, ":troop_id"),
(else_try),
(troop_set_slot, ":cur_child", slot_troop_mother, ":troop_id"),
(try_end),
#Adding mother/father and sibling from troop to new son
(troop_get_slot, ":cur_mother_father", ":troop_id", slot_troop_spouse),
(troop_get_slot, ":cur_sibling", ":troop_id", slot_troop_daughter),
(try_begin),
(gt, ":cur_mother_father", 0),
(try_begin),
(eq, ":troop_gender", 1),
(troop_set_slot, ":cur_child", slot_troop_father, ":cur_mother_father"),
(else_try),
(troop_set_slot, ":cur_child", slot_troop_mother, ":cur_mother_father"),
(try_end),
(try_end),
(try_begin),
(gt, ":cur_sibling", 0),
(troop_set_slot, ":cur_child", slot_troop_sibling, ":cur_sibling"),
(try_end),
#Adding son/daughter and spouse from new son to troop
(try_begin),
(eq, ":troop_gender", 0),
(troop_get_slot, ":cur_spouse", ":cur_child", slot_troop_mother),
(else_try),
(troop_get_slot, ":cur_spouse", ":cur_child", slot_troop_father),
(try_end),
(troop_get_slot, ":cur_daughter", ":cur_child", slot_troop_sibling),
(try_begin),
(gt, ":cur_spouse", 0),
(troop_set_slot, ":troop_id", slot_troop_spouse, ":cur_spouse"),
(try_end),
(try_begin),
(gt, ":cur_daughter", 0),
(troop_set_slot, ":troop_id", slot_troop_daughter, ":cur_daughter"),
(try_end),
(try_end),
(try_begin),
(troop_get_slot, ":cur_child", ":troop_id", slot_troop_daughter),
(gt, ":cur_child", 0),
(try_begin),
(eq, ":troop_gender", 0),
(troop_set_slot, ":cur_child", slot_troop_father, ":troop_id"),
(else_try),
(troop_set_slot, ":cur_child", slot_troop_mother, ":troop_id"),
(try_end),
#Adding mother/father and sibling from troop to new daughter
(troop_get_slot, ":cur_mother_father", ":troop_id", slot_troop_spouse),
(troop_get_slot, ":cur_sibling", ":troop_id", slot_troop_son),
(try_begin),
(gt, ":cur_mother_father", 0),
(try_begin),
(eq, ":troop_gender", 1),
(troop_set_slot, ":cur_child", slot_troop_father, ":cur_mother_father"),
(else_try),
(troop_set_slot, ":cur_child", slot_troop_mother, ":cur_mother_father"),
(try_end),
(try_end),
(try_begin),
(gt, ":cur_sibling", 0),
(troop_set_slot, ":cur_child", slot_troop_sibling, ":cur_sibling"),
(try_end),
#Adding son/daughter and spouse from new daughter to troop
(try_begin),
(eq, ":troop_gender", 0),
(troop_get_slot, ":cur_spouse", ":cur_child", slot_troop_mother),
(else_try),
(troop_get_slot, ":cur_spouse", ":cur_child", slot_troop_father),
(try_end),
(troop_get_slot, ":cur_son", ":cur_child", slot_troop_sibling),
(try_begin),
(gt, ":cur_spouse", 0),
(troop_set_slot, ":troop_id", slot_troop_spouse, ":cur_spouse"),
(try_end),
(try_begin),
(gt, ":cur_son", 0),
(troop_set_slot, ":troop_id", slot_troop_son, ":cur_son"),
(try_end),
(try_end),
(try_begin),
(troop_get_slot, ":cur_father", ":troop_id", slot_troop_father),
(gt, ":cur_father", 0),
(try_begin),
(eq, ":troop_gender", 0),
(troop_set_slot, ":cur_father", slot_troop_son, ":troop_id"),
(else_try),
(troop_set_slot, ":cur_father", slot_troop_daughter, ":troop_id"),
(try_end),
#Adding son/daughter and spouse from troop to new father
(troop_get_slot, ":cur_spouse", ":troop_id", slot_troop_mother),
(troop_get_slot, ":cur_son_daughter", ":troop_id", slot_troop_sibling),
(try_begin),
(gt, ":cur_spouse", 0),
(troop_set_slot, ":cur_father", slot_troop_spouse, ":cur_spouse"),
(try_end),
(try_begin),
(gt, ":cur_son_daughter", 0),
(try_begin),
(eq, ":troop_gender", 0),
(troop_set_slot, ":cur_father", slot_troop_daughter, ":cur_son_daughter"),
(else_try),
(troop_set_slot, ":cur_father", slot_troop_son, ":cur_son_daughter"),
(try_end),
(try_end),
#Adding mother/father and sibling from new father to troop
(try_begin),
(eq, ":troop_gender", 0),
(troop_get_slot, ":cur_sibling", ":cur_father", slot_troop_daughter),
(else_try),
(troop_get_slot, ":cur_sibling", ":cur_father", slot_troop_son),
(try_end),
(troop_get_slot, ":cur_mother", ":cur_father", slot_troop_spouse),
(try_begin),
(gt, ":cur_sibling", 0),
(troop_set_slot, ":troop_id", slot_troop_sibling, ":cur_sibling"),
(try_end),
(try_begin),
(gt, ":cur_mother", 0),
(troop_set_slot, ":troop_id", slot_troop_mother, ":cur_mother"),
(try_end),
(try_end),
(try_begin),
(troop_get_slot, ":cur_mother", ":troop_id", slot_troop_mother),
(gt, ":cur_mother", 0),
(try_begin),
(eq, ":troop_gender", 0),
(troop_set_slot, ":cur_mother", slot_troop_son, ":troop_id"),
(else_try),
(troop_set_slot, ":cur_mother", slot_troop_daughter, ":troop_id"),
(try_end),
#Adding son/daughter and spouse from troop to new mother
(troop_get_slot, ":cur_spouse", ":troop_id", slot_troop_father),
(troop_get_slot, ":cur_son_daughter", ":troop_id", slot_troop_sibling),
(try_begin),
(gt, ":cur_spouse", 0),
(troop_set_slot, ":cur_mother", slot_troop_spouse, ":cur_spouse"),
(try_end),
(try_begin),
(gt, ":cur_son_daughter", 0),
(try_begin),
(eq, ":troop_gender", 0),
(troop_set_slot, ":cur_mother", slot_troop_daughter, ":cur_son_daughter"),
(else_try),
(troop_set_slot, ":cur_mother", slot_troop_son, ":cur_son_daughter"),
(try_end),
(try_end),
#Adding mother/father and sibling from new mother to troop
(try_begin),
(eq, ":troop_gender", 0),
(troop_get_slot, ":cur_sibling", ":cur_mother", slot_troop_daughter),
(else_try),
(troop_get_slot, ":cur_sibling", ":cur_mother", slot_troop_son),
(try_end),
(troop_get_slot, ":cur_father", ":cur_mother", slot_troop_spouse),
(try_begin),
(gt, ":cur_sibling", 0),
(troop_set_slot, ":troop_id", slot_troop_sibling, ":cur_sibling"),
(try_end),
(try_begin),
(gt, ":cur_father", 0),
(troop_set_slot, ":troop_id", slot_troop_father, ":cur_father"),
(try_end),
(try_end),
(try_end),
]),
# script_collect_friendly_parties
# Fills the party p_collective_friends with the members of parties attached to main_party and ally_party_no
("collect_friendly_parties",
[
(party_collect_attachments_to_party, "p_main_party", "p_collective_friends"),
(try_begin),
(gt, "$g_ally_party", 0),
(party_collect_attachments_to_party, "$g_ally_party", "p_temp_party"),
(assign, "$g_move_heroes", 1),
(call_script, "script_party_add_party", "p_collective_friends", "p_temp_party"),
(try_end),
]),
# script_encounter_calculate_fit
# Input: arg1 = troop_no
# Output: none
("encounter_calculate_fit",
[
# (assign, "$g_enemy_fit_for_battle_old", "$g_enemy_fit_for_battle"),
# (assign, "$g_friend_fit_for_battle_old", "$g_friend_fit_for_battle"),
# (assign, "$g_main_party_fit_for_battle_old", "$g_main_party_fit_for_battle"),
(call_script, "script_party_count_fit_for_battle", "p_main_party"),
# (assign, "$g_main_party_fit_for_battle", reg(0)),
(call_script, "script_collect_friendly_parties"),
(call_script, "script_party_count_fit_for_battle", "p_collective_friends"),
(assign, "$g_friend_fit_for_battle", reg(0)),
(party_clear, "p_collective_ally"),
(try_begin),
(gt, "$g_ally_party", 0),
(party_is_active, "$g_ally_party"),
(party_collect_attachments_to_party, "$g_ally_party", "p_collective_ally"),
# (call_script, "script_party_count_fit_for_battle", "p_collective_ally"),
# (val_add, "$g_friend_fit_for_battle", reg(0)),
(try_end),
(party_clear, "p_collective_enemy"),
(try_begin),
(party_is_active, "$g_enemy_party"),
(party_collect_attachments_to_party, "$g_enemy_party", "p_collective_enemy"),
(try_end),
(call_script, "script_party_count_fit_for_battle", "p_collective_enemy"),
(assign, "$g_enemy_fit_for_battle", reg(0)),
(assign, reg11, "$g_enemy_fit_for_battle"),
(assign, reg10, "$g_friend_fit_for_battle"),
]),
# script_encounter_init_variables
# Input: arg1 = troop_no
# Output: none
("encounter_init_variables",
[
(assign, "$capture_screen_shown", 0),
(assign, "$loot_screen_shown", 0),
(assign, "$thanked_by_ally_leader", 0),
(assign, "$g_battle_result", 0),
(assign, "$cant_leave_encounter", 0),
(assign, "$cant_talk_to_enemy", 0),
(assign, "$last_defeated_hero", 0),
(assign, "$last_freed_hero", 0),
(call_script, "script_encounter_calculate_fit"),
(call_script, "script_party_copy", "p_main_party_backup", "p_main_party"),
(call_script, "script_party_calculate_strength", "p_main_party", 0),
(assign, "$g_starting_strength_main_party", reg0),
(call_script, "script_party_copy", "p_encountered_party_backup", "p_collective_enemy"),
(call_script, "script_party_calculate_strength", "p_collective_enemy", 0),
(assign, "$g_starting_strength_enemy_party", reg0),
# (assign, "$g_starting_strength_ally_party", 0),
(assign, "$g_strength_contribution_of_player", 100),
(call_script, "script_party_copy", "p_collective_friends_backup", "p_collective_friends"),
(call_script, "script_party_calculate_strength", "p_collective_friends", 0),
(assign, "$g_starting_strength_friends", reg0),
(store_mul, "$g_strength_contribution_of_player","$g_starting_strength_main_party", 100), # reduce contribution if we are helping someone.
(val_div, "$g_strength_contribution_of_player","$g_starting_strength_friends"),
# (try_begin),
# (gt, "$g_ally_party", 0),
# (call_script, "script_party_copy", "p_ally_party_backup", "p_collective_ally"),
# (call_script, "script_party_calculate_strength", "p_collective_ally"),
# (assign, "$g_starting_strength_ally_party", reg0),
# (store_add, ":starting_strength_factor_combined","$g_starting_strength_ally_party","$g_starting_strength_main_party"),
# (store_mul, "$g_strength_contribution_of_player","$g_starting_strength_main_party", 80), #reduce contribution if we are helping someone.
# (val_div, "$g_strength_contribution_of_player",":starting_strength_factor_combined"),
# (try_end),
]),
# script_calculate_renown_value
# Input: arg1 = troop_no
# Output: fills $battle_renown_value
("calculate_renown_value",
[
(call_script, "script_party_calculate_strength", "p_main_party", 0),
(assign, ":main_party_strength", reg0),
(call_script, "script_party_calculate_strength", "p_collective_enemy", 0),
(assign, ":enemy_strength", reg0),
(call_script, "script_party_calculate_strength", "p_collective_friends", 0),
(assign, ":friends_strength", reg0),
(val_add, ":friends_strength", 1),
(store_mul, ":enemy_strength_ratio", ":enemy_strength", 100),
(val_div, ":enemy_strength_ratio", ":friends_strength"),
(assign, ":renown_val", ":enemy_strength"),
(val_mul, ":renown_val", ":enemy_strength_ratio"),
(val_div, ":renown_val", 100),
(val_mul, ":renown_val", ":main_party_strength"),
(val_div, ":renown_val",":friends_strength"),
(store_div, "$battle_renown_value", ":renown_val", 5),
(val_min, "$battle_renown_value", 2500),
(convert_to_fixed_point, "$battle_renown_value"),
(store_sqrt, "$battle_renown_value", "$battle_renown_value"),
(convert_from_fixed_point, "$battle_renown_value"),
(assign, reg8, "$battle_renown_value"),
(display_message, "@Renown value for this battle is {reg8}.",0xFFFFFFFF),
]),
## # script_calculate_weekly_wage_for_player
## # Input: none
## # Output: none
## ("calculate_weekly_wage_for_player",
## [
## (call_script, "script_calculate_weekly_party_wage", "p_main_party"),
## (assign, ":result", reg0),
## (try_for_parties, ":party_no"),
## (store_faction_of_party, ":party_faction", ":party_no"),
## (eq, ":party_faction", "fac_player_supporters_faction"),
## (call_script, "script_calculate_weekly_party_wage", ":party_no"),
## (val_add, ":result", reg0),
## (try_end),
## (assign, reg0, ":result"),
## ]),
# script_get_first_agent_with_troop_id
# Input: arg1 = troop_no
# Output: agent_id
("cf_get_first_agent_with_troop_id",
[
(store_script_param_1, ":troop_no"),
# (store_script_param_2, ":agent_no_to_begin_searching_after"),
(assign, ":result", -1),
(try_for_agents, ":cur_agent"),
(eq, ":result", -1),
## (try_begin),
## (eq, ":cur_agent", ":agent_no_to_begin_searching_after"),
## (assign, ":agent_no_to_begin_searching_after", -1),
## (try_end),
## (eq, ":agent_no_to_begin_searching_after", -1),
(agent_get_troop_id, ":cur_troop_no", ":cur_agent"),
(eq, ":cur_troop_no", ":troop_no"),
(assign, ":result", ":cur_agent"),
(try_end),
(assign, reg0, ":result"),
(neq, reg0, -1),
]),
# script_cf_team_get_average_position_of_agents_with_type_to_pos1
# Input: arg1 = team_no, arg2 = class_no (grc_everyone, grc_infantry, grc_cavalry, grc_archers, grc_heroes)
# Output: none, pos1 = average_position (0,0,0 if there are no matching agents)
("cf_team_get_average_position_of_agents_with_type_to_pos1",
[
(store_script_param_1, ":team_no"),
(store_script_param_2, ":class_no"),
(assign, ":total_pos_x", 0),
(assign, ":total_pos_y", 0),
(assign, ":total_pos_z", 0),
(assign, ":num_agents", 0),
(set_fixed_point_multiplier, 100),
(try_for_agents, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_get_team, ":cur_team_no", ":cur_agent"),
(eq, ":cur_team_no", ":team_no"),
(agent_get_class, ":cur_class_no", ":cur_agent"),
(this_or_next|eq, ":class_no", grc_everyone),
(eq, ":class_no", ":cur_class_no"),
(agent_get_position, pos1, ":cur_agent"),
(position_get_x, ":cur_pos_x", pos1),
(val_add, ":total_pos_x", ":cur_pos_x"),
(position_get_y, ":cur_pos_y", pos1),
(val_add, ":total_pos_y", ":cur_pos_y"),
(position_get_z, ":cur_pos_z", pos1),
(val_add, ":total_pos_z", ":cur_pos_z"),
(val_add, ":num_agents", 1),
(try_end),
(gt, ":num_agents", 1),
(val_div, ":total_pos_x", ":num_agents"),
(val_div, ":total_pos_y", ":num_agents"),
(val_div, ":total_pos_z", ":num_agents"),
(init_position, pos1),
(position_move_x, pos1, ":total_pos_x"),
(position_move_y, pos1, ":total_pos_y"),
(position_move_z, pos1, ":total_pos_z"),
]),
# script_cf_turn_windmill_fans
# Input: arg1 = instance_no (none = 0)
# Output: none
("cf_turn_windmill_fans",
[(store_script_param_1, ":instance_no"),
(scene_prop_get_instance, ":windmill_fan_object", "spr_windmill_fan_turning", ":instance_no"),
(ge, ":windmill_fan_object", 0),
(prop_instance_get_position, pos1, ":windmill_fan_object"),
(position_rotate_y, pos1, 10),
(prop_instance_animate_to_position, ":windmill_fan_object", pos1, 100),
(val_add, ":instance_no", 1),
(call_script, "script_cf_turn_windmill_fans", ":instance_no"),
]),
# script_print_party_members
# Input: arg1 = party_no
# Output: s51 = output string. "noone" if the party is empty
("print_party_members",
[(store_script_param_1, ":party_no"),
(party_get_num_companion_stacks, ":num_stacks",":party_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"),
(troop_is_hero, ":stack_troop"),
(try_begin),
(eq, ":i_stack", 0),
(str_store_troop_name, s51, ":stack_troop"),
(try_end),
(str_store_troop_name, s50, ":stack_troop"),
(try_begin),
(eq, ":i_stack", 1),
(str_store_string, s51, "str_s50_and_s51"),
(else_try),
(gt, ":i_stack", 1),
(str_store_string, s51, "str_s50_comma_s51"),
(try_end),
(try_end),
(try_begin),
(eq, ":num_stacks", 0),
(str_store_string, s51, "str_noone"),
(try_end),
]),
# script_round_value
# Input: arg1 = value
# Output: reg0 = rounded_value
("round_value",
[
(store_script_param_1, ":value"),
(try_begin),
(lt, ":value", 100),
(neq, ":value", 0),
(val_add, ":value", 5),
(val_div, ":value", 10),
(val_mul, ":value", 10),
(try_begin),
(eq, ":value", 0),
(assign, ":value", 5),
(try_end),
(else_try),
(lt, ":value", 300),
(val_add, ":value", 25),
(val_div, ":value", 50),
(val_mul, ":value", 50),
(else_try),
(val_add, ":value", 50),
(val_div, ":value", 100),
(val_mul, ":value", 100),
(try_end),
(assign, reg0, ":value"),
]),
## # script_print_productions_above_or_below_50
## # Input: arg1 = center_no, arg2 = sign of the production, 1 if produced goods, -1 if consumed goods
## # Output: s51 = output string. "nothing" if there are no productions above or below 50
## ("print_productions_above_or_below_50",
## [(store_script_param_1, ":center_no"),
## (store_script_param_2, ":sign"),
## (store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin),
## (assign, ":cur_print_index", 0),
## (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
## (store_add, ":cur_good_slot", ":cur_goods", ":item_to_slot"),
## (party_get_slot, ":cur_production", ":center_no", ":cur_good_slot"),
## (val_mul, ":cur_production", ":sign"),
## (ge, ":cur_production", 50),
## (try_begin),
## (eq, ":cur_print_index", 0),
## (str_store_item_name, s51, ":cur_goods"),
## (try_end),
## (str_store_item_name, s50, ":cur_goods"),
## (try_begin),
## (eq, ":cur_print_index", 1),
## (str_store_string, s51, "str_s50_and_s51"),
## (else_try),
## (gt, ":cur_print_index", 1),
## (str_store_string, s51, "str_s50_comma_s51"),
## (try_end),
## (val_add, ":cur_print_index", 1),
## (try_end),
## (try_begin),
## (eq, ":cur_print_index", 0),
## (str_store_string, s51, "str_nothing"),
## (try_end),
## ]),
# script_change_banners_and_chest
# Input: none
# Output: none
("change_banners_and_chest",
[(party_get_slot, ":cur_leader", "$g_encountered_party", slot_town_lord),
(try_begin),
(ge, ":cur_leader", 0),
#normal_banner_begin
(troop_get_slot, ":troop_banner_object", ":cur_leader", slot_troop_banner_scene_prop),
(gt, ":troop_banner_object", 0),
(replace_scene_props, banner_scene_props_begin, ":troop_banner_object"),
(else_try),
(replace_scene_props, banner_scene_props_begin, "spr_empty"),
#custom_banner_begin
# (troop_get_slot, ":flag_spr", ":cur_leader", slot_troop_custom_banner_flag_type),
# (ge, ":flag_spr", 0),
# (val_add, ":flag_spr", custom_banner_flag_scene_props_begin),
# (replace_scene_props, banner_scene_props_begin, ":flag_spr"),
# (else_try),
# (replace_scene_props, banner_scene_props_begin, "spr_empty"),
(try_end),
(try_begin),
(neq, ":cur_leader", "trp_player"),
(replace_scene_props, "spr_player_chest", "spr_locked_player_chest"),
(try_end),
]),
# script_remove_siege_objects
# Input: none
# Output: none
("remove_siege_objects",
[
(replace_scene_props, "spr_battlement_a_destroyed", "spr_battlement_a"),
(replace_scene_props, "spr_snowy_castle_battlement_a_destroyed", "spr_snowy_castle_battlement_a"),
(replace_scene_props, "spr_castle_e_battlement_a_destroyed", "spr_castle_e_battlement_a"),
(replace_scene_props, "spr_castle_battlement_a_destroyed", "spr_castle_battlement_a"),
(replace_scene_props, "spr_castle_battlement_b_destroyed", "spr_castle_battlement_b"),
(replace_scene_props, "spr_earth_wall_a2", "spr_earth_wall_a"),
(replace_scene_props, "spr_earth_wall_b2", "spr_earth_wall_b"),
(replace_scene_props, "spr_belfry_platform_b", "spr_empty"),
(replace_scene_props, "spr_belfry_platform_a", "spr_empty"),
(replace_scene_props, "spr_belfry_a", "spr_empty"),
(replace_scene_props, "spr_belfry_wheel", "spr_empty"),
(replace_scene_props, "spr_siege_ladder_12m", "spr_empty"),
(replace_scene_props, "spr_siege_ladder_14m", "spr_empty"),
(replace_scene_props, "spr_mangonel", "spr_empty"),
(replace_scene_props, "spr_trebuchet_old", "spr_empty"),
(replace_scene_props, "spr_trebuchet_new", "spr_empty"),
(replace_scene_props, "spr_stone_ball", "spr_empty"),
(replace_scene_props, "spr_Village_fire_big", "spr_empty"),
]),
# script_describe_relation_to_s63
# Input: arg1 = relation (-100 .. 100)
# Output: none
("describe_relation_to_s63",
[(store_script_param_1, ":relation"),
(store_add, ":normalized_relation", ":relation", 100),
(val_add, ":normalized_relation", 5),
(store_div, ":str_offset", ":normalized_relation", 10),
(val_clamp, ":str_offset", 0, 20),
(store_add, ":str_id", "str_relation_mnus_100", ":str_offset"),
(str_store_string, s63, ":str_id"),
]),
# script_describe_center_relation_to_s3
# Input: arg1 = relation (-100 .. 100)
# Output: none
("describe_center_relation_to_s3",
[(store_script_param_1, ":relation"),
(store_add, ":normalized_relation", ":relation", 100),
(val_add, ":normalized_relation", 5),
(store_div, ":str_offset", ":normalized_relation", 10),
(val_clamp, ":str_offset", 0, 20),
(store_add, ":str_id", "str_center_relation_mnus_100", ":str_offset"),
(str_store_string, s3, ":str_id"),
]),
# script_center_ambiance_sounds
# Input: none
# Output: none
# to be called every two seconds
("center_ambiance_sounds",
[
(assign, ":sound_1", -1),
(assign, ":sound_2", -1),
(assign, ":sound_3", -1),
(assign, ":sound_4", -1),
(assign, ":sound_5", -1),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(try_begin),
(neg|is_currently_night),
(assign, ":sound_3", "snd_distant_dog_bark"),
(assign, ":sound_3", "snd_distant_chicken"),
(else_try),
(assign, ":sound_1", "snd_distant_dog_bark"),
(assign, ":sound_2", "snd_distant_owl"),
(try_end),
(else_try),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(try_begin),
(neg|is_currently_night),
(assign, ":sound_1", "snd_distant_carpenter"),
(assign, ":sound_2", "snd_distant_blacksmith"),
(assign, ":sound_3", "snd_distant_dog_bark"),
(else_try),
(assign, ":sound_1", "snd_distant_dog_bark"),
(try_end),
(try_end),
(try_begin),
(store_random_in_range, ":r", 0, 7),
(try_begin),
(eq, ":r", 1),
(ge, ":sound_1", 0),
(play_sound, ":sound_1"),
(else_try),
(eq, ":r", 2),
(ge, ":sound_2", 0),
(play_sound, ":sound_2"),
(else_try),
(eq, ":r", 3),
(ge, ":sound_3", 0),
(play_sound, ":sound_3"),
(else_try),
(eq, ":r", 4),
(ge, ":sound_4", 0),
(play_sound, ":sound_4"),
(else_try),
(eq, ":r", 5),
(ge, ":sound_5", 0),
(play_sound, ":sound_5"),
(try_end),
(try_end),
]),
# script_center_set_walker_to_type
# Input: arg1 = center_no, arg2 = walker_no, arg3 = walker_type,
# Output: none
("center_set_walker_to_type",
[
(store_script_param, ":center_no", 1),
(store_script_param, ":walker_no", 2),
(store_script_param, ":walker_type", 3),
(store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"),
(party_set_slot, ":center_no", ":type_slot", ":walker_type"),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(store_random_in_range, ":walker_troop_id", village_walkers_begin, village_walkers_end),
(else_try),
(store_random_in_range, ":walker_troop_id", town_walkers_begin, town_walkers_end),
(try_end),
(try_begin),
(eq,":walker_type",walkert_spy),
(assign,":original_walker",":walker_troop_id"),
(val_add,":walker_troop_id",4), # select spy troop id
# restore spy inventory
(try_for_range,":item_no","itm_horse_meat","itm_wooden_stick"),
(store_item_kind_count,":num_items",":item_no",":original_walker"),
(ge,":num_items",1),
(store_item_kind_count,":num_items",":item_no",":walker_troop_id"),
(lt,":num_items",1),
(troop_add_items,":walker_troop_id",":item_no",1),
(try_end),
# determine spy recognition item
(store_random_in_range,":spy_item_type",itp_type_head_armor,itp_type_hand_armor),
(assign,":num",0),
(try_for_range,":item_no","itm_horse_meat","itm_wooden_stick"),
(store_item_kind_count,":num_items",":item_no",":walker_troop_id"),
(ge,":num_items",1),
(item_get_type, ":itp", ":item_no"),
(eq,":itp",":spy_item_type"),
(val_add,":num",1),
(troop_remove_items,":walker_troop_id",":item_no",":num_items"),
(try_end),
(store_random_in_range,":random_item",0,":num"),
(assign,":num",-1),
(try_for_range,":item_no","itm_horse_meat","itm_wooden_stick"),
(store_item_kind_count,":num_items",":item_no",":original_walker"),
(ge,":num_items",1),
(item_get_type, ":itp", ":item_no"),
(eq,":itp",":spy_item_type"),
(val_add,":num",1),
(eq,":num",":random_item"),
(troop_add_items,":walker_troop_id",":item_no",1),
(assign,":spy_item",":item_no"),
(try_end),
(assign,"$spy_item_worn",":spy_item"),
(assign,"$spy_quest_troop",":walker_troop_id"),
(troop_equip_items,":walker_troop_id"),
(try_end),
(store_add, ":troop_slot", slot_center_walker_0_troop, ":walker_no"),
(party_set_slot, ":center_no", ":troop_slot", ":walker_troop_id"),
(store_random_in_range, ":walker_dna", 0, 1000000),
(store_add, ":dna_slot", slot_center_walker_0_dna, ":walker_no"),
(party_set_slot, ":center_no", ":dna_slot", ":walker_dna"),
]),
# script_cf_center_get_free_walker
# Input: arg1 = center_no
# Output: reg0 = walker no (can fail)
("cf_center_get_free_walker",
[
(store_script_param, ":center_no", 1),
(assign, ":num_free_walkers", 0),
(try_for_range, ":walker_no", 0, num_town_walkers),
(store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"),
(party_slot_eq, ":center_no", ":type_slot", walkert_default),
(val_add, ":num_free_walkers", 1),
(try_end),
(gt, ":num_free_walkers", 0),
(assign, reg0, -1),
(store_random_in_range, ":random_rank", 0, ":num_free_walkers"),
(try_for_range, ":walker_no", 0, num_town_walkers),
(store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"),
(party_slot_eq, ":center_no", ":type_slot", walkert_default),
(val_sub, ":num_free_walkers", 1),
(eq, ":num_free_walkers", ":random_rank"),
(assign, reg0, ":walker_no"),
(try_end),
]),
# script_center_remove_walker_type_from_walkers
# Input: arg1 = center_no, arg2 = walker_type,
# Output: reg0 = 1 if comment found, 0 otherwise; s61 will contain comment string if found
("center_remove_walker_type_from_walkers",
[
(store_script_param, ":center_no", 1),
(store_script_param, ":walker_type", 2),
(try_for_range, ":walker_no", 0, num_town_walkers),
(store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"),
(party_slot_eq, ":center_no", ":type_slot", ":walker_type"),
(call_script, "script_center_set_walker_to_type", ":center_no", ":walker_no", walkert_default),
(try_end),
]),
# script_init_town_walkers
# Input: none
# Output: none
("init_town_walkers",
[(try_begin),
(eq, "$town_nighttime", 0),
(try_for_range, ":walker_no", 0, num_town_walkers),
(store_add, ":troop_slot", slot_center_walker_0_troop, ":walker_no"),
(party_get_slot, ":walker_troop_id", "$current_town", ":troop_slot"),
(gt, ":walker_troop_id", 0),
(store_add, ":entry_no", town_walker_entries_start, ":walker_no"),
(set_visitor, ":entry_no", ":walker_troop_id"),
(try_end),
## (try_for_range, ":cur_walker", 0, 8),
## (try_begin),
## (lt, ":cur_walker", ":num_walkers"),
## (store_random_in_range, ":walker_troop", town_walkers_begin, town_walkers_end),
## (else_try),
## (assign, ":walker_troop", -1),
## (try_end),
## (try_begin),
## (eq, ":cur_walker", 0),
## (assign, reg0, ":walker_troop"),
## (else_try),
## (eq, ":cur_walker", 1),
## (assign, reg1, ":walker_troop"),
## (else_try),
## (eq, ":cur_walker", 2),
## (assign, reg2, ":walker_troop"),
## (else_try),
## (eq, ":cur_walker", 3),
## (assign, reg3, ":walker_troop"),
## (else_try),
## (eq, ":cur_walker", 4),
## (assign, reg4, ":walker_troop"),
## (else_try),
## (eq, ":cur_walker", 5),
## (assign, reg5, ":walker_troop"),
## (else_try),
## (eq, ":cur_walker", 6),
## (assign, reg6, ":walker_troop"),
## (else_try),
## (eq, ":cur_walker", 7),
## (assign, reg7, ":walker_troop"),
## (try_end),
## (try_end),
## (shuffle_range, 0, 8),
## (set_visitor, 32, reg0),
## (set_visitor, 33, reg1),
## (set_visitor, 34, reg2),
## (set_visitor, 35, reg3),
## (set_visitor, 36, reg4),
## (set_visitor, 37, reg5),
## (set_visitor, 38, reg6),
## (set_visitor, 39, reg7),
## (try_end),
]),
# script_cf_enter_center_location_bandit_check
# Input: none
# Output: none
("cf_enter_center_location_bandit_check",
[
(neq, "$town_nighttime", 0),
(party_slot_ge, "$current_town", slot_center_has_bandits, 1),
(eq, "$g_defending_against_siege", 0),#Skip if the center is under siege (because of resting)
(eq, "$sneaked_into_town", 0),#Skip if sneaked
(try_begin),
(party_slot_eq, "$current_town", slot_party_type, spt_village),
(party_get_slot, ":cur_scene", "$current_town", slot_castle_exterior),
(else_try),
(party_get_slot, ":cur_scene", "$current_town", slot_town_center),
(try_end),
(modify_visitors_at_site, ":cur_scene"),
(reset_visitors),
(party_get_slot, ":bandit_troop", "$current_town", slot_center_has_bandits),
(store_character_level, ":level", "trp_player"),
(set_jump_mission, "mt_bandits_at_night"),
(try_begin),
(party_slot_eq, "$current_town", slot_party_type, spt_village),
(assign, ":spawn_amount", 2),
(store_div, ":level_fac", ":level", 10),
(val_add, ":spawn_amount", ":level_fac"),
(try_for_range, ":unused", 0, 3),
(gt, ":level", 10),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":level"),
(val_add, ":spawn_amount", 1),
(try_end),
(set_visitors, 4, ":bandit_troop", ":spawn_amount"),
(assign, "$num_center_bandits", ":spawn_amount"),
(set_jump_entry, 2),
(else_try),
(assign, ":spawn_amount", 1),
(assign, "$num_center_bandits", 0),
(try_begin),
(gt, ":level", 15),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":level"),
(assign, ":spawn_amount", 2),
(try_end),
(val_add, "$num_center_bandits", ":spawn_amount"),
(set_visitors, 11, ":bandit_troop", ":spawn_amount"),
(assign, ":spawn_amount", 1),
(try_begin),
(gt, ":level", 20),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":level"),
(assign, ":spawn_amount", 2),
(try_end),
(set_visitors, 27, ":bandit_troop", ":spawn_amount"),
(val_add, "$num_center_bandits", ":spawn_amount"),
(try_begin),
(gt, ":level", 9),
(assign, ":spawn_amount", 1),
(try_begin),
(gt, ":level", 25),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":level"),
(assign, ":spawn_amount", 2),
(try_end),
(set_visitors, 28, ":bandit_troop", ":spawn_amount"),
(val_add, "$num_center_bandits", ":spawn_amount"),
(try_end),
(assign, "$town_entered", 1),
(assign, "$all_doors_locked", 1),
(try_end),
(display_message, "@You have run into a trap!", 0xFFFF2222),
(display_message, "@You are attacked by a group of bandits!", 0xFFFF2222),
(jump_to_scene, ":cur_scene"),
(change_screen_mission),
]),
# script_init_town_agent
# Input: none
# Output: none
("init_town_agent",
[
(store_script_param, ":agent_no", 1),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(set_fixed_point_multiplier, 100),
(assign, ":stand_animation", -1),
(try_begin),
(this_or_next|is_between, ":troop_no", armor_merchants_begin, armor_merchants_end),
(is_between, ":troop_no", weapon_merchants_begin, weapon_merchants_end),
(try_begin),
(troop_get_type, ":cur_troop_gender", ":troop_no"),
(eq, ":cur_troop_gender", 0),
(agent_set_animation, ":agent_no", "anim_stand_townguard"),
(else_try),
(agent_set_animation, ":agent_no", "anim_stand_townguard"),
(end_try),
(else_try),
(is_between, ":troop_no", kingdom_ladies_begin, kingdom_ladies_end),
(assign, ":stand_animation", "anim_stand_lady"),
(else_try),
(is_between, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(assign, ":stand_animation", "anim_stand_lord"),
(else_try),
(is_between, ":troop_no", soldiers_begin, soldiers_end),
(assign, ":stand_animation", "anim_stand_townguard"),
(try_end),
(try_begin),
(ge, ":stand_animation", 0),
(agent_set_stand_animation, ":agent_no", ":stand_animation"),
(agent_set_animation, ":agent_no", ":stand_animation"),
(store_random_in_range, ":random_no", 0, 100),
(agent_set_animation_progress, ":agent_no", ":random_no"),
(try_end),
]),
# script_init_town_walker_agents
# Input: none
# Output: none
("init_town_walker_agents",
[(assign, ":num_walkers", 0),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_troop", ":cur_agent"),
(is_between, ":cur_troop", walkers_begin, walkers_end),
(val_add, ":num_walkers", 1),
(agent_get_position, pos1, ":cur_agent"),
(try_for_range, ":i_e_p", 9, 40),#Entry points
(entry_point_get_position, pos2, ":i_e_p"),
(get_distance_between_positions, ":distance", pos1, pos2),
(lt, ":distance", 200),
(agent_set_slot, ":cur_agent", 0, ":i_e_p"),
(try_end),
(call_script, "script_set_town_walker_destination", ":cur_agent"),
(try_end),
]),
# script_agent_get_town_walker_details
# This script assumes this is one of town walkers.
# Input: agent_id
# Output: reg0: town_walker_type, reg1: town_walker_dna
("agent_get_town_walker_details",
[(store_script_param, ":agent_no", 1),
(agent_get_entry_no, ":entry_no", ":agent_no"),
(store_sub, ":walker_no", ":entry_no", town_walker_entries_start),
(store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"),
(party_get_slot, ":walker_type", "$current_town", ":type_slot"),
(store_add, ":dna_slot", slot_center_walker_0_dna, ":walker_no"),
(party_get_slot, ":walker_dna", "$current_town", ":dna_slot"),
(assign, reg0, ":walker_type"),
(assign, reg1, ":walker_dna"),
(assign, reg2, ":walker_no"),
]),
# script_tick_town_walkers
# Input: none
# Output: none
("tick_town_walkers",
[(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_troop", ":cur_agent"),
(is_between, ":cur_troop", walkers_begin, walkers_end),
(agent_get_slot, ":target_entry_point", ":cur_agent", 0),
(entry_point_get_position, pos1, ":target_entry_point"),
(try_begin),
(lt, ":target_entry_point", 32),
(init_position, pos2),
(position_set_y, pos2, 250),
(position_transform_position_to_parent, pos1, pos1, pos2),
(try_end),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":distance", pos1, pos2),
(lt, ":distance", 400),
(assign, ":random_no", 0),
(try_begin),
(lt, ":target_entry_point", 32),
(store_random_in_range, ":random_no", 0, 100),
(try_end),
(lt, ":random_no", 20),
(call_script, "script_set_town_walker_destination", ":cur_agent"),
(try_end),
]),
# script_set_town_walker_destination
# Input: arg1 = agent_no
# Output: none
("set_town_walker_destination",
[(store_script_param_1, ":agent_no"),
(assign, reg0, 9),
(assign, reg1, 10),
(assign, reg2, 12),
(assign, reg3, 32),
(assign, reg4, 33),
(assign, reg5, 34),
(assign, reg6, 35),
(assign, reg7, 36),
(assign, reg8, 37),
(assign, reg9, 38),
(assign, reg10, 39),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_troop", ":cur_agent"),
(is_between, ":cur_troop", walkers_begin, walkers_end),
(agent_get_slot, ":target_entry_point", ":cur_agent", 0),
(try_begin),
(eq, ":target_entry_point", 9),
(assign, reg0, 0),
(else_try),
(eq, ":target_entry_point", 10),
(assign, reg1, 0),
(else_try),
(eq, ":target_entry_point", 12),
(assign, reg2, 0),
(else_try),
(eq, ":target_entry_point", 32),
(assign, reg3, 0),
(else_try),
(eq, ":target_entry_point", 33),
(assign, reg4, 0),
(else_try),
(eq, ":target_entry_point", 34),
(assign, reg5, 0),
(else_try),
(eq, ":target_entry_point", 35),
(assign, reg6, 0),
(else_try),
(eq, ":target_entry_point", 36),
(assign, reg7, 0),
(else_try),
(eq, ":target_entry_point", 37),
(assign, reg8, 0),
(else_try),
(eq, ":target_entry_point", 38),
(assign, reg9, 0),
(else_try),
(eq, ":target_entry_point", 39),
(assign, reg10, 0),
(try_end),
(try_end),
(assign, ":try_limit", 100),
(assign, ":target_entry_point", 0),
(try_for_range, ":unused", 0, ":try_limit"),
(shuffle_range, 0, 11),
(gt, reg0, 0),
(assign, ":target_entry_point", reg0),
(assign, ":try_limit", 0),
(try_end),
(try_begin),
(gt, ":target_entry_point", 0),
(agent_set_slot, ":agent_no", 0, ":target_entry_point"),
(entry_point_get_position, pos1, ":target_entry_point"),
(try_begin),
(lt, ":target_entry_point", 32),
(init_position, pos2),
(position_set_y, pos2, 250),
(position_transform_position_to_parent, pos1, pos1, pos2),
(try_end),
(agent_set_scripted_destination, ":agent_no", pos1, 0),
(agent_set_speed_limit, ":agent_no", 5),
(try_end),
]),
# script_town_init_doors
# Input: door_state (-1 = closed, 1 = open, 0 = use $town_nighttime)
# Output: none (required for siege mission templates)
("town_init_doors",
[(store_script_param, ":door_state", 1),
(try_begin),
(assign, ":continue", 0),
(try_begin),
(eq, ":door_state", 1),
(assign, ":continue", 1),
(else_try),
(eq, ":door_state", 0),
(eq, "$town_nighttime", 0),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),# open doors
(assign, ":end_cond", 1),
(try_for_range, ":i_instance", 0, ":end_cond"),
(scene_prop_get_instance, ":object", "spr_towngate_door_left", ":i_instance"),
(ge, ":object", 0),
(val_add, ":end_cond", 1),
(prop_instance_get_position, pos1, ":object"),
(position_rotate_z, pos1, -100),
(prop_instance_animate_to_position, ":object", pos1, 1),
(try_end),
(assign, ":end_cond", 1),
(try_for_range, ":i_instance", 0, ":end_cond"),
(scene_prop_get_instance, ":object", "spr_towngate_rectangle_door_left", ":i_instance"),
(ge, ":object", 0),
(val_add, ":end_cond", 1),
(prop_instance_get_position, pos1, ":object"),
(position_rotate_z, pos1, -80),
(prop_instance_animate_to_position, ":object", pos1, 1),
(try_end),
(assign, ":end_cond", 1),
(try_for_range, ":i_instance", 0, ":end_cond"),
(scene_prop_get_instance, ":object", "spr_towngate_door_right", ":i_instance"),
(ge, ":object", 0),
(val_add, ":end_cond", 1),
(prop_instance_get_position, pos1, ":object"),
(position_rotate_z, pos1, 100),
(prop_instance_animate_to_position, ":object", pos1, 1),
(try_end),
(assign, ":end_cond", 1),
(try_for_range, ":i_instance", 0, ":end_cond"),
(scene_prop_get_instance, ":object", "spr_towngate_rectangle_door_right", ":i_instance"),
(ge, ":object", 0),
(val_add, ":end_cond", 1),
(prop_instance_get_position, pos1, ":object"),
(position_rotate_z, pos1, 80),
(prop_instance_animate_to_position, ":object", pos1, 1),
(try_end),
(try_end),
]),
# script_siege_init_ai_and_belfry
# Input: none
# Output: none (required for siege mission templates)
("siege_init_ai_and_belfry",
[(assign, "$cur_belfry_pos", 50),
(assign, ":cur_belfry_object_pos", slot_scene_belfry_props_begin),
(store_current_scene, ":cur_scene"),
#Collecting belfry objects
(try_for_range, ":i_belfry_instance", 0, 3),
(scene_prop_get_instance, ":belfry_object", "spr_belfry_a", ":i_belfry_instance"),
(ge, ":belfry_object", 0),
(scene_set_slot, ":cur_scene", ":cur_belfry_object_pos", ":belfry_object"),
(val_add, ":cur_belfry_object_pos", 1),
(try_end),
(try_for_range, ":i_belfry_instance", 0, 3),
(scene_prop_get_instance, ":belfry_object", "spr_belfry_platform_a", ":i_belfry_instance"),
(ge, ":belfry_object", 0),
(scene_set_slot, ":cur_scene", ":cur_belfry_object_pos", ":belfry_object"),
(val_add, ":cur_belfry_object_pos", 1),
(try_end),
(try_for_range, ":i_belfry_instance", 0, 3),
(scene_prop_get_instance, ":belfry_object", "spr_belfry_platform_b", ":i_belfry_instance"),
(ge, ":belfry_object", 0),
(scene_set_slot, ":cur_scene", ":cur_belfry_object_pos", ":belfry_object"),
(val_add, ":cur_belfry_object_pos", 1),
(try_end),
(assign, "$belfry_rotating_objects_begin", ":cur_belfry_object_pos"),
(try_for_range, ":i_belfry_instance", 0, 5),
(scene_prop_get_instance, ":belfry_object", "spr_belfry_wheel", ":i_belfry_instance"),
(ge, ":belfry_object", 0),
(scene_set_slot, ":cur_scene", ":cur_belfry_object_pos", ":belfry_object"),
(val_add, ":cur_belfry_object_pos", 1),
(try_end),
(assign, "$last_belfry_object_pos", ":cur_belfry_object_pos"),
#Lifting up the platform at the beginning
(scene_prop_get_instance, ":belfry_object_to_rotate", "spr_belfry_platform_a", 0),
#Moving the belfry objects to their starting position
(entry_point_get_position,pos1,55),
(entry_point_get_position,pos3,50),
(try_for_range, ":i_belfry_object_pos", slot_scene_belfry_props_begin, "$last_belfry_object_pos"),
(assign, ":pos_no", pos_belfry_begin),
(val_add, ":pos_no", ":i_belfry_object_pos"),
(val_sub, ":pos_no", slot_scene_belfry_props_begin),
(scene_get_slot, ":cur_belfry_object", ":cur_scene", ":i_belfry_object_pos"),
(prop_instance_get_position, pos2, ":cur_belfry_object"),
(try_begin),
(eq, ":cur_belfry_object", ":belfry_object_to_rotate"),
(position_rotate_x, pos2, 90),
(try_end),
(position_transform_position_to_local, ":pos_no", pos1, pos2),
(position_transform_position_to_parent, pos4, pos3, ":pos_no"),
(prop_instance_animate_to_position, ":cur_belfry_object", pos4, 1),
(try_end),
(assign, "$belfry_positioned", 0),
(assign, "$belfry_num_slots_positioned", 0),
(assign, "$belfry_num_men_pushing", 0),
]),
# script_cf_siege_move_belfry
# Input: none
# Output: none (required for siege mission templates)
("cf_siege_move_belfry",
[(neq, "$last_belfry_object_pos", slot_scene_belfry_props_begin),
(entry_point_get_position,pos1,50),
(entry_point_get_position,pos4,55),
(get_distance_between_positions, ":total_distance", pos4, pos1),
(store_current_scene, ":cur_scene"),
(scene_get_slot, ":first_belfry_object", ":cur_scene", slot_scene_belfry_props_begin),
(prop_instance_get_position, pos2, ":first_belfry_object"),
(entry_point_get_position,pos1,"$cur_belfry_pos"),
(position_transform_position_to_parent, pos3, pos1, pos_belfry_begin),
(position_transform_position_to_parent, pos5, pos4, pos_belfry_begin),
(get_distance_between_positions, ":cur_distance", pos2, pos3),
(get_distance_between_positions, ":distance_left", pos2, pos5),
(try_begin),
(le, ":cur_distance", 10),
(val_add, "$cur_belfry_pos", 1),
(entry_point_get_position,pos1,"$cur_belfry_pos"),
(position_transform_position_to_parent, pos3, pos1, pos_belfry_begin),
(get_distance_between_positions, ":cur_distance", pos2, pos3),
(try_end),
(neq, "$cur_belfry_pos", 50),
(assign, ":base_speed", 20),
(store_div, ":slow_range", ":total_distance", 60),
(store_sub, ":distance_moved", ":total_distance", ":distance_left"),
(try_begin),
(lt, ":distance_moved", ":slow_range"),
(store_mul, ":base_speed", ":distance_moved", -60),
(val_div, ":base_speed", ":slow_range"),
(val_add, ":base_speed", 80),
(else_try),
(lt, ":distance_left", ":slow_range"),
(store_mul, ":base_speed", ":distance_left", -60),
(val_div, ":base_speed", ":slow_range"),
(val_add, ":base_speed", 80),
(try_end),
(store_mul, ":belfry_speed", ":cur_distance", ":base_speed"),
(try_begin),
(eq, "$belfry_num_men_pushing", 0),
(assign, ":belfry_speed", 1000000),
(else_try),
(val_div, ":belfry_speed", "$belfry_num_men_pushing"),
(try_end),
(try_begin),
(le, "$cur_belfry_pos", 55),
(init_position, pos3),
(position_rotate_x, pos3, ":distance_moved"),
(scene_get_slot, ":base_belfry_object", ":cur_scene", slot_scene_belfry_props_begin),
(prop_instance_get_position, pos4, ":base_belfry_object"),
(entry_point_get_position,pos1,"$cur_belfry_pos"),
(try_for_range, ":i_belfry_object_pos", slot_scene_belfry_props_begin, "$last_belfry_object_pos"),
(scene_get_slot, ":cur_belfry_object", ":cur_scene", ":i_belfry_object_pos"),
(try_begin),
(ge, ":i_belfry_object_pos", "$belfry_rotating_objects_begin"),
(prop_instance_get_starting_position, pos5, ":base_belfry_object"),
(prop_instance_get_starting_position, pos6, ":cur_belfry_object"),
(position_transform_position_to_local, pos7, pos5, pos6),
(position_transform_position_to_parent, pos5, pos4, pos7),
(position_transform_position_to_parent, pos6, pos5, pos3),
(prop_instance_set_position, ":cur_belfry_object", pos6),
(else_try),
(assign, ":pos_no", pos_belfry_begin),
(val_add, ":pos_no", ":i_belfry_object_pos"),
(val_sub, ":pos_no", slot_scene_belfry_props_begin),
(position_transform_position_to_parent, pos2, pos1, ":pos_no"),
(prop_instance_animate_to_position, ":cur_belfry_object", pos2, ":belfry_speed"),
(try_end),
(try_end),
(try_end),
(gt, "$cur_belfry_pos", 55),
(assign, "$belfry_positioned", 1),
]),
# script_cf_siege_rotate_belfry_platform
# Input: none
# Output: none (required for siege mission templates)
("cf_siege_rotate_belfry_platform",
[(eq, "$belfry_positioned", 1),
(scene_prop_get_instance, ":belfry_object", "spr_belfry_platform_a", 0),
(prop_instance_get_position, pos1, ":belfry_object"),
(position_rotate_x, pos1, -90),
(prop_instance_animate_to_position, ":belfry_object", pos1, 400),
(assign, "$belfry_positioned", 2),
]),
# script_cf_siege_assign_men_to_belfry
# Input: none
# Output: none (required for siege mission templates)
("cf_siege_assign_men_to_belfry",
[
(store_mission_timer_a, ":cur_seconds"),
(neq, "$last_belfry_object_pos", slot_scene_belfry_props_begin),
(assign, ":end_trigger", 0),
(try_begin),
(lt, "$belfry_positioned", 3),
(get_player_agent_no, ":player_agent"),
(store_current_scene, ":cur_scene"),
(scene_get_slot, ":first_belfry_object", ":cur_scene", slot_scene_belfry_props_begin),
(prop_instance_get_position, pos2, ":first_belfry_object"),
(assign, ":slot_1_positioned", 0),
(assign, ":slot_2_positioned", 0),
(assign, ":slot_3_positioned", 0),
(assign, ":slot_4_positioned", 0),
(assign, ":slot_5_positioned", 0),
(assign, ":slot_6_positioned", 0),
(assign, "$belfry_num_slots_positioned", 0),
(assign, "$belfry_num_men_pushing", 0),
(try_for_agents, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(try_begin),
(agent_get_slot, ":x_pos", ":cur_agent", slot_agent_target_x_pos),
(neq, ":x_pos", 0),
(agent_get_slot, ":y_pos", ":cur_agent", slot_agent_target_y_pos),
(try_begin),
(eq, ":x_pos", -600),
(try_begin),
(eq, ":y_pos", 0),
(assign, ":slot_1_positioned", 1),
(else_try),
(eq, ":y_pos", -200),
(assign, ":slot_2_positioned", 1),
(else_try),
(assign, ":slot_3_positioned", 1),
(try_end),
(else_try),
(try_begin),
(eq, ":y_pos", 0),
(assign, ":slot_4_positioned", 1),
(else_try),
(eq, ":y_pos", -200),
(assign, ":slot_5_positioned", 1),
(else_try),
(assign, ":slot_6_positioned", 1),
(try_end),
(try_end),
(val_add, "$belfry_num_slots_positioned", 1),
(init_position, pos1),
(position_move_x, pos1, ":x_pos"),
(position_move_y, pos1, ":y_pos"),
(init_position, pos3),
(position_move_x, pos3, ":x_pos"),
(position_move_y, pos3, -1000),
(position_transform_position_to_parent, pos4, pos2, pos1),
(position_transform_position_to_parent, pos5, pos2, pos3),
(agent_get_position, pos6, ":cur_agent"),
(get_distance_between_positions, ":target_distance", pos6, pos4),
(get_distance_between_positions, ":waypoint_distance", pos6, pos5),
(try_begin),
(this_or_next|lt, ":target_distance", ":waypoint_distance"),
(lt, ":waypoint_distance", 600),
(agent_set_scripted_destination, ":cur_agent", pos4, 1),
(else_try),
(agent_set_scripted_destination, ":cur_agent", pos5, 1),
(try_end),
(try_begin),
(le, ":target_distance", 300),
(val_add, "$belfry_num_men_pushing", 1),
(try_end),
(else_try),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(this_or_next|eq, "$attacker_team", ":cur_agent_team"),
( eq, "$attacker_team_2", ":cur_agent_team"),
(try_begin),
(gt, ":cur_seconds", 20),
(agent_get_position, pos1, ":cur_agent"),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(else_try),
(try_begin),
(team_get_movement_order, ":order1", "$attacker_team", grc_infantry),
(team_get_movement_order, ":order2", "$attacker_team", grc_cavalry),
(team_get_movement_order, ":order3", "$attacker_team", grc_archers),
(this_or_next|neq, ":order1", mordr_stand_ground),
(this_or_next|neq, ":order2", mordr_stand_ground),
(neq, ":order3", mordr_stand_ground),
(set_show_messages, 0),
(team_give_order, "$attacker_team", grc_everyone, mordr_stand_ground),
(set_show_messages, 1),
(try_end),
(try_end),
(try_end),
(try_end),
(try_begin),
(lt, "$belfry_num_slots_positioned", 6),
(try_for_agents, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(this_or_next|eq, "$attacker_team", ":cur_agent_team"),
( eq, "$attacker_team_2", ":cur_agent_team"),
(neq, ":player_agent", ":cur_agent"),
(agent_get_class, ":agent_class", ":cur_agent"),
(this_or_next|eq, ":agent_class", grc_infantry),
(eq, ":agent_class", grc_cavalry),
(agent_get_slot, ":x_pos", ":cur_agent", 1),
(eq, ":x_pos", 0),
(assign, ":y_pos", 0),
(try_begin),
(eq, ":slot_1_positioned", 0),
(assign, ":x_pos", -600),
(assign, ":y_pos", 0),
(val_add, ":slot_1_positioned", 1),
(else_try),
(eq, ":slot_2_positioned", 0),
(assign, ":x_pos", -600),
(assign, ":y_pos", -200),
(val_add, ":slot_2_positioned", 1),
(else_try),
(eq, ":slot_3_positioned", 0),
(assign, ":x_pos", -600),
(assign, ":y_pos", -400),
(val_add, ":slot_3_positioned", 1),
(else_try),
(eq, ":slot_4_positioned", 0),
(assign, ":x_pos", 600),
(assign, ":y_pos", 0),
(val_add, ":slot_4_positioned", 1),
(else_try),
(eq, ":slot_5_positioned", 0),
(assign, ":x_pos", 600),
(assign, ":y_pos", -200),
(val_add, ":slot_5_positioned", 1),
(else_try),
(eq, ":slot_6_positioned", 0),
(assign, ":x_pos", 600),
(assign, ":y_pos", -400),
(val_add, ":slot_6_positioned", 1),
(try_end),
(val_add, "$belfry_num_slots_positioned", 1),
(agent_set_slot, ":cur_agent", 1, ":x_pos"),
(agent_set_slot, ":cur_agent", 2, ":y_pos"),
(try_end),
(try_end),
(try_begin),
(store_mission_timer_a, ":cur_timer"),
(gt, ":cur_timer", 20),
(lt, "$belfry_num_slots_positioned", 6),
(try_for_agents, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(this_or_next|eq, "$attacker_team", ":cur_agent_team"),
( eq, "$attacker_team_2", ":cur_agent_team"),
(neq, ":player_agent", ":cur_agent"),
(agent_get_slot, ":x_pos", ":cur_agent", 1),
(eq, ":x_pos", 0),
(assign, ":y_pos", 0),
(try_begin),
(eq, ":slot_1_positioned", 0),
(assign, ":x_pos", -600),
(assign, ":y_pos", 0),
(val_add, ":slot_1_positioned", 1),
(else_try),
(eq, ":slot_2_positioned", 0),
(assign, ":x_pos", -600),
(assign, ":y_pos", -200),
(val_add, ":slot_2_positioned", 1),
(else_try),
(eq, ":slot_3_positioned", 0),
(assign, ":x_pos", -600),
(assign, ":y_pos", -400),
(val_add, ":slot_3_positioned", 1),
(else_try),
(eq, ":slot_4_positioned", 0),
(assign, ":x_pos", 600),
(assign, ":y_pos", 0),
(val_add, ":slot_4_positioned", 1),
(else_try),
(eq, ":slot_5_positioned", 0),
(assign, ":x_pos", 600),
(assign, ":y_pos", -200),
(val_add, ":slot_5_positioned", 1),
(else_try),
(eq, ":slot_6_positioned", 0),
(assign, ":x_pos", 600),
(assign, ":y_pos", -400),
(val_add, ":slot_6_positioned", 1),
(try_end),
(val_add, "$belfry_num_slots_positioned", 1),
(agent_set_slot, ":cur_agent", 1, ":x_pos"),
(agent_set_slot, ":cur_agent", 2, ":y_pos"),
(try_end),
(try_end),
(else_try),
(assign, ":end_trigger", 1),
(try_for_agents, ":cur_agent"),
(agent_clear_scripted_mode, ":cur_agent"),
(try_end),
(set_show_messages, 0),
(team_give_order, "$attacker_team", grc_everyone, mordr_charge),
(set_show_messages, 1),
(try_end),
(eq, ":end_trigger", 1),
]),
# script_siege_move_archers_to_archer_positions
# Input: none
# Output: none
("siege_move_archers_to_archer_positions",
[
(try_for_agents, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_slot_eq, ":agent_no", slot_agent_is_not_reinforcement, 0),
(agent_is_defender, ":agent_no"),
(agent_get_class, ":agent_class", ":agent_no"),
(agent_get_troop_id, ":agent_troop", ":agent_no"),
(eq, ":agent_class", grc_archers),
(try_begin),
(agent_slot_eq, ":agent_no", slot_agent_target_entry_point, 0),
(store_random_in_range, ":random_entry_point", 40, 44),
(agent_set_slot, ":agent_no", slot_agent_target_entry_point, ":random_entry_point"),
(try_end),
(try_begin),
(agent_get_position, pos0, ":agent_no"),
(entry_point_get_position, pos1, ":random_entry_point"),
(get_distance_between_positions, ":dist", pos0, pos1),
(lt, ":dist", 300),
(agent_clear_scripted_mode, ":agent_no"),
(agent_set_slot, ":agent_no", slot_agent_is_in_scripted_mode, 0),
(agent_set_slot, ":agent_no", slot_agent_is_not_reinforcement, 1),
(str_store_troop_name, s1, ":agent_troop"),
(assign, reg0, ":agent_no"),
# (display_message, "@{s1} ({reg0}) reached pos"),
(else_try),
(agent_get_simple_behavior, ":agent_sb", ":agent_no"),
(agent_get_combat_state, ":agent_cs", ":agent_no"),
(this_or_next|eq, ":agent_sb", aisb_ranged),
(eq, ":agent_sb", aisb_go_to_pos),#scripted mode
(eq, ":agent_cs", 7), # 7 = no visible targets (state for ranged units)
(try_begin),
(agent_slot_eq, ":agent_no", slot_agent_is_in_scripted_mode, 0),
(agent_set_scripted_destination, ":agent_no", pos1, 0),
(agent_set_slot, ":agent_no", slot_agent_is_in_scripted_mode, 1),
(str_store_troop_name, s1, ":agent_troop"),
(assign, reg0, ":agent_no"),
# (display_message, "@{s1} ({reg0}) moving to pos"),
(try_end),
(else_try),
(try_begin),
(agent_slot_eq, ":agent_no", slot_agent_is_in_scripted_mode, 1),
(agent_clear_scripted_mode, ":agent_no"),
(agent_set_slot, ":agent_no", slot_agent_is_in_scripted_mode, 0),
(str_store_troop_name, s1, ":agent_troop"),
(assign, reg0, ":agent_no"),
# (display_message, "@{s1} ({reg0}) seeing target or changed mode"),
(try_end),
(try_end),
(try_end),
]),
# script_store_movement_order_name_to_s1
# Input: arg1 = team_no, arg2 = class_no
# Output: s1 = order_name
("store_movement_order_name_to_s1",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":class_no"),
(team_get_movement_order, ":cur_order", ":team_no", ":class_no"),
(try_begin),
(eq, ":cur_order", mordr_hold),
(str_store_string, s1, "@Holding"),
(else_try),
(eq, ":cur_order", mordr_follow),
(str_store_string, s1, "@Following"),
(else_try),
(eq, ":cur_order", mordr_charge),
(str_store_string, s1, "@Charging"),
(else_try),
(eq, ":cur_order", mordr_advance),
(str_store_string, s1, "@Advancing"),
(else_try),
(eq, ":cur_order", mordr_fall_back),
(str_store_string, s1, "@Falling Back"),
(else_try),
(eq, ":cur_order", mordr_stand_closer),
(str_store_string, s1, "@Standing Closer"),
(else_try),
(eq, ":cur_order", mordr_spread_out),
(str_store_string, s1, "@Spreading Out"),
(else_try),
(eq, ":cur_order", mordr_stand_ground),
(str_store_string, s1, "@Standing"),
(else_try),
(str_store_string, s1, "@N/A"),
(try_end),
]),
# script_store_riding_order_name_to_s1
# Input: arg1 = team_no, arg2 = class_no
# Output: s1 = order_name
("store_riding_order_name_to_s1",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":class_no"),
(team_get_riding_order, ":cur_order", ":team_no", ":class_no"),
(try_begin),
(eq, ":cur_order", rordr_free),
(str_store_string, s1, "@Free"),
(else_try),
(eq, ":cur_order", rordr_mount),
(str_store_string, s1, "@Mount"),
(else_try),
(eq, ":cur_order", rordr_dismount),
(str_store_string, s1, "@Dismount"),
(else_try),
(str_store_string, s1, "@N/A"),
(try_end),
]),
# script_store_weapon_usage_order_name_to_s1
# Input: arg1 = team_no, arg2 = class_no
# Output: s1 = order_name
("store_weapon_usage_order_name_to_s1",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":class_no"),
(team_get_weapon_usage_order, ":cur_order", ":team_no", ":class_no"),
(team_get_hold_fire_order, ":cur_hold_fire", ":team_no", ":class_no"),
(try_begin),
(eq, ":cur_order", wordr_use_any_weapon),
(eq, ":cur_hold_fire", aordr_fire_at_will),
(str_store_string, s1, "@Any Weapon"),
(else_try),
(eq, ":cur_order", wordr_use_blunt_weapons),
(eq, ":cur_hold_fire", aordr_fire_at_will),
(str_store_string, s1, "@Blunt Weapons"),
(else_try),
(eq, ":cur_order", wordr_use_any_weapon),
(eq, ":cur_hold_fire", aordr_hold_your_fire),
(str_store_string, s1, "str_hold_fire"),
(else_try),
(eq, ":cur_order", wordr_use_blunt_weapons),
(eq, ":cur_hold_fire", aordr_hold_your_fire),
(str_store_string, s1, "str_blunt_hold_fire"),
(else_try),
(str_store_string, s1, "@N/A"),
(try_end),
]),
# script_team_give_order_from_order_panel
# Input: arg1 = leader_agent_no, arg2 = class_no
# Output: none
("team_give_order_from_order_panel",
[(store_script_param_1, ":leader_agent_no"),
(store_script_param_2, ":order"),
(agent_get_team, ":team_no", ":leader_agent_no"),
(set_show_messages, 0),
(try_begin),
(eq, "$g_formation_infantry_selected", 1),
(team_give_order, ":team_no", grc_infantry, ":order"),
(try_end),
(try_begin),
(eq, "$g_formation_archers_selected", 1),
(team_give_order, ":team_no", grc_archers, ":order"),
(try_end),
(try_begin),
(eq, "$g_formation_cavalry_selected", 1),
(team_give_order, ":team_no", grc_cavalry, ":order"),
(try_end),
(try_begin),
(eq, ":order", mordr_hold),
(agent_get_position, pos1, ":leader_agent_no"),
(try_begin),
(eq, "$g_formation_infantry_selected", 1),
(team_set_order_position, ":team_no", grc_infantry, pos1),
(try_end),
(try_begin),
(eq, "$g_formation_archers_selected", 1),
(team_set_order_position, ":team_no", grc_archers, pos1),
(try_end),
(try_begin),
(eq, "$g_formation_cavalry_selected", 1),
(team_set_order_position, ":team_no", grc_cavalry, pos1),
(try_end),
(try_end),
(set_show_messages, 1),
]),
# script_update_order_panel
# Input: arg1 = team_no
# Output: none
("update_order_panel",
[(store_script_param_1, ":team_no"),
(set_fixed_point_multiplier, 1000),
(assign, ":old_is_infantry_listening", 0),
(try_begin),
(class_is_listening_order, ":team_no", grc_infantry),
(assign, ":old_is_infantry_listening", 1),
(try_end),
(assign, ":old_is_archers_listening", 0),
(try_begin),
(class_is_listening_order, ":team_no", grc_archers),
(assign, ":old_is_archers_listening", 1),
(try_end),
(assign, ":old_is_cavalry_listening", 0),
(try_begin),
(class_is_listening_order, ":team_no", grc_cavalry),
(assign, ":old_is_cavalry_listening", 1),
(try_end),
(call_script, "script_store_movement_order_name_to_s1", ":team_no", grc_infantry),
(overlay_set_text, "$g_presentation_infantry_movement", s1),
(call_script, "script_store_riding_order_name_to_s1", ":team_no", grc_infantry),
(overlay_set_text, "$g_presentation_infantry_riding", s1),
(call_script, "script_store_weapon_usage_order_name_to_s1", ":team_no", grc_infantry),
(overlay_set_text, "$g_presentation_infantry_weapon_usage", s1),
(call_script, "script_store_movement_order_name_to_s1", ":team_no", grc_archers),
(overlay_set_text, "$g_presentation_archers_movement", s1),
(call_script, "script_store_riding_order_name_to_s1", ":team_no", grc_archers),
(overlay_set_text, "$g_presentation_archers_riding", s1),
(call_script, "script_store_weapon_usage_order_name_to_s1", ":team_no", grc_archers),
(overlay_set_text, "$g_presentation_archers_weapon_usage", s1),
(call_script, "script_store_movement_order_name_to_s1", ":team_no", grc_cavalry),
(overlay_set_text, "$g_presentation_cavalry_movement", s1),
(call_script, "script_store_riding_order_name_to_s1", ":team_no", grc_cavalry),
(overlay_set_text, "$g_presentation_cavalry_riding", s1),
(call_script, "script_store_weapon_usage_order_name_to_s1", ":team_no", grc_cavalry),
(overlay_set_text, "$g_presentation_cavalry_weapon_usage", s1),
(try_begin),
(eq, ":old_is_infantry_listening", 1),
(eq, ":old_is_archers_listening", 1),
(eq, ":old_is_cavalry_listening", 1),
(team_set_order_listener, ":team_no", grc_everyone),
(else_try),
(eq, ":old_is_infantry_listening", 1),
(team_set_order_listener, ":team_no", grc_infantry),
(else_try),
(eq, ":old_is_archers_listening", 1),
(team_set_order_listener, ":team_no", grc_archers),
(else_try),
(eq, ":old_is_cavalry_listening", 1),
(team_set_order_listener, ":team_no", grc_cavalry),
(try_end),
(position_set_y, pos1, 660),
(position_set_x, pos1, 250),
(overlay_set_position, "$g_presentation_infantry_movement", pos1),
(position_set_x, pos1, 400),
(overlay_set_position, "$g_presentation_infantry_riding", pos1),
(position_set_x, pos1, 550),
(overlay_set_position, "$g_presentation_infantry_weapon_usage", pos1),
(position_set_y, pos1, 620),
(position_set_x, pos1, 250),
(overlay_set_position, "$g_presentation_archers_movement", pos1),
(position_set_x, pos1, 400),
(overlay_set_position, "$g_presentation_archers_riding", pos1),
(position_set_x, pos1, 550),
(overlay_set_position, "$g_presentation_archers_weapon_usage", pos1),
(position_set_y, pos1, 580),
(position_set_x, pos1, 250),
(overlay_set_position, "$g_presentation_cavalry_movement", pos1),
(position_set_x, pos1, 400),
(overlay_set_position, "$g_presentation_cavalry_riding", pos1),
(position_set_x, pos1, 550),
(overlay_set_position, "$g_presentation_cavalry_weapon_usage", pos1),
]),
# script_update_agent_position_on_map
# Input: arg1 = agent_no, pos2 = map_size_pos
# Output: none
("update_agent_position_on_map",
[(store_script_param_1, ":agent_no"),
(agent_get_slot, ":agent_overlay", ":agent_no", slot_agent_map_overlay_id),
(get_player_agent_no, ":player_agent"),
(try_begin),
(le, ":agent_overlay", 0),
(set_fixed_point_multiplier, 1000),
(try_begin),
(eq, ":agent_no", ":player_agent"),
(create_mesh_overlay, reg1, "mesh_player_dot"),
(position_set_x, pos1, 500),
(position_set_y, pos1, 500),
(overlay_set_size, reg1, pos1),
(else_try),
(create_mesh_overlay, reg1, "mesh_white_dot"),
(position_set_x, pos1, 200),
(position_set_y, pos1, 200),
(overlay_set_size, reg1, pos1),
(try_end),
(overlay_set_alpha, reg1, 0x88),
(agent_set_slot, ":agent_no", slot_agent_map_overlay_id, reg1),
(assign, ":agent_overlay", reg1),
(try_end),
(try_begin),
(neq, ":agent_no", ":player_agent"),
(agent_get_party_id, ":agent_party", ":agent_no"),
###############################
# Changed by Form Ranks kit
#
(try_begin),
(assign, ":continue", 0),
(try_for_range, ":i", 1, "$formation_max_array_no"),
(store_add, ":slot", slot_party_array_parties_begin, ":i"),
(party_get_slot, ":array_party", "p_main_party", ":slot"),
(eq, ":array_party", ":agent_party"),
(assign, ":continue", 1),
(try_end),
(this_or_next|eq, ":agent_party", "p_main_party"),
(eq, ":continue", 1),
#
# Change of Form Ranks kit end
###############################
(agent_get_class, ":agent_class", ":agent_no"),
(try_begin),
(eq, ":agent_class", grc_archers),
(overlay_set_color, ":agent_overlay", 0x34c6e4),
(else_try),
(eq, ":agent_class", grc_cavalry),
(overlay_set_color, ":agent_overlay", 0x569619),
(else_try),
#grc_infantry
(overlay_set_color, ":agent_overlay", 0x8d5220),
(try_end),
(else_try),
(agent_is_ally, ":agent_no"),
(overlay_set_color, ":agent_overlay", 0x5555FF),
(else_try),
(overlay_set_color, ":agent_overlay", 0xFF0000),
(try_end),
(try_end),
(try_begin),
(eq, ":agent_no", ":player_agent"),
(agent_get_look_position, pos1, ":agent_no"),
(position_get_rotation_around_z, ":rot", pos1),
(init_position, pos10),
(position_rotate_z, pos10, ":rot"),
(overlay_set_mesh_rotation, ":agent_overlay", pos10),
(call_script, "script_convert_3d_pos_to_map_pos"),
(else_try),
(agent_get_position, pos1, ":agent_no"),
(call_script, "script_convert_3d_pos_to_map_pos"),
(try_end),
(overlay_set_position, ":agent_overlay", pos0),
]),
# script_convert_3d_pos_to_map_pos
# Input: pos1 = 3d_pos, pos2 = map_size_pos
# Output: pos0 = map_pos
("convert_3d_pos_to_map_pos",
[(set_fixed_point_multiplier, 1000),
(position_transform_position_to_local, pos3, pos2, pos1),
(position_get_x, ":agent_x_pos", pos3),
(position_get_y, ":agent_y_pos", pos3),
(val_div, ":agent_x_pos", "$g_battle_map_scale"),
(val_div, ":agent_y_pos", "$g_battle_map_scale"),
(set_fixed_point_multiplier, 1000),
(store_sub, ":map_x", 980, "$g_battle_map_width"),
(store_sub, ":map_y", 730, "$g_battle_map_height"),
(val_add, ":agent_x_pos", ":map_x"),
(val_add, ":agent_y_pos", ":map_y"),
(position_set_x, pos0, ":agent_x_pos"),
(position_set_y, pos0, ":agent_y_pos"),
]),
# further follow-up needed...
# script_update_order_flags_on_map
# Input: none
# Output: none
("update_order_flags_on_map",
[(set_fixed_point_multiplier, 1000),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(assign, ":old_is_infantry_listening", 0),
(try_begin),
(class_is_listening_order, ":player_team", grc_infantry),
(assign, ":old_is_infantry_listening", 1),
(try_end),
(assign, ":old_is_archers_listening", 0),
(try_begin),
(class_is_listening_order, ":player_team", grc_archers),
(assign, ":old_is_archers_listening", 1),
(try_end),
(assign, ":old_is_cavalry_listening", 0),
(try_begin),
(class_is_listening_order, ":player_team", grc_cavalry),
(assign, ":old_is_cavalry_listening", 1),
(try_end),
(get_scene_boundaries, pos2, pos3),
(team_get_movement_order, ":cur_order", ":player_team", grc_infantry),
(try_begin),
(eq, ":cur_order", mordr_hold),
(team_get_order_position, pos1, ":player_team", grc_infantry),
(call_script, "script_convert_3d_pos_to_map_pos"),
(overlay_set_alpha, "$g_battle_map_infantry_order_flag", 0xFF),
(overlay_set_position, "$g_battle_map_infantry_order_flag", pos0),
(else_try),
(overlay_set_alpha, "$g_battle_map_infantry_order_flag", 0),
(try_end),
(team_get_movement_order, ":cur_order", ":player_team", grc_archers),
(try_begin),
(eq, ":cur_order", mordr_hold),
(team_get_order_position, pos1, ":player_team", grc_archers),
(call_script, "script_convert_3d_pos_to_map_pos"),
(overlay_set_alpha, "$g_battle_map_archers_order_flag", 0xFF),
(overlay_set_position, "$g_battle_map_archers_order_flag", pos0),
(else_try),
(overlay_set_alpha, "$g_battle_map_archers_order_flag", 0),
(try_end),
(team_get_movement_order, ":cur_order", ":player_team", grc_cavalry),
(try_begin),
(eq, ":cur_order", mordr_hold),
(team_get_order_position, pos1, ":player_team", grc_cavalry),
(call_script, "script_convert_3d_pos_to_map_pos"),
(overlay_set_alpha, "$g_battle_map_cavalry_order_flag", 0xFF),
(overlay_set_position, "$g_battle_map_cavalry_order_flag", pos0),
(else_try),
(overlay_set_alpha, "$g_battle_map_cavalry_order_flag", 0),
(try_end),
(try_begin),
(eq, ":old_is_infantry_listening", 1),
(eq, ":old_is_archers_listening", 1),
(eq, ":old_is_cavalry_listening", 1),
(team_set_order_listener, ":player_team", grc_everyone),
(else_try),
(eq, ":old_is_infantry_listening", 1),
(team_set_order_listener, ":player_team", grc_infantry),
(else_try),
(eq, ":old_is_archers_listening", 1),
(team_set_order_listener, ":player_team", grc_archers),
(else_try),
(eq, ":old_is_cavalry_listening", 1),
(team_set_order_listener, ":player_team", grc_cavalry),
(try_end),
]),
# script_update_order_panel_checked_classes
# Input: none
# Output: none
("update_order_panel_checked_classes",
[(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(try_begin),
(class_is_listening_order, ":player_team", grc_infantry),
(overlay_set_val, "$g_presentation_obj_4", 1),
(assign, "$g_formation_infantry_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_1", 250, 0x44),
(else_try),
(overlay_set_val, "$g_presentation_obj_4", 0),
(assign, "$g_formation_infantry_selected", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_1", 250, 0),
(try_end),
(try_begin),
(class_is_listening_order, ":player_team", grc_archers),
(overlay_set_val, "$g_presentation_obj_5", 1),
(assign, "$g_formation_archers_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_2", 250, 0x44),
(else_try),
(overlay_set_val, "$g_presentation_obj_5", 0),
(assign, "$g_formation_archers_selected", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_2", 250, 0),
(try_end),
(try_begin),
(class_is_listening_order, ":player_team", grc_cavalry),
(overlay_set_val, "$g_presentation_obj_6", 1),
(assign, "$g_formation_cavalry_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_3", 250, 0x44),
(else_try),
(overlay_set_val, "$g_presentation_obj_6", 0),
(assign, "$g_formation_cavalry_selected", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_3", 250, 0),
(try_end),
]),
# script_update_order_panel_statistics_and_map
# Input: none
# Output: none
("update_order_panel_statistics_and_map", #TODO: Call this in every battle mission template, once per second
[(set_fixed_point_multiplier, 1000),
(assign, ":num_us_ready_infantry", 0),
(assign, ":num_us_ready_archers", 0),
(assign, ":num_us_ready_cavalry", 0),
(assign, ":num_us_wounded_infantry", 0),
(assign, ":num_us_wounded_archers", 0),
(assign, ":num_us_wounded_cavalry", 0),
(assign, ":num_us_dead_infantry", 0),
(assign, ":num_us_dead_archers", 0),
(assign, ":num_us_dead_cavalry", 0),
(assign, ":num_allies_ready_men", 0),
(assign, ":num_allies_wounded_men", 0),
(assign, ":num_allies_dead_men", 0),
(assign, ":num_enemies_ready_men", 0),
(assign, ":num_enemies_wounded_men", 0),
(assign, ":num_enemies_dead_men", 0),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(assign, ":old_is_infantry_listening", 0),
(try_begin),
(class_is_listening_order, ":player_team", grc_infantry),
(assign, ":old_is_infantry_listening", 1),
(try_end),
(assign, ":old_is_archers_listening", 0),
(try_begin),
(class_is_listening_order, ":player_team", grc_archers),
(assign, ":old_is_archers_listening", 1),
(try_end),
(assign, ":old_is_cavalry_listening", 0),
(try_begin),
(class_is_listening_order, ":player_team", grc_cavalry),
(assign, ":old_is_cavalry_listening", 1),
(try_end),
(get_scene_boundaries, pos2, pos3),
(try_for_agents,":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_get_class, ":agent_class", ":cur_agent"),
(agent_get_party_id, ":agent_party", ":cur_agent"),
(agent_get_slot, ":agent_overlay", ":cur_agent", slot_agent_map_overlay_id),
(try_begin),
(eq, ":agent_party", "p_main_party"),
(try_begin),
(agent_is_alive, ":cur_agent"),
(call_script, "script_update_agent_position_on_map", ":cur_agent"),
(try_begin),
(eq, ":agent_class", grc_archers),
(val_add, ":num_us_ready_archers", 1),
(else_try),
(eq, ":agent_class", grc_cavalry),
(val_add, ":num_us_ready_cavalry", 1),
(else_try),
#infantry
(val_add, ":num_us_ready_infantry", 1),
(try_end),
(else_try),
(overlay_set_alpha, ":agent_overlay", 0),
(agent_is_wounded, ":cur_agent"),
(try_begin),
(eq, ":agent_class", grc_archers),
(val_add, ":num_us_wounded_archers", 1),
(else_try),
(eq, ":agent_class", grc_cavalry),
(val_add, ":num_us_wounded_cavalry", 1),
(else_try),
#infantry
(val_add, ":num_us_wounded_infantry", 1),
(try_end),
(else_try),
(try_begin),
(eq, ":agent_class", grc_archers),
(val_add, ":num_us_dead_archers", 1),
(else_try),
(eq, ":agent_class", grc_cavalry),
(val_add, ":num_us_dead_cavalry", 1),
(else_try),
#infantry
(val_add, ":num_us_dead_infantry", 1),
(try_end),
(try_end),
(else_try),
(agent_is_ally, ":cur_agent"),
(try_begin),
(agent_is_alive, ":cur_agent"),
(call_script, "script_update_agent_position_on_map", ":cur_agent"),
(val_add, ":num_allies_ready_men", 1),
(else_try),
(overlay_set_alpha, ":agent_overlay", 0),
(agent_is_wounded, ":cur_agent"),
(val_add, ":num_allies_wounded_men", 1),
(else_try),
(val_add, ":num_allies_dead_men", 1),
(try_end),
(else_try),
(try_begin),
(agent_is_alive, ":cur_agent"),
(call_script, "script_update_agent_position_on_map", ":cur_agent"),
(val_add, ":num_enemies_ready_men", 1),
(else_try),
(overlay_set_alpha, ":agent_overlay", 0),
(agent_is_wounded, ":cur_agent"),
(val_add, ":num_enemies_wounded_men", 1),
(else_try),
(val_add, ":num_enemies_dead_men", 1),
(try_end),
(try_end),
(try_end),
(assign, reg1, ":num_us_ready_infantry"),
(assign, reg2, ":num_us_ready_archers"),
(assign, reg3, ":num_us_ready_cavalry"),
(store_add, ":num_us_ready_men", ":num_us_ready_infantry", ":num_us_ready_archers"),
(val_add, ":num_us_ready_men", ":num_us_ready_cavalry"),
(store_add, ":num_us_wounded_men", ":num_us_wounded_infantry", ":num_us_wounded_archers"),
(val_add, ":num_us_wounded_men", ":num_us_wounded_cavalry"),
(store_add, ":num_us_dead_men", ":num_us_dead_infantry", ":num_us_dead_archers"),
(val_add, ":num_us_dead_men", ":num_us_dead_cavalry"),
(assign, reg4, ":num_us_ready_men"),
(assign, reg5, ":num_us_wounded_men"),
(assign, reg6, ":num_us_dead_men"),
(assign, reg7, ":num_allies_ready_men"),
(assign, reg8, ":num_allies_wounded_men"),
(assign, reg9, ":num_allies_dead_men"),
(assign, reg10, ":num_enemies_ready_men"),
(assign, reg11, ":num_enemies_wounded_men"),
(assign, reg12, ":num_enemies_dead_men"),
(overlay_set_text, "$g_presentation_obj_7", "@Infantry ({reg1})"),
(overlay_set_text, "$g_presentation_obj_8", "@Archers ({reg2})"),
(overlay_set_text, "$g_presentation_obj_9", "@Cavalry ({reg3})"),
(overlay_set_text, "$g_battle_us_ready", "@{reg4}"),
(overlay_set_text, "$g_battle_us_wounded", "@{reg5}"),
(overlay_set_text, "$g_battle_us_dead", "@{reg6}"),
(overlay_set_text, "$g_battle_allies_ready", "@{reg7}"),
(overlay_set_text, "$g_battle_allies_wounded", "@{reg8}"),
(overlay_set_text, "$g_battle_allies_dead", "@{reg9}"),
(overlay_set_text, "$g_battle_enemies_ready", "@{reg10}"),
(overlay_set_text, "$g_battle_enemies_wounded", "@{reg11}"),
(overlay_set_text, "$g_battle_enemies_dead", "@{reg12}"),
(assign, ":stat_position_x", 100),
(assign, ":stat_position_y", 100),
(val_add, ":stat_position_x", 150),
(val_add, ":stat_position_y", 80),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_battle_us_ready", pos1),
(val_add, ":stat_position_x", 150),
(position_set_x, pos1, ":stat_position_x"),
(overlay_set_position, "$g_battle_us_wounded", pos1),
(val_add, ":stat_position_x", 150),
(position_set_x, pos1, ":stat_position_x"),
(overlay_set_position, "$g_battle_us_dead", pos1),
(val_add, ":stat_position_x", -300),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_battle_allies_ready", pos1),
(val_add, ":stat_position_x", 150),
(position_set_x, pos1, ":stat_position_x"),
(overlay_set_position, "$g_battle_allies_wounded", pos1),
(val_add, ":stat_position_x", 150),
(position_set_x, pos1, ":stat_position_x"),
(overlay_set_position, "$g_battle_allies_dead", pos1),
(val_add, ":stat_position_x", -300),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_battle_enemies_ready", pos1),
(val_add, ":stat_position_x", 150),
(position_set_x, pos1, ":stat_position_x"),
(overlay_set_position, "$g_battle_enemies_wounded", pos1),
(val_add, ":stat_position_x", 150),
(position_set_x, pos1, ":stat_position_x"),
(overlay_set_position, "$g_battle_enemies_dead", pos1),
(call_script, "script_update_order_flags_on_map"),
(try_begin),
(eq, ":old_is_infantry_listening", 1),
(eq, ":old_is_archers_listening", 1),
(eq, ":old_is_cavalry_listening", 1),
(team_set_order_listener, ":player_team", grc_everyone),
(else_try),
(eq, ":old_is_infantry_listening", 1),
(team_set_order_listener, ":player_team", grc_infantry),
(else_try),
(eq, ":old_is_archers_listening", 1),
(team_set_order_listener, ":player_team", grc_archers),
(else_try),
(eq, ":old_is_cavalry_listening", 1),
(team_set_order_listener, ":player_team", grc_cavalry),
(try_end),
]),
# script_consume_food
# Input: arg1: order of the food to be consumed
# Output: none
("consume_food",
[(store_script_param, ":selected_food", 1),
(troop_get_inventory_capacity, ":capacity", "trp_player"),
(try_for_range, ":cur_slot", 0, ":capacity"),
(troop_get_inventory_slot, ":cur_item", "trp_player", ":cur_slot"),
(is_between, ":cur_item", food_begin, food_end),
(troop_get_inventory_slot_modifier, ":item_modifier", "trp_player", ":cur_slot"),
(neq, ":item_modifier", imod_rotten),
(item_slot_eq, ":cur_item", slot_item_is_checked, 0),
(item_set_slot, ":cur_item", slot_item_is_checked, 1),
(val_sub, ":selected_food", 1),
(lt, ":selected_food", 0),
(assign, ":capacity", 0),
(troop_inventory_slot_get_item_amount, ":cur_amount", "trp_player", ":cur_slot"),
(val_sub, ":cur_amount", 1),
(troop_inventory_slot_set_item_amount, "trp_player", ":cur_slot", ":cur_amount"),
(try_end),
]),
# script_calculate_troop_score_for_center
# Input: arg1 = troop_no, arg2 = center_no
# Output: reg0 = score
("calculate_troop_score_for_center",
[(store_script_param, ":troop_no", 1),
(store_script_param, ":center_no", 2),
(assign, ":num_center_points", 1),
(try_for_range, ":cur_center", centers_begin, centers_end),
(assign, ":center_owned", 0),
(try_begin),
(eq, ":troop_no", "trp_player"),
(party_slot_eq, ":cur_center", slot_town_lord, stl_reserved_for_player),
(assign, ":center_owned", 1),
(try_end),
(this_or_next|party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"),
(eq, ":center_owned", 1),
(try_begin),
(party_slot_eq, ":cur_center", slot_party_type, spt_town),
(val_add, ":num_center_points", 4),
(else_try),
(party_slot_eq, ":cur_center", slot_party_type, spt_castle),
(val_add, ":num_center_points", 2),
(else_try),
(val_add, ":num_center_points", 1),
(try_end),
(try_end),
(troop_get_slot, ":troop_renown", ":troop_no", slot_troop_renown),
(store_add, ":score", 500, ":troop_renown"),
(val_div, ":score", ":num_center_points"),
(store_random_in_range, ":random", 50, 100),
(val_mul, ":score", ":random"),
(try_begin),
(party_slot_eq, ":center_no", slot_center_last_taken_by_troop, ":troop_no"),
(val_mul, ":score", 3),
(val_div, ":score", 2),
(try_end),
(try_begin),
(eq, ":troop_no", "trp_player"),
(faction_get_slot, ":faction_leader", "$players_kingdom"),
(call_script, "script_troop_get_player_relation", ":faction_leader"),
(assign, ":leader_relation", reg0),
#(troop_get_slot, ":leader_relation", ":faction_leader", slot_troop_player_relation),
(val_mul, ":leader_relation", 2),
(val_add, ":score", ":leader_relation"),
(try_end),
(assign, reg0, ":score"),
]),
# script_assign_lords_to_empty_centers
# Input: none
# Output: none
("assign_lords_to_empty_centers",
[(try_for_range, ":cur_center", centers_begin, centers_end),
(party_get_slot, ":center_lord", ":cur_center", slot_town_lord),
(this_or_next|eq, ":center_lord", stl_unassigned),
(eq, ":center_lord", stl_rejected_by_player),
(store_faction_of_party, ":center_faction", ":cur_center"),
(is_between, ":center_faction", kingdoms_begin, kingdoms_end),
(neg|faction_slot_eq, ":center_faction", slot_faction_leader, "trp_player"),
(assign, ":best_lord", -1),
(assign, ":best_lord_score", -1),
(try_begin),
(eq, ":center_lord", stl_unassigned),
(try_begin),
(eq, "$players_kingdom", ":center_faction"),
(eq, "$player_has_homage", 1),
(assign, ":best_lord", stl_reserved_for_player),
(call_script, "script_calculate_troop_score_for_center", "trp_player", ":cur_center"),
(assign, ":best_lord_score", reg0),
(try_end),
(try_end),
(try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":troop_faction", ":cur_troop"),
(eq, ":troop_faction", ":center_faction"),
(call_script, "script_calculate_troop_score_for_center", ":cur_troop", ":cur_center"),
(assign, ":score", reg0),
(gt, ":score", ":best_lord_score"),
(assign, ":best_lord_score", ":score"),
(assign, ":best_lord", ":cur_troop"),
(try_end),
(try_begin),
(ge, ":best_lord", 0),
(call_script, "script_give_center_to_lord", ":cur_center", ":best_lord", 1),
(else_try),
(eq, ":best_lord", stl_reserved_for_player),
(party_set_slot, ":cur_center", slot_town_lord, stl_reserved_for_player),
(try_begin),
(party_slot_eq, ":cur_center", slot_party_type, spt_castle),
(try_for_range, ":cur_village", villages_begin, villages_end),
(party_slot_eq, ":cur_village", slot_village_bound_center, ":cur_center"),
(party_set_slot, ":cur_village", slot_town_lord, stl_reserved_for_player),
(try_end),
(try_end),
(try_end),
(try_end),
]),
# script_create_village_farmer_party
# Input: arg1 = village_no
# Output: reg0 = party_no
("create_village_farmer_party",
[(store_script_param, ":village_no", 1),
(party_get_slot, ":town_no", ":village_no", slot_village_market_town),
(store_faction_of_party, ":party_faction", ":town_no"),
(set_spawn_radius, 0),
(spawn_around_party, ":village_no", "pt_village_farmers"),
(assign, ":new_party", reg0),
(party_set_faction, ":new_party", ":party_faction"),
(party_set_slot, ":new_party", slot_party_home_center, ":village_no"),
(party_set_slot, ":new_party", slot_party_type, spt_village_farmer),
(party_set_slot, ":new_party", slot_party_ai_state, spai_trading_with_town),
(party_set_slot, ":new_party", slot_party_ai_object, ":town_no"),
(party_set_ai_behavior, ":new_party", ai_bhvr_travel_to_party),
(party_set_ai_object, ":new_party", ":town_no"),
(party_set_flags, ":new_party", pf_default_behavior, 0),
(store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
(try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
(store_add, ":cur_good_price_slot", ":cur_goods", ":item_to_price_slot"),
(party_get_slot, ":cur_village_price", ":village_no", ":cur_good_price_slot"),
(party_set_slot, ":new_party", ":cur_good_price_slot", ":cur_village_price"),
(try_end),
(assign, reg0, ":new_party"),
]),
#script_do_party_center_trade
# INPUT: arg1 = party_no, arg2 = center_no, arg3 = percentage_change_in_center
# OUTPUT: reg0 = total_change
("do_party_center_trade",
[
(store_script_param, ":party_no", 1),
(store_script_param, ":center_no", 2),
(store_script_param, ":percentage_change", 3),
(assign, ":total_change", 0),
(store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
(try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
(store_add, ":cur_good_price_slot", ":cur_good", ":item_to_price_slot"),
(party_get_slot, ":cur_merchant_price", ":party_no", ":cur_good_price_slot"),
(party_get_slot, ":cur_center_price", ":center_no", ":cur_good_price_slot"),
(store_sub, ":price_dif", ":cur_merchant_price", ":cur_center_price"),
(assign, ":cur_change", ":price_dif"),
(val_abs, ":cur_change"),
(val_add, ":total_change", ":cur_change"),
(val_mul, ":cur_change", ":percentage_change"),
(val_div, ":cur_change", 100),
(try_begin),
(lt, ":price_dif", 0),
(val_mul, ":cur_change", -1),
(try_end),
(val_add, ":cur_center_price", ":cur_change"),
(party_set_slot, ":center_no", ":cur_good_price_slot", ":cur_center_price"),
(party_set_slot, ":party_no", ":cur_good_price_slot", ":cur_center_price"),
(try_end),
(assign, reg0, ":total_change"),
]),
#script_player_join_faction
# INPUT: arg1 = faction_no
# OUTPUT: none
("player_join_faction",
[
(store_script_param, ":faction_no", 1),
(assign,"$players_kingdom",":faction_no"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_ai_state, sfai_default),
## (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"),
## (call_script, "script_change_troop_faction", ":kingdom_hero", ":faction_no"),
## (try_end),
(assign, "$players_oath_renounced_against_kingdom", 0),
(assign, "$players_oath_renounced_given_center", 0),
(assign, "$players_oath_renounced_begin_time", 0),
(try_for_range,":other_kingdom",kingdoms_begin,kingdoms_end),
(faction_slot_eq, ":other_kingdom", slot_faction_state, sfs_active),
(neq, ":other_kingdom", "fac_player_supporters_faction"),
(try_begin),
(neq, ":other_kingdom", ":faction_no"),
(store_relation, ":other_kingdom_reln", ":other_kingdom", ":faction_no"),
(else_try),
(store_relation, ":other_kingdom_reln", "fac_player_supporters_faction", ":other_kingdom"),
(val_max, ":other_kingdom_reln", 12),
(try_end),
(call_script, "script_set_player_relation_with_faction", ":other_kingdom", ":other_kingdom_reln"),
(try_end),
(try_for_range, ":cur_center", centers_begin, centers_end),
#Give center to kingdom if player is the owner
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(party_set_faction, ":cur_center", ":faction_no"),
(try_end),
(try_for_range, ":quest_no", lord_quests_begin, lord_quests_end),
(check_quest_active, ":quest_no"),
(quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
(store_troop_faction, ":quest_giver_faction", ":quest_giver_troop"),
(store_relation, ":quest_giver_faction_relation", "fac_player_supporters_faction", ":quest_giver_faction"),
(lt, ":quest_giver_faction_relation", 0),
(call_script, "script_abort_quest", ":quest_no", 0),
(try_end),
(try_begin),
(neq, ":faction_no", "fac_player_supporters_faction"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(try_end),
(call_script, "script_store_average_center_value_per_faction"),
(call_script, "script_update_all_notes"),
(assign, "$g_recalculate_ais", 1),
]),
#script_player_leave_faction
# INPUT: arg1 = give_back_fiefs
# OUTPUT: none
("player_leave_faction",
[
(store_script_param, ":give_back_fiefs", 1),
(call_script, "script_check_and_finish_active_army_quests_for_faction", "$players_kingdom"),
(assign, ":old_kingdom", "$players_kingdom"),
(assign, ":old_has_homage", "$player_has_homage"),
(assign, "$players_kingdom", 0),
(assign, "$player_has_homage", 0),
(try_begin),
(neq, ":give_back_fiefs", 0),
(try_for_range, ":cur_center", centers_begin, centers_end),
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(call_script, "script_give_center_to_faction", ":cur_center", ":old_kingdom"),
(try_end),
(else_try),
(try_for_range, ":cur_center", centers_begin, centers_end),
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(call_script, "script_give_center_to_faction", ":cur_center", "fac_player_supporters_faction"),
(try_end),
(try_for_range, ":cur_center", villages_begin, villages_end),
(party_get_slot, ":cur_bound_center", ":cur_center", slot_village_bound_center),
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(neg|party_slot_eq, ":cur_bound_center", slot_town_lord, "trp_player"),
(call_script, "script_give_center_to_faction", ":cur_center", ":old_kingdom"),
(try_end),
(store_relation, ":reln", "fac_player_supporters_faction", ":old_kingdom"),
(store_sub, ":req_dif", -40, ":reln"),
(call_script, "script_change_player_relation_with_faction", ":old_kingdom", ":req_dif"),
(try_end),
(try_begin),
(eq, ":old_has_homage", 1),
(faction_get_slot, ":faction_leader", ":old_kingdom", slot_faction_leader),
(call_script, "script_change_player_relation_with_troop", ":faction_leader", -20),
(try_end),
(call_script, "script_update_all_notes"),
(assign, "$g_recalculate_ais", 1),
]),
#script_activate_deactivate_player_faction
# INPUT: arg1 = last_interaction_with_faction
# OUTPUT: none
("activate_deactivate_player_faction",
[
(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", "@{s1} Rebels"),
(faction_set_color, "fac_player_supporters_faction", 0xAAAAAA),
(assign, "$players_kingdom", "fac_player_supporters_faction"),
(assign, "$g_player_banner_granted", 1),
(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),
(try_end),
]),
#script_agent_reassign_team
# INPUT: arg1 = agent_no
# OUTPUT: none
("agent_reassign_team",
[
(store_script_param, ":agent_no", 1),
(get_player_agent_no, ":player_agent"),
(try_begin),
(ge, ":player_agent", 0),
(agent_is_human, ":agent_no"),
(agent_is_ally, ":agent_no"),
(agent_get_party_id, ":party_no", ":agent_no"),
(neq, ":party_no", "p_main_party"),
(assign, ":continue", 1),
(store_faction_of_party, ":party_faction", ":party_no"),
(try_begin),
(eq, ":party_faction", "$players_kingdom"),
(is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
(assign, ":continue", 0),
(else_try),
(party_stack_get_troop_id, ":leader_troop_id", ":party_no", 0),
(neg|is_between, ":leader_troop_id", kingdom_heroes_begin, kingdom_heroes_end),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(agent_get_team, ":player_team", ":player_agent"),
(val_add, ":player_team", 2),
(agent_set_team, ":agent_no", ":player_team"),
(try_end),
]),
#script_start_quest
# INPUT: arg1 = quest_no, arg2 = giver_troop_no, s2 = description_text
# OUTPUT: none
("start_quest",
[(store_script_param, ":quest_no", 1),
(store_script_param, ":giver_troop_no", 2),
(try_begin),
(is_between, ":giver_troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(str_store_troop_name_link, s62, ":giver_troop_no"),
(else_try),
(str_store_troop_name, s62, ":giver_troop_no"),
(try_end),
(str_store_string, s63, "@Given by: {s62}"),
(store_current_hours, ":cur_hours"),
(str_store_date, s60, ":cur_hours"),
(str_store_string, s60, "@Given on: {s60}"),
(add_quest_note_from_sreg, ":quest_no", 0, s60, 0),
(add_quest_note_from_sreg, ":quest_no", 1, s63, 0),
(add_quest_note_from_sreg, ":quest_no", 2, s2, 0),
(try_begin),
(quest_slot_ge, ":quest_no", slot_quest_expiration_days, 1),
(quest_get_slot, reg0, ":quest_no", slot_quest_expiration_days),
(add_quest_note_from_sreg, ":quest_no", 7, "@You have {reg0} days to finish this quest.", 0),
(try_end),
#Adding dont_give_again_for_days value
(try_begin),
(quest_slot_ge, ":quest_no", slot_quest_dont_give_again_period, 1),
(quest_get_slot, ":dont_give_again_period", ":quest_no", slot_quest_dont_give_again_period),
(quest_set_slot, ":quest_no", slot_quest_dont_give_again_remaining_days, ":dont_give_again_period"),
(try_end),
(start_quest, ":quest_no", ":giver_troop_no"),
(display_message, "str_quest_log_updated"),
]),
#script_conclude_quest
# INPUT: arg1 = quest_no
# OUTPUT: none
("conclude_quest",
[(store_script_param, ":quest_no", 1),
(conclude_quest, ":quest_no"),
(quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
(str_store_troop_name, s59, ":quest_giver_troop"),
(add_quest_note_from_sreg, ":quest_no", 7, "@This quest has been concluded. Talk to {s59} to finish it.", 0),
]),
#script_succeed_quest
# INPUT: arg1 = quest_no
# OUTPUT: none
("succeed_quest",
[(store_script_param, ":quest_no", 1),
(succeed_quest, ":quest_no"),
(quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
(str_store_troop_name, s59, ":quest_giver_troop"),
(add_quest_note_from_sreg, ":quest_no", 7, "@This quest has been successfully completed. Talk to {s59} to claim your reward.", 0),
]),
#script_fail_quest
# INPUT: arg1 = quest_no
# OUTPUT: none
("fail_quest",
[(store_script_param, ":quest_no", 1),
(fail_quest, ":quest_no"),
(quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop),
(str_store_troop_name, s59, ":quest_giver_troop"),
(add_quest_note_from_sreg, ":quest_no", 7, "@This quest has failed. Talk to {s59} to explain the situation.", 0),
]),
#script_report_quest_troop_positions
# INPUT: arg1 = quest_no, arg2 = troop_no, arg3 = note_index
# OUTPUT: none
("report_quest_troop_positions",
[(store_script_param, ":quest_no", 1),
(store_script_param, ":troop_no", 2),
(store_script_param, ":note_index", 3),
(call_script, "script_get_information_about_troops_position", ":troop_no", 1),
(str_store_string, s5, "@At the time quest was given:^{s1}"),
(add_quest_note_from_sreg, ":quest_no", ":note_index", s5, 1),
(call_script, "script_update_troop_location_notes", ":troop_no", 1),
]),
#script_end_quest
# INPUT: arg1 = quest_no
# OUTPUT: none
("end_quest",
[(store_script_param, ":quest_no", 1),
(str_clear, s1),
(add_quest_note_from_sreg, ":quest_no", 0, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 1, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 2, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 3, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 4, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 5, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 6, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 7, s1, 0),
(try_begin),
(neg|check_quest_failed, ":quest_no"),
(val_add, "$g_total_quests_completed", 1),
(try_end),
(complete_quest, ":quest_no"),
(try_begin),
(is_between, ":quest_no", mayor_quests_begin, mayor_quests_end),
(assign, "$merchant_quest_last_offerer", -1),
(assign, "$merchant_offered_quest", -1),
(try_end),
]),
#script_cancel_quest
# INPUT: arg1 = quest_no
# OUTPUT: none
("cancel_quest",
[(store_script_param, ":quest_no", 1),
(str_clear, s1),
(add_quest_note_from_sreg, ":quest_no", 0, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 1, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 2, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 3, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 4, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 5, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 6, s1, 0),
(add_quest_note_from_sreg, ":quest_no", 7, s1, 0),
(cancel_quest, ":quest_no"),
(try_begin),
(is_between, ":quest_no", mayor_quests_begin, mayor_quests_end),
(assign, "$merchant_quest_last_offerer", -1),
(assign, "$merchant_offered_quest", -1),
(try_end),
]),
## #script_get_available_mercenary_troop_and_amount_of_center
## # INPUT: arg1 = center_no
## # OUTPUT: reg0 = mercenary_troop_type, reg1 = amount
## ("get_available_mercenary_troop_and_amount_of_center",
## [(store_script_param, ":center_no", 1),
## (party_get_slot, ":mercenary_troop", ":center_no", slot_center_mercenary_troop_type),
## (party_get_slot, ":mercenary_amount", ":center_no", slot_center_mercenary_troop_amount),
## (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
## (val_min, ":mercenary_amount", ":free_capacity"),
## (store_troop_gold, ":cur_gold", "trp_player"),
## (call_script, "script_game_get_join_cost", ":mercenary_troop"),
## (assign, ":join_cost", reg0),
## (try_begin),
## (gt, ":join_cost", 0),
## (val_div, ":cur_gold", ":join_cost"),
## (val_min, ":mercenary_amount", ":cur_gold"),
## (try_end),
## (assign, reg0, ":mercenary_troop"),
## (assign, reg1, ":mercenary_amount"),
## ]),
##
#script_update_village_market_towns
# INPUT: none
# OUTPUT: none
("update_village_market_towns",
[(try_for_range, ":cur_village", villages_begin, villages_end),
(store_faction_of_party, ":village_faction", ":cur_village"),
(assign, ":min_dist", 999999),
(assign, ":min_dist_town", -1),
(try_for_range, ":cur_town", towns_begin, towns_end),
(store_faction_of_party, ":town_faction", ":cur_town"),
(eq, ":town_faction", ":village_faction"),
(store_distance_to_party_from_party, ":cur_dist", ":cur_village", ":cur_town"),
(lt, ":cur_dist", ":min_dist"),
(assign, ":min_dist", ":cur_dist"),
(assign, ":min_dist_town", ":cur_town"),
(try_end),
(gt, ":min_dist_town", -1),
(party_set_slot, ":cur_village", slot_village_market_town, ":min_dist_town"),
(try_end),
]),
#script_update_mercenary_units_of_towns
# INPUT: none
# OUTPUT: none
("update_mercenary_units_of_towns",
[(try_for_range, ":town_no", towns_begin, towns_end),
(store_random_in_range, ":troop_no", mercenary_troops_begin, mercenary_troops_end),
(party_set_slot, ":town_no", slot_center_mercenary_troop_type, ":troop_no"),
(store_random_in_range, ":amount", 3, 8),
(party_set_slot, ":town_no", slot_center_mercenary_troop_amount, ":amount"),
(try_end),
]),
#script_update_volunteer_troops_in_village
# INPUT: arg1 = center_no
# OUTPUT: none
("update_volunteer_troops_in_village",
[
(store_script_param, ":center_no", 1),
(party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
(party_get_slot, ":center_culture", ":center_no", slot_center_culture),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
(assign, ":volunteer_troop_tier", 1),
(store_div, ":tier_upgrades", ":player_relation", 10),
(try_for_range, ":unused", 0, ":tier_upgrades"),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 10),
(store_random_in_range, ":random_no", 0, 2),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"),
(try_begin),
(le, ":upgrade_troop_no", 0),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0),
(try_end),
(gt, ":upgrade_troop_no", 0),
(val_add, ":volunteer_troop_tier", 1),
(assign, ":volunteer_troop", ":upgrade_troop_no"),
(try_end),
(assign, ":upper_limit", 7),
(try_begin),
(ge, ":player_relation", 5),
(assign, ":upper_limit", ":player_relation"),
(val_div, ":upper_limit", 2),
(val_add, ":upper_limit", 10),
(else_try),
(lt, ":player_relation", 0),
(assign, ":upper_limit", 0),
(try_end),
(val_mul, ":upper_limit", 3),
(store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"),
(val_div, ":upper_limit", ":amount_random_divider"),
(store_random_in_range, ":amount", 0, ":upper_limit"),
(party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
(party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"),
]),
#script_update_npc_volunteer_troops_in_village
# INPUT: arg1 = center_no
# OUTPUT: none
("update_npc_volunteer_troops_in_village",
[
(store_script_param, ":center_no", 1),
(party_get_slot, ":center_culture", ":center_no", slot_center_culture),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
(assign, ":volunteer_troop_tier", 1),
(try_for_range, ":unused", 0, 5),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 10),
(store_random_in_range, ":random_no", 0, 2),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"),
(try_begin),
(le, ":upgrade_troop_no", 0),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0),
(try_end),
(gt, ":upgrade_troop_no", 0),
(val_add, ":volunteer_troop_tier", 1),
(assign, ":volunteer_troop", ":upgrade_troop_no"),
(try_end),
(assign, ":upper_limit", 12),
(store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"),
(val_div, ":upper_limit", ":amount_random_divider"),
(store_random_in_range, ":amount", 0, ":upper_limit"),
(party_set_slot, ":center_no", slot_center_npc_volunteer_troop_type, ":volunteer_troop"),
(party_set_slot, ":center_no", slot_center_npc_volunteer_troop_amount, ":amount"),
]),
#script_update_companion_candidates_in_taverns
# INPUT: none
# OUTPUT: none
("update_companion_candidates_in_taverns",
[ (try_for_range, ":troop_no", companions_begin, companions_end),
(troop_set_slot, ":troop_no", slot_troop_cur_center, -1),
(troop_slot_eq, ":troop_no", slot_troop_occupation, 0),
(store_random_in_range, ":town_no", towns_begin, towns_end),
(try_begin),
(neg|troop_slot_eq, ":troop_no", slot_troop_home, ":town_no"),
(neg|troop_slot_eq, ":troop_no", slot_troop_first_encountered, ":town_no"),
(troop_set_slot, ":troop_no", slot_troop_cur_center, ":town_no"),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, 4, ":troop_no"),
(str_store_party_name, 5, ":town_no"),
(display_message, "@{s4} is in {s5}"),
(try_end),
(try_end),
(try_end),
]),
#script_update_ransom_brokers
# INPUT: none
# OUTPUT: none
("update_ransom_brokers",
[(try_for_range, ":town_no", towns_begin, towns_end),
(party_set_slot, ":town_no", slot_center_ransom_broker, 0),
(try_end),
(try_for_range, ":troop_no", ransom_brokers_begin, ransom_brokers_end),
(store_random_in_range, ":town_no", towns_begin, towns_end),
(party_set_slot, ":town_no", slot_center_ransom_broker, ":troop_no"),
(try_end),
(party_set_slot,"p_town_2",slot_center_ransom_broker,"trp_ramun_the_slave_trader"),
]),
#script_update_tavern_travelers
# INPUT: none
# OUTPUT: none
("update_tavern_travelers",
[(try_for_range, ":town_no", towns_begin, towns_end),
(party_set_slot, ":town_no", slot_center_tavern_traveler, 0),
(try_end),
(try_for_range, ":troop_no", tavern_travelers_begin, tavern_travelers_end),
(store_random_in_range, ":town_no", towns_begin, towns_end),
(party_set_slot, ":town_no", slot_center_tavern_traveler, ":troop_no"),
(assign, ":end_cond", 15),
(try_for_range, ":unused", 0, ":end_cond"),
(store_random_in_range, ":info_faction", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":info_faction", slot_faction_state, sfs_active),
(neq, ":info_faction", "$players_kingdom"),
(neq, ":info_faction", "fac_player_supporters_faction"),
(party_set_slot, ":town_no", slot_center_traveler_info_faction, ":info_faction"),
(assign, ":end_cond", 0),
(try_end),
(try_end),
]),
#script_update_villages_infested_by_bandits
# INPUT: none
# OUTPUT: none
("update_villages_infested_by_bandits",
[(try_for_range, ":village_no", villages_begin, villages_end),
(try_begin),
(check_quest_active, "qst_eliminate_bandits_infesting_village"),
(quest_slot_eq, "qst_eliminate_bandits_infesting_village", slot_quest_target_center, ":village_no"),
(quest_get_slot, ":cur_state", "qst_eliminate_bandits_infesting_village", slot_quest_current_state),
(val_add, ":cur_state", 1),
(try_begin),
(lt, ":cur_state", 3),
(quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_current_state, ":cur_state"),
(else_try),
(party_set_slot, ":village_no", slot_village_infested_by_bandits, 0),
(call_script, "script_abort_quest", "qst_eliminate_bandits_infesting_village", 2),
(try_end),
(else_try),
(check_quest_active, "qst_deal_with_bandits_at_lords_village"),
(quest_slot_eq, "qst_deal_with_bandits_at_lords_village", slot_quest_target_center, ":village_no"),
(quest_get_slot, ":cur_state", "qst_deal_with_bandits_at_lords_village", slot_quest_current_state),
(val_add, ":cur_state", 1),
(try_begin),
(lt, ":cur_state", 3),
(quest_set_slot, "qst_deal_with_bandits_at_lords_village", slot_quest_current_state, ":cur_state"),
(else_try),
(party_set_slot, ":village_no", slot_village_infested_by_bandits, 0),
(call_script, "script_abort_quest", "qst_deal_with_bandits_at_lords_village", 2),
(try_end),
(else_try),
(party_set_slot, ":village_no", slot_village_infested_by_bandits, 0),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 3),
(store_random_in_range, ":random_no", 0, 3),
(try_begin),
(eq, ":random_no", 0),
(assign, ":bandit_troop", "trp_bandit"),
(else_try),
(eq, ":random_no", 1),
(assign, ":bandit_troop", "trp_mountain_bandit"),
(else_try),
(assign, ":bandit_troop", "trp_forest_bandit"),
(try_end),
(party_set_slot, ":village_no", slot_village_infested_by_bandits, ":bandit_troop"),
#Reduce prosperity of the village by 3
(call_script, "script_change_center_prosperity", ":village_no", -3),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_party_name, s1, ":village_no"),
(display_message, "@{s1} is infested by bandits."),
(try_end),
(try_end),
(try_end),
]),
#script_update_booksellers
# INPUT: none
# OUTPUT: none
("update_booksellers",
[(try_for_range, ":town_no", towns_begin, towns_end),
(party_set_slot, ":town_no", slot_center_tavern_bookseller, 0),
(try_end),
(try_for_range, ":troop_no", tavern_booksellers_begin, tavern_booksellers_end),
(store_random_in_range, ":town_no", towns_begin, towns_end),
(party_set_slot, ":town_no", slot_center_tavern_bookseller, ":troop_no"),
(try_end),
]),
#script_update_tavern_minstels
# INPUT: none
# OUTPUT: none
("update_tavern_minstels",
[(try_for_range, ":town_no", towns_begin, towns_end),
(party_set_slot, ":town_no", slot_center_tavern_minstrel, 0),
(try_end),
(try_for_range, ":troop_no", tavern_minstrels_begin, tavern_minstrels_end),
(store_random_in_range, ":town_no", towns_begin, towns_end),
(party_set_slot, ":town_no", slot_center_tavern_minstrel, ":troop_no"),
(try_end),
]),
#script_update_faction_notes
# INPUT: faction_no
# OUTPUT: none
("update_faction_notes",
[(store_script_param, ":faction_no", 1),
(try_begin),
(is_between, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(faction_get_slot, ":faction_leader", ":faction_no", slot_faction_leader),
(str_store_faction_name, s5, ":faction_no"),
(str_store_troop_name_link, s6, ":faction_leader"),
(assign, ":num_centers", 0),
(str_store_string, s8, "@nowhere"),
(try_for_range_backwards, ":cur_center", centers_begin, centers_end),
(store_faction_of_party, ":center_faction", ":cur_center"),
(eq, ":center_faction", ":faction_no"),
(try_begin),
(eq, ":num_centers", 0),
(str_store_party_name_link, s8, ":cur_center"),
(else_try),
(eq, ":num_centers", 1),
(str_store_party_name_link, s7, ":cur_center"),
(str_store_string, s8, "@{s7} and {s8}"),
(else_try),
(str_store_party_name_link, s7, ":cur_center"),
(str_store_string, s8, "@{s7}, {s8}"),
(try_end),
(val_add, ":num_centers", 1),
(try_end),
(assign, ":num_members", 0),
(str_store_string, s10, "@noone"),
(try_for_range_backwards, ":loop_var", "trp_kingdom_heroes_including_player_begin", kingdom_heroes_end),
(assign, ":cur_troop", ":loop_var"),
(try_begin),
(eq, ":loop_var", "trp_kingdom_heroes_including_player_begin"),
(assign, ":cur_troop", "trp_player"),
(assign, ":troop_faction", "$players_kingdom"),
(else_try),
(store_troop_faction, ":troop_faction", ":cur_troop"),
(try_end),
(eq, ":troop_faction", ":faction_no"),
(neq, ":cur_troop", ":faction_leader"),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(try_begin),
(eq, ":num_members", 0),
(str_store_troop_name_link, s10, ":cur_troop"),
(else_try),
(eq, ":num_members", 1),
(str_store_troop_name_link, s9, ":cur_troop"),
(str_store_string, s10, "@{s9} and {s10}"),
(else_try),
(str_store_troop_name_link, s9, ":cur_troop"),
(str_store_string, s10, "@{s9}, {s10}"),
(try_end),
(val_add, ":num_members", 1),
(try_end),
(str_store_string, s12, "@noone"),
(assign, ":num_enemies", 0),
(try_for_range_backwards, ":cur_faction", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
(store_relation, ":cur_relation", ":cur_faction", ":faction_no"),
(lt, ":cur_relation", 0),
(try_begin),
(eq, ":num_enemies", 0),
(str_store_faction_name_link, s12, ":cur_faction"),
(else_try),
(eq, ":num_enemies", 1),
(str_store_faction_name_link, s11, ":cur_faction"),
(str_store_string, s12, "@{s11} and {s12}"),
(else_try),
(str_store_faction_name_link, s11, ":cur_faction"),
(str_store_string, s12, "@{s11}, {s12}"),
(try_end),
(val_add, ":num_enemies", 1),
(try_end),
(add_faction_note_from_sreg, ":faction_no", 0, "@{s5} is ruled by {s6}.^It occupies {s8}.^Its vassals are {s10}.^{s5} is at war with {s12}.", 0),
(else_try),
(is_between, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_defeated),
(str_store_faction_name, s5, ":faction_no"),
(add_faction_note_from_sreg, ":faction_no", 0, "@{s5} has been defeated!", 0),
(str_clear, s1),
(add_faction_note_from_sreg, ":faction_no", 1, s1, 0),
(else_try),
(str_clear, s1),
(add_faction_note_from_sreg, ":faction_no", 0, s1, 0),
(add_faction_note_from_sreg, ":faction_no", 1, s1, 0),
(try_end),
(try_begin),
(is_between, ":faction_no", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
(add_faction_note_tableau_mesh, ":faction_no", "tableau_faction_note_mesh"),
(else_try),
(add_faction_note_tableau_mesh, ":faction_no", "tableau_faction_note_mesh_banner"),
(try_end),
]),
#script_update_faction_traveler_notes
# INPUT: faction_no
# OUTPUT: none
("update_faction_traveler_notes",
[(store_script_param, ":faction_no", 1),
(assign, ":total_men", 0),
(try_for_parties, ":cur_party"),
(store_faction_of_party, ":center_faction", ":cur_party"),
(eq, ":center_faction", ":faction_no"),
(party_get_num_companions, ":num_men", ":cur_party"),
(val_add, ":total_men", ":num_men"),
(try_end),
(str_store_faction_name, s5, ":faction_no"),
(assign, reg1, ":total_men"),
(add_faction_note_from_sreg, ":faction_no", 1, "@{s5} has a strength of {reg1} men in total.", 1),
]),
#script_update_troop_notes
# INPUT: troop_no
# OUTPUT: none
("update_troop_notes",
[(store_script_param, ":troop_no", 1),
(str_store_troop_name, s54, ":troop_no"),
(try_begin),
(eq, ":troop_no", "trp_player"),
(this_or_next|eq, "$player_has_homage", 1),
( eq, "$players_kingdom", "fac_player_supporters_faction"),
(assign, ":troop_faction", "$players_kingdom"),
(else_try),
(store_troop_faction, ":troop_faction", ":troop_no"),
(try_end),
(try_begin),
(neq, ":troop_no", "trp_player"),
(neg|is_between, ":troop_faction", kingdoms_begin, kingdoms_end),
(str_clear, s54),
(add_troop_note_from_sreg, ":troop_no", 0, s54, 0),
(add_troop_note_from_sreg, ":troop_no", 1, s54, 0),
(add_troop_note_from_sreg, ":troop_no", 2, s54, 0),
(else_try),
(is_between, ":troop_no", kingdom_ladies_begin, kingdom_ladies_end),
(str_clear, s54),
(add_troop_note_from_sreg, ":troop_no", 0, s54, 0),
(add_troop_note_from_sreg, ":troop_no", 1, s54, 0),
(add_troop_note_from_sreg, ":troop_no", 2, s54, 0),
(else_try),
(is_between, ":troop_no", pretenders_begin, pretenders_end),
(neg|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(neq, ":troop_no", "$supported_pretender"),
(troop_get_slot, ":orig_faction", ":troop_no", slot_troop_original_faction),
(try_begin),
(faction_slot_eq, ":orig_faction", slot_faction_state, sfs_active),
(faction_slot_eq, ":orig_faction", slot_faction_has_rebellion_chance, 1),
(str_store_faction_name_link, s56, ":orig_faction"),
(add_troop_note_from_sreg, ":troop_no", 0, "@{s54} is a claimant to the throne of {s56}.", 0),
(add_troop_note_tableau_mesh, ":troop_no", "tableau_troop_note_mesh"),
(else_try),
(str_clear, s54),
(add_troop_note_from_sreg, ":troop_no", 0, s54, 0),
(add_troop_note_from_sreg, ":troop_no", 1, s54, 0),
(add_troop_note_from_sreg, ":troop_no", 2, s54, 0),
(try_end),
(else_try),
(faction_get_slot, ":faction_leader", ":troop_faction", slot_faction_leader),
(str_store_troop_name_link, s55, ":faction_leader"),
(str_store_faction_name_link, s56, ":troop_faction"),
(assign, reg4, 0),
(assign, reg6, 0),
(try_begin),
(eq, ":troop_faction", "fac_player_faction"),
(assign, reg6, 1),
(else_try),
(eq, ":faction_leader", ":troop_no"),
(assign, reg4, 1),
(try_end),
(assign, ":num_centers", 0),
(str_store_string, s58, "@nowhere"),
(try_for_range_backwards, ":cur_center", centers_begin, centers_end),
(party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"),
(try_begin),
(eq, ":num_centers", 0),
(str_store_party_name_link, s58, ":cur_center"),
(else_try),
(eq, ":num_centers", 1),
(str_store_party_name_link, s57, ":cur_center"),
(str_store_string, s58, "@{s57} and {s58}"),
(else_try),
(str_store_party_name_link, s57, ":cur_center"),
(str_store_string, s58, "@{s57}, {s58}"),
(try_end),
(val_add, ":num_centers", 1),
(try_end),
(troop_get_type, reg3, ":troop_no"),
(troop_get_slot, reg5, ":troop_no", slot_troop_renown),
(str_clear, s59),
(try_begin),
# (troop_get_slot, ":relation", ":troop_no", slot_troop_player_relation),
(call_script, "script_troop_get_player_relation", ":troop_no"),
(assign, ":relation", reg0),
(store_add, ":normalized_relation", ":relation", 100),
(val_add, ":normalized_relation", 5),
(store_div, ":str_offset", ":normalized_relation", 10),
(val_clamp, ":str_offset", 0, 20),
(store_add, ":str_id", "str_relation_mnus_100_ns", ":str_offset"),
(neq, ":str_id", "str_relation_plus_0_ns"),
(str_store_string, s60, "@{reg3?She:He}"),
(str_store_string, s59, ":str_id"),
(str_store_string, s59, "@^{s59}"),
(try_end),
(assign, reg9, ":num_centers"),
(add_troop_note_from_sreg, ":troop_no", 0, "@{reg6?:{reg4?{s54} is the ruler of {s56}.^:{s54} is a vassal of {s55} of {s56}.^}}Renown: {reg5}.^{reg9?{reg3?She:He} is the {reg3?lady:lord} of {s58}.:{reg3?She:He} has no fiefs.}{s59}", 0),
(add_troop_note_tableau_mesh, ":troop_no", "tableau_troop_note_mesh"),
(try_end),
]),
#script_update_troop_location_notes
# INPUT: troop_no
# OUTPUT: none
("update_troop_location_notes",
[(store_script_param, ":troop_no", 1),
(store_script_param, ":see_or_hear", 2),
(call_script, "script_get_information_about_troops_position", ":troop_no", 1),
(try_begin),
(neq, reg0, 0),
(troop_get_type, reg1, ":troop_no"),
(try_begin),
(eq, ":see_or_hear", 0),
(add_troop_note_from_sreg, ":troop_no", 2, "@The last time you saw {reg1?her:him}, {s1}", 1),
(else_try),
(add_troop_note_from_sreg, ":troop_no", 2, "@The last time you heard about {reg1?her:him}, {s1}", 1),
(try_end),
(try_end),
]),
#script_update_center_notes
# INPUT: center_no
# OUTPUT: none
("update_center_notes",
[(store_script_param, ":center_no", 1),
(party_get_slot, ":lord_troop", ":center_no", slot_town_lord),
(try_begin),
(ge, ":lord_troop", 0),
(store_troop_faction, ":lord_faction", ":lord_troop"),
(str_store_troop_name_link, s1, ":lord_troop"),
(try_begin),
(eq, ":lord_troop", "trp_player"),
(gt, "$players_kingdom", 0),
(str_store_faction_name_link, s2, "$players_kingdom"),
(else_try),
(str_store_faction_name_link, s2, ":lord_faction"),
(try_end),
(str_store_party_name, s50, ":center_no"),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(str_store_string, s51, "@The town of {s50}"),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(party_get_slot, ":bound_center", ":center_no", slot_village_bound_center),
(str_store_party_name_link, s52, ":bound_center"),
(str_store_string, s51, "@The village of {s50} near {s52}"),
(else_try),
(str_store_string, s51, "@{s50}"),
(try_end),
(str_store_string, s2, "@{s51} belongs to {s1} of {s2}.^"),
(else_try),
(str_clear, s2),
(try_end),
(try_begin),
(is_between, ":center_no", villages_begin, villages_end),
(else_try),
(assign, ":num_villages", 0),
(try_for_range_backwards, ":village_no", villages_begin, villages_end),
(party_slot_eq, ":village_no", slot_village_bound_center, ":center_no"),
(try_begin),
(eq, ":num_villages", 0),
(str_store_party_name_link, s8, ":village_no"),
(else_try),
(eq, ":num_villages", 1),
(str_store_party_name_link, s7, ":village_no"),
(str_store_string, s8, "@{s7} and {s8}"),
(else_try),
(str_store_party_name_link, s7, ":village_no"),
(str_store_string, s8, "@{s7}, {s8}"),
(try_end),
(val_add, ":num_villages", 1),
(try_end),
(try_begin),
(eq, ":num_villages", 0),
(str_store_string, s2, "@{s2}It has no villages.^"),
(else_try),
(store_sub, reg0, ":num_villages", 1),
(str_store_string, s2, "@{s2}{reg0?Its villages are:Its village is} {s8}.^"),
(try_end),
(try_end),
(call_script, "script_get_prosperity_text_to_s50", ":center_no"),
(add_party_note_from_sreg, ":center_no", 0, "@{s2}Its prosperity is: {s50}", 0),
(add_party_note_tableau_mesh, ":center_no", "tableau_center_note_mesh"),
]),
#script_update_center_recon_notes
# INPUT: center_no
# OUTPUT: none
("update_center_recon_notes",
[(store_script_param, ":center_no", 1),
(try_begin),
(this_or_next|is_between, ":center_no", towns_begin, towns_end),
(is_between, ":center_no", castles_begin, castles_end),
(party_get_slot, ":center_food_store", ":center_no", slot_party_food_store),
(call_script, "script_center_get_food_consumption", ":center_no"),
(assign, ":food_consumption", reg0),
(store_div, reg6, ":center_food_store", ":food_consumption"),
(party_collect_attachments_to_party, ":center_no", "p_collective_ally"),
(party_get_num_companions, reg5, "p_collective_ally"),
(add_party_note_from_sreg, ":center_no", 1, "@Current garrison consists of {reg5} men.^Has food stock for {reg6} days.", 1),
(try_end),
]),
#script_update_all_notes
# INPUT: none
# OUTPUT: none
("update_all_notes",
[
(call_script, "script_update_troop_notes", "trp_player"),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(call_script, "script_update_troop_notes", ":troop_no"),
(try_end),
(try_for_range, ":center_no", centers_begin, centers_end),
(call_script, "script_update_center_notes", ":center_no"),
(try_end),
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(call_script, "script_update_faction_notes", ":faction_no"),
(try_end),
]),
#script_shield_item_set_banner
# INPUT: agent_no
# OUTPUT: none
("shield_item_set_banner",
[
(store_script_param, ":tableau_no",1),
(store_script_param, ":agent_no", 2),
(store_script_param, ":troop_no", 3),
(assign, ":banner_troop", -1),
(assign, ":banner_mesh", "mesh_banners_default_b"),
(try_begin),
(lt, ":agent_no", 0),
(try_begin),
(ge, ":troop_no", 0),
(this_or_next|troop_slot_ge, ":troop_no", slot_troop_banner_scene_prop, 1),
( eq, ":troop_no", "trp_player"),
(assign, ":banner_troop", ":troop_no"),
(else_try),
(is_between, ":troop_no", companions_begin, companions_end),
(assign, ":banner_troop", "trp_player"),
(else_try),
(assign, ":banner_mesh", "mesh_banners_default_a"),
(try_end),
(else_try),
(agent_get_troop_id, ":troop_id", ":agent_no"),
(this_or_next|troop_slot_ge, ":troop_id", slot_troop_banner_scene_prop, 1),
( eq, ":troop_no", "trp_player"),
(assign, ":banner_troop", ":troop_id"),
(else_try),
(agent_get_party_id, ":agent_party", ":agent_no"),
# modified by formations here to ensure player troops' heraldry showed correctly
(party_get_slot, ":num", "p_main_party", slot_party_array_parties_begin),
(try_for_range, ":array", 1, ":num"),
(store_add, ":array_slot", ":array", slot_party_array_parties_begin),
(party_get_slot, ":array_party", "p_main_party", ":array_slot"),
(eq, ":agent_party", ":array_party"),
(assign, ":agent_party", "p_main_party"),
(try_end),
# formation changes end
(try_begin),
(lt, ":agent_party", 0),
(is_between, ":troop_id", companions_begin, companions_end),
(main_party_has_troop, ":troop_id"),
(assign, ":agent_party", "p_main_party"),
(try_end),
(ge, ":agent_party", 0),
(party_get_template_id, ":party_template", ":agent_party"),
(try_begin),
(eq, ":party_template", "pt_deserters"),
(assign, ":banner_mesh", "mesh_banners_default_c"),
(else_try),
(is_between, ":agent_party", centers_begin, centers_end),
(party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
(ge, ":town_lord", 0),
(assign, ":banner_troop", ":town_lord"),
(else_try),
(this_or_next|party_slot_eq, ":agent_party", slot_party_type, spt_kingdom_hero_party),
( eq, ":agent_party", "p_main_party"),
(party_get_num_companion_stacks, ":num_stacks", ":agent_party"),
(gt, ":num_stacks", 0),
(party_stack_get_troop_id, ":leader_troop_id", ":agent_party", 0),
(this_or_next|troop_slot_ge, ":leader_troop_id", slot_troop_banner_scene_prop, 1),
( eq, ":leader_troop_id", "trp_player"),
(assign, ":banner_troop", ":leader_troop_id"),
(try_end),
(else_try), #Check if we are in a tavern
(eq, "$talk_context", tc_tavern_talk),
(neq, ":troop_no", "trp_player"),
(assign, ":banner_mesh", "mesh_banners_default_d"),
(else_try), #can't find party, this can be a town guard
(neq, ":troop_no", "trp_player"),
(is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
(party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
(ge, ":town_lord", 0),
(assign, ":banner_troop", ":town_lord"),
(try_end),
(try_begin),
(ge, ":banner_troop", 0),
(try_begin),
(neg|troop_slot_ge, ":banner_troop", slot_troop_banner_scene_prop, 1),
(assign, ":banner_mesh", "mesh_banners_default_b"),
(else_try),
(troop_get_slot, ":banner_spr", ":banner_troop", slot_troop_banner_scene_prop),
(store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
(is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
(val_sub, ":banner_spr", banner_scene_props_begin),
(store_add, ":banner_mesh", ":banner_spr", arms_meshes_begin),
(try_end),
(try_end),
(cur_item_set_tableau_material, ":tableau_no", ":banner_mesh"),
]),
## #script_shield_item_set_banner
## # INPUT: agent_no
## # OUTPUT: none
## ("shield_item_set_banner",
## [
## (store_script_param, ":tableau_no",1),
## (store_script_param, ":agent_no", 2),
## (store_script_param, ":troop_no", 3),
## (assign, ":banner_troop", -1),
## (try_begin),
## (lt, ":agent_no", 0),
## (try_begin),
## (ge, ":troop_no", 0),
## (troop_slot_ge, ":troop_no", slot_troop_banner_scene_prop, 0),
## (assign, ":banner_troop", ":troop_no"),
## (else_try),
## (assign, ":banner_troop", -2),
## (try_end),
## (else_try),
## (agent_get_troop_id, ":troop_id", ":agent_no"),
## (troop_slot_ge, ":troop_id", slot_troop_custom_banner_flag_type, 0),
## (assign, ":banner_troop", ":troop_id"),
## (else_try),
## (agent_get_party_id, ":agent_party", ":agent_no"),
## (try_begin),
## (lt, ":agent_party", 0),
## (is_between, ":troop_id", companions_begin, companions_end),
## (main_party_has_troop, ":troop_id"),
## (assign, ":agent_party", "p_main_party"),
## (try_end),
## (ge, ":agent_party", 0),
## (party_get_template_id, ":party_template", ":agent_party"),
## (try_begin),
## (eq, ":party_template", "pt_deserters"),
## (assign, ":banner_troop", -3),
## (else_try),
## (is_between, ":agent_party", centers_begin, centers_end),
## (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
## (ge, ":town_lord", 0),
## (assign, ":banner_troop", ":town_lord"),
## (else_try),
## (this_or_next|party_slot_eq, ":agent_party", slot_party_type, spt_kingdom_hero_party),
## ( eq, ":agent_party", "p_main_party"),
## (party_get_num_companion_stacks, ":num_stacks", ":agent_party"),
## (gt, ":num_stacks", 0),
## (party_stack_get_troop_id, ":leader_troop_id", ":agent_party", 0),
## (troop_slot_ge, ":leader_troop_id", slot_troop_banner_scene_prop, 1),
## (assign, ":banner_troop", ":leader_troop_id"),
## (try_end),
## (else_try), #Check if we are in a tavern
## (eq, "$talk_context", tc_tavern_talk),
## (neq, ":troop_no", "trp_player"),
## (assign, ":banner_troop", -4),
## (else_try), #can't find party, this can be a town guard
## (neq, ":troop_no", "trp_player"),
## (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
## (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
## (ge, ":town_lord", 0),
## (assign, ":banner_troop", ":town_lord"),
## (try_end),
## (cur_item_set_tableau_material, ":tableau_no", ":banner_troop"),
## ]),
#script_add_troop_to_cur_tableau
# INPUT: troop_no
# OUTPUT: none
("add_troop_to_cur_tableau",
[
(store_script_param, ":troop_no",1),
(set_fixed_point_multiplier, 100),
(assign, ":banner_mesh", -1),
(troop_get_slot, ":banner_spr", ":troop_no", slot_troop_banner_scene_prop),
(store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
(try_begin),
(is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
(val_sub, ":banner_spr", banner_scene_props_begin),
(store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin),
(try_end),
(cur_tableau_clear_override_items),
# (cur_tableau_set_override_flags, af_override_fullhelm),
(cur_tableau_set_override_flags, af_override_head|af_override_weapons),
(init_position, pos2),
(cur_tableau_set_camera_parameters, 1, 6, 6, 10, 10000),
(init_position, pos5),
(assign, ":eye_height", 162),
(store_mul, ":camera_distance", ":troop_no", 87323),
# (val_mod, ":camera_distance", 5),
(assign, ":camera_distance", 139),
(store_mul, ":camera_yaw", ":troop_no", 124337),
(val_mod, ":camera_yaw", 50),
(val_add, ":camera_yaw", -25),
(store_mul, ":camera_pitch", ":troop_no", 98123),
(val_mod, ":camera_pitch", 20),
(val_add, ":camera_pitch", -14),
(assign, ":animation", anim_stand_man),
## (troop_get_inventory_slot, ":horse_item", ":troop_no", ek_horse),
## (try_begin),
## (gt, ":horse_item", 0),
## (assign, ":eye_height", 210),
## (cur_tableau_add_horse, ":horse_item", pos2, anim_horse_stand, 0),
## (assign, ":animation", anim_ride_0),
## (position_set_z, pos5, 125),
## (try_begin),
## (is_between, ":camera_yaw", -10, 10), #make sure horse head doesn't obstruct face.
## (val_min, ":camera_pitch", -5),
## (try_end),
## (try_end),
(position_set_z, pos5, ":eye_height"),
# camera looks towards -z axis
(position_rotate_x, pos5, -90),
(position_rotate_z, pos5, 180),
# now apply yaw and pitch
(position_rotate_y, pos5, ":camera_yaw"),
(position_rotate_x, pos5, ":camera_pitch"),
(position_move_z, pos5, ":camera_distance", 0),
(position_move_x, pos5, 5, 0),
(try_begin),
(ge, ":banner_mesh", 0),
(init_position, pos1),
(position_set_z, pos1, -1500),
(position_set_x, pos1, 265),
(position_set_y, pos1, 400),
(position_transform_position_to_parent, pos3, pos5, pos1),
(cur_tableau_add_mesh, ":banner_mesh", pos3, 400, 0),
(try_end),
(cur_tableau_add_troop, ":troop_no", pos2, ":animation" , 0),
(cur_tableau_set_camera_position, pos5),
(copy_position, pos8, pos5),
(position_rotate_x, pos8, -90), #y axis aligned with camera now. z is up
(position_rotate_z, pos8, 30),
(position_rotate_x, pos8, -60),
(cur_tableau_add_sun_light, pos8, 175,150,125),
]),
#script_add_troop_to_cur_tableau_for_character
# INPUT: troop_no
# OUTPUT: none
("add_troop_to_cur_tableau_for_character",
[
(store_script_param, ":troop_no",1),
(set_fixed_point_multiplier, 100),
(cur_tableau_clear_override_items),
(cur_tableau_set_override_flags, af_override_fullhelm),
## (cur_tableau_set_override_flags, af_override_head|af_override_weapons),
(init_position, pos2),
(cur_tableau_set_camera_parameters, 1, 4, 8, 10, 10000),
(init_position, pos5),
(assign, ":cam_height", 150),
# (val_mod, ":camera_distance", 5),
(assign, ":camera_distance", 360),
(assign, ":camera_yaw", -15),
(assign, ":camera_pitch", -18),
(assign, ":animation", anim_stand_man),
(position_set_z, pos5, ":cam_height"),
# camera looks towards -z axis
(position_rotate_x, pos5, -90),
(position_rotate_z, pos5, 180),
# now apply yaw and pitch
(position_rotate_y, pos5, ":camera_yaw"),
(position_rotate_x, pos5, ":camera_pitch"),
(position_move_z, pos5, ":camera_distance", 0),
(position_move_x, pos5, 5, 0),
(try_begin),
(troop_is_hero, ":troop_no"),
(cur_tableau_add_troop, ":troop_no", pos2, ":animation", -1),
(else_try),
(store_mul, ":random_seed", ":troop_no", 126233),
(val_mod, ":random_seed", 1000),
(val_add, ":random_seed", 1),
(cur_tableau_add_troop, ":troop_no", pos2, ":animation", ":random_seed"),
(try_end),
(cur_tableau_set_camera_position, pos5),
(copy_position, pos8, pos5),
(position_rotate_x, pos8, -90), #y axis aligned with camera now. z is up
(position_rotate_z, pos8, 30),
(position_rotate_x, pos8, -60),
(cur_tableau_add_sun_light, pos8, 175,150,125),
]),
#script_add_troop_to_cur_tableau_for_inventory
# INPUT: troop_no
# OUTPUT: none
("add_troop_to_cur_tableau_for_inventory",
[
(store_script_param, ":troop_no",1),
(store_mod, ":side", ":troop_no", 4), #side flag is inside troop_no value
(val_div, ":troop_no", 4), #removing the flag bit
(val_mul, ":side", 90), #to degrees
(set_fixed_point_multiplier, 100),
(cur_tableau_clear_override_items),
(init_position, pos2),
(position_rotate_z, pos2, ":side"),
(cur_tableau_set_camera_parameters, 1, 4, 6, 10, 10000),
(init_position, pos5),
(assign, ":cam_height", 105),
# (val_mod, ":camera_distance", 5),
(assign, ":camera_distance", 380),
(assign, ":camera_yaw", -15),
(assign, ":camera_pitch", -18),
(assign, ":animation", anim_stand_man),
(position_set_z, pos5, ":cam_height"),
# camera looks towards -z axis
(position_rotate_x, pos5, -90),
(position_rotate_z, pos5, 180),
# now apply yaw and pitch
(position_rotate_y, pos5, ":camera_yaw"),
(position_rotate_x, pos5, ":camera_pitch"),
(position_move_z, pos5, ":camera_distance", 0),
(position_move_x, pos5, 5, 0),
(try_begin),
(troop_is_hero, ":troop_no"),
(cur_tableau_add_troop, ":troop_no", pos2, ":animation", -1),
(else_try),
(store_mul, ":random_seed", ":troop_no", 126233),
(val_mod, ":random_seed", 1000),
(val_add, ":random_seed", 1),
(cur_tableau_add_troop, ":troop_no", pos2, ":animation", ":random_seed"),
(try_end),
(cur_tableau_set_camera_position, pos5),
(copy_position, pos8, pos5),
(position_rotate_x, pos8, -90), #y axis aligned with camera now. z is up
(position_rotate_z, pos8, 30),
(position_rotate_x, pos8, -60),
(cur_tableau_add_sun_light, pos8, 175,150,125),
]),
#script_add_troop_to_cur_tableau_for_party
# INPUT: troop_no
# OUTPUT: none
("add_troop_to_cur_tableau_for_party",
[
(store_script_param, ":troop_no",1),
(store_mod, ":hide_weapons", ":troop_no", 2), #hide_weapons flag is inside troop_no value
(val_div, ":troop_no", 2), #removing the flag bit
(set_fixed_point_multiplier, 100),
(cur_tableau_clear_override_items),
(try_begin),
(eq, ":hide_weapons", 1),
(cur_tableau_set_override_flags, af_override_fullhelm|af_override_head|af_override_weapons),
(try_end),
(init_position, pos2),
(cur_tableau_set_camera_parameters, 1, 6, 6, 10, 10000),
(init_position, pos5),
(assign, ":cam_height", 105),
# (val_mod, ":camera_distance", 5),
(assign, ":camera_distance", 450),
(assign, ":camera_yaw", 15),
(assign, ":camera_pitch", -18),
(assign, ":animation", anim_stand_man),
(troop_get_inventory_slot, ":horse_item", ":troop_no", ek_horse),
(try_begin),
(gt, ":horse_item", 0),
(eq, ":hide_weapons", 0),
(cur_tableau_add_horse, ":horse_item", pos2, "anim_horse_stand", 0),
(assign, ":animation", "anim_ride_0"),
(assign, ":camera_yaw", 23),
(assign, ":cam_height", 150),
(assign, ":camera_distance", 550),
(try_end),
(position_set_z, pos5, ":cam_height"),
# camera looks towards -z axis
(position_rotate_x, pos5, -90),
(position_rotate_z, pos5, 180),
# now apply yaw and pitch
(position_rotate_y, pos5, ":camera_yaw"),
(position_rotate_x, pos5, ":camera_pitch"),
(position_move_z, pos5, ":camera_distance", 0),
(position_move_x, pos5, 5, 0),
(try_begin),
(troop_is_hero, ":troop_no"),
(cur_tableau_add_troop, ":troop_no", pos2, ":animation", -1),
(else_try),
(store_mul, ":random_seed", ":troop_no", 126233),
(val_mod, ":random_seed", 1000),
(val_add, ":random_seed", 1),
(cur_tableau_add_troop, ":troop_no", pos2, ":animation", ":random_seed"),
(try_end),
(cur_tableau_set_camera_position, pos5),
(copy_position, pos8, pos5),
(position_rotate_x, pos8, -90), #y axis aligned with camera now. z is up
(position_rotate_z, pos8, 30),
(position_rotate_x, pos8, -60),
(cur_tableau_add_sun_light, pos8, 175,150,125),
]),
#script_get_prosperity_text_to_s50
# INPUT: center_no
# OUTPUT: none
("get_prosperity_text_to_s50",
[(store_script_param, ":center_no", 1),
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(val_div, ":prosperity", 20),
(try_begin),
(eq, ":prosperity", 0),
(str_store_string, s50, "@Very Poor"),
(else_try),
(eq, ":prosperity", 1),
(str_store_string, s50, "@Poor"),
(else_try),
(eq, ":prosperity", 2),
(str_store_string, s50, "@Average"),
(else_try),
(eq, ":prosperity", 3),
(str_store_string, s50, "@Rich"),
(else_try),
(str_store_string, s50, "@Very Rich"),
(try_end),
]),
#script_spawn_bandits
# INPUT: none
# OUTPUT: none
("spawn_bandits",
[(set_spawn_radius,1),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_mountain_bandits"),
(lt,":num_parties",14),
(store_random,":spawn_point",num_mountain_bandit_spawn_points),
(val_add,":spawn_point","p_mountain_bandit_spawn_point"),
(spawn_around_party,":spawn_point","pt_mountain_bandits"),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_forest_bandits"),
(lt,":num_parties",14),
(store_random,":spawn_point",num_mountain_bandit_spawn_points),
(val_add,":spawn_point","p_forest_bandit_spawn_point"),
(spawn_around_party,":spawn_point","pt_forest_bandits"),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_sea_raiders"),
(lt,":num_parties",14),
(store_random,":spawn_point",num_sea_raider_spawn_points),
(val_add,":spawn_point","p_sea_raider_spawn_point_1"),
(spawn_around_party,":spawn_point","pt_sea_raiders"),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_steppe_bandits"),
(lt,":num_parties",14),
(store_random,":spawn_point",num_steppe_bandit_spawn_points),
(val_add,":spawn_point","p_steppe_bandit_spawn_point"),
(spawn_around_party,":spawn_point","pt_steppe_bandits"),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_looters"),
(lt,":num_parties",23),
(store_random_in_range,":spawn_point",villages_begin,villages_end), #spawn looters twice to have lots of them at the beginning
(spawn_around_party,":spawn_point","pt_looters"),
(assign, ":spawned_party_id", reg0),
(try_begin),
(check_quest_active, "qst_deal_with_looters"),
(party_set_flags, ":spawned_party_id", pf_quest_party, 1),
(else_try),
(party_set_flags, ":spawned_party_id", pf_quest_party, 0),
(try_end),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_deserters"),
(lt,":num_parties",15),
(set_spawn_radius, 4),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 5),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(store_troop_faction, ":troop_faction", ":troop_no"),
(neq, ":troop_faction", "fac_player_supporters_faction"),
(gt, ":party_no", 0),
(neg|party_is_in_any_town, ":party_no"),
## (party_get_attached_to, ":attached_party_no", ":party_no"),
## (lt, ":attached_party_no", 0),#in wilderness
(spawn_around_party, ":party_no", "pt_deserters"),
(assign, ":new_party", reg0),
(store_troop_faction, ":faction_no", ":troop_no"),
(faction_get_slot, ":tier_1_troop", ":faction_no", slot_faction_tier_1_troop),
(store_character_level, ":level", "trp_player"),
(store_mul, ":max_number_to_add", ":level", 2),
(val_add, ":max_number_to_add", 11),
(store_random_in_range, ":number_to_add", 10, ":max_number_to_add"),
(party_add_members, ":new_party", ":tier_1_troop", ":number_to_add"),
(store_random_in_range, ":random_no", 1, 4),
(try_for_range, ":unused", 0, ":random_no"),
(party_upgrade_with_xp, ":new_party", 1000000, 0),
(try_end),
## (str_store_party_name, s1, ":party_no"),
## (call_script, "script_get_closest_center", ":party_no"),
## (try_begin),
## (gt, reg0, 0),
## (str_store_party_name, s2, reg0),
## (else_try),
## (str_store_string, s2, "@unknown place"),
## (try_end),
## (assign, reg1, ":number_to_add"),
## (display_message, "@{reg1} Deserters spawned from {s1}, near {s2}."),
(try_end),
(try_end),
]),
#script_count_mission_casualties_from_agents
# INPUT: none
# OUTPUT: none
("count_mission_casualties_from_agents",
[(party_clear, "p_player_casualties"),
(party_clear, "p_enemy_casualties"),
(party_clear, "p_ally_casualties"),
(assign, "$any_allies_at_the_last_battle", 0),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
# This section is added/modified to cope with the array system
(assign, ":array", 0),
(agent_get_party_id, ":agent_party", ":cur_agent"),
(try_begin),
(neq, ":agent_party", "p_main_party"),
(agent_is_ally, ":cur_agent"),
(party_get_slot, ":array_parties", "p_main_party", slot_party_array_parties_begin),
(try_for_range, ":i", 1, ":array_parties"),
(store_add, ":array_slot", slot_party_array_parties_begin, ":i"),
(party_slot_eq, "p_main_party", ":array_slot", ":agent_party"),
(assign, ":array", 1),
(try_end),
(neq, ":array", 1),
(assign, "$any_allies_at_the_last_battle", 1),
(try_end),
(neg|agent_is_alive, ":cur_agent"),
(agent_get_troop_id, ":agent_troop_id", ":cur_agent"),
(try_begin),
(this_or_next|eq, ":agent_party", "p_main_party"),
(eq, ":array", 1),
# array system changes end
(party_add_members, "p_player_casualties", ":agent_troop_id", 1),
(try_begin),
(agent_is_wounded, ":cur_agent"),
(party_wound_members, "p_player_casualties", ":agent_troop_id", 1),
(try_end),
(else_try),
(agent_is_ally, ":cur_agent"),
(party_add_members, "p_ally_casualties", ":agent_troop_id", 1),
(try_begin),
(agent_is_wounded, ":cur_agent"),
(party_wound_members, "p_ally_casualties", ":agent_troop_id", 1),
(try_end),
(else_try),
(party_add_members, "p_enemy_casualties", ":agent_troop_id", 1),
(try_begin),
(agent_is_wounded, ":cur_agent"),
(party_wound_members, "p_enemy_casualties", ":agent_troop_id", 1),
(try_end),
(try_end),
(try_end),
]),
#script_get_max_skill_of_player_party
# INPUT: arg1 = skill_no
# OUTPUT: reg0 = max_skill, reg1 = skill_owner_troop_no
("get_max_skill_of_player_party",
[(store_script_param, ":skill_no", 1),
(party_get_num_companion_stacks, ":num_stacks","p_main_party"),
(store_skill_level, ":max_skill", ":skill_no", "trp_player"),
(assign, ":skill_owner", "trp_player"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
(troop_is_hero, ":stack_troop"),
(neg|troop_is_wounded, ":stack_troop"),
(store_skill_level, ":cur_skill", ":skill_no", ":stack_troop"),
(gt, ":cur_skill", ":max_skill"),
(assign, ":max_skill", ":cur_skill"),
(assign, ":skill_owner", ":stack_troop"),
(try_end),
(assign, reg0, ":max_skill"),
(assign, reg1, ":skill_owner"),
]),
#script_upgrade_hero_party
# INPUT: arg1 = party_id, arg2 = xp_amount
("upgrade_hero_party",
[(store_script_param, ":party_no", 1),
(store_script_param, ":xp_amount", 2),
(party_upgrade_with_xp, ":party_no", ":xp_amount", 0),
]),
#script_get_improvement_details
# INPUT: arg1 = improvement
# OUTPUT: reg0 = base_cost
("get_improvement_details",
[(store_script_param, ":improvement_no", 1),
(try_begin),
(eq, ":improvement_no", slot_center_has_manor),
(str_store_string, s0, "@Manor"),
(str_store_string, s1, "@A manor lets you rest at the village and pay your troops half wages while you rest."),
(assign, reg0, 8000),
(else_try),
(eq, ":improvement_no", slot_center_has_fish_pond),
(str_store_string, s0, "@Mill"),
(str_store_string, s1, "@A mill increases village prosperity by 5%."),
(assign, reg0, 6000),
(else_try),
(eq, ":improvement_no", slot_center_has_watch_tower),
(str_store_string, s0, "@Watch Tower"),
(str_store_string, s1, "@A watch tower lets the villagers raise alarm earlier. The time it takes for enemies to loot the village increases by 25%."),
(assign, reg0, 5000),
(else_try),
(eq, ":improvement_no", slot_center_has_school),
(str_store_string, s0, "@School"),
(str_store_string, s1, "@A shool increases the loyality of the villagers to you by +1 every month."),
(assign, reg0, 9000),
(else_try),
(eq, ":improvement_no", slot_center_has_messenger_post),
(str_store_string, s0, "@Messenger Post"),
(str_store_string, s1, "@A messenger post lets the inhabitants send you a message whenever enemies are nearby, even if you are far away from here."),
(assign, reg0, 4000),
(else_try),
(eq, ":improvement_no", slot_center_has_prisoner_tower),
(str_store_string, s0, "@Prison Tower"),
(str_store_string, s1, "@A prison tower reduces the chance of captives held here running away successfully."),
(assign, reg0, 7000),
(try_end),
]),
#script_cf_troop_agent_is_alive
# INPUT: arg1 = troop_id
("cf_troop_agent_is_alive",
[(store_script_param, ":troop_no", 1),
(assign, ":alive_count", 0),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":troop_no", ":cur_agent_troop"),
(agent_is_alive, ":cur_agent"),
(val_add, ":alive_count", 1),
(try_end),
(gt, ":alive_count", 0),
]),
#script_cf_village_recruit_volunteers_cond
# INPUT: none
# OUTPUT: none
("cf_village_recruit_volunteers_cond",
[(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(store_faction_of_party, ":village_faction", "$current_town"),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(store_relation, ":village_faction_relation", ":village_faction", "fac_player_faction"),
(ge, ":center_relation", 0),
(this_or_next|ge, ":center_relation", 5),
(this_or_next|eq, ":village_faction", "$players_kingdom"),
(this_or_next|ge, ":village_faction_relation", 0),
(this_or_next|eq, ":village_faction", "$supported_pretender_old_faction"),
( eq, "$players_kingdom", 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(ge, ":free_capacity", 1),
]),
#script_village_recruit_volunteers_recruit
# INPUT: none
# OUTPUT: none
("village_recruit_volunteers_recruit",
[(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(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"),
]),
#script_get_troop_item_amount
# INPUT: arg1 = troop_no, arg2 = item_no
# OUTPUT: reg0 = item_amount
("get_troop_item_amount",
[(store_script_param, ":troop_no", 1),
(store_script_param, ":item_no", 2),
(troop_get_inventory_capacity, ":inv_cap", ":troop_no"),
(assign, ":count", 0),
(try_for_range, ":i_slot", 0, ":inv_cap"),
(troop_get_inventory_slot, ":cur_item", ":troop_no", ":i_slot"),
(eq, ":cur_item", ":item_no"),
(val_add, ":count", 1),
(try_end),
(assign, reg0, ":count"),
]),
#script_get_name_from_dna_to_s50
# INPUT: arg1 = dna
# OUTPUT: s50 = name
("get_name_from_dna_to_s50",
[(store_script_param, ":dna", 1),
(store_sub, ":num_names", names_end, names_begin),
(store_sub, ":num_surnames", surnames_end, surnames_begin),
(assign, ":selected_name", ":dna"),
(val_mod, ":selected_name", ":num_names"),
(assign, ":selected_surname", ":dna"),
(val_div, ":selected_surname", ":num_names"),
(val_mod, ":selected_surname", ":num_surnames"),
(val_add, ":selected_name", names_begin),
(val_add, ":selected_surname", surnames_begin),
(str_store_string, s50, ":selected_name"),
(str_store_string, s50, ":selected_surname"),
]),
#script_change_center_prosperity
# INPUT: arg1 = center_no, arg2 = difference
# OUTPUT: none
("change_center_prosperity",
[(store_script_param, ":center_no", 1),
(store_script_param, ":difference", 2),
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(store_add, ":new_prosperity", ":prosperity", ":difference"),
(val_clamp, ":new_prosperity", 0, 100),
(store_div, ":old_state", ":prosperity", 20),
(store_div, ":new_state", ":new_prosperity", 20),
(try_begin),
(neq, ":old_state", ":new_state"),
(str_store_party_name_link, s2, ":center_no"),
(call_script, "script_get_prosperity_text_to_s50", ":center_no"),
(str_store_string, s3, s50),
(party_set_slot, ":center_no", slot_town_prosperity, ":new_prosperity"),
(call_script, "script_get_prosperity_text_to_s50", ":center_no"),
(str_store_string, s4, s50),
(display_message, "@Prosperity of {s2} has changed from {s3} to {s4}."),
(call_script, "script_update_center_notes", ":center_no"),
(else_try),
(party_set_slot, ":center_no", slot_town_prosperity, ":new_prosperity"),
(try_end),
]),
#script_get_center_ideal_prosperity
# INPUT: arg1 = center_no
# OUTPUT: reg0 = ideal_prosperity
("get_center_ideal_prosperity",
[(store_script_param, ":center_no", 1),
(assign, ":ideal", 40),
(try_begin),
(is_between, ":center_no", villages_begin, villages_end),
(try_begin),
(party_slot_eq, ":center_no", slot_center_has_fish_pond, 1),
(val_add, ":ideal", 5),
(try_end),
(party_get_slot, ":land_quality", ":center_no", slot_village_land_quality),
(val_mul, ":land_quality", 3),
(val_add, ":ideal", ":land_quality"),
(party_get_slot, ":num_cattle", ":center_no", slot_village_number_of_cattle),
(val_div, ":num_cattle", 20),
(val_add, ":ideal", ":num_cattle"),
(else_try),
(try_for_range, ":village_no", villages_begin, villages_end),
(party_slot_eq, ":village_no", slot_village_bound_center, ":center_no"),
(party_get_slot, ":prosperity", ":village_no", slot_town_prosperity),
(val_div, ":prosperity", 20),
(val_add, ":ideal", ":prosperity"),
(try_end),
(try_end),
(assign, reg0, ":ideal"),
]),
#script_get_poorest_village_of_faction
# INPUT: arg1 = center_no
# OUTPUT: reg0 = ideal_prosperity
("get_poorest_village_of_faction",
[(store_script_param, ":faction_no", 1),
(assign, ":min_prosperity_village", -1),
(assign, ":min_prosperity", 101),
(try_for_range, ":village_no", villages_begin, villages_end),
(store_faction_of_party, ":village_faction", ":village_no"),
(eq, ":village_faction", ":faction_no"),
(party_get_slot, ":prosperity", ":village_no", slot_town_prosperity),
(lt, ":prosperity", ":min_prosperity"),
(assign, ":min_prosperity", ":prosperity"),
(assign, ":min_prosperity_village", ":village_no"),
(try_end),
(assign, reg0, ":min_prosperity_village"),
]),
#script_troop_add_gold
# INPUT: arg1 = troop_no, arg2 = amount
# OUTPUT: none
("troop_add_gold",
[(store_script_param, ":troop_no", 1),
(store_script_param, ":amount", 2),
(troop_add_gold, ":troop_no", ":amount"),
(try_begin),
(eq, ":troop_no", "trp_player"),
(play_sound, "snd_money_received"),
(try_end),
]),
#NPC companion changes begin
("initialize_npcs",
[
# set strings
(troop_set_slot, "trp_npc1", slot_troop_morality_type, tmt_egalitarian), #borcha
(troop_set_slot, "trp_npc1", slot_troop_morality_value, 4), #borcha
(troop_set_slot, "trp_npc1", slot_troop_2ary_morality_type, tmt_aristocratic), #borcha
(troop_set_slot, "trp_npc1", slot_troop_2ary_morality_value, -1),
(troop_set_slot, "trp_npc1", slot_troop_personalityclash_object, "trp_npc7"), #borcha - deshavi
(troop_set_slot, "trp_npc1", slot_troop_personalityclash2_object, "trp_npc16"), #borcha - klethi
(troop_set_slot, "trp_npc1", slot_troop_personalitymatch_object, "trp_npc2"), #borcha - marnid
(troop_set_slot, "trp_npc1", slot_troop_home, "p_village_71"), #Tshibtin
(troop_set_slot, "trp_npc1", slot_troop_payment_request, 300),
(troop_set_slot, "trp_npc2", slot_troop_morality_type, tmt_humanitarian), #marnid
(troop_set_slot, "trp_npc2", slot_troop_morality_value, 2),
(troop_set_slot, "trp_npc2", slot_troop_2ary_morality_type, tmt_honest),
(troop_set_slot, "trp_npc2", slot_troop_2ary_morality_value, 1),
(troop_set_slot, "trp_npc2", slot_troop_personalityclash_object, "trp_npc5"), #marnid - beheshtur
(troop_set_slot, "trp_npc2", slot_troop_personalityclash2_object, "trp_npc9"), #marnid - alayen
(troop_set_slot, "trp_npc2", slot_troop_personalitymatch_object, "trp_npc1"), #marnid - borcha
(troop_set_slot, "trp_npc2", slot_troop_home, "p_town_1"), #Sargoth
(troop_set_slot, "trp_npc2", slot_troop_payment_request, 0),
#
(troop_set_slot, "trp_npc3", slot_troop_morality_type, tmt_humanitarian), #Ymira
(troop_set_slot, "trp_npc3", slot_troop_morality_value, 4),
(troop_set_slot, "trp_npc3", slot_troop_2ary_morality_type, tmt_aristocratic),
(troop_set_slot, "trp_npc3", slot_troop_2ary_morality_value, -1),
(troop_set_slot, "trp_npc3", slot_troop_personalityclash_object, "trp_npc14"), #Ymira - artimenner
(troop_set_slot, "trp_npc3", slot_troop_personalityclash2_object, "trp_npc8"), #Ymira - matheld
(troop_set_slot, "trp_npc3", slot_troop_personalitymatch_object, "trp_npc9"), #Ymira - alayen
(troop_set_slot, "trp_npc3", slot_troop_home, "p_town_3"), #Veluca
(troop_set_slot, "trp_npc3", slot_troop_payment_request, 0),
(troop_set_slot, "trp_npc4", slot_troop_morality_type, tmt_aristocratic), #Rolf
(troop_set_slot, "trp_npc4", slot_troop_morality_value, 4),
(troop_set_slot, "trp_npc4", slot_troop_2ary_morality_type, tmt_honest),
(troop_set_slot, "trp_npc4", slot_troop_2ary_morality_value, -1),
(troop_set_slot, "trp_npc4", slot_troop_personalityclash_object, "trp_npc10"), #Rolf - bunduk
(troop_set_slot, "trp_npc4", slot_troop_personalityclash2_object, "trp_npc7"), #Rolf - deshavi
(troop_set_slot, "trp_npc4", slot_troop_personalitymatch_object, "trp_npc5"), #Rolf - beheshtur
(troop_set_slot, "trp_npc4", slot_troop_home, "p_village_34"), #Ehlerdah
(troop_set_slot, "trp_npc4", slot_troop_payment_request, 300),
(troop_set_slot, "trp_npc5", slot_troop_morality_type, tmt_egalitarian), #beheshtur
(troop_set_slot, "trp_npc5", slot_troop_morality_value, 3), #beheshtur
(troop_set_slot, "trp_npc5", slot_troop_2ary_morality_type, -1),
(troop_set_slot, "trp_npc5", slot_troop_2ary_morality_value, 0),
(troop_set_slot, "trp_npc5", slot_troop_personalityclash_object, "trp_npc2"), #beheshtur - marnid
(troop_set_slot, "trp_npc5", slot_troop_personalityclash2_object, "trp_npc11"), #beheshtur- katrin
(troop_set_slot, "trp_npc5", slot_troop_personalitymatch_object, "trp_npc4"), #beheshtur - rolf
(troop_set_slot, "trp_npc5", slot_troop_home, "p_town_14"), #Halmar
(troop_set_slot, "trp_npc5", slot_troop_payment_request, 400),
(troop_set_slot, "trp_npc6", slot_troop_morality_type, tmt_humanitarian), #firenz
(troop_set_slot, "trp_npc6", slot_troop_morality_value, 2), #beheshtur
(troop_set_slot, "trp_npc6", slot_troop_2ary_morality_type, tmt_honest),
(troop_set_slot, "trp_npc6", slot_troop_2ary_morality_value, 1),
(troop_set_slot, "trp_npc6", slot_troop_personalityclash_object, "trp_npc11"), #firenz
(troop_set_slot, "trp_npc6", slot_troop_personalityclash2_object, "trp_npc13"), #firenz - nizar
(troop_set_slot, "trp_npc6", slot_troop_personalitymatch_object, "trp_npc12"), #firenz - jeremus
(troop_set_slot, "trp_npc6", slot_troop_home, "p_town_4"), #Suno
(troop_set_slot, "trp_npc6", slot_troop_payment_request, 0),
(troop_set_slot, "trp_npc7", slot_troop_morality_type, tmt_egalitarian), #deshavi
(troop_set_slot, "trp_npc7", slot_troop_morality_value, 3), #beheshtur
(troop_set_slot, "trp_npc7", slot_troop_2ary_morality_type, -1),
(troop_set_slot, "trp_npc7", slot_troop_2ary_morality_value, 0),
(troop_set_slot, "trp_npc7", slot_troop_personalityclash_object, "trp_npc1"), #deshavi
(troop_set_slot, "trp_npc7", slot_troop_personalityclash2_object, "trp_npc4"), #deshavi - rolf
(troop_set_slot, "trp_npc7", slot_troop_personalitymatch_object, "trp_npc16"), #deshavi - klethi
(troop_set_slot, "trp_npc7", slot_troop_home, "p_village_5"), #Kulum
# (troop_set_slot, "trp_npc7", slot_troop_payment_request, 300),
(troop_set_slot, "trp_npc8", slot_troop_morality_type, tmt_aristocratic), #matheld
(troop_set_slot, "trp_npc8", slot_troop_morality_value, 3), #beheshtur
(troop_set_slot, "trp_npc8", slot_troop_2ary_morality_type, -1),
(troop_set_slot, "trp_npc8", slot_troop_2ary_morality_value, 0),
(troop_set_slot, "trp_npc8", slot_troop_personalityclash_object, "trp_npc12"), #matheld
(troop_set_slot, "trp_npc8", slot_troop_personalityclash2_object, "trp_npc3"), #matheld - ymira
(troop_set_slot, "trp_npc8", slot_troop_personalitymatch_object, "trp_npc13"), #matheld - nizar
(troop_set_slot, "trp_npc8", slot_troop_home, "p_sea_raider_spawn_point_2"), #Gundig's Point
(troop_set_slot, "trp_npc8", slot_troop_payment_request, 500),
(troop_set_slot, "trp_npc9", slot_troop_morality_type, tmt_aristocratic), #alayen
(troop_set_slot, "trp_npc9", slot_troop_morality_value, 2), #beheshtur
(troop_set_slot, "trp_npc9", slot_troop_2ary_morality_type, tmt_honest),
(troop_set_slot, "trp_npc9", slot_troop_2ary_morality_value, 1),
(troop_set_slot, "trp_npc9", slot_troop_personalityclash_object, "trp_npc13"), #alayen
(troop_set_slot, "trp_npc9", slot_troop_personalityclash2_object, "trp_npc2"), #alayen - marnid
(troop_set_slot, "trp_npc9", slot_troop_personalitymatch_object, "trp_npc3"), #alayen - ymira
(troop_set_slot, "trp_npc9", slot_troop_home, "p_town_13"), #Rivacheg
(troop_set_slot, "trp_npc9", slot_troop_payment_request, 300),
(troop_set_slot, "trp_npc10", slot_troop_morality_type, tmt_humanitarian), #bunduk
(troop_set_slot, "trp_npc10", slot_troop_morality_value, 2),
(troop_set_slot, "trp_npc10", slot_troop_2ary_morality_type, tmt_egalitarian),
(troop_set_slot, "trp_npc10", slot_troop_2ary_morality_value, 1),
(troop_set_slot, "trp_npc10", slot_troop_personalityclash_object, "trp_npc4"), #bunduk
(troop_set_slot, "trp_npc10", slot_troop_personalityclash2_object, "trp_npc14"), #bunduk - lazalet
(troop_set_slot, "trp_npc10", slot_troop_personalitymatch_object, "trp_npc11"), #bunduk - katrin
(troop_set_slot, "trp_npc10", slot_troop_home, "p_castle_28"), #Grunwalder Castle
(troop_set_slot, "trp_npc10", slot_troop_payment_request, 200),
(troop_set_slot, "trp_npc11", slot_troop_morality_type, tmt_egalitarian), #katrin
(troop_set_slot, "trp_npc11", slot_troop_morality_value, 3),
(troop_set_slot, "trp_npc11", slot_troop_2ary_morality_type, -1),
(troop_set_slot, "trp_npc11", slot_troop_2ary_morality_value, 0),
(troop_set_slot, "trp_npc11", slot_troop_personalityclash_object, "trp_npc6"), #katrin
(troop_set_slot, "trp_npc11", slot_troop_personalityclash2_object, "trp_npc5"), #katrin - beheshtur
(troop_set_slot, "trp_npc11", slot_troop_personalitymatch_object, "trp_npc10"), #bunduk - katrin
(troop_set_slot, "trp_npc11", slot_troop_home, "p_town_6"), #Praven
(troop_set_slot, "trp_npc11", slot_troop_payment_request, 100),
(troop_set_slot, "trp_npc12", slot_troop_morality_type, tmt_humanitarian), #jerem
(troop_set_slot, "trp_npc12", slot_troop_morality_value, 3),
(troop_set_slot, "trp_npc12", slot_troop_2ary_morality_type, -1),
(troop_set_slot, "trp_npc12", slot_troop_2ary_morality_value, 0),
(troop_set_slot, "trp_npc12", slot_troop_personalityclash_object, "trp_npc8"), #jerem
(troop_set_slot, "trp_npc12", slot_troop_personalityclash2_object, "trp_npc15"), #jeremus - artimenner
(troop_set_slot, "trp_npc12", slot_troop_personalitymatch_object, "trp_npc6"), #jeremus - firenz
(troop_set_slot, "trp_npc12", slot_troop_home, "p_castle_16"), #undetermined #University
(troop_set_slot, "trp_npc12", slot_troop_payment_request, 0),
(troop_set_slot, "trp_npc13", slot_troop_morality_type, tmt_aristocratic), #nizar
(troop_set_slot, "trp_npc13", slot_troop_morality_value, 3),
(troop_set_slot, "trp_npc13", slot_troop_2ary_morality_type, -1),
(troop_set_slot, "trp_npc13", slot_troop_2ary_morality_value, 0),
(troop_set_slot, "trp_npc13", slot_troop_personalityclash_object, "trp_npc9"), #nizar
(troop_set_slot, "trp_npc13", slot_troop_personalityclash2_object, "trp_npc6"), #nizar - firenz
(troop_set_slot, "trp_npc13", slot_troop_personalitymatch_object, "trp_npc8"), #nizar - matheld
(troop_set_slot, "trp_npc13", slot_troop_home, "p_castle_15"), #Ergellon Castle
(troop_set_slot, "trp_npc13", slot_troop_payment_request, 300),
(troop_set_slot, "trp_npc14", slot_troop_morality_type, tmt_aristocratic), #lazalit
(troop_set_slot, "trp_npc14", slot_troop_morality_value, 4),
(troop_set_slot, "trp_npc14", slot_troop_2ary_morality_type, tmt_egalitarian),
(troop_set_slot, "trp_npc14", slot_troop_2ary_morality_value, -1),
(troop_set_slot, "trp_npc14", slot_troop_personalityclash_object, "trp_npc3"), #lazalit
(troop_set_slot, "trp_npc14", slot_troop_personalityclash2_object, "trp_npc10"), #lazalit - bunduk
(troop_set_slot, "trp_npc14", slot_troop_personalitymatch_object, "trp_npc15"), #lazalit - artimenner
(troop_set_slot, "trp_npc14", slot_troop_home, "p_castle_18"), #Ismirala Castle
(troop_set_slot, "trp_npc14", slot_troop_payment_request, 400),
(troop_set_slot, "trp_npc15", slot_troop_morality_type, tmt_egalitarian), #artimenner
(troop_set_slot, "trp_npc15", slot_troop_morality_value, 2),
(troop_set_slot, "trp_npc15", slot_troop_2ary_morality_type, tmt_honest),
(troop_set_slot, "trp_npc15", slot_troop_2ary_morality_value, 1),
(troop_set_slot, "trp_npc15", slot_troop_personalityclash_object, "trp_npc16"), #artimenner - klethi
(troop_set_slot, "trp_npc15", slot_troop_personalityclash2_object, "trp_npc12"), #artimenner - jeremus
(troop_set_slot, "trp_npc15", slot_troop_personalitymatch_object, "trp_npc14"), #lazalit - artimenner
(troop_set_slot, "trp_npc15", slot_troop_home, "p_castle_1"), #Culmarr Castle
(troop_set_slot, "trp_npc15", slot_troop_payment_request, 300),
(troop_set_slot, "trp_npc16", slot_troop_morality_type, tmt_aristocratic), #klethi
(troop_set_slot, "trp_npc16", slot_troop_morality_value, 4),
(troop_set_slot, "trp_npc16", slot_troop_2ary_morality_type, tmt_humanitarian),
(troop_set_slot, "trp_npc16", slot_troop_2ary_morality_value, -1),
(troop_set_slot, "trp_npc16", slot_troop_personalityclash_object, "trp_npc15"), #klethi
(troop_set_slot, "trp_npc16", slot_troop_personalityclash2_object, "trp_npc1"), #klethi - borcha
(troop_set_slot, "trp_npc16", slot_troop_personalitymatch_object, "trp_npc7"), #deshavi - klethi
(troop_set_slot, "trp_npc16", slot_troop_home, "p_village_20"), #Uslum
(troop_set_slot, "trp_npc16", slot_troop_payment_request, 200),
(store_sub, "$number_of_npc_slots", slot_troop_strings_end, slot_troop_intro),
(try_for_range, ":npc", companions_begin, companions_end),
(try_for_range, ":slot_addition", 0, "$number_of_npc_slots"),
(store_add, ":slot", ":slot_addition", slot_troop_intro),
(store_mul, ":string_addition", ":slot_addition", 16),
(store_add, ":string", "str_npc1_intro", ":string_addition"),
(val_add, ":string", ":npc"),
(val_sub, ":string", companions_begin),
(troop_set_slot, ":npc", ":slot", ":string"),
(try_end),
(try_end),
#Troop commentary changes begin
(try_for_range, ":lord", "trp_knight_1_1", "trp_heroes_end"),
(store_random_in_range, ":reputation", 0, 8),
(try_begin),
(eq, ":reputation", 0),
(assign, ":reputation", 1),
(try_end),
(troop_set_slot, ":lord", slot_lord_reputation_type, ":reputation"),
(try_end),
#Troop commentary changes end
#Post 0907 changes begin
(call_script, "script_add_log_entry", logent_game_start, "trp_player", -1, -1, -1),
#Post 0907 changes end
#Rebellion changes begin
(troop_set_slot, "trp_kingdom_1_pretender", slot_troop_original_faction, "fac_kingdom_1"),
(troop_set_slot, "trp_kingdom_2_pretender", slot_troop_original_faction, "fac_kingdom_2"),
(troop_set_slot, "trp_kingdom_3_pretender", slot_troop_original_faction, "fac_kingdom_3"),
(troop_set_slot, "trp_kingdom_4_pretender", slot_troop_original_faction, "fac_kingdom_4"),
(troop_set_slot, "trp_kingdom_5_pretender", slot_troop_original_faction, "fac_kingdom_5"),
(troop_set_slot, "trp_kingdom_1_pretender", slot_troop_support_base, "p_town_4"), #suno
(troop_set_slot, "trp_kingdom_2_pretender", slot_troop_support_base, "p_town_11"), #curaw
(troop_set_slot, "trp_kingdom_3_pretender", slot_troop_support_base, "p_town_18"), #town_18
(troop_set_slot, "trp_kingdom_4_pretender", slot_troop_support_base, "p_town_12"), #wercheg
(troop_set_slot, "trp_kingdom_5_pretender", slot_troop_support_base, "p_town_3"), #veluca
(try_for_range, ":pretender", pretenders_begin, pretenders_end),
(troop_set_slot, ":pretender", slot_lord_reputation_type, lrep_none),
(try_end),
#Rebellion changes end
]),
("objectionable_action",
[
(store_script_param_1, ":action_type"),
(store_script_param_2, ":action_string"),
# (str_store_string, 12, ":action_string"),
# (display_message, "@Objectionable action check: {s12}"),
(assign, ":grievance_minimum", -2),
(try_for_range, ":npc", companions_begin, companions_end),
(main_party_has_troop, ":npc"),
###Primary morality check
(try_begin),
(troop_slot_eq, ":npc", slot_troop_morality_type, ":action_type"),
(troop_get_slot, ":value", ":npc", slot_troop_morality_value),
(try_begin),
(troop_slot_eq, ":npc", slot_troop_morality_state, tms_acknowledged),
# npc is betrayed, major penalty to player honor and morale
(troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties),
(val_mul, ":value", 2),
(val_add, ":grievance", ":value"),
(troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"),
(else_try),
(this_or_next|troop_slot_eq, ":npc", slot_troop_morality_state, tms_dismissed),
(eq, "$disable_npc_complaints", 1),
# npc is quietly disappointed
(troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties),
(val_add, ":grievance", ":value"),
(troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"),
(else_try),
# npc raises the issue for the first time
(troop_slot_eq, ":npc", slot_troop_morality_state, tms_no_problem),
(gt, ":value", ":grievance_minimum"),
(assign, "$npc_with_grievance", ":npc"),
(assign, "$npc_grievance_string", ":action_string"),
(assign, "$npc_grievance_slot", slot_troop_morality_state),
(assign, ":grievance_minimum", ":value"),
(assign, "$npc_praise_not_complaint", 0),
(try_begin),
(lt, ":value", 0),
(assign, "$npc_praise_not_complaint", 1),
(try_end),
(try_end),
###Secondary morality check
(else_try),
(troop_slot_eq, ":npc", slot_troop_2ary_morality_type, ":action_type"),
(troop_get_slot, ":value", ":npc", slot_troop_2ary_morality_value),
(try_begin),
(troop_slot_eq, ":npc", slot_troop_2ary_morality_state, tms_acknowledged),
# npc is betrayed, major penalty to player honor and morale
(troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties),
(val_mul, ":value", 2),
(val_add, ":grievance", ":value"),
(troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"),
(else_try),
(this_or_next|troop_slot_eq, ":npc", slot_troop_2ary_morality_state, tms_dismissed),
(eq, "$disable_npc_complaints", 1),
# npc is quietly disappointed
(troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties),
(val_add, ":grievance", ":value"),
(troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"),
(else_try),
# npc raises the issue for the first time
(troop_slot_eq, ":npc", slot_troop_2ary_morality_state, tms_no_problem),
(gt, ":value", ":grievance_minimum"),
(assign, "$npc_with_grievance", ":npc"),
(assign, "$npc_grievance_string", ":action_string"),
(assign, "$npc_grievance_slot", slot_troop_2ary_morality_state),
(assign, ":grievance_minimum", ":value"),
(assign, "$npc_praise_not_complaint", 0),
(try_begin),
(lt, ":value", 0),
(assign, "$npc_praise_not_complaint", 1),
(try_end),
(try_end),
(try_end),
(try_begin),
(gt, "$npc_with_grievance", 0),
(eq, "$npc_praise_not_complaint", 0),
(str_store_troop_name, 4, "$npc_with_grievance"),
(display_message, "@{s4} looks upset."),
(try_end),
(try_end),
]),
("post_battle_personality_clash_check",
[
# (display_message, "@Post-victory personality clash check"),
(try_for_range, ":npc", companions_begin, companions_end),
(eq, "$disable_npc_complaints", 0),
(main_party_has_troop, ":npc"),
(neg|troop_is_wounded, ":npc"),
(troop_get_slot, ":other_npc", ":npc", slot_troop_personalityclash2_object),
(main_party_has_troop, ":other_npc"),
(neg|troop_is_wounded, ":other_npc"),
# (store_random_in_range, ":random", 0, 3),
(try_begin),
(troop_slot_eq, ":npc", slot_troop_personalityclash2_state, 0),
(try_begin),
# (eq, ":random", 0),
(assign, "$npc_with_personality_clash_2", ":npc"),
(try_end),
(try_end),
(try_end),
(try_for_range, ":npc", companions_begin, companions_end),
(troop_slot_eq, ":npc", slot_troop_personalitymatch_state, 0),
(eq, "$disable_npc_complaints", 0),
(main_party_has_troop, ":npc"),
(neg|troop_is_wounded, ":npc"),
(troop_get_slot, ":other_npc", ":npc", slot_troop_personalitymatch_object),
(main_party_has_troop, ":other_npc"),
(neg|troop_is_wounded, ":other_npc"),
(assign, "$npc_with_personality_match", ":npc"),
(try_end),
(try_begin),
(gt, "$npc_with_personality_clash_2", 0),
(assign, "$npc_map_talk_context", slot_troop_personalityclash2_state),
(start_map_conversation, "$npc_with_personality_clash_2"),
(else_try),
(gt, "$npc_with_personality_match", 0),
(assign, "$npc_map_talk_context", slot_troop_personalitymatch_state),
(start_map_conversation, "$npc_with_personality_match"),
(try_end),
]),
#script_event_player_defeated_enemy_party
# INPUT: none
# OUTPUT: none
("event_player_defeated_enemy_party",
[(try_begin),
(check_quest_active, "qst_raid_caravan_to_start_war"),
(neg|check_quest_concluded, "qst_raid_caravan_to_start_war"),
(party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_caravan),
(store_faction_of_party, ":enemy_faction", "$g_enemy_party"),
(quest_slot_eq, "qst_raid_caravan_to_start_war", slot_quest_target_faction, ":enemy_faction"),
(quest_get_slot, ":cur_state", "qst_raid_caravan_to_start_war", slot_quest_current_state),
(quest_get_slot, ":quest_target_amount", "qst_raid_caravan_to_start_war", slot_quest_target_amount),
(val_add, ":cur_state", 1),
(quest_set_slot, "qst_raid_caravan_to_start_war", slot_quest_current_state, ":cur_state"),
(try_begin),
(ge, ":cur_state", ":quest_target_amount"),
(quest_get_slot, ":quest_target_faction", "qst_raid_caravan_to_start_war", slot_quest_target_faction),
(quest_get_slot, ":quest_giver_troop", "qst_raid_caravan_to_start_war", slot_quest_giver_troop),
(store_troop_faction, ":quest_giver_faction", ":quest_giver_troop"),
(call_script, "script_diplomacy_start_war_between_kingdoms", ":quest_target_faction", ":quest_giver_faction", 1),
(call_script, "script_succeed_quest", "qst_raid_caravan_to_start_war"),
(try_end),
(try_end),
]),
#script_event_player_captured_as_prisoner
# INPUT: none
# OUTPUT: none
("event_player_captured_as_prisoner",
[
(try_begin),
(check_quest_active, "qst_raid_caravan_to_start_war"),
(neg|check_quest_concluded, "qst_raid_caravan_to_start_war"),
(quest_get_slot, ":quest_target_faction", "qst_raid_caravan_to_start_war", slot_quest_target_faction),
(store_faction_of_party, ":capturer_faction", "$capturer_party"),
(eq, ":quest_target_faction", ":capturer_faction"),
(call_script, "script_fail_quest", "qst_raid_caravan_to_start_war"),
(try_end),
#Removing followers of the player
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(gt, ":party_no", 0),
(party_slot_eq, ":party_no", slot_party_commander_party, "p_main_party"),
(call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(assign, "$g_recalculate_ais", 1),
(try_end),
]),
#NPC morale both returns a string and reg0 as the morale value
("npc_morale",
[
(store_script_param_1, ":npc"),
(troop_get_slot, ":morality_grievances", ":npc", slot_troop_morality_penalties),
(troop_get_slot, ":personality_grievances", ":npc", slot_troop_personalityclash_penalties),
(party_get_morale, ":party_morale", "p_main_party"),
(store_sub, ":troop_morale", ":party_morale", ":morality_grievances"),
(val_sub, ":troop_morale", ":personality_grievances"),
(val_add, ":troop_morale", 50),
(assign, reg8, ":troop_morale"),
(val_mul, ":troop_morale", 3),
(val_div, ":troop_morale", 4),
(val_clamp, ":troop_morale", 0, 100),
(assign, reg5, ":party_morale"),
(assign, reg6, ":morality_grievances"),
(assign, reg7, ":personality_grievances"),
(assign, reg9, ":troop_morale"),
# (str_store_troop_name, s11, ":npc"),
# (display_message, "@{s11}'s morale = PM{reg5} + 50 - MG{reg6} - PG{reg7} = {reg8} x 0.75 = {reg9}"),
(try_begin),
(lt, ":morality_grievances", 3),
(str_store_string, 7, "str_happy"),
(else_try),
(lt, ":morality_grievances", 15),
(str_store_string, 7, "str_content"),
(else_try),
(lt, ":morality_grievances", 30),
(str_store_string, 7, "str_concerned"),
(else_try),
(lt, ":morality_grievances", 45),
(str_store_string, 7, "str_not_happy"),
(else_try),
(str_store_string, 7, "str_miserable"),
(try_end),
(try_begin),
(lt, ":personality_grievances", 3),
(str_store_string, 6, "str_happy"),
(else_try),
(lt, ":personality_grievances", 15),
(str_store_string, 6, "str_content"),
(else_try),
(lt, ":personality_grievances", 30),
(str_store_string, 6, "str_concerned"),
(else_try),
(lt, ":personality_grievances", 45),
(str_store_string, 6, "str_not_happy"),
(else_try),
(str_store_string, 6, "str_miserable"),
(try_end),
(try_begin),
(gt, ":troop_morale", 80),
(str_store_string, 8, "str_happy"),
(str_store_string, 63, "str_bar_enthusiastic"),
(else_try),
(gt, ":troop_morale", 60),
(str_store_string, 8, "str_content"),
(str_store_string, 63, "str_bar_content"),
(else_try),
(gt, ":troop_morale", 40),
(str_store_string, 8, "str_concerned"),
(str_store_string, 63, "str_bar_weary"),
(else_try),
(gt, ":troop_morale", 20),
(str_store_string, 8, "str_not_happy"),
(str_store_string, 63, "str_bar_disgruntled"),
(else_try),
(str_store_string, 8, "str_miserable"),
(str_store_string, 63, "str_bar_miserable"),
(try_end),
(str_store_string, 21, "str_npc_morale_report"),
(assign, reg0, ":troop_morale"),
]),
#NPC morale both returns a string and reg0 as the morale value
#
("retire_companion", [
(store_script_param_1, ":npc"),
(store_script_param_2, ":length"),
(remove_member_from_party, ":npc", "p_main_party"),
(troop_set_slot, ":npc", slot_troop_personalityclash_penalties, 0),
(troop_set_slot, ":npc", slot_troop_morality_penalties, 0),
(troop_get_slot, ":renown", "trp_player", slot_troop_renown),
(store_add, ":return_renown", ":renown", ":length"),
(troop_set_slot, ":npc", slot_troop_occupation, slto_retirement),
(troop_set_slot, ":npc", slot_troop_return_renown, ":return_renown"),
(call_script, "script_reassign_array_on_npc_leave", ":npc"), # Added by Form Ranks kit
]),
#############################
# Form Ranks kit section
#
# script_array_reassign_on_npc_leave
# take back array command if an npc leaves
# input: arg1: npc
# output: none
("reassign_array_on_npc_leave",
[(store_script_param_1, ":npc"),
(party_get_num_attached_parties, ":num", "p_main_party"),
(assign, ":dismissed_array", -1),
(try_for_range, ":i", 0, ":num"),
(store_add, ":next", ":i", 1),
(store_add, ":slot", slot_party_array_parties_begin, ":next"),
(party_get_slot, ":next_array_party", "p_main_party", ":slot"),
(party_get_slot, ":leader", ":next_array_party", slot_array_party_leader),
(try_begin),
(eq, ":leader", ":npc"),
(assign, ":dismissed_array", ":next_array_party"),
(else_try),
(neq, ":dismissed_array", -1),
(store_add, ":array_string", formation_array_names_begin, ":i"),
(str_store_string, s1, ":array_string"),
(str_store_troop_name, s2, ":leader"),
(str_store_string, s1, "@{s2}'s {s1}"),
(val_sub, ":slot", 1),
(party_set_slot, "p_main_party", ":slot", ":next_array_party"),
(party_set_name, ":next_array_party", s1),
(try_end),
(try_end),
(try_begin),
(neq, ":dismissed_array", -1),
(val_sub, ":num", 1),
(party_detach, ":dismissed_array"),
(assign, "$g_move_heroes", 0),
(call_script, "script_party_add_party_companions", "p_main_party", ":dismissed_array"),
(remove_party, ":dismissed_array"),
(party_set_slot, "p_main_party", slot_party_array_parties_begin, ":num"),
(str_store_troop_name, s1, ":npc"),
(display_message, "@{s1}'s command dismissed.", formation_message_color),
(try_end),
]
),
#
# Form Ranks kit section end
#############################
#NPC companion changes end
#script_reduce_companion_morale_for_clash
#script_calculate_ransom_amount_for_troop
# INPUT: arg1 = troop_no for companion1 arg2 = troop_no for companion2 arg3 = slot_for_clash_state
# slot_for_clash_state means: 1=give full penalty to companion1; 2=give full penalty to companion2; 3=give penalty equally
("reduce_companion_morale_for_clash",
[
(store_script_param, ":companion_1", 1),
(store_script_param, ":companion_2", 2),
(store_script_param, ":slot_for_clash_state", 3),
(troop_get_slot, ":clash_state", ":companion_1", ":slot_for_clash_state"),
(troop_get_slot, ":grievance_1", ":companion_1", slot_troop_personalityclash_penalties),
(troop_get_slot, ":grievance_2", ":companion_2", slot_troop_personalityclash_penalties),
(try_begin),
(eq, ":clash_state", pclash_penalty_to_self),
(val_add, ":grievance_1", 5),
(else_try),
(eq, ":clash_state", pclash_penalty_to_other),
(val_add, ":grievance_2", 5),
(else_try),
(eq, ":clash_state", pclash_penalty_to_both),
(val_add, ":grievance_1", 3),
(val_add, ":grievance_2", 3),
(try_end),
(troop_set_slot, ":companion_1", slot_troop_personalityclash_penalties, ":grievance_1"),
(troop_set_slot, ":companion_2", slot_troop_personalityclash_penalties, ":grievance_2"),
]),
#Hunting scripts end
#script_calculate_ransom_amount_for_troop
# INPUT: arg1 = troop_no
# OUTPUT: reg0 = ransom_amount
("calculate_ransom_amount_for_troop",
[(store_script_param, ":troop_no", 1),
(store_troop_faction, ":faction_no", ":troop_no"),
(assign, ":ransom_amount", 400),
(try_begin),
(faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"),
(val_add, ":ransom_amount", 4000),
(try_end),
(assign, ":num_center_points", 0),
(try_for_range, ":cur_center", centers_begin, centers_end),
(party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"),
(try_begin),
(party_slot_eq, ":cur_center", slot_party_type, spt_town),
(val_add, ":num_center_points", 4),
(else_try),
(party_slot_eq, ":cur_center", slot_party_type, spt_castle),
(val_add, ":num_center_points", 2),
(else_try),
(val_add, ":num_center_points", 1),
(try_end),
(try_end),
(val_mul, ":num_center_points", 500),
(val_add, ":ransom_amount", ":num_center_points"),
(troop_get_slot, ":renown", ":troop_no", slot_troop_renown),
(val_mul, ":renown", 2),
(val_add, ":ransom_amount", ":renown"),
(store_mul, ":ransom_max_amount", ":ransom_amount", 3),
(val_div, ":ransom_max_amount", 2),
(store_random_in_range, ":random_ransom_amount", ":ransom_amount", ":ransom_max_amount"),
(val_div, ":random_ransom_amount", 100),
(val_mul, ":random_ransom_amount", 100),
(assign, reg0, ":random_ransom_amount"),
]),
#script_offer_ransom_amount_to_player_for_prisoners_in_party
# INPUT: arg1 = party_no
# OUTPUT: reg0 = result (1 = offered, 0 = not offered)
("offer_ransom_amount_to_player_for_prisoners_in_party",
[(store_script_param, ":party_no", 1),
(assign, ":result", 0),
(party_get_num_prisoner_stacks, ":num_stacks", ":party_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(eq, ":result", 0),
(party_prisoner_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
(troop_is_hero, ":stack_troop"),
(troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":stack_troop_faction", ":stack_troop"),
(store_random_in_range, ":random_no", 0, 100),
(try_begin),
(faction_slot_eq, ":stack_troop_faction", slot_faction_state, sfs_active),
(le, ":random_no", 5),
(neq, "$g_ransom_offer_rejected", 1),
(assign, ":num_stacks", 0), #break
(assign, ":result", 1),
(assign, "$g_ransom_offer_troop", ":stack_troop"),
(assign, "$g_ransom_offer_party", ":party_no"),
(jump_to_menu, "mnu_enemy_offer_ransom_for_prisoner"),
(try_end),
(try_end),
(assign, reg0, ":result"),
]),
# script_event_hero_taken_prisoner_by_player
# Input: arg1 = troop_no
# Output: none
("event_hero_taken_prisoner_by_player",
[
(store_script_param_1, ":troop_no"),
(try_begin),
(check_quest_active, "qst_persuade_lords_to_make_peace"),
(try_begin),
(quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, ":troop_no"),
(val_mul, ":troop_no", -1),
(quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, ":troop_no"),
(val_mul, ":troop_no", -1),
(else_try),
(quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, ":troop_no"),
(val_mul, ":troop_no", -1),
(quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, ":troop_no"),
(val_mul, ":troop_no", -1),
(try_end),
(neg|check_quest_concluded, "qst_persuade_lords_to_make_peace"),
(neg|quest_slot_ge, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, 0),
(neg|quest_slot_ge, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, 0),
(call_script, "script_succeed_quest", "qst_persuade_lords_to_make_peace"),
(try_end),
(call_script, "script_update_troop_location_notes", ":troop_no", 0),
]),
# script_cf_check_hero_can_escape_from_player
# Input: arg1 = troop_no
# Output: none (can fail)
("cf_check_hero_can_escape_from_player",
[
(store_script_param_1, ":troop_no"),
(assign, ":quest_target", 0),
(try_begin),
(check_quest_active, "qst_persuade_lords_to_make_peace"),
(this_or_next|quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, ":troop_no"),
(quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, ":troop_no"),
(assign, ":quest_target", 1),
(try_end),
(eq, ":quest_target", 0),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", hero_escape_after_defeat_chance),
]),
# script_cf_party_remove_random_regular_troop
# Input: arg1 = party_no
# Output: troop_id that has been removed (can fail)
("cf_party_remove_random_regular_troop",
[(store_script_param_1, ":party_no"),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(assign, ":num_troops", 0),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size", ":party_no", ":i_stack"),
(val_add, ":num_troops", ":stack_size"),
(try_end),
(assign, reg0, -1),
(gt, ":num_troops", 0),
(store_random_in_range, ":random_troop", 0, ":num_troops"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size", ":party_no", ":i_stack"),
(val_sub, ":random_troop", ":stack_size"),
(lt, ":random_troop", 0),
(assign, ":num_stacks", 0), #break
(party_remove_members, ":party_no", ":stack_troop", 1),
(assign, reg0, ":stack_troop"),
(try_end),
]),
# script_place_player_banner_near_inventory
# Input: none
# Output: none
("place_player_banner_near_inventory",
[
#normal_banner_begin
(troop_get_slot, ":troop_banner_object", "trp_player", slot_troop_banner_scene_prop),
#custom_banner_begin
# (troop_get_slot, ":flag_spr", "trp_player", slot_troop_custom_banner_flag_type),
(try_begin),
#normal_banner_begin
(gt, ":troop_banner_object", 0),
(scene_prop_get_instance, ":flag_object", ":troop_banner_object", 0),
#custom_banner_begin
# (ge, ":flag_spr", 0),
# (val_add, ":flag_spr", custom_banner_flag_scene_props_begin),
# (scene_prop_get_instance, ":flag_object", ":flag_spr", 0),
(try_begin),
(ge, ":flag_object", 0),
(get_player_agent_no, ":player_agent"),
(agent_get_look_position, pos1, ":player_agent"),
(position_move_y, pos1, -500),
(position_rotate_z, pos1, 180),
(position_set_z_to_ground_level, pos1),
(position_move_z, pos1, 300),
(prop_instance_set_position, ":flag_object", pos1),
(try_end),
(scene_prop_get_instance, ":pole_object", "spr_banner_pole", 0),
(try_begin),
(ge, ":pole_object", 0),
(position_move_z, pos1, -320),
(prop_instance_set_position, ":pole_object", pos1),
(try_end),
(else_try),
(init_position, pos1),
(position_move_z, pos1, -1000000),
(scene_prop_get_instance, ":flag_object", banner_scene_props_begin, 0),
(try_begin),
(ge, ":flag_object", 0),
(prop_instance_set_position, ":flag_object", pos1),
(try_end),
(scene_prop_get_instance, ":pole_object", "spr_banner_pole", 0),
(try_begin),
(ge, ":pole_object", 0),
(prop_instance_set_position, ":pole_object", pos1),
(try_end),
(try_end),
]),
# script_place_player_banner_near_inventory_bms
# Input: none
# Output: none
("place_player_banner_near_inventory_bms",
[
#normal_banner_begin
(troop_get_slot, ":troop_banner_object", "trp_player", slot_troop_banner_scene_prop),
#custom_banner_begin
# (troop_get_slot, ":flag_spr", "trp_player", slot_troop_custom_banner_flag_type),
(try_begin),
#normal_banner_begin
(gt, ":troop_banner_object", 0),
(replace_scene_props, banner_scene_props_begin, ":troop_banner_object"),
#custom_banner_begin
# (ge, ":flag_spr", 0),
# (val_add, ":flag_spr", custom_banner_flag_scene_props_begin),
# (replace_scene_props, banner_scene_props_begin, ":flag_spr"),
(try_end),
]),
# script_stay_captive_for_hours
# Input: arg1 = num_hours
# Output: none
("stay_captive_for_hours",
[(store_script_param, ":num_hours", 1),
(store_current_hours, ":cur_hours"),
(val_add, ":cur_hours", ":num_hours"),
(val_max, "$g_check_autos_at_hour", ":cur_hours"),
(val_add, ":num_hours", 1),
(rest_for_hours, ":num_hours", 0, 0),
]),
# script_set_parties_around_player_ignore_player
# Input: arg1 = ignore_range, arg2 = num_hours_to_ignore
# Output: none
("set_parties_around_player_ignore_player",
[(store_script_param, ":ignore_range", 1),
(store_script_param, ":num_hours", 2),
(try_for_parties, ":party_no"),
(party_is_active, ":party_no"),
(store_distance_to_party_from_party, ":dist", "p_main_party", ":party_no"),
(lt, ":dist", ":ignore_range"),
(party_ignore_player, ":party_no", ":num_hours"),
(try_end),
]),
# script_randomly_make_prisoner_heroes_escape_from_party
# Input: arg1 = party_no, arg2 = escape_chance_mul_1000
# Output: none
("randomly_make_prisoner_heroes_escape_from_party",
[(store_script_param, ":party_no", 1),
(store_script_param, ":escape_chance", 2),
(assign, ":quest_troop_1", -1),
(assign, ":quest_troop_2", -1),
(try_begin),
(check_quest_active, "qst_rescue_lord_by_replace"),
(quest_get_slot, ":quest_troop_1", "qst_rescue_lord_by_replace", slot_quest_target_troop),
(try_end),
(try_begin),
(check_quest_active, "qst_deliver_message_to_prisoner_lord"),
(quest_get_slot, ":quest_troop_2", "qst_deliver_message_to_prisoner_lord", slot_quest_target_troop),
(try_end),
(party_get_num_prisoner_stacks, ":num_stacks", ":party_no"),
(try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
(troop_is_hero, ":stack_troop"),
(neq, ":stack_troop", ":quest_troop_1"),
(neq, ":stack_troop", ":quest_troop_2"),
(troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero),
(store_random_in_range, ":random_no", 0, 1000),
(lt, ":random_no", ":escape_chance"),
(party_remove_prisoners, ":party_no", ":stack_troop", 1),
(call_script, "script_remove_troop_from_prison", ":stack_troop"),
(str_store_troop_name_link, s1, ":stack_troop"),
(try_begin),
(eq, ":party_no", "p_main_party"),
(str_store_string, s2, "@your party"),
(else_try),
(str_store_party_name, s2, ":party_no"),
(try_end),
(assign, reg0, 0),
(try_begin),
(this_or_next|eq, ":party_no", "p_main_party"),
(party_slot_eq, ":party_no", slot_town_lord, "trp_player"),
(assign, reg0, 1),
(try_end),
(store_troop_faction, ":troop_faction", ":stack_troop"),
(str_store_faction_name_link, s3, ":troop_faction"),
(display_message, "@{reg0?One of your prisoners, :}{s1} of {s3} has escaped from captivity!"),
(try_end),
]),
# script_fill_tournament_participants_troop
# Input: arg1 = center_no, arg2 = player_at_center
# Output: none (fills trp_tournament_participants)
("fill_tournament_participants_troop",
[(store_script_param, ":center_no", 1),
(store_script_param, ":player_at_center", 2),
(assign, ":cur_slot", 0),
(try_begin),
(eq, ":player_at_center", 1),
(party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":cur_troop", "p_main_party", ":stack_no"),
(troop_is_hero, ":cur_troop"),
(neq, ":cur_troop", "trp_kidnapped_girl"),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", ":cur_troop"),
(val_add, ":cur_slot", 1),
(try_end),
(try_end),
(party_collect_attachments_to_party, ":center_no", "p_temp_party"),
(party_get_num_companion_stacks, ":num_stacks", "p_temp_party"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":cur_troop", "p_temp_party", ":stack_no"),
(troop_is_hero, ":cur_troop"),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", ":cur_troop"),
(val_add, ":cur_slot", 1),
(try_end),
(try_begin),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 50),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_xerina"),
(val_add, ":cur_slot", 1),
(try_end),
(try_begin),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 50),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_dranton"),
(val_add, ":cur_slot", 1),
(try_end),
(try_begin),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 50),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_kradus"),
(val_add, ":cur_slot", 1),
(try_end),
(assign, ":begin_slot", ":cur_slot"),
(try_for_range, ":cur_slot", ":begin_slot", 64),
(store_random_in_range, ":random_no", 0, 6),
(try_begin),
(eq, ":random_no", 0),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_regular_fighter"),
(else_try),
(eq, ":random_no", 1),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_veteran_fighter"),
(else_try),
(eq, ":random_no", 2),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_champion_fighter"),
(else_try),
(eq, ":random_no", 3),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_sword_sister"),
(else_try),
(eq, ":random_no", 4),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_hired_blade"),
(else_try),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_mercenary_swordsman"),
(try_end),
(try_end),
]),
# script_get_num_tournament_participants
# Input: none
# Output: reg0 = num_participants
("get_num_tournament_participants",
[(assign, ":num_participants", 0),
(try_for_range, ":cur_slot", 0, 64),
(troop_slot_ge, "trp_tournament_participants", ":cur_slot", 0),
(val_add, ":num_participants", 1),
(try_end),
(assign, reg0, ":num_participants"),
]),
# script_get_random_tournament_participant
# Input: none
# Output: reg0 = troop_no
("get_random_tournament_participant",
[(call_script, "script_get_num_tournament_participants"),
(assign, ":num_participants", reg0),
(store_random_in_range, ":random_troop", 0, ":num_participants"),
(assign, ":continue", 1),
(try_for_range, ":cur_slot", 0, 64),
(eq, ":continue", 1),
(troop_slot_ge, "trp_tournament_participants", ":cur_slot", 0),
(val_sub, ":random_troop", 1),
(lt, ":random_troop", 0),
(assign, ":continue", 0),
(troop_get_slot, ":troop_no", "trp_tournament_participants", ":cur_slot"),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", -1),
(try_end),
(assign, reg0, ":troop_no"),
]),
# script_add_tournament_participant
# Input: arg1 = troop_no
# Output: none
("add_tournament_participant",
[(store_script_param, ":troop_no", 1),
(assign, ":continue", 1),
(try_for_range, ":cur_slot", 0, 64),
(eq, ":continue", 1),
(troop_slot_eq, "trp_tournament_participants", ":cur_slot", -1),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", ":troop_no"),
(assign, ":continue", 0),
(try_end),
]),
# script_get_random_tournament_team_amount_and_size
# Input: none
# Output: reg0 = number_of_teams, reg1 = team_size
("get_random_tournament_team_amount_and_size",
[
(call_script, "script_get_num_tournament_participants"),
(assign, ":num_participants", reg0),
(party_get_slot, ":town_max_teams", "$current_town", slot_town_tournament_max_teams),
(val_add, ":town_max_teams", 1),
(party_get_slot, ":town_max_team_size", "$current_town", slot_town_tournament_max_team_size),
(val_add, ":town_max_team_size", 1),
(assign, ":max_teams", ":num_participants"),
(val_min, ":max_teams", ":town_max_teams"),
(assign, ":max_size", ":num_participants"),
(val_min, ":max_size", ":town_max_team_size"),
(assign, ":min_size", 1),
(try_begin),
(ge, ":num_participants", 32),
(assign, ":min_size", 2),
(val_min, ":min_size", ":town_max_team_size"),
(try_end),
(assign, ":end_cond", 500),
(try_for_range, ":unused", 0, ":end_cond"),
(store_random_in_range, ":random_teams", 2, ":max_teams"),
(store_random_in_range, ":random_size", ":min_size", ":max_size"),
(store_mul, ":total_men", ":random_teams", ":random_size"),
(le, ":total_men", ":num_participants"),
(store_sub, ":left_men", ":num_participants", ":total_men"),
(neq, ":left_men", 1),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(gt, ":end_cond", 0),
(assign, ":random_teams", 2),
(assign, ":random_size", 1),
(try_end),
(assign, reg0, ":random_teams"),
(assign, reg1, ":random_size"),
]),
# script_get_troop_priority_point_for_tournament
# Input: arg1 = troop_no
# Output: reg0 = troop_point
("get_troop_priority_point_for_tournament",
[(store_script_param, ":troop_no", 1),
(assign, ":troop_point", 0),
(try_begin),
(ge, ":troop_no", 0),
(val_add, ":troop_point", 40000),
(try_begin),
(eq, ":troop_no", "trp_player"),
(val_add, ":troop_point", 80000),
(try_end),
(try_begin),
(troop_is_hero, ":troop_no"),
(val_add, ":troop_point", 20000),
(try_end),
(try_begin),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_player_companion),
(val_add, ":troop_point", 10000),
(else_try),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":renown", ":troop_no", slot_troop_renown),
(val_add, ":troop_point", ":renown"),
(val_add, ":troop_point", 1000), #in order to make it more prior than tournament heroes with higher levels
(else_try),
(store_character_level, ":level", ":troop_no"),
(val_add, ":troop_point", ":level"),
(try_end),
(try_end),
(assign, reg0, ":troop_point"),
]),
# script_sort_tournament_participant_troops
# Input: none
# Output: none (sorts trp_tournament_participants)
("sort_tournament_participant_troops",
[(try_for_range, ":cur_slot", 0, 63),
(store_add, ":cur_slot_2_begin", ":cur_slot", 1),
(try_for_range, ":cur_slot_2", ":cur_slot_2_begin", 64),
(troop_get_slot, ":troop_1", "trp_tournament_participants", ":cur_slot"),
(troop_get_slot, ":troop_2", "trp_tournament_participants", ":cur_slot_2"),
(call_script, "script_get_troop_priority_point_for_tournament", ":troop_1"),
(assign, ":troop_1_point", reg0),
(call_script, "script_get_troop_priority_point_for_tournament", ":troop_2"),
(assign, ":troop_2_point", reg0),
(gt, ":troop_2_point", ":troop_1_point"),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", ":troop_2"),
(troop_set_slot, "trp_tournament_participants", ":cur_slot_2", ":troop_1"),
(try_end),
(try_end),
]),
# script_remove_tournament_participants_randomly
# Input: arg1 = number_to_be_removed
# Output: none
("remove_tournament_participants_randomly",
[(store_script_param, ":number_to_be_removed", 1),
(try_for_range, ":unused", 0, ":number_to_be_removed"),
(assign, ":total_weight", 0),
(try_for_range, ":cur_slot", 0, 64),
(troop_get_slot, ":troop_no", "trp_tournament_participants", ":cur_slot"),
(ge, ":troop_no", 0),
(store_character_level, ":level", ":troop_no"),
(val_min, ":level", 38),
(store_sub, ":weight", 40, ":level"),
(val_add, ":total_weight", ":weight"),
(try_end),
(store_random_in_range, ":random_weight", 0, ":total_weight"),
(assign, ":continue", 1),
(try_for_range, ":cur_slot", 0, 64),
(eq, ":continue", 1),
(troop_get_slot, ":troop_no", "trp_tournament_participants", ":cur_slot"),
(ge, ":troop_no", 0),
(store_character_level, ":level", ":troop_no"),
(val_min, ":level", 38),
(store_sub, ":weight", 40, ":level"),
(val_sub, ":random_weight", ":weight"),
(lt, ":random_weight", 0),
(troop_set_slot, "trp_tournament_participants", ":cur_slot", -1),
(assign, ":continue", 0),
(try_end),
(try_end),
]),
# script_end_tournament_fight
# Input: arg1 = player_team_won (1 or 0)
# Output: none
("end_tournament_fight",
[(store_script_param, ":player_team_won", 1),
(call_script, "script_get_num_tournament_participants"),
(assign, ":num_participants", reg0),
(store_div, ":needed_to_remove_randomly", ":num_participants", 2),
#Must remove other participants randomly earlier than adding the winners back to participants
(call_script, "script_remove_tournament_participants_randomly", ":needed_to_remove_randomly"),
(assign, ":num_needed", "$g_tournament_num_participants_for_fight"),
(val_div, ":num_needed", 2),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(try_for_agents, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_get_troop_id, ":troop_id", ":agent_no"),
(neg|is_between, ":troop_id", arena_masters_begin, arena_masters_end),#omit tournament master
(agent_get_team, ":agent_team", ":agent_no"),
(assign, ":cur_point", 0),
(try_begin),
(eq, ":player_team_won", 1),
(eq, ":agent_team", ":player_team"),
(val_add, ":cur_point", 5000000),#Make sure that team members are chosen
(try_end),
(agent_get_kill_count, ":kill_count", ":agent_no", 1), #everyone is knocked unconscious
(store_mul, ":kill_point", ":kill_count", 160000),#Make sure that kill count is the second most important variable
(val_add, ":cur_point", ":kill_point"),
(call_script, "script_get_troop_priority_point_for_tournament", ":troop_id"),
(val_add, ":cur_point", reg0),
(try_begin),#reset player's point if kill count is one after the first 2 rounds, or if it is zero
(eq, ":agent_no", ":player_agent"),
(eq, ":player_team_won", 0),
(assign, ":not_passed", 1),
(try_begin),
(ge, ":kill_count", 2),
(assign, ":not_passed", 0),
(else_try),
(eq, ":kill_count", 1),
(le, "$g_tournament_cur_tier", 1),
(assign, ":not_passed", 0),
(try_end),
(eq, ":not_passed", 1),
(assign, ":cur_point", 0),
(try_end),
(agent_set_slot, ":agent_no", slot_agent_tournament_point, ":cur_point"),
(try_end),
(try_for_range, ":unused", 0, ":num_needed"),
(assign, ":best_point", 0),
(assign, ":best_agent_no", -1),
(try_for_agents, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_get_slot, ":point", ":agent_no", slot_agent_tournament_point),
(gt, ":point", ":best_point"),
(assign, ":best_agent_no", ":agent_no"),
(assign, ":best_point", ":point"),
(try_end),
(agent_set_slot, ":best_agent_no", slot_agent_tournament_point, 0),#Do not select the same agent again
(agent_get_troop_id, ":troop_id", ":best_agent_no"),
(call_script, "script_add_tournament_participant", ":troop_id"),
(try_end),
(assign, "$g_tournament_player_team_won", ":player_team_won"),
(jump_to_menu, "mnu_town_tournament"),
]),
# script_get_win_amount_for_tournament_bet
# Input: none
# Output: reg0 = win_amount_with_100_denars
("get_win_amount_for_tournament_bet",
[
(party_get_slot, ":player_odds", "$current_town", slot_town_player_odds),
(try_begin),
(eq, "$g_tournament_cur_tier", 0),
(assign, ":win_amount", 120),
(else_try),
(eq, "$g_tournament_cur_tier", 1),
(assign, ":win_amount", 90),
(else_try),
(eq, "$g_tournament_cur_tier", 2),
(assign, ":win_amount", 60),
(else_try),
(eq, "$g_tournament_cur_tier", 3),
(assign, ":win_amount", 40),
(else_try),
(eq, "$g_tournament_cur_tier", 4),
(assign, ":win_amount", 20),
(else_try),
(assign, ":win_amount", 8),
(try_end),
(val_mul, ":win_amount", ":player_odds"),
(val_div, ":win_amount", 100),
(val_add, ":win_amount", 100), #win amount when 100 denars is placed
(assign, reg0, ":win_amount"),
]),
# script_tournament_place_bet
# Input: arg1 = bet_amount
# Output: none
("tournament_place_bet",
[
(store_script_param, ":bet_amount", 1),
(call_script, "script_get_win_amount_for_tournament_bet"),
(assign, ":win_amount", reg0),
(val_mul, ":win_amount", ":bet_amount"),
(val_div, ":win_amount", 100),
(val_sub, ":win_amount", ":bet_amount"),
(val_add, "$g_tournament_bet_placed", ":bet_amount"),
(val_add, "$g_tournament_bet_win_amount", ":win_amount"),
(troop_remove_gold, "trp_player", ":bet_amount"),
(assign, "$g_tournament_last_bet_tier", "$g_tournament_cur_tier"),
]),
# script_calculate_amount_of_cattle_can_be_stolen
# Input: arg1 = village_no
# Output: reg0 = max_amount
("calculate_amount_of_cattle_can_be_stolen",
[
(store_script_param, ":village_no", 1),
(call_script, "script_get_max_skill_of_player_party", "skl_looting"),
(assign, ":max_skill", reg0),
(store_mul, ":can_steal", ":max_skill", 2),
(call_script, "script_party_count_fit_for_battle", "p_main_party"),
(store_add, ":num_men_effect", reg0, 10),
(val_div, ":num_men_effect", 10),
(val_add, ":can_steal", ":num_men_effect"),
(party_get_slot, ":num_cattle", ":village_no", slot_village_number_of_cattle),
(val_min, ":can_steal", ":num_cattle"),
(assign, reg0, ":can_steal"),
]),
# script_draw_banner_to_region
# Input: arg1 = troop_no, arg2 = center_pos_x, arg3 = center_pos_y, arg4 = width, arg5 = height, arg6 = stretch_width, arg7 = stretch_height, arg8 = default_scale, arg9 = max_charge_scale, arg10 = drawn_item_type
# drawn_item_type is 0 for banners, 1 for shields, 2 for heater shield, 3 for armor
# arguments will be used as fixed point values
# Output: none
("draw_banner_to_region",
[
(store_script_param, ":troop_no", 1),
(store_script_param, ":center_pos_x", 2),
(store_script_param, ":center_pos_y", 3),
(store_script_param, ":width", 4),
(store_script_param, ":height", 5),
(store_script_param, ":stretch_width", 6),
(store_script_param, ":stretch_height", 7),
(store_script_param, ":default_scale", 8),
(store_script_param, ":max_charge_scale", 9),
(store_script_param, ":drawn_item_type", 10),
(troop_get_slot, ":bg_type", ":troop_no", slot_troop_custom_banner_bg_type),
(val_add, ":bg_type", custom_banner_backgrounds_begin),
(troop_get_slot, ":bg_color_1", ":troop_no", slot_troop_custom_banner_bg_color_1),
(troop_get_slot, ":bg_color_2", ":troop_no", slot_troop_custom_banner_bg_color_2),
(troop_get_slot, ":num_charges", ":troop_no", slot_troop_custom_banner_num_charges),
(troop_get_slot, ":positioning", ":troop_no", slot_troop_custom_banner_positioning),
(call_script, "script_get_troop_custom_banner_num_positionings", ":troop_no"),
(assign, ":num_positionings", reg0),
(val_mod, ":positioning", ":num_positionings"),
(init_position, pos2),
(position_set_x, pos2, ":width"),
(position_set_y, pos2, ":height"),
(assign, ":default_value", 1),
(convert_to_fixed_point, ":default_value"),
(position_set_z, pos2, ":default_value"),
(init_position, pos1),
(position_set_x, pos1, ":center_pos_x"),
(position_set_y, pos1, ":center_pos_y"),
(position_move_z, pos1, -20),
(init_position, pos3),
(position_set_x, pos3, ":default_scale"),
(position_set_y, pos3, ":default_scale"),
(position_set_z, pos3, ":default_value"),
(try_begin),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_bg"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg01"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg02"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg03"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg08"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg09"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg10"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg11"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg12"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg13"),
(this_or_next|eq, ":bg_type", "mesh_custom_banner_fg16"),
(eq, ":bg_type", "mesh_custom_banner_fg17"),
(cur_tableau_add_mesh_with_scale_and_vertex_color, ":bg_type", pos1, pos2, 0, ":bg_color_1"),
(else_try),
(cur_tableau_add_mesh_with_scale_and_vertex_color, ":bg_type", pos1, pos3, 0, ":bg_color_1"),
(try_end),
(position_move_z, pos1, -20),
(position_move_x, pos2, ":width"),
(position_move_y, pos2, ":height"),
(cur_tableau_add_mesh_with_scale_and_vertex_color, "mesh_custom_banner_bg", pos1, pos2, 0, ":bg_color_2"),
(assign, ":charge_stretch", ":stretch_width"),
(val_min, ":charge_stretch", ":stretch_height"),
(val_min, ":charge_stretch", ":max_charge_scale"),
(call_script, "script_get_custom_banner_charge_type_position_scale_color", "trp_player", ":positioning"),
(try_begin),
(this_or_next|eq, ":drawn_item_type", 2), #heater shield
(eq, ":drawn_item_type", 3), #armor
(assign, ":change_center_pos", 0),
(try_begin),
(eq, ":num_charges", 1),
(assign, ":change_center_pos", 1),
(else_try),
(eq, ":num_charges", 2),
(eq, ":positioning", 1),
(assign, ":change_center_pos", 1),
(else_try),
(eq, ":num_charges", 3),
(eq, ":positioning", 1),
(assign, ":change_center_pos", 1),
(try_end),
(try_begin),
(eq, ":change_center_pos", 1),
(val_add, ":center_pos_y", 30),
(try_end),
(try_end),
(try_begin),
(ge, ":num_charges", 1),
(val_mul, reg1, ":charge_stretch"),
(val_div, reg1, 10000),
(position_get_x, ":x", pos0),
(position_get_y, ":y", pos0),
(val_mul, ":x", ":stretch_width"),
(val_mul, ":y", ":stretch_height"),
(val_div, ":x", 10000),
(val_div, ":y", 10000),
(val_add, ":x", ":center_pos_x"),
(val_add, ":y", ":center_pos_y"),
(position_set_x, pos0, ":x"),
(position_set_y, pos0, ":y"),
(assign, ":scale_value", reg1),
(convert_to_fixed_point, ":scale_value"),
(store_mul, ":scale_value_inverse", ":scale_value", -1),
(init_position, pos4),
(position_set_x, pos4, ":scale_value"),
(position_set_y, pos4, ":scale_value"),
(position_set_z, pos4, ":scale_value"),
(store_div, ":orientation", reg0, 256), #orientation flags
(try_begin),
(this_or_next|eq, ":orientation", 1),
(eq, ":orientation", 3),
(position_set_x, pos4, ":scale_value_inverse"),
(try_end),
(try_begin),
(this_or_next|eq, ":orientation", 2),
(eq, ":orientation", 3),
(position_set_y, pos4, ":scale_value_inverse"),
(try_end),
(val_mod, reg0, 256), #remove orientation flags
(cur_tableau_add_mesh_with_scale_and_vertex_color, reg0, pos0, pos4, 0, reg2),
(try_end),
(try_begin),
(ge, ":num_charges", 2),
(val_mul, reg4, ":charge_stretch"),
(val_div, reg4, 10000),
(position_get_x, ":x", pos1),
(position_get_y, ":y", pos1),
(val_mul, ":x", ":stretch_width"),
(val_mul, ":y", ":stretch_height"),
(val_div, ":x", 10000),
(val_div, ":y", 10000),
(val_add, ":x", ":center_pos_x"),
(val_add, ":y", ":center_pos_y"),
(position_set_x, pos1, ":x"),
(position_set_y, pos1, ":y"),
(assign, ":scale_value", reg4),
(convert_to_fixed_point, ":scale_value"),
(store_mul, ":scale_value_inverse", ":scale_value", -1),
(init_position, pos4),
(position_set_x, pos4, ":scale_value"),
(position_set_y, pos4, ":scale_value"),
(position_set_z, pos4, ":scale_value"),
(store_div, ":orientation", reg3, 256), #orientation flags
(try_begin),
(this_or_next|eq, ":orientation", 1),
(eq, ":orientation", 3),
(position_set_x, pos4, ":scale_value_inverse"),
(try_end),
(try_begin),
(this_or_next|eq, ":orientation", 2),
(eq, ":orientation", 3),
(position_set_y, pos4, ":scale_value_inverse"),
(try_end),
(val_mod, reg3, 256), #remove orientation flags
(cur_tableau_add_mesh_with_scale_and_vertex_color, reg3, pos1, pos4, 0, reg5),
(try_end),
(try_begin),
(ge, ":num_charges", 3),
(val_mul, reg7, ":charge_stretch"),
(val_div, reg7, 10000),
(position_get_x, ":x", pos2),
(position_get_y, ":y", pos2),
(val_mul, ":x", ":stretch_width"),
(val_mul, ":y", ":stretch_height"),
(val_div, ":x", 10000),
(val_div, ":y", 10000),
(val_add, ":x", ":center_pos_x"),
(val_add, ":y", ":center_pos_y"),
(position_set_x, pos2, ":x"),
(position_set_y, pos2, ":y"),
(assign, ":scale_value", reg7),
(convert_to_fixed_point, ":scale_value"),
(store_mul, ":scale_value_inverse", ":scale_value", -1),
(init_position, pos4),
(position_set_x, pos4, ":scale_value"),
(position_set_y, pos4, ":scale_value"),
(position_set_z, pos4, ":scale_value"),
(store_div, ":orientation", reg6, 256), #orientation flags
(try_begin),
(this_or_next|eq, ":orientation", 1),
(eq, ":orientation", 3),
(position_set_x, pos4, ":scale_value_inverse"),
(try_end),
(try_begin),
(this_or_next|eq, ":orientation", 2),
(eq, ":orientation", 3),
(position_set_y, pos4, ":scale_value_inverse"),
(try_end),
(val_mod, reg6, 256), #remove orientation flags
(cur_tableau_add_mesh_with_scale_and_vertex_color, reg6, pos2, pos4, 0, reg8),
(try_end),
(try_begin),
(ge, ":num_charges", 4),
(val_mul, reg10, ":charge_stretch"),
(val_div, reg10, 10000),
(position_get_x, ":x", pos3),
(position_get_y, ":y", pos3),
(val_mul, ":x", ":stretch_width"),
(val_mul, ":y", ":stretch_height"),
(val_div, ":x", 10000),
(val_div, ":y", 10000),
(val_add, ":x", ":center_pos_x"),
(val_add, ":y", ":center_pos_y"),
(position_set_x, pos3, ":x"),
(position_set_y, pos3, ":y"),
(assign, ":scale_value", reg10),
(convert_to_fixed_point, ":scale_value"),
(store_mul, ":scale_value_inverse", ":scale_value", -1),
(init_position, pos4),
(position_set_x, pos4, ":scale_value"),
(position_set_y, pos4, ":scale_value"),
(position_set_z, pos4, ":scale_value"),
(store_div, ":orientation", reg9, 256), #orientation flags
(try_begin),
(this_or_next|eq, ":orientation", 1),
(eq, ":orientation", 3),
(position_set_x, pos4, ":scale_value_inverse"),
(try_end),
(try_begin),
(this_or_next|eq, ":orientation", 2),
(eq, ":orientation", 3),
(position_set_y, pos4, ":scale_value_inverse"),
(try_end),
(val_mod, reg9, 256), #remove orientation flags
(cur_tableau_add_mesh_with_scale_and_vertex_color, reg9, pos3, pos4, 0, reg11),
(try_end),
]),
# script_get_troop_custom_banner_num_positionings
# Input: arg1 = troop_no
# Output: reg0 = num_positionings
("get_troop_custom_banner_num_positionings",
[
(store_script_param, ":troop_no", 1),
(troop_get_slot, ":num_charges", ":troop_no", slot_troop_custom_banner_num_charges),
(try_begin),
(eq, ":num_charges", 1),
(assign, ":num_positionings", 2),
(else_try),
(eq, ":num_charges", 2),
(assign, ":num_positionings", 4),
(else_try),
(eq, ":num_charges", 3),
(assign, ":num_positionings", 6),
(else_try),
(assign, ":num_positionings", 2),
(try_end),
(assign, reg0, ":num_positionings"),
]),
# script_get_custom_banner_charge_type_position_scale_color
# Input: arg1 = troop_no, arg2 = positioning_index
# Output: reg0 = type_1
# reg1 = scale_1
# reg2 = color_1
# reg3 = type_2
# reg4 = scale_2
# reg5 = color_2
# reg6 = type_3
# reg7 = scale_3
# reg8 = color_3
# reg9 = type_4
# reg10 = scale_4
# reg11 = color_4
("get_custom_banner_charge_type_position_scale_color",
[
(store_script_param, ":troop_no", 1),
(store_script_param, ":positioning", 2),
(troop_get_slot, ":num_charges", ":troop_no", slot_troop_custom_banner_num_charges),
(init_position, pos0),
(init_position, pos1),
(init_position, pos2),
(init_position, pos3),
(troop_get_slot, reg0, ":troop_no", slot_troop_custom_banner_charge_type_1),
(val_add, reg0, custom_banner_charges_begin),
(troop_get_slot, reg2, ":troop_no", slot_troop_custom_banner_charge_color_1),
(troop_get_slot, reg3, ":troop_no", slot_troop_custom_banner_charge_type_2),
(val_add, reg3, custom_banner_charges_begin),
(troop_get_slot, reg5, ":troop_no", slot_troop_custom_banner_charge_color_2),
(troop_get_slot, reg6, ":troop_no", slot_troop_custom_banner_charge_type_3),
(val_add, reg6, custom_banner_charges_begin),
(troop_get_slot, reg8, ":troop_no", slot_troop_custom_banner_charge_color_3),
(troop_get_slot, reg9, ":troop_no", slot_troop_custom_banner_charge_type_4),
(val_add, reg9, custom_banner_charges_begin),
(troop_get_slot, reg11, ":troop_no", slot_troop_custom_banner_charge_color_4),
(try_begin),
(eq, ":num_charges", 1),
(try_begin),
(eq, ":positioning", 0),
(assign, reg1, 100),
(else_try),
(assign, reg1, 50),
(try_end),
(else_try),
(eq, ":num_charges", 2),
(try_begin),
(eq, ":positioning", 0),
(position_set_y, pos0, 25),
(position_set_y, pos1, -25),
(assign, reg1, 40),
(assign, reg4, 40),
(else_try),
(eq, ":positioning", 1),
(position_set_x, pos0, -25),
(position_set_x, pos1, 25),
(assign, reg1, 40),
(assign, reg4, 40),
(else_try),
(eq, ":positioning", 2),
(position_set_x, pos0, -25),
(position_set_y, pos0, 25),
(position_set_x, pos1, 25),
(position_set_y, pos1, -25),
(assign, reg1, 50),
(assign, reg4, 50),
(else_try),
(position_set_x, pos0, -25),
(position_set_y, pos0, -25),
(position_set_x, pos1, 25),
(position_set_y, pos1, 25),
(assign, reg1, 50),
(assign, reg4, 50),
(try_end),
(else_try),
(eq, ":num_charges", 3),
(try_begin),
(eq, ":positioning", 0),
(position_set_y, pos0, 33),
(position_set_y, pos2, -33),
(assign, reg1, 30),
(assign, reg4, 30),
(assign, reg7, 30),
(else_try),
(eq, ":positioning", 1),
(position_set_x, pos0, -33),
(position_set_x, pos2, 33),
(assign, reg1, 30),
(assign, reg4, 30),
(assign, reg7, 30),
(else_try),
(eq, ":positioning", 2),
(position_set_x, pos0, -30),
(position_set_y, pos0, 30),
(position_set_x, pos2, 30),
(position_set_y, pos2, -30),
(assign, reg1, 35),
(assign, reg4, 35),
(assign, reg7, 35),
(else_try),
(eq, ":positioning", 3),
(position_set_x, pos0, -30),
(position_set_y, pos0, -30),
(position_set_x, pos2, 30),
(position_set_y, pos2, 30),
(assign, reg1, 35),
(assign, reg4, 35),
(assign, reg7, 35),
(else_try),
(eq, ":positioning", 4),
(position_set_x, pos0, -25),
(position_set_y, pos0, -25),
(position_set_y, pos1, 25),
(position_set_x, pos2, 25),
(position_set_y, pos2, -25),
(assign, reg1, 50),
(assign, reg4, 50),
(assign, reg7, 50),
(else_try),
(position_set_x, pos0, -25),
(position_set_y, pos0, 25),
(position_set_y, pos1, -25),
(position_set_x, pos2, 25),
(position_set_y, pos2, 25),
(assign, reg1, 50),
(assign, reg4, 50),
(assign, reg7, 50),
(try_end),
(else_try),
(try_begin),
(eq, ":positioning", 0),
(position_set_x, pos0, -25),
(position_set_y, pos0, 25),
(position_set_x, pos1, 25),
(position_set_y, pos1, 25),
(position_set_x, pos2, -25),
(position_set_y, pos2, -25),
(position_set_x, pos3, 25),
(position_set_y, pos3, -25),
(assign, reg1, 50),
(assign, reg4, 50),
(assign, reg7, 50),
(assign, reg10, 50),
(else_try),
(position_set_y, pos0, 30),
(position_set_x, pos1, -30),
(position_set_x, pos2, 30),
(position_set_y, pos3, -30),
(assign, reg1, 35),
(assign, reg4, 35),
(assign, reg7, 35),
(assign, reg10, 35),
(try_end),
(try_end),
]),
# script_get_random_custom_banner
# Input: arg1 = troop_no
# Output: none
("get_random_custom_banner",
[
(store_script_param, ":troop_no", 1),
(store_random_in_range, ":num_charges", 1, 5),
(troop_set_slot, ":troop_no", slot_troop_custom_banner_num_charges, ":num_charges"),
(store_random_in_range, ":random_color_index", 0, 42),
(call_script, "script_get_custom_banner_color_from_index", ":random_color_index"),
(assign, ":color_1", reg0),
(troop_set_slot, ":troop_no", slot_troop_custom_banner_bg_color_1, ":color_1"),
(assign, ":end_cond", 1),
(try_for_range, ":unused", 0, ":end_cond"),
(store_random_in_range, ":random_color_index", 0, 42),
(call_script, "script_get_custom_banner_color_from_index", ":random_color_index"),
(assign, ":color_2", reg0),
(try_begin),
(call_script, "script_cf_check_color_visibility", ":color_1", ":color_2"),
(troop_set_slot, ":troop_no", slot_troop_custom_banner_bg_color_2, ":color_2"),
(else_try),
(val_add, ":end_cond", 1),
(try_end),
(try_end),
(assign, ":end_cond", 4),
(assign, ":cur_charge", 0),
(try_for_range, ":unused", 0, ":end_cond"),
(store_random_in_range, ":random_color_index", 0, 42),
(call_script, "script_get_custom_banner_color_from_index", ":random_color_index"),
(assign, ":charge_color", reg0),
(try_begin),
(call_script, "script_cf_check_color_visibility", ":charge_color", ":color_1"),
(call_script, "script_cf_check_color_visibility", ":charge_color", ":color_2"),
(store_add, ":cur_slot", ":cur_charge", slot_troop_custom_banner_charge_color_1),
(troop_set_slot, ":troop_no", ":cur_slot", ":charge_color"),
(store_random_in_range, ":random_charge", custom_banner_charges_begin, custom_banner_charges_end),
(val_sub, ":random_charge", custom_banner_charges_begin),
(store_add, ":cur_slot", ":cur_charge", slot_troop_custom_banner_charge_type_1),
(troop_set_slot, ":troop_no", ":cur_slot", ":random_charge"),
(val_add, ":cur_charge", 1),
(else_try),
(val_add, ":end_cond", 1),
(try_end),
(try_end),
(store_random_in_range, ":random_bg", custom_banner_backgrounds_begin, custom_banner_backgrounds_end),
(val_sub, ":random_bg", custom_banner_backgrounds_begin),
(troop_set_slot, ":troop_no", slot_troop_custom_banner_bg_type, ":random_bg"),
(store_random_in_range, ":random_flag", custom_banner_flag_types_begin, custom_banner_flag_types_end),
(val_sub, ":random_flag", custom_banner_flag_types_begin),
(troop_set_slot, ":troop_no", slot_troop_custom_banner_flag_type, ":random_flag"),
(store_random_in_range, ":random_positioning", 0, 4),
(troop_set_slot, ":troop_no", slot_troop_custom_banner_positioning, ":random_positioning"),
]),
# script_get_custom_banner_color_from_index
# Input: arg1 = color_index
# Output: reg0 = color
("get_custom_banner_color_from_index",
[
(store_script_param, ":color_index", 1),
(assign, ":cur_color", 0xFF000000),
(assign, ":red", 0x00),
(assign, ":green", 0x00),
(assign, ":blue", 0x00),
(store_mod, ":mod_i_color", ":color_index", 7),
(try_begin),
(eq, ":mod_i_color", 0),
(assign, ":blue", 0xFF),
(else_try),
(eq, ":mod_i_color", 1),
(assign, ":red", 0xEE),
(else_try),
(eq, ":mod_i_color", 2),
(assign, ":red", 0xFB),
(assign, ":green", 0xAC),
(else_try),
(eq, ":mod_i_color", 3),
(assign, ":red", 0x5F),
(assign, ":blue", 0xFF),
(else_try),
(eq, ":mod_i_color", 4),
(assign, ":red", 0x05),
(assign, ":green", 0x44),
(else_try),
(eq, ":mod_i_color", 5),
(assign, ":red", 0xEE),
(assign, ":green", 0xEE),
(assign, ":blue", 0xEE),
(else_try),
(assign, ":red", 0x22),
(assign, ":green", 0x22),
(assign, ":blue", 0x22),
(try_end),
(store_div, ":cur_tone", ":color_index", 7),
(store_sub, ":cur_tone", 8, ":cur_tone"),
(val_mul, ":red", ":cur_tone"),
(val_div, ":red", 8),
(val_mul, ":green", ":cur_tone"),
(val_div, ":green", 8),
(val_mul, ":blue", ":cur_tone"),
(val_div, ":blue", 8),
(val_mul, ":green", 0x100),
(val_mul, ":red", 0x10000),
(val_add, ":cur_color", ":blue"),
(val_add, ":cur_color", ":green"),
(val_add, ":cur_color", ":red"),
(assign, reg0, ":cur_color"),
]),
# script_cf_check_color_visibility
# Input: arg1 = color_1, arg2 = color_2
# Output: none
("cf_check_color_visibility",
[
(store_script_param, ":color_1", 1),
(store_script_param, ":color_2", 2),
(store_mod, ":blue_1", ":color_1", 256),
(store_div, ":green_1", ":color_1", 256),
(val_mod, ":green_1", 256),
(store_div, ":red_1", ":color_1", 256 * 256),
(val_mod, ":red_1", 256),
(store_mod, ":blue_2", ":color_2", 256),
(store_div, ":green_2", ":color_2", 256),
(val_mod, ":green_2", 256),
(store_div, ":red_2", ":color_2", 256 * 256),
(val_mod, ":red_2", 256),
(store_sub, ":red_dif", ":red_1", ":red_2"),
(val_abs, ":red_dif"),
(store_sub, ":green_dif", ":green_1", ":green_2"),
(val_abs, ":green_dif"),
(store_sub, ":blue_dif", ":blue_1", ":blue_2"),
(val_abs, ":blue_dif"),
(assign, ":max_dif", 0),
(val_max, ":max_dif", ":red_dif"),
(val_max, ":max_dif", ":green_dif"),
(val_max, ":max_dif", ":blue_dif"),
(ge, ":max_dif", 64),
]),
# script_get_next_active_kingdom
# Input: arg1 = faction_no
# Output: reg0 = faction_no (does not choose player faction)
("get_next_active_kingdom",
[
(store_script_param, ":faction_no", 1),
(assign, ":end_cond", kingdoms_end),
(try_for_range, ":unused", kingdoms_begin, ":end_cond"),
(val_add, ":faction_no", 1),
(try_begin),
(ge, ":faction_no", kingdoms_end),
(assign, ":faction_no", kingdoms_begin),
(try_end),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(neq, ":faction_no", "fac_player_supporters_faction"),
(assign, ":end_cond", 0),
(try_end),
(assign, reg0, ":faction_no"),
]),
# script_store_average_center_value_per_faction
# Input: none
# Output: none (sets $g_average_center_value_per_faction)
("store_average_center_value_per_faction",
[
(store_sub, ":num_towns", towns_end, towns_begin),
(store_sub, ":num_castles", castles_end, castles_begin),
(assign, ":num_factions", 0),
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(val_add, ":num_factions", 1),
(try_end),
(val_max, ":num_factions", 1),
(store_mul, "$g_average_center_value_per_faction", ":num_towns", 2),
(val_add, "$g_average_center_value_per_faction", ":num_castles"),
(val_mul, "$g_average_center_value_per_faction", 10),
(val_div, "$g_average_center_value_per_faction", ":num_factions"),
]),
# script_remove_cattles_if_herd_is_close_to_party
# Input: arg1 = party_no, arg2 = maximum_number_of_cattles_required
# Output: reg0 = number_of_cattles_removed
("remove_cattles_if_herd_is_close_to_party",
[
(store_script_param, ":party_no", 1),
(store_script_param, ":max_req", 2),
(assign, ":cur_req", ":max_req"),
(try_for_parties, ":cur_party"),
(gt, ":cur_req", 0),
(party_slot_eq, ":cur_party", slot_party_type, spt_cattle_herd),
(store_distance_to_party_from_party, ":dist", ":cur_party", ":party_no"),
(lt, ":dist", 3),
#Do not use the quest herd
(assign, ":subcontinue", 1),
(try_begin),
(check_quest_active, "qst_move_cattle_herd"),
(quest_slot_eq, "qst_move_cattle_herd", slot_quest_target_party, ":cur_party"),
(assign, ":subcontinue", 0),
(try_end),
(eq, ":subcontinue", 1),
(party_count_companions_of_type, ":num_cattle", ":cur_party", "trp_cattle"),
(try_begin),
(le, ":num_cattle", ":cur_req"),
(assign, ":num_added", ":num_cattle"),
(remove_party, ":cur_party"),
(else_try),
(assign, ":num_added", ":cur_req"),
(party_remove_members, ":cur_party", "trp_cattle", ":cur_req"),
(try_end),
(val_sub, ":cur_req", ":num_added"),
(try_begin),
(party_slot_eq, ":party_no", slot_party_type, spt_village),
(party_get_slot, ":village_cattle_amount", ":party_no", slot_village_number_of_cattle),
(val_add, ":village_cattle_amount", ":num_added"),
(party_set_slot, ":party_no", slot_village_number_of_cattle, ":village_cattle_amount"),
(try_end),
(assign, reg3, ":num_added"),
(str_store_party_name_link, s1, ":party_no"),
(display_message, "@You brought {reg3} heads of cattle to {s1}."),
(try_end),
(store_sub, reg0, ":max_req", ":cur_req"),
]),
# script_get_rumor_to_s61
# Input: rumor_id
# Output: reg0 = 1 if rumor found, 0 otherwise; s61 will contain rumor string if found
("get_rumor_to_s61",
[
(store_script_param, ":base_rumor_id", 1), # the script returns the same rumor for the same rumor id, so that one cannot hear all rumors by
# speaking to a single person.
(store_current_hours, ":cur_hours"),
(store_div, ":cur_day", ":cur_hours", 24),
(assign, ":rumor_found", 0),
(assign, ":num_tries", 3),
(try_for_range, ":try_no", 0, ":num_tries"),
(store_mul, ":rumor_id", ":try_no", 6781),
(val_add, ":rumor_id", ":base_rumor_id"),
(store_mod, ":rumor_type", ":rumor_id", 7),
(val_add, ":rumor_id", ":cur_hours"),
(try_begin),
(eq, ":rumor_type", 0),
(try_begin),
(store_sub, ":range", towns_end, towns_begin),
(store_mod, ":random_center", ":rumor_id", ":range"),
(val_add, ":random_center", towns_begin),
(party_slot_ge, ":random_center", slot_town_has_tournament, 1),
(neq, ":random_center", "$current_town"),
(str_store_party_name, s62, ":random_center"),
(str_store_string, s61, "@I heard that there will be a tournament in {s62} soon."),
(assign, ":rumor_found", 1),
(try_end),
(else_try),
(eq, ":rumor_type", 1),
(try_begin),
(store_sub, ":range", kingdom_heroes_end, kingdom_heroes_begin),
(store_mod, ":random_hero", ":rumor_id", ":range"),
(val_add, ":random_hero", kingdom_heroes_begin),
(troop_get_slot, ":personality", ":random_hero", slot_lord_reputation_type),
(gt, ":personality", 0),
(store_add, ":rumor_string", ":personality", "str_gossip_about_character_default"),
(str_store_troop_name, s6, ":random_hero"),
(str_store_string, s61, ":rumor_string"),
(assign, ":rumor_found", 1),
(try_end),
(else_try),
(eq, ":rumor_type", 2),
(try_begin),
(store_sub, ":range", trade_goods_end, trade_goods_begin),
(store_add, ":random_trade_good", ":rumor_id", ":cur_day"),
(store_mod, ":random_trade_good", ":random_trade_good", ":range"),
(store_add, ":random_trade_good_slot", ":random_trade_good", slot_town_trade_good_prices_begin),
(val_add, ":random_trade_good", trade_goods_begin),
(store_mul, ":min_price", average_price_factor, 3),
(val_div, ":min_price", 4),
(assign, ":min_price_center", -1),
(try_for_range, ":sub_try_no", 0, 10),
(store_sub, ":range", towns_end, towns_begin),
(store_add, ":center_rumor_id", ":rumor_id", ":sub_try_no"),
(store_mod, ":random_center", ":center_rumor_id", ":range"),
(val_add, ":random_center", towns_begin),
(neq, ":random_center", "$g_encountered_party"),
(party_get_slot, ":cur_price", ":random_center", ":random_trade_good_slot"),
(lt, ":cur_price", ":min_price"),
(assign, ":min_price", ":cur_price"),
(assign, ":min_price_center", ":random_center"),
(try_end),
(ge, ":min_price_center", 0),
(str_store_item_name, s62, ":random_trade_good"),
(str_store_party_name, s63, ":min_price_center"),
(str_store_string, s61, "@I heard that one can buy {s62} very cheap at {s63}."),
(assign, ":rumor_found", 1),
(try_end),
(else_try),
(eq, ":rumor_type", 3),
(try_begin),
(store_sub, ":range", trade_goods_end, trade_goods_begin),
(store_add, ":random_trade_good", ":rumor_id", ":cur_day"),
(store_mod, ":random_trade_good", ":random_trade_good", ":range"),
(store_add, ":random_trade_good_slot", ":random_trade_good", slot_town_trade_good_prices_begin),
(val_add, ":random_trade_good", trade_goods_begin),
(store_mul, ":max_price", average_price_factor, 5),
(val_div, ":max_price", 4),
(assign, ":max_price_center", -1),
(try_for_range, ":sub_try_no", 0, 10),
(store_sub, ":range", towns_end, towns_begin),
(store_add, ":center_rumor_id", ":rumor_id", ":sub_try_no"),
(store_mod, ":random_center", ":center_rumor_id", ":range"),
(val_add, ":random_center", towns_begin),
(neq, ":random_center", "$g_encountered_party"),
(party_get_slot, ":cur_price", ":random_center", ":random_trade_good_slot"),
(gt, ":cur_price", ":max_price"),
(assign, ":max_price", ":cur_price"),
(assign, ":max_price_center", ":random_center"),
(try_end),
(ge, ":max_price_center", 0),
(str_store_item_name, s62, ":random_trade_good"),
(str_store_party_name, s63, ":max_price_center"),
(str_store_string, s61, "@I heard that they pay a very high price for {s62} at {s63}."),
(assign, ":rumor_found", 1),
(try_end),
(try_end),
(try_begin),
(gt, ":rumor_found", 0),
(assign, ":num_tries", 0),
(try_end),
(try_end),
(assign, reg0, ":rumor_found"),
]),
("lord_comment_to_s43",
[(store_script_param, ":lord", 1),
(store_script_param, ":default_string", 2),
(troop_get_slot,":reputation", ":lord", slot_lord_reputation_type),
(val_add,":reputation", ":default_string"),
(str_store_string,43,":reputation"),
]),
#Troop Commentaries begin
# script_add_log_entry
# Input: arg1 = entry_type, arg2 = event_actor, arg3 = center_object, arg4 = troop_object, arg5 = faction_object
# Output: none
("add_log_entry",
[(store_script_param, ":entry_type", 1),
(store_script_param, ":actor", 2),
(store_script_param, ":center_object", 3),
(store_script_param, ":troop_object", 4),
(store_script_param, ":faction_object", 5),
(assign, ":center_object_lord", -1),
(assign, ":center_object_faction", -1),
(assign, ":troop_object_faction", -1),
(try_begin),
(gt, ":center_object", 0),
(party_get_slot, ":center_object_lord", ":center_object", slot_town_lord),
(store_faction_of_party, ":center_object_faction", ":center_object"),
(try_end),
(try_begin),
(ge, ":troop_object", 0),
(store_troop_faction, ":troop_object_faction", ":troop_object"),
(try_end),
(val_add, "$num_log_entries", 1),
(store_current_hours, ":entry_time"),
(troop_set_slot, "trp_log_array_entry_type", "$num_log_entries", ":entry_type"),
(troop_set_slot, "trp_log_array_entry_time", "$num_log_entries", ":entry_time"),
(troop_set_slot, "trp_log_array_actor", "$num_log_entries", ":actor"),
(troop_set_slot, "trp_log_array_center_object", "$num_log_entries", ":center_object"),
(troop_set_slot, "trp_log_array_center_object_lord", "$num_log_entries", ":center_object_lord"),
(troop_set_slot, "trp_log_array_center_object_faction", "$num_log_entries", ":center_object_faction"),
(troop_set_slot, "trp_log_array_troop_object", "$num_log_entries", ":troop_object"),
(troop_set_slot, "trp_log_array_troop_object_faction", "$num_log_entries", ":troop_object_faction"),
(troop_set_slot, "trp_log_array_faction_object", "$num_log_entries", ":faction_object"),
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg3, "$num_log_entries"),
(assign, reg4, ":entry_type"),
(display_message, "@Log entry {reg3}: type {reg4}"),
(try_begin),
(gt, ":center_object", 0),
(str_store_party_name, s4, ":center_object"),
(display_message, "@Center: {s4}"),
(try_end),
(try_begin),
(gt, ":troop_object", 0),
(str_store_troop_name, s4, ":troop_object"),
(display_message, "@Troop: {s4}"),
(try_end),
(try_begin),
(gt, ":center_object_lord", 0),
(str_store_troop_name, s4, ":center_object_lord"),
(display_message, "@Lord: {s4}"),
(try_end),
(try_end),
(try_begin),
(this_or_next|gt, "$g_ally_party", 0),
(eq, ":entry_type", logent_player_participated_in_siege),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "@Ally party is present"),
(try_end),
(try_for_range, ":hero", kingdom_heroes_begin, kingdom_heroes_end),
(party_count_companions_of_type, ":hero_present", "p_collective_friends", ":hero"),
(gt, ":hero_present", 0),
(troop_set_slot, ":hero", slot_troop_present_at_event, "$num_log_entries"),
# (store_sub, ":skip_up_to_here", "$num_log_entries", 1),
# (troop_set_slot, ":hero", slot_troop_last_comment_slot, ":skip_up_to_here"),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, 4, ":hero"),
(display_message, "@{s4} is present at event"),
(try_end),
(try_end),
(try_end),
]),
# script_get_relevant_comment_for_log_entry
# Input: arg1 = log_entry_no,
# Output: reg0 = comment_id; reg1 = relevance
# Notes: 50 is the default relevance.
# A comment with relevance less than 30 will always be skipped.
# A comment with relevance 75 or more will never be skipped.
# A comment with relevance 50 has about 50% chance to be skipped.
# If there is more than one comment that is not skipped, the system will randomize their relevance values, and then choose the highest one.
# Also note that the relevance of events decreases as time passes. After three months, relevance reduces to 50%, after 6 months, 25%, etc...
("get_relevant_comment_for_log_entry",
[(store_script_param, ":log_entry_no", 1),
(troop_get_slot, ":entry_type", "trp_log_array_entry_type", ":log_entry_no"),
(troop_get_slot, ":entry_time", "trp_log_array_entry_time", ":log_entry_no"),
(troop_get_slot, ":actor", "trp_log_array_actor", ":log_entry_no"),
## (troop_get_slot, ":center_object", "trp_log_array_center_object", ":log_entry_no"),
(troop_get_slot, ":center_object_lord", "trp_log_array_center_object_lord", ":log_entry_no"),
(troop_get_slot, ":center_object_faction", "trp_log_array_center_object_faction", ":log_entry_no"),
(troop_get_slot, ":troop_object", "trp_log_array_troop_object", ":log_entry_no"),
(troop_get_slot, ":troop_object_faction", "trp_log_array_troop_object_faction", ":log_entry_no"),
(troop_get_slot, ":faction_object", "trp_log_array_faction_object", ":log_entry_no"),
(assign, ":relevance", 0),
(assign, ":comment", -1),
(assign, ":suggested_relation_change", 0),
(troop_get_slot, ":reputation", "$g_talk_troop", slot_lord_reputation_type),
(store_current_hours, ":current_time"),
(store_sub, ":entry_hours_elapsed", ":current_time", ":entry_time"),
#Post 0907 changes begin
(assign, ":players_kingdom_relation", 0), ##the below is so that lords will not congratulate player on attacking neutrals
(try_begin),
(eq, "$cheat_mode", 1),
(try_begin),
(assign, reg5, ":log_entry_no"),
(assign, reg6, ":entry_type"),
(assign, reg8, ":entry_time"),
(gt, "$players_kingdom", 0),
(try_begin),
(gt, ":troop_object_faction", 0),
(store_relation, ":players_kingdom_relation", "$players_kingdom", ":troop_object_faction"),
(assign, reg7, ":players_kingdom_relation"),
(display_message, "@Event #{reg5}, type {reg6}, time {reg8}: player's kingdom relation to troop object = {reg7}"),
(else_try),
(gt, ":center_object_faction", 0),
(store_relation, ":players_kingdom_relation", "$players_kingdom", ":center_object_faction"),
(assign, reg7, ":players_kingdom_relation"),
(display_message, "@Event #{reg5}, type {reg6}, time {reg8}: player's kingdom relation to center object faction = {reg7}"),
(else_try),
(gt, ":faction_object", 0),
(store_relation, ":players_kingdom_relation", "$players_kingdom", ":faction_object"),
(assign, reg7, ":players_kingdom_relation"),
(display_message, "@Event #{reg5}, type {reg6}, time {reg8}: player's kingdom relation to faction object = {reg7}"),
(else_try),
(display_message, "@Event #{reg5}, type {reg6}, time {reg8}. No relevant kingdom relation"),
(try_end),
(else_try),
(display_message, "@Event #{reg5}, type {reg6}, time {reg8}. Player unaffiliated"),
(try_end),
(try_end),
(try_begin),
(eq, ":entry_type", logent_game_start),
(eq, "$g_talk_troop_met", 0),
(is_between, "$g_talk_troop_faction_relation", -5, 5),
(is_between, "$g_talk_troop_relation", -5, 5),
(assign, ":relevance", 25),
(troop_get_slot, ":plyr_renown", "trp_player", slot_troop_renown),
#normal_banner_begin
(troop_get_slot, ":banner", "trp_player", slot_troop_banner_scene_prop),
#custom_banner_begin
# (troop_get_slot, ":banner", "trp_player", slot_troop_custom_banner_flag_type),
(store_random_in_range, ":renown_check", 100, 200),
(try_begin),
(eq, ":reputation", lrep_none),
(gt, "$players_kingdom", 0),
(assign, ":comment", "str_comment_intro_liege_affiliated"),
(else_try),
(gt, ":plyr_renown", ":renown_check"),
(assign, ":comment", "str_comment_intro_famous_liege"),
(val_add, ":comment", ":reputation"),
(else_try),
#normal_banner_begin
(gt, ":banner", 0),
#custom_banner_begin
# (ge, ":banner", 0),
(assign, ":comment", "str_comment_intro_noble_liege"),
(val_add, ":comment", ":reputation"),
(else_try),
(assign, ":comment", "str_comment_intro_common_liege"),
(val_add, ":comment", ":reputation"),
(try_end),
#Post 0907 changes end
(else_try),
(eq, ":entry_type", logent_village_raided),
(eq, ":actor", "trp_player"),
(try_begin),
(eq, ":center_object_lord", "$g_talk_troop"),
(assign, ":relevance", 200),
(assign, ":suggested_relation_change", -1),
(assign, ":comment", "str_comment_you_raided_my_village_default"),
(try_begin),
(lt, "$g_talk_troop_faction_relation", -5),
(this_or_next|eq, ":reputation", lrep_goodnatured),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_you_raided_my_village_enemy_benevolent"),
(else_try),
(lt, "$g_talk_troop_faction_relation", -5),
(this_or_next|eq, ":reputation", lrep_cunning),
(eq, ":reputation", lrep_selfrighteous),
(assign, ":comment", "str_comment_you_raided_my_village_enemy_coldblooded"),
(else_try),
(lt, "$g_talk_troop_faction_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_raided_my_village_enemy_spiteful"),
(else_try),
(lt, "$g_talk_troop_faction_relation", -5),
(assign, ":comment", "str_comment_you_raided_my_village_enemy"),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_raided_my_village_unfriendly_spiteful"),
(else_try),
(gt, "$g_talk_troop_relation", 5),
(assign, ":comment", "str_comment_you_raided_my_village_friendly"),
(try_end),
(try_end),
(else_try),
(eq, ":entry_type", logent_village_extorted),
(eq, ":actor", "trp_player"),
(try_begin),
(eq, ":center_object_lord", "$g_talk_troop"),
(assign, ":relevance", 30),
(assign, ":suggested_relation_change", -1),
(assign, ":comment", "str_comment_you_robbed_my_village_default"),
(try_begin),
(lt, "$g_talk_troop_faction_relation", -5),
(this_or_next|eq, ":reputation", lrep_cunning),
(eq, ":reputation", lrep_selfrighteous),
(assign, ":comment", "str_comment_you_robbed_my_village_enemy_coldblooded"),
(else_try),
(lt, "$g_talk_troop_faction_relation", -5),
(assign, ":comment", "str_comment_you_robbed_my_village_enemy"),
(else_try),
(gt, "$g_talk_troop_relation", 5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_robbed_my_village_friendly_spiteful"),
(else_try),
(gt, "$g_talk_troop_relation", 5),
(assign, ":comment", "str_comment_you_robbed_my_village_friendly"),
(try_end),
(try_end),
(else_try),
(eq, ":entry_type", logent_caravan_accosted),
(eq, ":actor", "trp_player"),
(eq, ":faction_object", "$g_talk_troop_faction"),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(assign, ":relevance", 30),
(assign, ":suggested_relation_change", -1),
(assign, ":comment", "str_comment_you_accosted_my_caravan_default"),
(try_begin),
(lt, "$g_talk_troop_faction_relation", -5),
(assign, ":comment", "str_comment_you_accosted_my_caravan_enemy"),
(try_end),
(else_try),
(eq, ":entry_type", logent_helped_peasants),
(eq, ":actor", "trp_player"),
(try_begin),
(eq, ":center_object_lord", "$g_talk_troop"),
(assign, ":relevance", 40),
(assign, ":suggested_relation_change", 0),
(try_begin),
(this_or_next|eq, ":reputation", lrep_goodnatured),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_you_helped_villagers_benevolent"),
(assign, ":suggested_relation_change", 1),
(else_try),
(gt, "$g_talk_troop_relation", 5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_helped_villagers_friendly_cruel"),
(assign, ":suggested_relation_change", -1),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_helped_villagers_unfriendly_spiteful"),
(assign, ":suggested_relation_change", -1),
(else_try),
(gt, "$g_talk_troop_relation", 5),
(assign, ":comment", "str_comment_you_helped_villagers_friendly"),
(else_try),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_helped_villagers_cruel"),
(assign, ":suggested_relation_change", -1),
(else_try),
(assign, ":comment", "str_comment_you_helped_villagers_default"),
(try_end),
(try_end),
###Combat events
(else_try),
(eq, ":entry_type", logent_castle_captured_by_player),
(try_begin),
(eq, ":center_object_lord", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_captured_my_castle_enemy_spiteful"),
(assign, ":relevance", 200),
(else_try),
(eq, ":center_object_lord", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_martial),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_you_captured_my_castle_enemy_chivalrous"),
(assign, ":relevance", 200),
(else_try),
(eq, ":center_object_lord", "$g_talk_troop"),
(assign, ":comment", "str_comment_you_captured_my_castle_enemy"),
(assign, ":relevance", 200),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_captured_a_castle_allied_spiteful"),
(assign, ":relevance", 75),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(gt, "$g_talk_troop_relation", 5),
(assign, ":comment", "str_comment_you_captured_a_castle_allied_friendly"),
(assign, ":relevance", 75),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_captured_a_castle_allied_unfriendly_spiteful"),
(assign, ":relevance", 75),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(lt, "$g_talk_troop_relation", -5),
(assign, ":comment", "str_comment_you_captured_a_castle_allied_unfriendly"),
(assign, ":relevance", 75),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(assign, ":comment", "str_comment_you_captured_a_castle_allied"),
(assign, ":relevance", 75),
(try_end),
#Post 0907 changes begin
(else_try),
(this_or_next|eq, ":entry_type", logent_lord_defeated_by_player),
(eq, ":entry_type", logent_lord_helped_by_player),
(troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"),
(try_begin),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_we_defeated_a_lord_unfriendly_spiteful"),
(assign, ":relevance", 150),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(assign, ":comment", "str_comment_we_defeated_a_lord_unfriendly"),
(assign, ":relevance", 150),
(else_try),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_we_defeated_a_lord_cruel"),
(assign, ":relevance", 150),
(else_try),
(eq, ":reputation", lrep_quarrelsome),
(assign, ":comment", "str_comment_we_defeated_a_lord_cruel"),
(assign, ":relevance", 150),
(else_try),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_we_defeated_a_lord_upstanding"),
(assign, ":relevance", 150),
(else_try),
(assign, ":comment", "str_comment_we_defeated_a_lord_default"),
(assign, ":relevance", 150),
(try_end),
(else_try),
(this_or_next|eq, ":entry_type", logent_castle_captured_by_player),
(eq, ":entry_type", logent_player_participated_in_siege),
(troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"),
(try_begin),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_we_fought_in_siege_unfriendly_spiteful"),
(assign, ":relevance", 150),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(assign, ":comment", "str_comment_we_fought_in_siege_unfriendly"),
(assign, ":relevance", 150),
(else_try),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_we_fought_in_siege_cruel"),
(assign, ":relevance", 150),
(else_try),
(eq, ":reputation", lrep_quarrelsome),
(assign, ":comment", "str_comment_we_fought_in_siege_quarrelsome"),
(assign, ":relevance", 150),
(else_try),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_we_fought_in_siege_upstanding"),
(assign, ":relevance", 150),
(else_try),
(assign, ":comment", "str_comment_we_fought_in_siege_default"),
(assign, ":relevance", 150),
(try_end),
(else_try),
(eq, ":entry_type", logent_player_participated_in_major_battle),
(troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"),
(try_begin),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_we_fought_in_major_battle_unfriendly_spiteful"),
(assign, ":relevance", 150),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(assign, ":comment", "str_comment_we_fought_in_major_battle_unfriendly"),
(assign, ":relevance", 150),
(else_try),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_we_fought_in_major_battle_cruel"),
(assign, ":relevance", 150),
(else_try),
(eq, ":reputation", lrep_quarrelsome),
(assign, ":comment", "str_comment_we_fought_in_major_battle_cruel"),
(assign, ":relevance", 150),
(else_try),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_we_fought_in_major_battle_upstanding"),
(assign, ":relevance", 150),
(else_try),
(assign, ":comment", "str_comment_we_fought_in_major_battle_default"),
(assign, ":relevance", 150),
(try_end),
#Post 0907 changes end
(else_try),
(eq, ":entry_type", logent_lord_defeated_by_player),
(try_begin),
(eq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_martial),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_you_defeated_me_enemy_chivalrous"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_debauched),
(eq, ":reputation", lrep_quarrelsome),
(assign, ":comment", "str_comment_you_defeated_me_enemy_spiteful"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(assign, ":comment", "str_comment_you_defeated_me_enemy"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object_faction", "$g_talk_troop_faction"),
(this_or_next|eq, ":reputation", lrep_upstanding),
(eq, ":reputation", lrep_cunning),
(assign, ":comment", "str_comment_you_defeated_my_friend_enemy_pragmatic"),
(assign, ":relevance", 85),
(else_try),
(eq, ":troop_object_faction", "$g_talk_troop_faction"),
(this_or_next|eq, ":reputation", lrep_martial),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_you_defeated_my_friend_enemy_chivalrous"),
(assign, ":relevance", 85),
(else_try),
(eq, ":troop_object_faction", "$g_talk_troop_faction"),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_defeated_my_friend_enemy_spiteful"),
(assign, ":relevance", 85),
(else_try),
(eq, ":troop_object_faction", "$g_talk_troop_faction"),
(assign, ":comment", "str_comment_you_defeated_my_friend_enemy"),
(assign, ":relevance", 85),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(faction_slot_eq, "$players_kingdom", slot_faction_leader, "$g_talk_troop"),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied_liege"),
(assign, ":relevance", 70),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied_unfriendly_spiteful"),
(assign, ":relevance", 65),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied_spiteful"),
(assign, ":relevance", 65),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_upstanding),
(eq, ":reputation", lrep_martial),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied_unfriendly_chivalrous"),
(assign, ":relevance", 65),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied"),
(assign, ":relevance", 65),
(try_end),
(else_try),
(eq, ":entry_type", logent_lord_defeated_by_player),
(try_begin),
(eq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_martial),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_you_defeated_me_enemy_chivalrous"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_debauched),
(eq, ":reputation", lrep_quarrelsome),
(assign, ":comment", "str_comment_you_defeated_me_enemy_spiteful"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(assign, ":comment", "str_comment_you_defeated_me_enemy"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object_faction", "$g_talk_troop_faction"),
(this_or_next|eq, ":reputation", lrep_upstanding),
(eq, ":reputation", lrep_cunning),
(assign, ":comment", "str_comment_you_defeated_my_friend_enemy_pragmatic"),
(assign, ":relevance", 85),
(else_try),
(eq, ":troop_object_faction", "$g_talk_troop_faction"),
(this_or_next|eq, ":reputation", lrep_martial),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_you_defeated_my_friend_enemy_chivalrous"),
(assign, ":relevance", 85),
(else_try),
(eq, ":troop_object_faction", "$g_talk_troop_faction"),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_defeated_my_friend_enemy_spiteful"),
(assign, ":relevance", 85),
(else_try),
(eq, ":troop_object_faction", "$g_talk_troop_faction"),
(assign, ":comment", "str_comment_you_defeated_my_friend_enemy"),
(assign, ":relevance", 85),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(faction_slot_eq, "$players_kingdom", slot_faction_leader, "$g_talk_troop"),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied_liege"),
(assign, ":relevance", 70),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied_unfriendly_spiteful"),
(assign, ":relevance", 65),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied_spiteful"),
(assign, ":relevance", 65),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_upstanding),
(eq, ":reputation", lrep_martial),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied_unfriendly_chivalrous"),
(assign, ":relevance", 65),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(assign, ":comment", "str_comment_you_defeated_a_lord_allied"),
(assign, ":relevance", 65),
(try_end),
#Post 0907 changes begin
(else_try),
(eq, ":entry_type", logent_lord_helped_by_player),
(neq, ":troop_object", "$g_talk_troop"),
(eq, ":troop_object_faction", "$g_talk_troop_faction"),
(try_begin),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_upstanding),
(eq, ":reputation", lrep_martial),
(assign, ":comment", "str_comment_you_helped_my_ally_unfriendly_chivalrous"),
(assign, ":relevance", 65),
(assign, ":suggested_relation_change", 2),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(assign, ":comment", "str_comment_you_helped_my_ally_unfriendly"),
(assign, ":relevance", 0),
(else_try),
(eq, ":reputation", lrep_none),
(assign, ":comment", "str_comment_you_helped_my_ally_liege"),
(assign, ":relevance", 65),
(assign, ":suggested_relation_change", 3),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_helped_my_ally_unfriendly_spiteful"),
(assign, ":relevance", 65),
(else_try),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_helped_my_ally_spiteful"),
(assign, ":relevance", 65),
(else_try),
(this_or_next|eq, ":reputation", lrep_martial),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_you_helped_my_ally_chivalrous"),
(assign, ":relevance", 65),
(assign, ":suggested_relation_change", 2),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(assign, ":comment", "str_comment_you_helped_my_ally_default"),
(try_end),
#Post 0907 changes begin
(else_try),
(eq, ":entry_type", logent_player_defeated_by_lord),
(troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"),
(try_begin),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_we_were_defeated_unfriendly_spiteful"),
(assign, ":relevance", 150),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(assign, ":comment", "str_comment_we_were_defeated_unfriendly"),
(assign, ":relevance", 150),
(else_try),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_we_were_defeated_cruel"),
(assign, ":relevance", 150),
(else_try),
(assign, ":comment", "str_comment_we_were_defeated_default"),
(assign, ":relevance", 150),
(try_end),
(else_try),
(eq, ":entry_type", logent_player_defeated_by_lord),
(try_begin),
(eq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_I_defeated_you_enemy_spiteful"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(eq, ":reputation", lrep_martial),
(assign, ":comment", "str_comment_I_defeated_you_enemy_chivalrous"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_goodnatured),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_I_defeated_you_enemy_benevolent"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_cunning),
(assign, ":comment", "str_comment_I_defeated_you_enemy_coldblooded"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(assign, ":comment", "str_comment_I_defeated_you_enemy"),
(assign, ":relevance", 200),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(assign, ":comment", "str_comment_I_defeated_you_enemy"),
(assign, ":relevance", 200),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(gt, "$g_talk_troop_relation", 5),
(assign, ":comment", "str_comment_you_were_defeated_allied_friendly_spiteful"),
(assign, ":relevance", 80),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(lt, "$g_talk_troop_relation", -5),
(assign, ":comment", "str_comment_you_were_defeated_allied_unfriendly_cruel"),
(assign, ":relevance", 80),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(le, "$g_talk_troop_relation", 5),
(assign, ":comment", "str_comment_you_were_defeated_allied_spiteful"),
(assign, ":relevance", 80),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(eq, ":reputation", lrep_selfrighteous),
(assign, ":comment", "str_comment_you_were_defeated_allied_pitiless"),
(assign, ":relevance", 65),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(eq, ":reputation", lrep_upstanding),
(lt, "$g_talk_troop_relation", -15),
(assign, ":comment", "str_comment_you_were_defeated_allied_unfriendly_upstanding"),
(assign, ":relevance", 65),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, "$g_talk_troop_relation", -10),
(assign, ":comment", "str_comment_you_were_defeated_allied_unfriendly"),
(assign, ":relevance", 65),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(assign, ":comment", "str_comment_you_were_defeated_allied"),
(assign, ":relevance", 65),
(try_end),
#Post 0907 changes end
#Post 0907 changes begin
(else_try),
(eq, ":entry_type", logent_player_retreated_from_lord),
(troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"),
(try_begin),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_abandoned_us_unfriendly_spiteful"),
(assign, ":relevance", 150),
(assign, ":suggested_relation_change", -5),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(eq, ":reputation", lrep_selfrighteous),
(assign, ":comment", "str_comment_you_abandoned_us_unfriendly_pitiless"),
(assign, ":relevance", 150),
(assign, ":suggested_relation_change", -5),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_abandoned_us_spiteful"),
(assign, ":suggested_relation_change", -5),
(else_try),
(eq, ":reputation", lrep_martial),
(assign, ":comment", "str_comment_you_abandoned_us_chivalrous"),
(assign, ":relevance", 150),
(assign, ":suggested_relation_change", -2),
(else_try),
(this_or_next|eq, ":reputation", lrep_upstanding),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_you_abandoned_us_benefitofdoubt"),
(assign, ":relevance", 150),
(assign, ":suggested_relation_change", -1),
(else_try),
(assign, ":comment", "str_comment_you_abandoned_us_default"),
(assign, ":relevance", 150),
(assign, ":suggested_relation_change", -2),
(try_end),
#Post 0907 changes end
(else_try),
(this_or_next|eq, ":entry_type", logent_player_retreated_from_lord),
(eq, ":entry_type", logent_player_retreated_from_lord_cowardly),
(eq, ":troop_object", "$g_talk_troop"),
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg7, ":entry_hours_elapsed"),
(display_message, "@Elapsed hours: {reg7}"),
(try_end),
(gt, ":entry_hours_elapsed", 2),
(try_begin),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_ran_from_me_enemy_spiteful"),
(assign, ":relevance", 25),
(else_try),
(eq, ":reputation", lrep_martial),
(assign, ":comment", "str_comment_you_ran_from_me_enemy_chivalrous"),
(assign, ":relevance", 25),
(else_try),
(this_or_next|eq, ":reputation", lrep_goodnatured),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_you_ran_from_me_enemy_benevolent"),
(assign, ":relevance", 25),
(else_try),
(eq, ":reputation", lrep_cunning),
(assign, ":comment", "str_comment_you_ran_from_me_enemy_coldblooded"),
(assign, ":relevance", 25),
(else_try),
(assign, ":comment", "str_comment_you_ran_from_me_enemy"),
(assign, ":relevance", 25),
(try_end),
(else_try),
(eq, ":entry_type", logent_player_retreated_from_lord_cowardly),
(try_begin),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(neq, ":troop_object", "$g_talk_troop"),
(lt, "$g_talk_troop_relation", 5),
(eq, ":reputation", lrep_martial),
(assign, ":comment", "str_comment_you_ran_from_foe_allied_chivalrous"),
(assign, ":relevance", 80),
(assign, ":suggested_relation_change", -3),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(neq, ":troop_object", "$g_talk_troop"),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_you_ran_from_foe_allied_upstanding"),
(assign, ":relevance", 80),
(assign, ":suggested_relation_change", -1),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(neq, ":troop_object", "$g_talk_troop"),
(lt, "$g_talk_troop_relation", 5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_ran_from_foe_allied_spiteful"),
(assign, ":relevance", 80),
(try_end),
(else_try),
(eq, ":entry_type", logent_lord_defeated_but_let_go_by_player),
(try_begin),
(eq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_let_me_go_spiteful"),
(assign, ":relevance", 300),
(assign, ":suggested_relation_change", -15),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(ge, "$g_talk_troop_faction_relation", 0),
(assign, ":comment", "str_comment_you_let_me_go_default"),
(assign, ":relevance", 300),
(assign, ":suggested_relation_change", 2),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(lt, "$g_talk_troop_faction_relation", 0),
(this_or_next|eq, ":reputation", lrep_martial),
(eq, ":reputation", lrep_upstanding),
(assign, ":suggested_relation_change", 5),
(assign, ":relevance", 300),
(assign, ":comment", "str_comment_you_let_me_go_enemy_chivalrous"),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(lt, "$g_talk_troop_faction_relation", 0),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_cunning),
(assign, ":relevance", 300),
(assign, ":comment", "str_comment_you_let_me_go_enemy_coldblooded"),
(else_try),
(eq, ":troop_object", "$g_talk_troop"),
(lt, "$g_talk_troop_faction_relation", 0),
(assign, ":relevance", 300),
(assign, ":comment", "str_comment_you_let_me_go_enemy"),
(assign, ":suggested_relation_change", 1),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(neq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_martial),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_you_let_go_a_lord_allied_chivalrous"),
(assign, ":relevance", 80),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(neq, ":troop_object", "$g_talk_troop"),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_you_let_go_a_lord_allied_upstanding"),
(assign, ":relevance", 80),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(neq, ":troop_object", "$g_talk_troop"),
(this_or_next|eq, ":reputation", lrep_cunning),
(eq, ":reputation", lrep_selfrighteous),
(assign, ":comment", "str_comment_you_let_go_a_lord_allied_coldblooded"),
(assign, ":relevance", 80),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(neq, ":troop_object", "$g_talk_troop"),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_let_go_a_lord_allied_unfriendly_spiteful"),
(assign, ":relevance", 80),
(else_try),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(lt, ":players_kingdom_relation", 0),
(neq, ":troop_object", "$g_talk_troop"),
(assign, ":comment", "str_comment_you_let_go_a_lord_allied"),
(assign, ":relevance", 80),
(try_end),
#Internal faction relations
(else_try),
(eq, ":entry_type", logent_pledged_allegiance),
(eq, ":actor", "trp_player"),
(try_begin),
(eq, ":faction_object", "$g_talk_troop_faction"),
(neq, ":troop_object", "$g_talk_troop"),
(assign, ":relevance", 200),
(try_begin),
(lt, "$g_talk_troop_relation", -5),
(eq, ":reputation", lrep_martial),
(assign, ":comment", "str_comment_pledged_allegiance_allied_martial_unfriendly"),
(else_try),
(eq, ":reputation", lrep_martial),
(assign, ":comment", "str_comment_pledged_allegiance_allied_martial"),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(eq, ":reputation", lrep_quarrelsome),
(assign, ":comment", "str_comment_pledged_allegiance_allied_quarrelsome_unfriendly"),
(else_try),
(eq, ":reputation", lrep_quarrelsome),
(assign, ":comment", "str_comment_pledged_allegiance_allied_quarrelsome"),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(eq, ":reputation", lrep_selfrighteous),
(assign, ":comment", "str_comment_pledged_allegiance_allied_selfrighteous_unfriendly"),
(else_try),
(eq, ":reputation", lrep_selfrighteous),
(assign, ":comment", "str_comment_pledged_allegiance_allied_selfrighteous"),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(eq, ":reputation", lrep_cunning),
(assign, ":comment", "str_comment_pledged_allegiance_allied_cunning_unfriendly"),
(else_try),
(eq, ":reputation", lrep_cunning),
(assign, ":comment", "str_comment_pledged_allegiance_allied_cunning"),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_pledged_allegiance_allied_debauched_unfriendly"),
(else_try),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_pledged_allegiance_allied_debauched"),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_pledged_allegiance_allied_goodnatured_unfriendly"),
(else_try),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_pledged_allegiance_allied_goodnatured"),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_pledged_allegiance_allied_upstanding_unfriendly"),
(else_try),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_pledged_allegiance_allied_upstanding"),
(try_end),
(try_end),
(else_try),
(eq, ":entry_type", logent_fief_granted_village),
(eq, ":actor", "trp_player"),
(try_begin),
(eq, ":faction_object", "$g_talk_troop_faction"),
(neq, ":troop_object", "$g_talk_troop"),
(eq, ":faction_object", "$players_kingdom"),
(assign, ":relevance", 110),
(try_begin),
(gt, "$g_talk_troop_relation", 5),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_friendly_cruel"),
(else_try),
(gt, "$g_talk_troop_relation", 5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_cunning),
(assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_friendly_cynical"),
(else_try),
(gt, "$g_talk_troop_relation", 5),
(assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_friendly"),
(else_try),
(is_between, "$g_talk_troop_relation", -5, 5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_spiteful"),
(assign, ":suggested_relation_change", -2),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_unfriendly_upstanding"),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_unfriendly_spiteful"),
(else_try),
(assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied"),
(try_end),
(try_end),
(else_try),
(eq, ":entry_type", logent_renounced_allegiance),
(eq, ":actor", "trp_player"),
(try_begin),
(eq, ":faction_object", "$g_talk_troop_faction"),
(neq, ":troop_object", "$g_talk_troop"),
(try_begin),
(ge, "$g_talk_troop_faction_relation", 0),
(neq, "$g_talk_troop_faction", "$players_kingdom"),
(assign, ":relevance", 180),
(try_begin),
(gt, "$g_talk_troop_relation", 5),
(assign, ":comment", "str_comment_you_renounced_your_alliegance_friendly"),
(else_try),
(ge, "$g_talk_troop_relation", 0),
(eq, ":reputation", lrep_goodnatured),
(assign, ":comment", "str_comment_you_renounced_your_alliegance_friendly"),
(try_end),
(else_try),
(lt, "$g_talk_troop_faction_relation", 0),
(assign, ":relevance", 300),
(try_begin),
(ge, "$g_talk_troop_relation", 0),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_renounced_your_alliegance_unfriendly_moralizing"),
(else_try),
(gt, "$g_talk_troop_relation", 5),
(this_or_next|eq, ":reputation", lrep_goodnatured),
(eq, ":reputation", lrep_upstanding),
(assign, ":comment", "str_comment_you_renounced_your_alliegance_enemy_friendly"),
(else_try),
(gt, "$g_talk_troop_relation", 5),
(assign, ":comment", "str_comment_you_renounced_your_alliegance_enemy"),
(else_try),
(is_between, "$g_talk_troop_relation", -5, 5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_renounced_your_alliegance_unfriendly_spiteful"),
(assign, ":suggested_relation_change", -2),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(eq, ":reputation", lrep_debauched),
(assign, ":comment", "str_comment_you_renounced_your_alliegance_unfriendly_spiteful"),
(else_try),
(assign, ":comment", "str_comment_you_renounced_your_alliegance_default"),
(try_end),
(try_end),
(try_end),
(try_end),
(assign, reg0, ":comment"),
(assign, reg1, ":relevance"),
(assign, reg2, ":suggested_relation_change"),
]),
# script_get_relevant_comment_to_s42
# Input: none
# Output: reg0 = 1 if comment found, 0 otherwise; s61 will contain comment string if found
("get_relevant_comment_to_s42",
[
(troop_get_slot, ":reputation", "$g_talk_troop", slot_lord_reputation_type),
(try_begin),
(eq, "$cheat_mode", 1),
(store_add, ":rep_string", ":reputation", "str_personality_archetypes"),
(str_store_string, s15, ":rep_string"),
(display_message, "@Reputation type: {s15}"),
(try_end),
(assign, ":highest_score_so_far", 50),
(assign, ":best_comment_so_far", -1),
(assign, ":comment_found", 0),
(assign, ":best_log_entry", -1),
(assign, ":comment_relation_change", 0),
(store_current_hours, ":current_time"),
#prevents multiple comments in conversations in same hour
# (troop_get_slot, ":talk_troop_last_comment_time", "$g_talk_troop", slot_troop_last_comment_time),
#"$num_log_entries should also be set to one, not zero. This is included in the initialize npcs script, although could be moved to game_start
(troop_get_slot, ":talk_troop_last_comment_slot", "$g_talk_troop", slot_troop_last_comment_slot),
(troop_set_slot, "$g_talk_troop", slot_troop_last_comment_slot, "$num_log_entries"),
(store_add, ":log_entries_plus_one", "$num_log_entries", 1),
(try_for_range, ":log_entry_no", 1, ":log_entries_plus_one"),
# It should be log entries plus one, so that the try_ sequence does not stop short of the last log entry
# $Num_log_entries is now the number of the last log entry, which begins at "1" rather than "0"
# This is so that (le, ":log_entry_no", ":talk_troop_last_comment_slot") works properly
(troop_get_slot, ":entry_time", "trp_log_array_entry_time", ":log_entry_no"),
# (val_max, ":entry_time", 1), #This is needed for pre-game events to be commented upon, if hours are used rather than the order of events
(store_sub, ":entry_hours_elapsed", ":current_time", ":entry_time"),
(try_begin),
(le, ":log_entry_no", ":talk_troop_last_comment_slot"),
# (le, ":entry_time", ":talk_troop_last_comment_time"),
(try_begin),
(eq, ":log_entry_no", ":talk_troop_last_comment_slot"),
(eq, "$cheat_mode", 1),
(assign, reg5, ":log_entry_no"),
(display_message, "@Entries up to #{reg5} skipped"),
(try_end),
# I suggest using the log entry number as opposed to time so that events in the same hour can be commented upon
# This feels more natural, for example, if there are other lords in the court when the player pledges allegiance
(else_try),
# (le, ":entry_hours_elapsed", 3), #don't comment on really fresh events
# (else_try),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(gt, reg1, 10),
(assign, ":score", reg1),
(assign, ":comment", reg0),
(store_random_in_range, ":rand", 70, 140),
(val_mul, ":score", ":rand"),
(store_add, ":entry_time_score", ":entry_hours_elapsed", 500), #approx. one month
(val_mul, ":score", 1000),
(val_div, ":score", ":entry_time_score"), ###Relevance decreases over time - halved after one month, one-third after two, etc
(try_begin),
(gt, ":score", ":highest_score_so_far"),
(assign, ":highest_score_so_far", ":score"),
(assign, ":best_comment_so_far", ":comment"),
(assign, ":best_log_entry", ":log_entry_no"),
(assign, ":comment_relation_change", reg2),
(try_end),
(try_end),
(try_end),
(try_begin),
(gt, ":best_comment_so_far", 0),
(assign, ":comment_found", 1), #comment found print it to s61 now.
(troop_get_slot, ":actor", "trp_log_array_actor", ":best_log_entry"),
(troop_get_slot, ":center_object", "trp_log_array_center_object", ":best_log_entry"),
(troop_get_slot, ":center_object_lord", "trp_log_array_center_object_lord", ":best_log_entry"),
(troop_get_slot, ":center_object_faction", "trp_log_array_center_object_faction", ":best_log_entry"),
(troop_get_slot, ":troop_object", "trp_log_array_troop_object", ":best_log_entry"),
(troop_get_slot, ":troop_object_faction", "trp_log_array_troop_object_faction", ":best_log_entry"),
(troop_get_slot, ":faction_object", "trp_log_array_faction_object", ":best_log_entry"),
(try_begin),
(ge, ":actor", 0),
(str_store_troop_name, s50, ":actor"),
(try_end),
(try_begin),
(ge, ":center_object", 0),
(str_store_party_name, s51, ":center_object"),
(try_end),
(try_begin),
(ge, ":center_object_lord", 0),
(str_store_troop_name, s52, ":center_object_lord"),
(try_end),
(try_begin),
(ge, ":center_object_faction", 0),
(str_store_faction_name, s53, ":center_object_faction"),
(try_end),
(try_begin),
(ge, ":troop_object", 0),
(str_store_troop_name, s54, ":troop_object"),
(try_end),
(try_begin),
(ge, ":troop_object_faction", 0),
(str_store_faction_name, s55, ":troop_object_faction"),
(try_end),
(try_begin),
(ge, ":faction_object", 0),
(str_store_faction_name, s56, ":faction_object"),
(try_end),
(str_store_string, s42, ":best_comment_so_far"),
(try_end),
(assign, reg0, ":comment_found"),
(assign, "$log_comment_relation_change", ":comment_relation_change"),
]),
#Troop Commentaries end
#Rebellion changes begin
("find_rival_from_faction",
[
(store_script_param, ":source_lord", 1),
(store_script_param, ":target_faction", 2),
(assign, ":rival", 0),
(troop_get_slot, ":source_reputation", ":source_lord", slot_lord_reputation_type),
(try_for_range, ":target_lord", kingdom_heroes_begin, kingdom_heroes_end),
(store_troop_faction, ":test_faction", ":target_lord"),
(eq, ":test_faction", ":target_faction"),
(troop_get_slot, ":target_reputation", ":target_lord", slot_lord_reputation_type),
(try_begin),
(eq, ":source_reputation", lrep_martial),
(eq, ":target_reputation", lrep_martial),
(assign, ":rival", ":target_lord"),
(else_try),
(eq, ":source_reputation", lrep_debauched),
(eq, ":target_reputation", lrep_upstanding),
(assign, ":rival", ":target_lord"),
(else_try),
(eq, ":source_reputation", lrep_selfrighteous),
(eq, ":target_reputation", lrep_goodnatured),
(assign, ":rival", ":target_lord"),
(else_try),
(eq, ":source_reputation", lrep_cunning),
(eq, ":target_reputation", lrep_quarrelsome),
(assign, ":rival", ":target_lord"),
(else_try),
(eq, ":source_reputation", lrep_quarrelsome),
(eq, ":target_reputation", lrep_cunning),
(assign, ":rival", ":target_lord"),
(else_try),
(eq, ":source_reputation", lrep_goodnatured),
(eq, ":target_reputation", lrep_selfrighteous),
(assign, ":rival", ":target_lord"),
(else_try),
(eq, ":source_reputation", lrep_upstanding),
(eq, ":target_reputation", lrep_debauched),
(assign, ":rival", ":target_lord"),
(try_end),
(try_end),
(assign, reg0, ":rival"),
]),
("rebellion_arguments",
[
(store_script_param, ":lord", 1),
(store_script_param, ":argument", 2),
(assign, ":argument_value", 0),
(troop_get_slot, ":reputation", ":lord", slot_lord_reputation_type),
(try_begin),
(eq, ":reputation", lrep_martial),
(try_begin),
(eq, ":argument", argument_claim),
(assign, ":argument_value", 30),
(else_try),
(eq, ":argument", argument_ruler),
(assign, ":argument_value", 10),
(else_try),
(eq, ":argument", argument_benefit),
(assign, ":argument_value", -20),
(else_try),
(eq, ":argument", argument_victory),
(assign, ":argument_value", -30),
(try_end),
(else_try),
(eq, ":reputation", lrep_quarrelsome),
(try_begin),
(eq, ":argument", argument_claim),
(assign, ":argument_value", -20),
(else_try),
(eq, ":argument", argument_ruler),
(assign, ":argument_value", -30),
(else_try),
(eq, ":argument", argument_benefit),
(assign, ":argument_value", 30),
(else_try),
(eq, ":argument", argument_victory),
(assign, ":argument_value", 10),
(try_end),
(else_try),
(eq, ":reputation", lrep_selfrighteous),
(try_begin),
(eq, ":argument", argument_claim),
(assign, ":argument_value", -20),
(else_try),
(eq, ":argument", argument_ruler),
(assign, ":argument_value", -30),
(else_try),
(eq, ":argument", argument_benefit),
(assign, ":argument_value", 20),
(else_try),
(eq, ":argument", argument_victory),
(assign, ":argument_value", 20),
(try_end),
(else_try),
(eq, ":reputation", lrep_cunning),
(try_begin),
(eq, ":argument", argument_claim),
(assign, ":argument_value", -30),
(else_try),
(eq, ":argument", argument_ruler),
(assign, ":argument_value", 20),
(else_try),
(eq, ":argument", argument_benefit),
(assign, ":argument_value", -20),
(else_try),
(eq, ":argument", argument_victory),
(assign, ":argument_value", 20),
(try_end),
(else_try),
(eq, ":reputation", lrep_debauched),
(try_begin),
(eq, ":argument", argument_claim),
(assign, ":argument_value", -20),
(else_try),
(eq, ":argument", argument_ruler),
(assign, ":argument_value", -20),
(else_try),
(eq, ":argument", argument_benefit),
(assign, ":argument_value", 20),
(else_try),
(eq, ":argument", argument_victory),
(assign, ":argument_value", 10),
(try_end),
(else_try),
(eq, ":reputation", lrep_goodnatured),
(try_begin),
(eq, ":argument", argument_claim),
(assign, ":argument_value", 10),
(else_try),
(eq, ":argument", argument_ruler),
(assign, ":argument_value", 20),
(else_try),
(eq, ":argument", argument_benefit),
(assign, ":argument_value", -15),
(else_try),
(eq, ":argument", argument_victory),
(assign, ":argument_value", -25),
(try_end),
(else_try),
(eq, ":reputation", lrep_upstanding),
(try_begin),
(eq, ":argument", argument_claim),
(assign, ":argument_value", 10),
(else_try),
(eq, ":argument", argument_ruler),
(assign, ":argument_value", 0),
(else_try),
(eq, ":argument", argument_benefit),
(assign, ":argument_value", -40),
(else_try),
(eq, ":argument", argument_victory),
(assign, ":argument_value", 10),
(try_end),
(try_end),
(assign, reg0, ":argument_value"),
]),
#Rebellion changes end
# script_get_culture_with_party_faction_for_music
# Input: arg1 = party_no
# Output: reg0 = culture
("get_culture_with_party_faction_for_music",
[
(store_script_param, ":party_no", 1),
(store_faction_of_party, ":faction_no", ":party_no"),
(try_begin),
(this_or_next|eq, ":faction_no", "fac_player_faction"),
(eq, ":faction_no", "fac_player_supporters_faction"),
(assign, ":faction_no", "$players_kingdom"),
(try_end),
(try_begin),
(is_between, ":party_no", centers_begin, centers_end),
(this_or_next|eq, ":faction_no", "fac_player_supporters_faction"),
(neg|is_between, ":faction_no", kingdoms_begin, kingdoms_end),
(party_get_slot, ":faction_no", ":party_no", slot_center_original_faction),
(try_end),
(try_begin),
(eq, ":faction_no", "fac_kingdom_1"),
(assign, ":result", mtf_culture_1),
(else_try),
(eq, ":faction_no", "fac_kingdom_2"),
(assign, ":result", mtf_culture_2),
(else_try),
(eq, ":faction_no", "fac_kingdom_3"),
(assign, ":result", mtf_culture_3),
(else_try),
(eq, ":faction_no", "fac_kingdom_4"),
(assign, ":result", mtf_culture_4),
(else_try),
(eq, ":faction_no", "fac_kingdom_5"),
(assign, ":result", mtf_culture_5),
(else_try),
(this_or_next|eq, ":faction_no", "fac_outlaws"),
(this_or_next|eq, ":faction_no", "fac_peasant_rebels"),
(this_or_next|eq, ":faction_no", "fac_deserters"),
(this_or_next|eq, ":faction_no", "fac_mountain_bandits"),
(eq, ":faction_no", "fac_forest_bandits"),
(assign, ":result", mtf_culture_6),
(else_try),
(assign, ":result", 0), #no culture, including player with no bindings to another kingdom
(try_end),
(assign, reg0, ":result"),
]),
# script_music_set_situation_with_culture
# Input: arg1 = music_situation
# Output: none
("music_set_situation_with_culture",
[
(store_script_param, ":situation", 1),
(assign, ":culture", 0), #no culture
(try_begin),
(this_or_next|eq, ":situation", mtf_sit_town),
(this_or_next|eq, ":situation", mtf_sit_day),
(this_or_next|eq, ":situation", mtf_sit_night),
(this_or_next|eq, ":situation", mtf_sit_town_infiltrate),
(eq, ":situation", mtf_sit_encounter_hostile),
(call_script, "script_get_culture_with_party_faction_for_music", "$g_encountered_party"),
(val_or, ":culture", reg0),
(else_try),
(this_or_next|eq, ":situation", mtf_sit_ambushed),
(eq, ":situation", mtf_sit_fight),
(call_script, "script_get_culture_with_party_faction_for_music", "$g_encountered_party"),
(val_or, ":culture", reg0),
(call_script, "script_get_culture_with_party_faction_for_music", "p_main_party"),
(val_or, ":culture", reg0),
(call_script, "script_get_closest_center", "p_main_party"),
(call_script, "script_get_culture_with_party_faction_for_music", reg0),
(val_or, ":culture", reg0),
(else_try),
(eq, ":situation", mtf_sit_travel),
(call_script, "script_get_culture_with_party_faction_for_music", "p_main_party"),
(val_or, ":culture", reg0),
(call_script, "script_get_closest_center", "p_main_party"),
(call_script, "script_get_culture_with_party_faction_for_music", reg0),
(val_or, ":culture", reg0),
(else_try),
(eq, ":situation", mtf_sit_victorious),
(call_script, "script_get_culture_with_party_faction_for_music", "p_main_party"),
(val_or, ":culture", reg0),
(else_try),
(eq, ":situation", mtf_sit_killed),
(call_script, "script_get_culture_with_party_faction_for_music", "$g_encountered_party"),
(val_or, ":culture", reg0),
(try_end),
(try_begin),
(this_or_next|eq, ":situation", mtf_sit_town),
(eq, ":situation", mtf_sit_day),
(try_begin),
(is_currently_night),
(assign, ":situation", mtf_sit_night),
(try_end),
(try_end),
(music_set_situation, ":situation"),
(music_set_culture, ":culture"),
]),
# script_combat_music_set_situation_with_culture
# Input: none
# Output: none
("combat_music_set_situation_with_culture",
[
(assign, ":situation", mtf_sit_fight),
(assign, ":num_allies", 0),
(assign, ":num_enemies", 0),
(try_for_agents, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_get_troop_id, ":agent_troop_id", ":agent_no"),
(store_character_level, ":troop_level", ":agent_troop_id"),
(val_add, ":troop_level", 10),
(val_mul, ":troop_level", ":troop_level"),
(try_begin),
(agent_is_ally, ":agent_no"),
(val_add, ":num_allies", ":troop_level"),
(else_try),
(val_add, ":num_enemies", ":troop_level"),
(try_end),
(try_end),
(val_mul, ":num_allies", 4), #play ambushed music if we are 2 times outnumbered.
(val_div, ":num_allies", 3),
(try_begin),
(lt, ":num_allies", ":num_enemies"),
(assign, ":situation", mtf_sit_ambushed),
(try_end),
(call_script, "script_music_set_situation_with_culture", ":situation"),
]),
# script_play_victorious_sound
# Input: none
# Output: none
("play_victorious_sound",
[
(call_script, "script_music_set_situation_with_culture", mtf_sit_victorious),
# (play_cue_track, "track_victorious_neutral_1"),
# (play_track, "track_victorious_neutral_1", 1),
]),
# script_set_items_for_tournament
# Input: arg1 = horse_chance, arg2 = lance_chance (with horse only), arg3 = sword_chance, arg4 = axe_chance, arg5 = bow_chance (without horse only), arg6 = javelin_chance (with horse only), arg7 = mounted_bow_chance (with horse only), arg8 = crossbow_sword_chance, arg9 = armor_item_begin, arg10 = helm_item_begin
# Output: none (sets mt_arena_melee_fight items)
("set_items_for_tournament",
[
(store_script_param, ":horse_chance", 1),
(store_script_param, ":lance_chance", 2),
(store_script_param, ":sword_chance", 3),
(store_script_param, ":axe_chance", 4),
(store_script_param, ":bow_chance", 5),
(store_script_param, ":javelin_chance", 6),
(store_script_param, ":mounted_bow_chance", 7),
(store_script_param, ":crossbow_sword_chance", 8),
(store_script_param, ":armor_item_begin", 9),
(store_script_param, ":helm_item_begin", 10),
(store_add, ":total_chance", ":sword_chance", ":axe_chance"),
(val_add, ":total_chance", ":crossbow_sword_chance"),
(try_for_range, ":i_ep", 0, 32),
(mission_tpl_entry_clear_override_items, "mt_arena_melee_fight", ":i_ep"),
(assign, ":has_horse", 0),
(store_div, ":cur_team", ":i_ep", 8),
(try_begin),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":horse_chance"),
(assign, ":has_horse", 1),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_horse"),
(try_end),
(try_begin),
(eq, ":has_horse", 1),
(store_add, ":cur_total_chance", ":total_chance", ":lance_chance"),
(val_add, ":cur_total_chance", ":javelin_chance"),
(val_add, ":cur_total_chance", ":mounted_bow_chance"),
(else_try),
(store_add, ":cur_total_chance", ":total_chance", ":bow_chance"),
(try_end),
(store_random_in_range, ":random_no", 0, ":cur_total_chance"),
(store_add, ":cur_shield_item", "itm_arena_shield_red", ":cur_team"),
(try_begin),
(val_sub, ":random_no", ":sword_chance"),
(lt, ":random_no", 0),
(try_begin),
(store_random_in_range, ":sub_random_no", 0, 100),
(lt, ":sub_random_no", 50),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_sword"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"),
# (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"),
(else_try),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_heavy_practice_sword"),
(try_end),
(else_try),
(val_sub, ":random_no", ":axe_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_axe"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"),
# (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"),
(else_try),
(val_sub, ":random_no", ":crossbow_sword_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_sword"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_crossbow"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_bolts"),
(else_try),
(eq, ":has_horse", 0),
(val_sub, ":random_no", ":bow_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_bow"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_arrows"),
(else_try),
(eq, ":has_horse", 1),
(val_sub, ":random_no", ":lance_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_lance"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"),
# (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"),
(else_try),
(eq, ":has_horse", 1),
(val_sub, ":random_no", ":javelin_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_javelin"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"),
# (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"),
(else_try),
(eq, ":has_horse", 1),
(val_sub, ":random_no", ":mounted_bow_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_bow"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_arrows"),
(try_end),
(try_begin),
(ge, ":armor_item_begin", 0),
(store_add, ":cur_armor_item", ":armor_item_begin", ":cur_team"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_armor_item"),
(try_end),
(try_begin),
(ge, ":helm_item_begin", 0),
(store_add, ":cur_helm_item", ":helm_item_begin", ":cur_team"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_helm_item"),
(try_end),
(try_end),
]),
# script_custom_battle_end
# Input: none
# Output: none
("custom_battle_end",
[
(assign, "$g_custom_battle_team1_death_count", 0),
(assign, "$g_custom_battle_team2_death_count", 0),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(neg|agent_is_alive, ":cur_agent"),
(agent_get_team, ":cur_team", ":cur_agent"),
(try_begin),
(eq, ":cur_team", 0),
(val_add, "$g_custom_battle_team1_death_count", 1),
(else_try),
(val_add, "$g_custom_battle_team2_death_count", 1),
(try_end),
(try_end),
]),
# script_remove_troop_from_prison
# Input: troop_no
# Output: none
("remove_troop_from_prison",
[(store_script_param, ":troop_no", 1),
(troop_set_slot, ":troop_no", slot_troop_prisoner_of_party, -1),
(try_begin),
(check_quest_active, "qst_rescue_lord_by_replace"),
(quest_slot_eq, "qst_rescue_lord_by_replace", slot_quest_target_troop, ":troop_no"),
(call_script, "script_cancel_quest", "qst_rescue_lord_by_replace"),
(try_end),
(try_begin),
(check_quest_active, "qst_deliver_message_to_prisoner_lord"),
(quest_slot_eq, "qst_deliver_message_to_prisoner_lord", slot_quest_target_troop, ":troop_no"),
(call_script, "script_cancel_quest", "qst_deliver_message_to_prisoner_lord"),
(try_end),
]),
##################################################
# Form Ranks Scripts Section Begin
#
############ Initialization code #################
#### No change should be done to these codes #####
# script_formation_agent_init
# Called when agent spawned. Initialize slot_agent_formations_states.
# To be developed
# Input: arg1: agent_no
# Output: none
("formation_agent_init",
[(store_script_param, ":agent_no", 1),
#TO DO: add code for multi arrays, update $formation_max_array_no
# set array leader -- added elsewhere
(agent_get_party_id, ":party_no", ":agent_no"),
(agent_get_team, ":team_no", ":agent_no"),
(agent_get_troop_id, ":troop_id", ":agent_no"),
(assign, ":formation_states", 0),
(try_begin),
#(eq, ":team_no", ":main_team"),
#(agent_is_ally, ":agent_no"),
(agent_is_human, ":agent_no"),
(assign, ":array_no", -1),
(assign, ":array_leader", 0),
(try_begin),
(eq, "p_main_party", ":party_no"),
(assign, ":array_no", 0),
(try_end),
(party_get_slot, ":max_array_no", "p_main_party", slot_party_array_parties_begin),
(try_for_range, ":i", 1, ":max_array_no"),
(store_add, ":slot", slot_party_array_parties_begin, ":i"),
(party_get_slot, ":array_party", "p_main_party", ":slot"),
(try_begin),
(party_slot_eq, ":array_party", slot_array_party_leader, ":troop_id"),
(assign, ":array_no", ":i"),
(assign, ":array_leader", 1),
(try_end),
(eq, ":array_party", ":party_no"),
(assign, ":array_no", ":i"),
(try_end),
(neq, ":array_no", -1),
(val_add, ":formation_states", ":array_no"),
(try_begin),
(neq, ":array_leader", 0),
(val_add, ":formation_states", safs_array_leader),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader),
(party_set_slot, formation_vector, reg0, ":agent_no"),
(try_end),
(else_try),
(agent_is_human, ":agent_no"),
(assign, ":formation_states", safs_full_mask), # agent to be assigned array
(try_end),
(agent_set_slot, ":agent_no", slot_agent_formation_states, ":formation_states"),
]),
# scrip_formation_array_init
# Called before change formation
# Input: arg1: team_no, arg2: array_no
# Output: reg0: num_of_men
("formation_array_init",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(assign, ":num_of_men", 0),
#(get_player_agent_no, ":player"),
(try_for_agents, ":agent"),
#(neq, ":agent", ":player"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(eq, ":agent_team", ":team_no"),
(agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states),
(assign, ":agent_array", 0),
(store_and, ":agent_array", ":formation_states", safs_array_no),
(eq, ":agent_array", ":array_no"),
(val_or, ":formation_states", safs_in_formation),
(val_sub, ":formation_states", safs_in_formation),
(agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"),
(val_add, ":num_of_men", 1),
(try_end),
(assign, reg0, ":num_of_men"),
#(display_message, "@Total {reg0} men.", formation_debug_color),
]),
# script_formation_formulate_arrays
# To assign soldiers to arrays for non-player teams
# Input: none
# Output: none
("formation_formulate_arrays",
[(get_player_agent_no, ":player"),
(agent_get_team, ":player_team", ":player"),
(val_add, "$spawn_wave", 1),
(try_begin),
(eq, "$spawn_wave", 1),
# initialize temp vector
(assign, ":base", slot_formation_tmp_team_stat_begin),
(try_for_range, ":team_no", 0, 4),
(try_for_range, ":offset", 0, slot_formation_tmp_team_stat_section_size),
(store_add, ":slot", ":offset", ":base"),
(party_set_slot, formation_temp_vector, ":slot", 0),
(try_end),
(val_add, ":base", slot_formation_tmp_team_stat_section_size),
(try_end),
(try_end),
(try_for_agents, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_get_slot, ":formation_states", ":agent_no", slot_agent_formation_states),
(eq, ":formation_states", safs_full_mask), # agent not assigned array yet
(agent_get_team, ":team_no", ":agent_no"),
(agent_get_troop_id, ":troop_id", ":agent_no"),
(agent_get_class, ":class", ":agent_no"),
(store_character_level, ":level", ":troop_id"),
(store_mul, ":stat_slot", slot_formation_tmp_team_stat_section_size, ":team_no"),
(val_add, ":stat_slot", slot_formation_tmp_team_stat_begin),
(try_begin),
(eq, ":class", grc_infantry),
(try_begin),
(ge, ":level", 15),
(val_add, ":stat_slot", slot_formation_tmp_team_infantry_high),
(party_get_slot, ":num", formation_temp_vector, ":stat_slot"),
(val_add, ":num", 1),
(try_begin),
(assign, ":stage", 0),
(store_and, ":stage", ":num", sftt_formation_stage_mask),
(val_div, ":stage", sftt_formation_stage),
(gt, ":stage", 0),
(le, ":stage", 7),
# new agents added,
# set formation stage to reform formation
(val_add, ":num", 7*sftt_formation_stage),
(try_end),
(party_set_slot, formation_temp_vector, ":stat_slot", ":num"),
(else_try),
(val_add, ":stat_slot", slot_formation_tmp_team_infantry_low),
(party_get_slot, ":num", formation_temp_vector, ":stat_slot"),
(val_add, ":num", 1),
(try_begin),
(assign, ":stage", 0),
(store_and, ":stage", ":num", sftt_formation_stage_mask),
(val_div, ":stage", sftt_formation_stage),
(gt, ":stage", 0),
(le, ":stage", 7),
# new agents added,
# set formation stage to reform formation
(val_add, ":num", 7*sftt_formation_stage),
(try_end),
(party_set_slot, formation_temp_vector, ":stat_slot", ":num"),
(try_end),
(else_try),
(eq, ":class", grc_archers),
(val_add, ":stat_slot", slot_formation_tmp_team_archer),
(party_get_slot, ":num", formation_temp_vector, ":stat_slot"),
(val_add, ":num", 1),
(try_begin),
(assign, ":stage", 0),
(store_and, ":stage", ":num", sftt_formation_stage_mask),
(val_div, ":stage", sftt_formation_stage),
(gt, ":stage", 0),
(le, ":stage", 7),
# new agents added,
# set formation stage to reform formation
(val_add, ":num", 7*sftt_formation_stage),
(try_end),
(party_set_slot, formation_temp_vector, ":stat_slot", ":num"),
(else_try),
(troop_is_guarantee_ranged, ":troop_id"),
(val_add, ":stat_slot", slot_formation_tmp_team_horse_archer_1),
(party_get_slot, ":num", formation_temp_vector, ":stat_slot"),
(val_add, ":num", 1),
(try_begin),
(assign, ":stage", 0),
(store_and, ":stage", ":num", sftt_formation_stage_mask),
(val_div, ":stage", sftt_formation_stage),
(gt, ":stage", 0),
(le, ":stage", 7),
# new agents added,
# set formation stage to reform formation
(val_add, ":num", 7*sftt_formation_stage),
(try_end),
(party_set_slot, formation_temp_vector, ":stat_slot", ":num"),
(else_try),
(val_add, ":stat_slot", slot_formation_tmp_team_cavalry_1),
(party_get_slot, ":num", formation_temp_vector, ":stat_slot"),
(val_add, ":num", 1),
(try_begin),
(assign, ":stage", 0),
(store_and, ":stage", ":num", sftt_formation_stage_mask),
(val_div, ":stage", sftt_formation_stage),
(gt, ":stage", 0),
(le, ":stage", 7),
# new agents added,
# set formation stage to reform formation
(val_add, ":num", 7*sftt_formation_stage),
(try_end),
(party_set_slot, formation_temp_vector, ":stat_slot", ":num"),
(try_end),
(try_end),
(assign, ":base", slot_formation_tmp_team_stat_begin),
(assign, ":base_1", slot_formation_teams_begin),
(try_for_range, ":team_no", 0, 4),
#(eq, "$spawn_wave", 1),
(try_begin),
(store_add, ":max_array_slot", ":base_1", slot_formation_team_max_array_no),
(party_get_slot, ":max_array_no", formation_vector, ":max_array_slot"),
(assign, ":prev_max", ":max_array_no"),
(store_add, ":infantry_high_slot", ":base", slot_formation_tmp_team_infantry_high),
(try_begin),
(party_get_slot, ":num", formation_temp_vector, ":infantry_high_slot"),
(gt, ":num", 0),
(assign, ":assigned", 0),
(store_and, ":assigned", ":num", sftt_num_assigned_mask),
(eq, ":assigned", 0),
(try_begin),
(lt, ":max_array_no", formation_arrays),
(assign, ":array_no", ":max_array_no"),
(else_try),
(assign, ":array_no", formation_arrays-1),
(try_end),
(val_mul, ":array_no", sftt_array_no_base),
(val_add, ":num", ":array_no"),
(party_set_slot, formation_temp_vector, ":infantry_high_slot", ":num"),
(val_add, ":max_array_no", 1),
(try_end),
(store_add, ":infantry_low_slot", ":base", slot_formation_tmp_team_infantry_low),
(try_begin),
(party_get_slot, ":num", formation_temp_vector, ":infantry_low_slot"),
(gt, ":num", 0),
(assign, ":assigned", 0),
(store_and, ":assigned", ":num", sftt_num_assigned_mask),
(eq, ":assigned", 0),
(try_begin),
(lt, ":max_array_no", formation_arrays),
(assign, ":array_no", ":max_array_no"),
(else_try),
(assign, ":array_no", formation_arrays-1),
(try_end),
(val_mul, ":array_no", sftt_array_no_base),
(val_add, ":num", ":array_no"),
(party_set_slot, formation_temp_vector, ":infantry_low_slot", ":num"),
(val_add, ":max_array_no", 1),
(try_end),
(store_add, ":archer_slot", ":base", slot_formation_tmp_team_archer),
(try_begin),
(party_get_slot, ":num", formation_temp_vector, ":archer_slot"),
(gt, ":num", 0),
(assign, ":assigned", 0),
(store_and, ":assigned", ":num", sftt_num_assigned_mask),
(eq, ":assigned", 0),
(try_begin),
(lt, ":max_array_no", formation_arrays),
(assign, ":array_no", ":max_array_no"),
(else_try),
(assign, ":array_no", formation_arrays-1),
(try_end),
(val_mul, ":array_no", sftt_array_no_base),
(val_add, ":num", ":array_no"),
(party_set_slot, formation_temp_vector, ":archer_slot", ":num"),
(val_add, ":max_array_no", 1),
(try_end),
(store_add, ":cavalry_slot", ":base", slot_formation_tmp_team_cavalry_1),
(try_begin),
(party_get_slot, ":stat", formation_temp_vector, ":cavalry_slot"),
(gt, ":stat", 0),
(assign, ":assigned", 0),
(store_and, ":assigned", ":stat", sftt_num_assigned_mask),
(eq, ":assigned", 0),
(try_begin),
(assign, ":num", 0),
(store_and, ":num", ":stat", sftt_num_mask),
(gt, ":num", 0),
(lt, ":num", 30),
(try_begin),
(lt, ":max_array_no", formation_arrays),
(assign, ":array_no", ":max_array_no"),
(else_try),
(assign, ":array_no", formation_arrays-1),
(try_end),
(val_mul, ":array_no", sftt_array_no_base),
(val_add, ":num", ":array_no"),
(party_set_slot, formation_temp_vector, ":cavalry_slot", ":num"),
(val_add, ":max_array_no", 1),
(else_try),
(ge, ":num", 30),
#(party_get_slot, ":num", formation_temp_vector, ":cavalry_slot"),
(val_div, ":num", 2),
(try_begin),
(lt, ":max_array_no", formation_arrays),
(assign, ":array_no", ":max_array_no"),
(else_try),
(assign, ":array_no", formation_arrays-1),
(try_end),
(val_mul, ":array_no", sftt_array_no_base),
(val_add, ":num", ":array_no"),
(party_set_slot, formation_temp_vector, ":cavalry_slot", ":num"),
(val_add, ":cavalry_slot", 1),
(try_begin),
(lt, ":array_no", (formation_arrays-1)*sftt_array_no_base),
(val_add, ":num", sftt_array_no_base),
(try_end),
(val_add, ":num", 1), # plus 1 in case the original number is odd
(party_set_slot, formation_temp_vector, ":cavalry_slot", ":num"),
(val_add, ":max_array_no", 2),
(try_end),
(else_try),
(party_get_slot, ":stat_1", formation_temp_vector, ":cavalry_slot"),
(val_add, ":cavalry_slot", 1),
(party_get_slot, ":stat_2", formation_temp_vector, ":cavalry_slot"),
(neq, ":stat_2", 0),
(assign, ":num_1", 0),
(assign, ":num_2", 0),
(store_and, ":num_1", ":stat_1", sftt_num_mask),
(store_and, ":num_2", ":stat_2", sftt_num_mask),
(try_begin),
(store_sub, ":dif", ":num_1", ":num_2"),
(gt, ":dif", 5),
(val_div, ":dif", 2),
(val_sub, ":stat_1", ":dif"),
(val_add, ":stat_2", ":dif"),
(try_begin),
(assign, ":stage", 0),
(store_and, ":stage", ":stat_2", sftt_formation_stage_mask),
(val_div, ":stage", sftt_formation_stage),
(gt, ":stage", 0),
(le, ":stage", 7),
# new agents added,
# set formation stage to reform formation
(val_add, ":stat_2", 7*sftt_formation_stage),
(try_end),
(party_set_slot, formation_temp_vector, ":cavalry_slot", ":stat_2"),
(val_sub, ":cavalry_slot", 1),
(party_set_slot, formation_temp_vector, ":cavalry_slot", ":stat_1"),
(try_end),
(try_end),
(store_add, ":horse_archer_slot", ":base", slot_formation_tmp_team_horse_archer_1),
(try_begin),
(assign, ":assigned", 0),
(store_and, ":assigned", ":num", sftt_num_assigned_mask),
(eq, ":assigned", 0),
(try_begin),
(party_get_slot, ":stat", formation_temp_vector, ":horse_archer_slot"),
(gt, ":stat", 0),
(assign, ":num", 0),
(store_and, ":num", ":stat", sftt_num_mask),
(gt, ":num", 0),
(lt, ":num", 30),
(try_begin),
(lt, ":max_array_no", formation_arrays),
(assign, ":array_no", ":max_array_no"),
(else_try),
(assign, ":array_no", formation_arrays-1),
(try_end),
(val_mul, ":array_no", sftt_array_no_base),
(val_add, ":num", ":array_no"),
(party_set_slot, formation_temp_vector, ":horse_archer_slot", ":num"),
(val_add, ":max_array_no", 1),
(else_try),
(gt, ":stat", 0),
(ge, ":num", 30),
(val_div, ":num", 2),
(try_begin),
(lt, ":max_array_no", formation_arrays),
(assign, ":array_no", ":max_array_no"),
(else_try),
(assign, ":array_no", formation_arrays-1),
(try_end),
(val_mul, ":array_no", sftt_array_no_base),
(val_add, ":num", ":array_no"),
(party_set_slot, formation_temp_vector, ":horse_archer_slot", ":num"),
(val_add, ":horse_archer_slot", 1),
(try_begin),
(lt, ":array_no", (formation_arrays-1)*sftt_array_no_base),
(val_add, ":num", sftt_array_no_base),
(try_end),
(val_add, ":num", 1), # plus 1 in case the original number is odd
(party_set_slot, formation_temp_vector, ":horse_archer_slot", ":num"),
(val_add, ":max_array_no", 2),
(try_end),
(else_try),
(party_get_slot, ":stat_1", formation_temp_vector, ":horse_archer_slot"),
(val_add, ":horse_archer_slot", 1),
(party_get_slot, ":stat_2", formation_temp_vector, ":horse_archer_slot"),
(neq, ":stat_2", 0),
(assign, ":num_1", 0),
(assign, ":num_2", 0),
(store_and, ":num_1", ":stat_1", sftt_num_mask),
(store_and, ":num_2", ":stat_2", sftt_num_mask),
(try_begin),
(store_sub, ":dif", ":num_1", ":num_2"),
(gt, ":dif", 5),
(val_div, ":dif", 2),
(val_sub, ":stat_1", ":dif"),
(val_add, ":stat_2", ":dif"),
(try_begin),
(assign, ":stage", 0),
(store_and, ":stage", ":stat_2", sftt_formation_stage_mask),
(val_div, ":stage", sftt_formation_stage),
(gt, ":stage", 0),
(le, ":stage", 7),
# new agents added,
# set formation stage to reform formation
(val_add, ":stat_2", 7*sftt_formation_stage),
(try_end),
(party_set_slot, formation_temp_vector, ":horse_archer_slot", ":stat_2"),
(val_sub, ":cavalry_slot", 1),
(party_set_slot, formation_temp_vector, ":horse_archer_slot", ":stat_1"),
(try_end),
(try_end),
(try_begin),
(gt, ":max_array_no", formation_arrays),
(assign, ":max_array_no", formation_arrays),
(try_end),
(store_add, ":base_2", ":base_1", slot_formation_team_arrays_begin),
(try_for_range, ":array_no", 0, ":max_array_no"),
(eq, "$spawn_wave", 1),
(store_add, ":leader_slot", ":base_2", slot_formation_array_leader),
(party_set_slot, formation_vector, ":leader_slot", -1),
(val_add, ":base_2", sfa_array_section_size),
(try_end),
(store_add, ":slot", ":base_1", slot_formation_team_max_array_no),
(party_set_slot, formation_vector, ":slot", ":max_array_no"),
(try_end),
(val_add, ":base_1", sft_team_section_size),
(val_add, ":base", slot_formation_tmp_team_stat_section_size),
(try_begin),
(eq, ":team_no", ":player_team"),
(assign, "$formation_max_array_no", ":max_array_no"),
(try_end),
(try_end),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states),
(eq, ":formation_states", safs_full_mask), # agent not assigned array yet
(agent_get_team, ":team_no", ":agent"),
(agent_get_class, ":class", ":agent"),
(agent_get_troop_id, ":troop_id", ":agent"),
(store_character_level, ":level", ":troop_id"),
(try_begin),
(eq, ":class", grc_infantry),
(try_begin),
(ge, ":level", 15),
(call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_infantry_high),
(else_try),
(call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_infantry_low),
(try_end),
(else_try),
(eq, ":class", grc_archers),
(call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_archer),
(else_try),
(agent_get_troop_id, ":troop_id", ":agent"),
(troop_is_guarantee_ranged, ":troop_id"),
(try_begin),
(call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_horse_archer_1),
(else_try),
(call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_horse_archer_2),
(try_end),
(else_try),
(try_begin),
(call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_cavalry_1),
(else_try),
(call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_cavalry_2),
(try_end),
(try_end),
(try_end),
(try_for_range, ":team_no", 0, 4),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_max_array_no),
(party_get_slot, ":max_array_no", formation_vector, reg0),
(store_add, ":mark", slot_formation_array_marks_begin, ":max_array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_sub, ":mark", 1),
#(try_begin),
# (neq, ":team_no", ":player_team"),
# debug_point_3,
# (call_script, "script_dismiss_battle_array", ":team_no", ":mark"),
#(try_end),
(store_add, ":mark_1", slot_formation_array_marks_begin, ":prev_max"),
(party_get_slot, ":mark_1", formation_vector, ":mark_1"),
(val_sub, ":mark_1", 1),
(val_sub, ":mark", ":mark_1"),
(neq, ":mark", 0),
(call_script, "script_cf_formation_elect_array_leader", ":team_no", ":mark"),
(try_end),
]
),
# script_cf_formation_agent_assign_array_by_class
# Assign agent to paticular array
# Input: arg1: agent_no, arg2: team_no
# arg3: slot_offset - class-array slot defined for ai,
# see module_constants.py for slots starting
# with slot_formation_tmp_team_
# Output: none
# Fail: If the array has already reached the number upon formulation
("cf_formation_agent_assign_array",
[(store_script_param_1, ":agent_no"),
(store_script_param_2, ":team_no"),
(store_script_param, ":slot_offset", 3),
(store_mul, ":stat_slot", slot_formation_tmp_team_stat_section_size, ":team_no"),
(val_add, ":stat_slot", slot_formation_tmp_team_stat_begin),
(val_add, ":stat_slot", ":slot_offset"),
(party_get_slot, ":stat", formation_temp_vector, ":stat_slot"),
(assign, ":array_no", 0),
(store_and, ":array_no", ":stat", sftt_array_no_mask),
(val_div, ":array_no", sftt_array_no_base),
(assign, ":num", 0),
(store_and, ":num", ":stat", sftt_num_mask),
(assign, ":assigned", 0),
(store_and, ":assigned", ":stat", sftt_num_assigned_mask),
(val_div, ":assigned", sftt_num_assigned_base),
(lt, ":assigned", ":num"),
(val_add, ":stat", sftt_num_assigned_base),
(party_set_slot, formation_temp_vector, ":stat_slot", ":stat"),
(agent_set_slot, ":agent_no", slot_agent_formation_states, ":array_no"),
]
),
############ Initialization code end #############
############## Major functions code ##############
###### No change should be done to these codes ###
# script_formation_elect_array_leader
# Elect a new leader from members of arrays
# Input: arg1: team_no, arg2: array_selection
# Output: reg0 - agent no of the new leader for the array of smallest no.
("cf_formation_elect_array_leader",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_selection"),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_max_array_no),
(party_get_slot, ":max_array_no", formation_vector, reg0),
(try_for_range, ":array_no", 0, ":max_array_no"),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader),
(party_set_slot, formation_vector, reg0, -1),
(try_end),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(eq, ":agent_team", ":team_no"),
(agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states),
(store_and, ":array_no", ":formation_states", safs_array_no),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader),
(party_get_slot, ":array_leader", formation_vector, reg0),
(try_begin),
(neq, ":array_leader", -1),
(agent_get_troop_id, ":leader_troop", ":array_leader"),
(store_character_level, ":leader_level", ":leader_troop"),
(agent_get_troop_id, ":troop_id", ":agent"),
(store_character_level, ":level", ":troop_id"),
(le, ":level", ":leader_level"),
(else_try),
(party_set_slot, formation_vector, reg0, ":agent"),
(try_end),
(try_end),
(assign, reg0, -1),
(try_for_range_backwards, ":array_no", 0, ":max_array_no"),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader),
(party_get_slot, ":array_leader", formation_vector, reg0),
(neq, ":array_leader", -1),
(agent_get_slot, ":formation_states", ":array_leader", slot_agent_formation_states),
(val_or, ":formation_states", safs_array_leader),
(agent_set_slot, ":array_leader", slot_agent_formation_states, ":formation_states"),
(assign, reg0, ":array_leader"),
(try_end),
(neq, reg0, -1),
]
),
# script_cf_apply_formation
# Script to set formations active. Can fail!
# Input: arg1: team_no, arg2: array_no,
# arg3: formation_type,
# Output: none
("cf_apply_formation",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
(store_script_param, ":formation_type", 3),
# Initialize array for formation and count number of men
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_num_of_men),
(assign, ":slot", reg0),
(call_script, "script_formation_array_init", ":team_no", ":array_no"),
(party_set_slot, formation_vector, ":slot", reg0),
(try_begin),
(eq, reg0, 0),
(store_add, ":array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s1, ":array_string"),
(display_message, "@{s1} has no one left standing!!", formation_warning_color),
(try_end),
(neq, reg0, 0),
(display_message, "@Men in formation: {reg0}", formation_debug_color),
# Store formation type and auto-rotation state
(val_add, ":slot", 1),
(store_add, ":array_states", ":formation_type", sfas_density_unit*2),
#(try_begin),
# (eq, ":auto_rotation", 1),
# (val_add, ":array_states", sfas_auto_rotate),
#(try_end),
(party_set_slot, formation_vector, ":slot", ":array_states"),
# Calculate the formation, assign position to soldiers
(store_add, ":formation_script", formation_scripts_begin, ":formation_type"),
(call_script, ":formation_script", ":team_no", ":array_no", reg0),
# Mark that this array is in formation
(store_add, ":slot", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":slot"),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(val_or, ":array_selection", ":mark"),
(party_set_slot, formation_vector, reg0, ":array_selection"),
# Set reference position as the leader's position
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader),
(assign, ":slot", reg0),
(party_get_slot, ":leader", formation_vector, ":slot"),
(try_begin),
(neg|agent_is_alive, ":leader"),
(call_script, "script_cf_formation_elect_array_leader", ":team_no", ":mark"),
(assign, ":leader", reg0),
(try_end),
(agent_get_position, pos1, ":leader"),
(position_get_x, ":ref_x", pos1),
(position_get_y, ":ref_y", pos1),
(position_get_rotation_around_z, ":rotation", pos1),
(store_sub, ":next", slot_formation_array_ref_x_pos, slot_formation_array_leader),
(val_add, ":slot", ":next"),
(party_set_slot, formation_vector, ":slot", ":ref_x"),
(store_sub, ":next", slot_formation_array_ref_y_pos, slot_formation_array_ref_x_pos),
(val_add, ":slot", ":next"),
(party_set_slot, formation_vector, ":slot", ":ref_y"),
(store_sub, ":next", slot_formation_array_ref_rotation, slot_formation_array_ref_y_pos),
(val_add, ":slot", ":next"),
(party_set_slot, formation_vector, ":slot", ":rotation"),
]),
# script_maintain_formation
# Called every 1sec
# Input: none
# Output: none
("maintain_formation",
[(assign, ":base", slot_formation_teams_begin),
(set_fixed_point_multiplier, 100),
# initialize counters, reference positions, auto-rotation
(try_for_range, ":team_no", 0, 4),
(store_add, ":slot", ":base", slot_formation_team_array_selection),
(try_begin),
(neg|party_slot_eq, formation_vector, ":slot", 0),
(call_script, "script_team_get_average_position_of_enemies", ":team_no"),
(copy_position, pos62, pos0),
(get_player_agent_no, ":player"),
(val_add, ":slot", 1),
(party_get_slot, ":max_array_no", formation_vector, ":slot"),
# pick pos20 - pos51 to store reference positions
(store_mul, ":ref_pos", ":team_no", formation_arrays),
(val_add, ":ref_pos", 20),
# use formation_temp_vector to record men number of current arrays
(store_mul, ":num_tmp_pt", ":team_no", formation_arrays*2),
(try_for_range, ":array_no", 0, ":max_array_no"),
(store_mul, ":offset", ":array_no", sfa_array_section_size),
(val_add, ":offset", slot_formation_team_arrays_begin),
(store_add, ":slot", ":offset", ":base"),
# consider charge, fall back and auto rotation
(store_add, ":states_slot", ":slot", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, ":states_slot"),
(store_add, ":leader_slot", ":slot", slot_formation_array_leader),
(party_get_slot, ":leader", formation_vector, ":leader_slot"),
(assign, ":charge", 0),
(assign, ":fall_back", 0),
(assign, ":speed", 0),
(store_and, ":charge", ":array_states", sfas_charge),
(store_and, ":fall_back", ":array_states", sfas_fall_back),
(try_begin),
(neq, ":charge", 0),
(try_begin),
(neq, ":fall_back", 0),
(agent_get_position, pos1, ":leader"),
(call_script, "script_formation_move_to_pos", ":team_no", ":array_no"),
(val_sub, ":array_states", sfas_charge+sfas_fall_back),
(party_set_slot, formation_vector, ":states_slot", ":array_states"),
(else_try),
(store_and, ":speed", ":array_states", sfas_speed),
(val_div, ":speed", sfas_speed_base),
(call_script, "script_formation_move", ":team_no", ":array_no", 0, ":speed"),
(try_end),
(else_try),
(neq, ":fall_back", 0),
(store_and, ":speed", ":array_states", sfas_speed),
(val_div, ":speed", -sfas_speed_base),
(call_script, "script_formation_move", ":team_no", ":array_no", 0, ":speed"),
(try_end),
(store_add, ":ref_x_slot", ":slot", slot_formation_array_ref_x_pos),
(init_position, ":ref_pos"),
(party_get_slot, ":ref_x", formation_vector, ":ref_x_slot"),
(position_set_x, ":ref_pos", ":ref_x"),
(store_add, ":ref_y_slot", ":slot", slot_formation_array_ref_y_pos),
(party_get_slot, ":ref_y", formation_vector, ":ref_y_slot"),
(position_set_y, ":ref_pos", ":ref_y"),
(store_add, ":rotation_slot", ":slot", slot_formation_array_ref_rotation),
#(position_get_x, reg0, ":ref_pos"),
#(position_get_y, reg1, ":ref_pos"),
#(assign, reg2, ":ref_pos"),
#(display_message, "@ref_pos: {reg2}, ref: ({reg0}, {reg1}).", formation_debug_color),
(party_get_slot, ":rotation", formation_vector, ":rotation_slot"),
(position_get_rotation_around_z, ":cur_rot", ":ref_pos"),
(val_sub, ":rotation", ":cur_rot"),
(position_rotate_z, ":ref_pos", ":rotation"),
# Turn ref_pos so that it faces enemies
(try_begin),
(party_get_slot, ":array_states", formation_vector, ":states_slot"),
(val_and, ":array_states", sfas_auto_rotate),
(neq, ":array_states", 0),
#(agent_get_position, pos61, ":leader"),
#(position_copy_rotation, pos61, ":ref_pos"),
(assign, ":turned", 0),
(try_begin),
(position_is_behind_position, pos62, ":ref_pos"),
#(position_rotate_z, pos61, 180),
(position_rotate_z, ":ref_pos", 180),
(assign, ":turned", 1),
(try_end),
(position_transform_position_to_local, pos2, ":ref_pos", pos62),
(position_get_x, ":dir_x", pos2),
(position_get_y, ":dir_y", pos2),
(convert_from_fixed_point, ":dir_y"),
(assign, ":tan", 0),
(assign, ":rotation", 0),
(store_div, ":tan", ":dir_x", ":dir_y"),
(call_script, "script_arctan", ":tan"),
(store_mul, ":rotation", reg0, -1),
(this_or_next|gt, ":rotation", 5),
(this_or_next|gt, -5, ":rotation"),
(eq, ":turned", 1),
(position_rotate_z, ":ref_pos", ":rotation"),
(position_get_rotation_around_z, reg0, ":ref_pos"),
(party_set_slot, formation_vector, ":rotation_slot", reg0),
(try_end),
(party_set_slot, formation_temp_vector, ":num_tmp_pt", 0),
# set the engage state and war cry of array
(party_get_slot, ":array_states", formation_vector, ":states_slot"),
(val_and, ":array_states", sfas_engaged+sfas_roar),
(store_add, ":engage_pt", ":num_tmp_pt", formation_arrays),
(party_set_slot, formation_temp_vector, ":engage_pt", ":array_states"),
(val_add, ":num_tmp_pt", 1),
(val_add, ":ref_pos", 1),
#(val_add, ":offset", sfa_array_section_size),
(try_end),
(store_mission_timer_a, ":cur_time"),
(set_show_messages, 0),
(try_begin),
(ge, ":cur_time", 1),
(team_give_order, ":team_no", grc_everyone, mordr_charge),
(else_try),
(team_give_order, ":team_no", grc_everyone, mordr_hold),
(try_end),
(set_show_messages, 1),
(try_end),
(val_add, ":base", sft_team_section_size),
(try_end),
# renew agent destinations, count number of men,
(get_player_agent_no, ":player"),
(try_for_agents, ":agent"),
(neq, ":agent", ":player"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":team_no", ":agent"),
(assign, ":in_formation", 0),
(agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states),
(store_and, ":in_formation", ":formation_states", safs_in_formation),
(neq, ":in_formation", 0),
#(display_message, "@reached!", formation_debug_color),
(store_and, ":array_no", ":formation_states", safs_array_no),
(store_mul, ":ref_pos", ":team_no", formation_arrays),
(val_add, ":ref_pos", 20),
(val_add, ":ref_pos",":array_no"),
(store_mul, ":num_tmp_pt", ":team_no", formation_arrays*2),
(val_add, ":num_tmp_pt", ":array_no"),
(party_get_slot, ":num", formation_temp_vector, ":num_tmp_pt"),
(val_add, ":num", 1),
(party_set_slot, formation_temp_vector, ":num_tmp_pt", ":num"),
(agent_get_slot, ":target_x", ":agent", slot_agent_formation_x_pos),
(agent_get_slot, ":target_y", ":agent", slot_agent_formation_y_pos),
(copy_position, pos9, ":ref_pos"),
(position_set_x, pos9, ":target_x"),
(position_set_y, pos9, ":target_y"),
#(position_get_x, reg0, ":ref_pos"),
#(position_get_y, reg1, ":ref_pos"),
#(assign, reg2, ":ref_pos"),
#(display_message, "@ref_pos: {reg2}, ref: ({reg0}, {reg1}).", formation_debug_color),
(position_transform_position_to_parent, pos10, ":ref_pos", pos9),
(position_copy_rotation, pos10, ":ref_pos"),
(position_set_z_to_ground_level, pos10),
(agent_get_position, pos11, ":agent"),
(store_add, ":engage_pt", ":num_tmp_pt", formation_arrays),
(party_get_slot, ":engage_states", formation_temp_vector, ":engage_pt"),
(assign, ":engage", 0),
(assign, ":roar", 0),
(store_and, ":engage", sfas_engaged, ":engage_states"),
(store_and, ":roar", sfas_roar, ":engage_states"),
(assign, ":roar_stage", 0),
(try_begin),
(neq, ":roar", 0),
(store_and, ":roar_stage", ":formation_states", safs_roar_stage),
(val_sub, ":formation_states", ":roar_stage"),
(try_begin),
(neq, ":roar_stage", 0),
(val_sub, ":roar_stage", safs_roar_stage_second),
(try_end),
(eq, ":roar_stage", 0),
(store_random_in_range, ":dice", 0, 10),
(lt, ":dice", 5),
(agent_get_troop_id, ":agent_troop", ":agent"),
(troop_get_type, ":gender", ":agent_troop"),
(eq, ":gender", 0),
(agent_play_sound, ":agent", "snd_man_warcry"),
(assign, ":roar_stage", safs_roar_stage),
(try_end),
(val_add, ":formation_states", ":roar_stage"),
(agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"),
(try_begin),
(set_fixed_point_multiplier, 100),
(assign, ":pos_error", 0),
(get_distance_between_positions, ":pos_error", pos10, pos11),
# the agent is allow to stand at a position with an error of 20 metres
# if the formation is engaged with enemy
(try_begin),
(eq, ":engage", 0),
(assign, ":tolerance", 10),
(else_try),
(assign, ":tolerance", 2000),
(try_end),
(gt, ":pos_error", ":tolerance"),
(agent_set_scripted_destination, ":agent", pos10, 1),
(agent_set_slot, ":agent", slot_agent_is_in_scripted_mode, 1),
#(val_mul, ":pos_error", 36),
# the following rounds pos_error to integral kilometres -- Useless and causes trouble
#(store_mod, ":remain", ":pos_error", 1000),
#(try_begin),
# (gt, ":remain", 500),
# (val_add, ":pos_error", 500),
#(try_end),
#(val_div, ":pos_error", 1000),
#(agent_set_speed_limit, ":agent", ":pos_error"),
(else_try),
(agent_clear_scripted_mode, ":agent"),
(agent_set_slot, ":agent", slot_agent_is_in_scripted_mode, 0),
(try_end),
(try_end),
(get_player_agent_no, ":player"),
(agent_get_team, ":player_team", ":player"),
(store_sub, ":base", 0, formation_arrays*2),
# check for arrays with no leader
(try_for_range, ":team_no", 0, 4),
(val_add, ":base", formation_arrays*2),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(neq, ":array_selection", 0),
(val_add, reg0, 1),
(party_get_slot, ":max_array_no", formation_vector, reg0),
(try_for_range, ":array_no", 0, ":max_array_no"),
(store_add, ":slot", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":slot"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(store_add, ":slot", ":base", ":array_no"),
(party_get_slot, ":cur_num", formation_temp_vector, ":slot"),
(try_begin),
(eq, ":cur_num", 0),
# Mark that this array is no longer in formation
(store_add, ":slot", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":slot"),
(call_script, "script_dismiss_battle_array", ":team_no", ":mark"),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(val_or, ":array_selection", ":mark"),
(val_sub, ":array_selection", ":mark"),
(party_set_slot, formation_vector, reg0, ":array_selection"),
#(get_player_agent_no, ":player"),
#(agent_get_team, ":player_team", ":player"),
(store_add, ":array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s1, ":array_string"),
(try_begin),
(eq, ":team_no", ":player_team"),
(display_message, "@{s1} has fought till the last man!", formation_warning_color),
(else_try),
(teams_are_enemies, ":team_no", ":player_team"),
(display_message, "@Enemies' {s1} is no more!", formation_message_color),
(else_try),
(display_message, "@Allies' {s1} has fought till the last man!", formation_warning_color),
(try_end),
(else_try),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader),
(party_get_slot, ":leader", formation_vector, reg0),
(try_begin),
(neg|agent_is_alive, ":leader"),
(agent_set_slot, ":leader", slot_agent_formation_states, 0),
# leader down!!
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(call_script, "script_cf_formation_elect_array_leader", ":team_no", ":mark"),
#(neq, ":team_no", ":player_team"),
(store_add, ":array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s1, ":array_string"),
(agent_get_troop_id, ":troop_id", reg0),
(str_store_troop_name, s2, ":troop_id"),
(try_begin),
(eq, ":team_no", ":player_team"),
(display_message, "@The commander of {s1} is down! {s2} has taken over command.", formation_warning_color),
(else_try),
(teams_are_enemies, ":team_no", ":player_team"),
(display_message, "@The enemies' commander of {s1} is down! {s2} has taken over command.", formation_message_color),
(else_try),
(display_message, "@The allies' commander of {s1} is down! {s2} has taen over command.", formation_warning_color),
(try_end),
(try_end),
(try_end),
(try_end),
(try_end),
]),
# script_formation_clean_up
# Script that's called by the end of mission
# Input: none
# Output: none
("formation_clean_up",
[(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(call_script, "script_dismiss_battle_array", ":team_no", "$formation_all_arrays"),
(assign, "$formation_vector_active", 0),
(remove_party, formation_vector),
(remove_party, formation_temp_vector),
]),
############## Major functions code end ###########
################### AI functions ##################
#### You can write your own or simply use this ####
# script_formation_ai_tactics
# script for AI tactics applying formations
# Input: none
# Output: none
("formation_ai_tactics",
[(get_player_agent_no, ":player"),
(agent_get_team, ":player_team", ":player"),
(try_for_range, ":team_no", 0, 4),
(neq, ":team_no", ":player_team"),
(team_get_leader, ":team_leader", ":team_no"),
(neq, ":team_leader", -1),
(assign, ":team_tactic", 0), # Defensive by default
(agent_get_position, pos1, ":team_leader"),
#(position_get_x, reg0, pos2),
#(position_get_y, reg1, pos2),
#(display_message, "@Ref pos: {reg0}, {reg1}", formation_debug_color),
(call_script, "script_find_high_ground_around_pos1", ":team_no", 5),
(copy_position, pos2, pos52),
(call_script, "script_team_get_average_position_of_enemies", ":team_no"),
(assign, ":num_enemies", reg0),
(call_script, "script_team_get_class_percentages", ":team_no", 1),
#(assign, ":enemy_perc_infantry", reg0),
#(assign, ":enemy_perc_archer", reg1),
(assign, ":enemy_perc_cavalry", reg2),
#(get_battle_advantage, ":advantage"),
(get_player_agent_no, ":player"),
(agent_get_team, ":player_team", ":player"),
(assign, ":archer_behind", 0),
(try_begin),
(store_mul, ":enemy_cavalry", ":num_enemies", ":enemy_perc_cavalry"),
(val_div, ":enemy_cavalry", 100),
(this_or_next|lt, ":num_enemies", 15),
(this_or_next|gt, ":enemy_cavalry", 15),
(gt, ":enemy_perc_cavalry", 80),
(val_add, ":team_tactic", 2), # cavalry free charge
(try_end),
(try_begin),
(lt, ":num_enemies", 15),
(val_add, ":team_tactic", 4), # infantry free charge
(try_end),
#(try_begin),
# (this_or_next|teams_are_enemies, ":player_team", ":team_no"),
# (gt, ":advantage", 0),
# (this_or_next|le, ":advantage", 0),
# (neg|teams_are_enemies, ":player_team", ":team_no"),
(val_add, ":team_tactic", 1), # Aggressive
(assign, ":archer_behind", 1),
#(try_end),
#(try_begin),
# (lt,
#(try_end),
(try_begin),
(position_is_behind_position, pos0, pos2),
(position_rotate_z, pos2, 180),
(try_end),
(position_transform_position_to_local, pos3, pos2, pos0),
(position_get_x, ":pos_x", pos3),
(position_get_y, ":pos_y", pos3),
(set_fixed_point_multiplier, 100),
(convert_to_fixed_point, ":pos_x"),
(store_div, ":tan", ":pos_x", ":pos_y"),
(call_script, "script_arctan", ":tan"),
(val_mul, reg0, -1),
(position_rotate_z, pos2, reg0),
(try_begin),
(copy_position, pos1, pos2),
(call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_archer, ft_line, 0, ":team_tactic"),
(store_mul, ":offset", ":archer_behind", 2250),
(init_position, pos4),
(position_move_y, pos4, ":offset"),
(position_transform_position_to_parent, pos1, pos2, pos4),
(position_copy_rotation, pos1, pos2),
(copy_position, pos2, pos1),
(try_end),
(try_begin),
(init_position, pos4),
#(store_mul, ":offset", ":archer_front", -750),
(position_move_y, pos4, -750),
(position_transform_position_to_parent, pos1, pos2, pos4),
(position_copy_rotation, pos1, pos2),
(call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_infantry_low, ft_phalanx, 0, ":team_tactic"),
(copy_position, pos2, pos1),
(try_end),
(try_begin),
(init_position, pos4),
(position_move_y, pos4, -750),
(position_transform_position_to_parent, pos1, pos2, pos4),
(position_copy_rotation, pos1, pos2),
(call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_infantry_high, ft_phalanx, 0, ":team_tactic"),
(copy_position, pos2, pos1),
(try_end),
(try_begin),
(init_position, pos4),
(position_move_x, pos4, -4000),
(position_move_y, pos4, 1000),
(position_transform_position_to_parent, pos1, pos2, pos4),
(position_copy_rotation, pos1, pos2),
(position_rotate_z, pos1, 45),
(call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_cavalry_1, ft_wedge, 1, ":team_tactic"),
(try_end),
(try_begin),
(init_position, pos4),
(position_move_x, pos4, 4000),
(position_move_y, pos4, 1000),
(position_transform_position_to_parent, pos1, pos2, pos4),
(position_copy_rotation, pos1, pos2),
(position_rotate_z, pos1, -45),
(call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_cavalry_2, ft_wedge, 1, ":team_tactic"),
(try_end),
(try_begin),
(init_position, pos4),
(position_move_x, pos4, -6000),
(position_transform_position_to_parent, pos1, pos2, pos4),
(position_copy_rotation, pos1, pos2),
(call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_horse_archer_1, ft_cant_circle, 1, ":team_tactic"),
(try_end),
(try_begin),
(init_position, pos4),
(position_move_x, pos4, 6000),
(position_transform_position_to_parent, pos1, pos2, pos4),
(position_copy_rotation, pos1, pos2),
(call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_horse_archer_2, ft_cant_circle, 1, ":team_tactic"),
(try_end),
(try_end),
]
),
# script_cf_formation_ai_deploy_array_generic
# Use the built-in tactical charge script for the corresponding formation
# Input: arg1: team_no, arg2: slot_offset, arg3: formation_type
# arg4: density - 0 to 3
# arg5: team_tactic
# arg6: pos1 - the position to deploy array
# Output: none
("cf_formation_ai_deploy_array_generic",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":slot_offset"),
(store_script_param, ":formation_type", 3),
(store_script_param, ":density", 4),
(store_script_param, ":team_tactic", 5),
(position_get_x, ":pos_x", pos1),
(position_get_y, ":pos_y", pos1),
(position_get_rotation_around_z, ":rotation", pos1),
(store_mul, ":slot", ":team_no", slot_formation_tmp_team_stat_section_size),
(val_add, ":slot", slot_formation_tmp_team_stat_begin),
(val_add, ":slot", ":slot_offset"),
(party_get_slot, ":state", formation_temp_vector, ":slot"),
(neq, ":state", 0),
(assign, ":formation_stage", 0),
(store_and, ":formation_stage", ":state", sftt_formation_stage_mask),
(val_div, ":formation_stage", sftt_formation_stage),
(assign, reg1, ":formation_stage"),
(display_message, "@DEBUG: at stage: {reg1}", formation_debug_color),
(assign, ":array_no", 0),
(store_and, ":array_no", ":state", sftt_array_no_mask),
(val_div, ":array_no", sftt_array_no_base),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(assign, ":free_charge", 0),
(try_begin),
(this_or_next|eq, ":slot_offset", slot_formation_tmp_team_cavalry_1),
(eq, ":slot_offset", slot_formation_tmp_team_cavalry_2),
(assign, ":free_charge", 2),
(val_and, ":free_charge", ":team_tactic"),
#(neq, ":free_charge", 0),
(eq, 0, 1),
(else_try),
(eq, ":slot_offset", slot_formation_tmp_team_archer),
(call_script, "script_formation_check_array_ammo", ":team_no", ":array_no"),
(lt, reg0, 20),
(assign, ":free_charge", 2),
(eq, 0, 1),
(else_try),
(this_or_next|eq, ":slot_offset", slot_formation_tmp_team_infantry_high),
(eq, ":slot_offset", slot_formation_tmp_team_infantry_low),
(assign, ":infantry_charge", 4),
(val_and, ":infantry_charge", ":team_tactic"),
(val_add, ":free_charge", ":infantry_charge"),
(eq, 0, 1),
(else_try),
(this_or_next|eq, ":slot_offset", slot_formation_tmp_team_horse_archer_1),
(eq, ":slot_offset", slot_formation_tmp_team_horse_archer_2),
(assign, ":free_charge", 2),
(val_and, ":free_charge", ":team_tactic"),
(call_script, "script_formation_check_array_ammo", ":team_no", ":array_no"),
(lt, reg0, 20),
(assign, ":free_charge", 2),
(eq, 0, 1),
(else_try),
(neq, ":free_charge", 0),
(try_begin),
(le, ":formation_stage", 7), # array is currently in formation or to form formation
(call_script, "script_dismiss_battle_array", ":team_no", ":mark"),
(store_sub, ":rest", 14, ":formation_stage"),
(val_mul, ":rest", sftt_formation_stage),
(val_add, ":state", ":rest"),
(party_set_slot, formation_temp_vector, ":slot", ":state"),
(set_show_messages, 0),
(team_give_order, ":team_no", grc_cavalry, mordr_charge),
(set_show_messages, 1),
(try_end),
(else_try),
(try_begin),
# form ranks first
(eq, ":formation_stage", 0),
(call_script, "script_cf_apply_formation", ":team_no", ":array_no", ":formation_type"),
(init_position, pos1),
(position_move_x, pos1, ":pos_x"),
(position_move_y, pos1, ":pos_y"),
(position_rotate_z, pos1, ":rotation"),
(call_script, "script_formation_move_to_pos", ":team_no", ":array_no"),
(else_try),
# when formation ready, start tactical action
(eq, ":formation_stage", 7),
(try_begin),
(assign, ":aggressive", 1),
(val_and, ":aggressive", ":team_tactic"),
(eq, ":aggressive", 1),
# Take aggressive action
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(val_or, ":array_states", sfas_tactical_charge),
(party_set_slot, formation_vector, reg0, ":array_states"),
(else_try),
# Take defensive action
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_state", formation_vector, reg0),
(val_and, ":array_state", sfas_formation_density),
(val_div, ":array_state", sfas_density_unit),
(store_sub, ":density", ":density", ":array_state"),
(neq, ":density", 0),
(call_script, "script_formation_density_change", ":team_no", ":mark", ":density"),
(try_end),
(else_try),
# formation need to be reformed, and then recover states
(ge, ":formation_stage", 8),
(try_begin),
(call_script, "script_cf_apply_formation", ":team_no", ":array_no", ":formation_type"),
(try_end),
(try_end),
(try_begin),
(lt, ":formation_stage", 7),
(val_add, ":state", sftt_formation_stage),
(party_set_slot, formation_temp_vector, ":slot", ":state"),
(else_try),
# reformed array set back to normal stage
(gt, ":formation_stage", 7),
(val_sub, ":state", 7*sftt_formation_stage),
(party_set_slot, formation_temp_vector, ":slot", ":state"),
(try_end),
(try_end),
]
),
################### AI functions end ##############
############### Formation operations ##############
#### Operations can be done to formations #########
# script_formation_move_to_pos
# Input: arg1: team_no, arg2:array_no,
# arg3: pos1 = position to move formation to
# Output: none
("formation_move_to_pos",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(set_fixed_point_multiplier, 100),
(position_get_x, ":ref_x", pos1),
(val_max, ":ref_x", "$battle_x_min"),
(val_min, ":ref_x", "$battle_x_max"),
(position_get_y, ":ref_y", pos1),
(val_max, ":ref_y", "$battle_y_min"),
(val_min, ":ref_y", "$battle_y_max"),
(position_get_rotation_around_z, ":rotation", pos1),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_ref_x_pos),
(party_set_slot, formation_vector, reg0, ":ref_x"),
(val_add, reg0, 1),
(party_set_slot, formation_vector, reg0, ":ref_y"),
(val_add, reg0, 1),
(party_set_slot, formation_vector, reg0, ":rotation"),
]
),
# script_formation_move
# Input: arg1: team_no, arg2: array_no,
# arg3: x_offset, arg4: y_offset, -- both relative to ref_pos
# Output: none
("formation_move",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
(store_script_param, ":x_offset", 3),
(store_script_param, ":y_offset", 4),
(set_fixed_point_multiplier, 100),
(convert_to_fixed_point, ":x_offset"),
(convert_to_fixed_point, ":y_offset"),
(init_position, pos10),
(position_set_x, pos10, ":x_offset"),
(position_set_y, pos10, ":y_offset"),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_ref_x_pos),
(assign, ":slot", reg0),
(init_position, pos9),
(party_get_slot, ":ref_x", formation_vector, ":slot"),
(position_set_x, pos9, ":ref_x"),
(val_add, ":slot", 1),
(party_get_slot, ":ref_y", formation_vector, ":slot"),
(position_set_y, pos9, ":ref_y"),
(val_add, ":slot", 1),
(party_get_slot, ":rotation", formation_vector, ":slot"),
(position_get_rotation_around_z, ":cur_rot", pos9),
(val_sub, ":rotation", ":cur_rot"),
(position_rotate_z, pos9, ":rotation"),
(position_transform_position_to_parent, pos11, pos9, pos10),
(position_get_x, ":new_x", pos11),
(position_get_y, ":new_y", pos11),
(try_begin),
(gt, ":new_x", "$battle_x_max"),
(assign, ":new_x", "$battle_x_max"),
(else_try),
(lt, ":new_x", "$battle_x_min"),
(assign, ":new_x", "$battle_x_min"),
(try_end),
(try_begin),
(gt, ":new_y", "$battle_y_max"),
(assign, ":new_y", "$battle_y_max"),
(else_try),
(lt, ":new_y", "$battle_y_min"),
(assign, ":new_y", "$battle_y_min"),
(try_end),
(val_sub, ":slot", 1),
(party_set_slot, formation_vector, ":slot", ":new_y"),
(val_sub, ":slot", 1),
(party_set_slot, formation_vector, ":slot", ":new_x"),
]),
# script_formation_turn
# Input: arg1: team_no, arg2: array_no,
# arg3: rotation
# Output: none
("formation_turn",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
(store_script_param, ":rotation", 3),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_ref_rotation),
(party_get_slot, ":cur_rot", formation_vector, reg0),
(val_add, ":cur_rot", ":rotation"),
(party_set_slot, formation_vector, reg0, ":cur_rot"),
]),
# script_formation_accelerate
# Accelerate the speed of charging or falling back
# Input: arg1: team_no, arg2: array_no,
# arg3: acceleration in speed bits
# Output: reg0: current speed
("formation_accelerate",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
(store_script_param, ":acceleration", 3),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":formation_states", formation_vector, reg0),
(assign, ":slot", reg0),
(assign, ":speed", 0),
(assign, ":charge", 0),
(assign, ":fall_back", 0),
(assign, reg0, 0),
(try_begin),
(eq, ":acceleration", 0), # halt command
(val_or, ":formation_states", sfas_charge+sfas_fall_back+sfas_speed),
(val_sub, ":formation_states", sfas_charge+sfas_fall_back+sfas_speed),
(else_try),
(store_and, ":charge", ":formation_states", sfas_charge),
(store_and, ":fall_back", ":formation_states", sfas_fall_back),
(neq, ":charge", 0),
(store_and, ":speed", ":formation_states", sfas_speed),
(val_sub, ":formation_states", ":speed"),
(val_mul, ":acceleration", sfas_speed_unit),
(val_add, ":speed", ":acceleration"),
(try_begin),
(gt, ":speed", sfas_speed),
(assign, ":speed", sfas_speed),
(else_try),
(eq, ":speed", 0),
(val_sub, ":formation_states", sfas_charge),
(try_end),
(val_add, ":formation_states", ":speed"),
(val_div, ":speed", sfas_speed_base),
(assign, reg0, ":speed"),
(else_try),
(neq, ":fall_back", 0),
(val_mul, ":acceleration", -sfas_speed_unit),
(store_and, ":speed", ":formation_states", sfas_speed),
(val_sub, ":formation_states", ":speed"),
(val_add, ":speed", ":acceleration"),
(try_begin),
(gt, ":speed", sfas_speed),
(assign, ":speed", sfas_speed),
(else_try),
(eq, ":speed", 0),
(val_sub, ":formation_states", sfas_fall_back),
(try_end),
(val_add, ":formation_states", ":speed"),
(val_div, ":speed", sfas_speed_base),
(assign, reg0, ":speed"),
(else_try),
(try_begin),
(gt, ":acceleration", 0),
(val_add, ":formation_states", sfas_charge+sfas_speed_unit),
(else_try),
(val_add, ":formation_states", sfas_fall_back+sfas_speed_unit),
(try_end),
(store_div, reg0, sfas_speed_unit, sfas_speed_base),
(try_end),
(party_set_slot, formation_vector, ":slot", ":formation_states"),
#(store_and, ":speed", ":formation_states", sfas_speed),
#(val_div, ":speed", sfas_speed_base),
#(set_fixed_point_multiplier, 100),
#(convert_to_fixed_point, ":speed"),
#(store_mul, ":speed_slot", ":team_no", formation_arrays*2),
#(val_add, ":speed_slot", ":array_no"),
#(val_add, ":speed_slot", formation_arrays),
#(party_set_slot, formation_temp_vector, ":speed_slot", ":speed"),
]),
# script_formation_density_change
# Script changes the tightness of the formation
# Input: arg1: team_no, arg2: array_selection
# arg3: option - -1 stand closer, 1 spread out
# Output: none
("formation_density_change",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_selection", 2),
(store_script_param, ":option", 3),
# calculate ratio to change density of all arrays selected
(try_for_range, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(assign, ":slot", reg0),
(party_get_slot, ":states", formation_vector, ":slot"),
(assign, ":density", 0),
(store_and, ":density", ":states", sfas_formation_density),
(store_div, ":cur_ratio", ":density", sfas_density_unit),
(store_add, ":density", ":cur_ratio", ":option"),
(val_add, ":cur_ratio", 1),
(store_add, ":new_ratio", ":cur_ratio", ":option"),
# set the temporary vector to store density change ratios
(try_begin),
(store_mul, ":tmp_ratio_pt", ":team_no", formation_arrays),
(val_add, ":tmp_ratio_pt", slot_formation_tmp_density),
(val_add, ":tmp_ratio_pt", ":array_no"),
(ge, ":density", 0),
(le, ":density", 3), # out of boundary, no change
(store_mul, ":change", ":option", sfas_density_unit),
(val_add, ":states", ":change"),
(party_set_slot, formation_vector, ":slot", ":states"),
(store_mul, ":ratio", ":new_ratio", sftd_ratio_base),
(val_div, ":ratio", ":cur_ratio"),
(party_set_slot, formation_temp_vector, ":tmp_ratio_pt", ":ratio"),
(else_try),
(party_set_slot, formation_temp_vector, ":tmp_ratio_pt", sftd_ratio_base),
(try_end),
(try_end),
(get_player_agent_no, ":player"),
(try_for_agents, ":agent"),
(neq, ":agent", ":player"),
(agent_get_team, ":agent_team", ":agent"),
(eq, ":team_no", ":agent_team"),
(agent_get_slot, ":array_no", ":agent", slot_agent_formation_states),
(val_and, ":array_no", safs_array_no),
(val_add, ":array_no", slot_formation_array_marks_begin),
(party_get_slot, ":mark", formation_vector, ":array_no"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(agent_get_slot, ":x_pos", ":agent", slot_agent_formation_x_pos),
(agent_get_slot, ":y_pos", ":agent", slot_agent_formation_y_pos),
(store_mul, ":tmp_ratio_pt", ":team_no", formation_arrays),
(val_add, ":tmp_ratio_pt", slot_formation_tmp_density),
(val_add, ":tmp_ratio_pt", ":array_no"),
(party_get_slot, ":ratio", formation_temp_vector, ":tmp_ratio_pt"),
(val_mul, ":x_pos", ":ratio"),
(val_div, ":x_pos", sftd_ratio_base),
(val_mul, ":y_pos", ":ratio"),
(val_div, ":y_pos", sftd_ratio_base),
(agent_set_slot, ":agent", slot_agent_formation_x_pos, ":x_pos"),
(agent_set_slot, ":agent", slot_agent_formation_y_pos, ":y_pos"),
(try_end),
]
),
# script_dismiss_battle_array
# Input: arg1: team_no, arg2:array_selection
# Output: none
("dismiss_battle_array",
[(store_script_param_1, ":team_no"),
debug_point_1,
(store_script_param_2, ":array_selection"),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_in_formation", formation_vector, reg0),
(val_or, ":array_in_formation", ":array_selection"),
(val_sub, ":array_in_formation", ":array_selection"),
(party_set_slot, formation_vector, reg0, ":array_in_formation"),
(get_player_agent_no, ":player"),
(try_for_agents, ":agent"),
(neq, ":agent", ":player"),
(agent_get_team, ":agent_team", ":agent"),
(eq, ":agent_team", ":team_no"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states),
(assign, ":agent_array", 0),
(store_and, ":agent_array", ":formation_states", safs_array_no),
(val_add, ":agent_array", slot_formation_array_marks_begin),
(party_get_slot, ":agent_array", formation_vector, ":agent_array"),
(val_and, ":agent_array", ":array_selection"),
(neq, ":agent_array", 0),
(val_or, ":formation_states", safs_in_formation),
(val_sub, ":formation_states", safs_in_formation),
(agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"),
(agent_clear_scripted_mode, ":agent"),
(agent_set_slot, ":agent", slot_agent_is_in_scripted_mode, 0),
(try_end),
(set_show_messages, 0),
(team_give_order, ":team_no", grc_everyone, mordr_charge),
(set_show_messages, 1),
]),
############### Formation operations end ##########
################## Key reactions ##################
#### Called when player presses order keys ########
# script_formation_move_key_reaction
# React to player key press
# Input: arg1:x_offset, arg2: y_offset, arg3: move name string id
# Output: none
("formation_move_key_reaction",
[(store_script_param, ":x_offset", 1),
(store_script_param, ":y_offset", 2),
(store_script_param, ":move_name", 3),
(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(str_clear, s1),
(assign, ":cnt", 0),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", "$formation_array_selected"),
(neq, ":mark", 0),
(store_add, ":formation_array_string", formation_array_names_begin, ":array_no"),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(call_script, "script_formation_move", ":team_no", ":array_no", ":x_offset", ":y_offset"),
(str_store_string, s2, ":formation_array_string"),
(val_add, ":cnt", 1),
(try_begin),
(eq, ":cnt", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(try_end),
(try_begin),
(eq, ":cnt", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(str_store_string, s2, ":move_name"),
(display_message, "@{s1}{s2}!!", formation_order_color),
]),
# script_formation_turn_key_reaction
# React to player key press
# Input: arg1:rotation, arg3: turn name string id
# Output: none
("formation_turn_key_reaction",
[(store_script_param, ":rotation", 1),
(store_script_param, ":turn_name", 2),
(str_clear, s1),
(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(assign, ":cnt", 0),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", "$formation_array_selected"),
(neq, ":mark", 0),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(store_add, ":formation_array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s2, ":formation_array_string"),
(val_add, ":cnt", 1),
(try_begin),
(eq, ":cnt", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(call_script, "script_formation_turn", ":team_no", ":array_no", ":rotation"),
(try_end),
(try_begin),
(eq, ":cnt", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(str_store_string, s2, ":turn_name"),
(display_message, "@{s1}{s2}!!", formation_order_color),
]),
# script_formation_charge_key_reaction
# Input: arg1: acceleration, arg2: order_string
# Output: none
("formation_charge_key_reaction",
[(store_script_param_1, ":acceleration"),
(store_script_param_2, ":order"),
(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(assign, ":cnt", 0),
(str_clear, s1),
(try_begin),
(eq, ":acceleration", 0), # if the command is halt
# cancel follow order
(val_or, "$formation_arrays_follow", "$formation_array_selected"),
(val_sub, "$formation_arrays_follow", "$formation_array_selected"),
(try_end),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", "$formation_array_selected"),
(neq, ":mark", 0),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":in_formation", formation_vector, reg0),
(val_and, ":mark", ":in_formation"),
(neq, ":mark", 0),
(store_add, ":formation_array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s2, ":formation_array_string"),
(val_add, ":cnt", 1),
(try_begin),
(eq, ":cnt", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(try_begin),
(eq, ":cnt", 1),
(call_script, "script_formation_accelerate", ":team_no", ":array_no", ":acceleration"),
(assign, ":speed", reg0),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":charge_states", formation_vector, reg0),
(val_and, ":charge_states", sfas_charge+sfas_fall_back+sfas_speed),
(try_begin),
(eq, ":acceleration", 0), # if command is halt
# cancel tactical charge state and all related states
(party_get_slot, ":array_states", formation_vector, reg0),
(val_or, ":array_states", sfas_tactical_charge+sfas_engaged+sfas_roar),
(val_sub, ":array_states", sfas_tactical_charge+sfas_engaged+sfas_roar),
(party_set_slot, formation_vector, reg0, ":array_states"),
(try_end),
(else_try),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(val_or, ":array_states", sfas_charge+sfas_fall_back+sfas_speed),
(val_sub, ":array_states", sfas_charge+sfas_fall_back+sfas_speed),
(val_add, ":array_states", ":charge_states"),
(try_begin),
(eq, ":acceleration", 0), # if command is halt
# cancel tactical charge state and all related states
(val_or, ":array_states", sfas_tactical_charge+sfas_engaged+sfas_roar),
(val_sub, ":array_states", sfas_tactical_charge+sfas_engaged+sfas_roar),
(try_end),
(party_set_slot, formation_vector, reg0, ":array_states"),
(try_end),
(try_end),
(try_begin),
(eq, ":cnt", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(str_store_string, s2, ":order"),
(val_and, ":charge_states", sfas_charge+sfas_fall_back),
(try_begin),
(eq, ":charge_states", 0),
(display_message, "@{s1}halt!!", formation_order_color),
(else_try),
(assign, reg0, ":speed"),
(eq, ":charge_states", sfas_charge),
(display_message, "@{s1}charge!! (With speed {reg0} m/s)", formation_order_color),
(else_try),
(display_message, "@{s1}fall back!! (With speed {reg0} m/s", formation_order_color),
(try_end),
],
),
# script_formation_density_key_reaction
# Script that reacts to density key
# Input: arg1: option - -1 stand closer, 1 spread out
# arg2: order_name
# Output: none
("formation_density_key_reaction",
[(store_script_param, ":option", 1),
(store_script_param, ":order_name", 2),
(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(val_and, ":array_selection", "$formation_array_selected"),
(call_script, "script_formation_density_change", ":team_no", ":array_selection", ":option"),
(str_clear, s1),
(assign, ":cnt", 0),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":in_formation", formation_vector, reg0),
(val_and, ":mark", ":in_formation"),
(neq, ":mark", 0),
(store_add, ":array_name", formation_array_names_begin, ":array_no"),
(str_store_string, s2, ":array_name"),
(val_add, ":cnt", 1),
(try_begin),
(eq, ":cnt", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(try_end),
(try_begin),
(eq, ":cnt", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(str_store_string, s2, ":order_name"),
(display_message, "@{s1}{s2}!!", formation_order_color),
]
),
# script_formation_follow_key_reaction
# Script called when follow key is clicked
# Input: none
# Output: none
("formation_follow_key_reaction",
[(str_clear, s1),
(assign, ":cnt", 0),
(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", "$formation_array_selected"),
(neq, ":mark", 0),
(store_add, ":array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s2, ":array_string"),
(val_add, ":cnt", 1),
# cancel tactical charge state and all related states
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(val_or, ":array_states", sfas_charge+sfas_fall_back+sfas_speed+sfas_tactical_charge+sfas_engaged+sfas_roar),
(val_sub, ":array_states", sfas_charge+sfas_fall_back+sfas_speed+sfas_tactical_charge+sfas_engaged+sfas_roar),
(party_set_slot, formation_vector, reg0, ":array_states"),
(try_begin),
(eq, ":cnt", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(try_end),
(try_begin),
(eq, ":cnt", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(display_message, "@{s1}follow me!!", formation_order_color),
(val_or, "$formation_arrays_follow", "$formation_array_selected"),
]),
# script_formation_move_to_pos_key_reaction
# Script called when move to position key is clicked
# Input: arg1: pos1 = destination, arg2: show_messages
# Output: none
("formation_move_to_pos_key_reaction",
[(set_fixed_point_multiplier, 100),
(store_script_param_2, ":show_messages"),
(store_script_param_1, ":array_selection"),
(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(init_position, pos2),
(copy_position, pos3, pos1),
#(position_copy_rotation, pos2, pos1),
(assign, ":pre1", 0),
(assign, ":pre2", 0),
(assign, ":cnt", 0),
# cancel follow command
(val_or, "$formation_arrays_follow", "$formation_array_selected"),
(val_sub, "$formation_arrays_follow", "$formation_array_selected"),
(try_for_range, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(val_add, ":cnt", 1),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":in_formation", formation_vector, reg0),
(val_and, ":mark", ":in_formation"),
(neq, ":mark", 0),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_num_of_men),
(party_get_slot, ":num_of_men", formation_vector, reg0),
(store_mul, ":width", ":num_of_men", sfas_density_base),
(val_div, ":width", 4), # Just some estimated number that could well separate different arrays but not too dispersal
# cancel tactical charge state and all related states
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(val_or, ":array_states", sfas_charge+sfas_fall_back+sfas_speed+sfas_tactical_charge+sfas_engaged+sfas_roar),
(val_sub, ":array_states", sfas_charge+sfas_fall_back+sfas_speed+sfas_tactical_charge+sfas_engaged+sfas_roar),
(party_set_slot, formation_vector, reg0, ":array_states"),
(try_begin),
(neq, ":cnt", 1),
(position_move_x, pos2, ":width", 1),
(position_move_x, pos2, ":pre2", 1),
(position_move_x, pos2, 75, 1), # one metre boundaries
(position_rotate_z, pos3, 180),
(position_rotate_z, pos2, 180),
(try_end),
(position_transform_position_to_parent, pos1, pos3, pos2),
#(position_copy_rotation, pos1, pos2),
(position_copy_origin, pos3, pos1),
(call_script, "script_formation_move_to_pos", ":team_no", ":array_no"),
(assign, ":pre2", ":pre1"),
(assign, ":pre1", ":width"),
(try_end),
(str_clear, s1),
(assign, ":cnt", 0),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(store_add, ":array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s2, ":array_string"),
(val_add, ":cnt", 1),
(try_begin),
(eq, ":cnt", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(try_end),
(try_begin),
(eq, ":cnt", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(try_begin),
(neq, ":show_messages", 0),
(display_message, "@{s1}hold this position!!", formation_order_color),
(try_end),
]
),
# script_apply_formation_key_reaction
# Script called when apply formation key is clicked
# Input: arg1: formation_type
# Output: none
("apply_formation_key_reaction",
[(store_script_param_1, ":formation_type"),
(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(assign, ":pl", 0),
(str_clear, s1),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", "$formation_array_selected"),
(neq, ":mark", 0),
(store_add, ":formation_array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s2, ":formation_array_string"),
(val_add, ":pl", 1),
(try_begin),
(eq, ":pl", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(call_script, "script_cf_apply_formation", ":team_no", ":array_no", ":formation_type"),
(try_end),
(try_begin),
(eq, ":pl", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(try_begin),
(gt, ":pl", 1),
(store_add, ":formation_string", formation_commands_pl_begin, ":formation_type"),
(str_store_string, s2, ":formation_string"),
(else_try),
(store_add, ":formation_string", formation_commands_begin, ":formation_type"),
(str_store_string, s2, ":formation_string"),
(try_end),
(display_message, "@{s1}form {s2}!"),
]
),
# script_formation_auto_rotation_key_reaction
# Script called when auto rotation key clicked
# Input: arg1: value - 1 = on, 0 = off, -1 = toggle
# Output: none
("formation_auto_rotation_key_reaction",
[(store_script_param_1, ":result"),
(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(str_clear, s1),
(assign, ":cnt", 0),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", ":array_no", slot_formation_array_marks_begin),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", "$formation_array_selected"),
(neq, ":mark", 0),
(party_get_slot, ":in_formation", formation_vector, ":array_no"),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":formation_states", formation_vector, reg0),
(assign, ":auto_rotation", 0),
(val_and, ":in_formation", ":array_selection"),
(store_and, ":auto_rotation", ":formation_states", sfas_auto_rotate),
(store_add, ":array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s2, ":array_string"),
(val_add, ":cnt", 1),
(try_begin),
(eq, ":cnt", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(try_begin),
(eq, ":result", -1),
(val_or, ":formation_states", sfas_auto_rotate),
(try_begin),
(eq, ":auto_rotation", 0),
(assign, ":result", 1),
(else_try),
(val_sub, ":formation_states", sfas_auto_rotate),
(assign, ":result", 0),
(try_end),
(else_try),
(eq, ":result", 1),
(val_or, ":formation_states", sfas_auto_rotate),
(else_try),
(val_or, ":formation_states", sfas_auto_rotate),
(val_sub, ":formation_states", sfas_auto_rotate),
(try_end),
(party_set_slot, formation_vector, reg0, ":formation_states"),
(try_end),
(try_begin),
(eq, ":cnt", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(try_begin),
(eq, ":result", 1),
(display_message, "@{s1}turn to enemies' direction!", formation_order_color),
(else_try),
(display_message, "@{s1}stick to current direction!", formation_order_color),
(try_end),
]
),
# script_formation_tactical_charge_key_reaction
# Script called when tactical charge key clicked
# Input: none
# Output: none
("formation_tactical_charge_key_reaction",
[(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(val_and, ":array_selection", "$formation_array_selected"),
(str_clear, s1),
(assign, ":cnt", 0),
(assign, ":result", -1),
# cancel follow command
(val_or, "$formation_arrays_follow", "$formation_array_selected"),
(val_sub, "$formation_arrays_follow", "$formation_array_selected"),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(val_add, ":cnt", 1),
(store_add, ":array_string", formation_array_names_begin, ":array_no"),
(str_store_string, s2, ":array_string"),
(try_begin),
(eq, ":cnt", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(try_begin),
(eq, ":cnt", 1),
(store_and, ":result", ":array_states", sfas_tactical_charge),
(store_sub, ":result", sfas_tactical_charge, ":result"),
(try_end),
(try_begin),
(eq, ":result", 0), # tactical charge turned off
(val_or, ":array_states", sfas_charge+sfas_fall_back+sfas_speed+sfas_tactical_charge+sfas_engaged+sfas_roar),
(val_sub, ":array_states", sfas_charge+sfas_fall_back+sfas_speed+sfas_tactical_charge+sfas_engaged+sfas_roar),
(try_end),
(val_add, ":array_states", ":result"),
(party_set_slot, formation_vector, reg0, ":array_states"),
(try_end),
(try_begin),
(eq, ":cnt", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(try_begin),
(neq, ":result", 0),
(display_message, "@{s1}charge!!(Tactical)", formation_order_color),
(else_try),
(display_message, "@{s1}stop charging!!", formation_order_color),
(try_end),
]
),
# script_formation_dismiss_key_reacion
# Script called when dismiss key clicked
# Input: none
# Output: none
("formation_dismiss_key_reaction",
[(str_clear, s1),
(assign, ":cnt", 0),
(try_for_range_backwards, ":array_no", 0, formation_arrays),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(val_and, ":mark", "$formation_array_selected"),
(neq, ":mark", 0),
(store_add, ":array_string", ":array_no", formation_array_names_begin),
(str_store_string, s2, ":array_string"),
(val_add, ":cnt", 1),
(try_begin),
(eq, ":cnt", 2),
(str_store_string, s1, "@{s2} and {s1}"),
(else_try),
(str_store_string, s1, "@{s2}, {s1}"),
(try_end),
(try_end),
(try_begin),
(eq, ":cnt", "$formation_max_array_no"),
(str_store_string, s1, "@All battles, "),
(try_end),
(display_message, "@{s1}dismiss formation!!", formation_order_color),
(get_player_agent_no, ":player"),
(agent_get_team, ":team_no", ":player"),
(call_script, "script_dismiss_battle_array", ":team_no", "$formation_array_selected"),
]
),
################## Key reactions end ##############
################# MISC functions ##################
#### Usually those called by other functions, #####
#### doing calculation & analysis and etc. #####
# script_calculate_formation_row
# Script calculates line positions relative to ref_pos.
# Internal function commonly used by line, phalanx, wedge and square formations
# Input: arg1: team_no, arg2: array_no,
# arg3: column_width - in centimeters,
# arg4: width - in number of men,
# arg5: row_width - distance between rows in centimetres
# arg6: inc - to increase line width by row or not (for wedge)
# Output: none
("calculate_formation_row",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
#(team_get_leader, ":leader", "team_no"),
(store_script_param, ":column_width", 3),
#(assign, ":column_width", 50),
(store_script_param, ":width", 4),
(store_script_param, ":row_width", 5),
(store_script_param, ":inc", 6),
(set_fixed_point_multiplier, 100),
(assign, ":dist", 0),
(assign, ":step", 0),
(try_begin),
(store_mod, ":odd", ":width", 2),
(eq, ":odd", 0),
(store_div, ":offset", ":column_width", 2),
(else_try),
(assign, ":offset", 0),
(try_end),
(assign, ":dir", 1),
(assign, ":num", 0),
(get_player_agent_no, ":player"),
(try_for_agents, ":agent"),
(neq, ":agent", ":player"),
(agent_get_team, ":agent_team", ":agent"),
(eq, ":agent_team", ":team_no"),
#(agent_is_ally, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
# Make sure the agent is not in another line
(agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states),
(assign, ":agent_array", 0),
(store_and, ":agent_array", ":formation_states", safs_array_no),
(eq, ":agent_array", ":array_no"),
(try_begin),
(eq, ":width", ":num"),
(val_sub, ":dist", ":row_width"),
(assign, ":num", 0),
(val_add, ":width", ":inc"),
(assign, ":step", 0),
(try_begin),
(store_mod, ":odd", ":width", 2),
(eq, ":odd", 0),
(store_div, ":offset", ":column_width", 2),
(else_try),
(assign, ":offset", 0),
(try_end),
(assign, ":dir", 1),
(try_end),
(assign, ":in_formation", 0),
(store_and, ":in_formation", ":formation_states", safs_in_formation),
(eq, ":in_formation", 0),
(store_mul, ":move", ":step", ":dir"),
(val_add, ":offset", ":move"),
(agent_set_slot, ":agent", slot_agent_formation_x_pos, ":offset"),
(agent_set_slot, ":agent", slot_agent_formation_y_pos, ":dist"),
# Make sure other lines don't include this agent
(val_or, ":formation_states", safs_in_formation),
(agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"),
(val_add, ":step", ":column_width"),
(val_mul, ":dir", -1),
(val_add, ":num", 1),
(try_end),
]),
# script_calculate_formation_arc
# Script calculates curved line positions relative to ref_pos.
# Internal function commonly used by line, phalanx, wedge and square formations
# Input: arg1: team_no, arg2: array_no,
# arg3: column_width - in centimeters,
# arg4: width - in number of men,
# arg5: row_width - distance between rows in centimetres
# arg6: inc - to increase line width by row or not (for wedge)
# Destories position register: pos11, pos12, pos13
# Output: none
("calculate_formation_arc",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
#(team_get_leader, ":leader", "team_no"),
(store_script_param, ":column_width", 3),
#(assign, ":column_width", 50),
(store_script_param, ":width", 4),
(store_script_param, ":row_width", 5),
(store_script_param, ":inc", 6),
(set_fixed_point_multiplier, 100),
#(assign, ":ang", 0),
#(assign, ":dir", 1),
(assign, ":num", 0),
(init_position, pos11),
(init_position, pos12),
(assign, ":radius", tactical_charge_arc_radius),
(position_move_y, pos12, -tactical_charge_arc_radius),
(store_mul, ":step_ang", 180, ":column_width"),
(val_div, ":step_ang", tactical_charge_arc_radius),
(val_mul, ":step_ang", 10000),
(val_div, ":step_ang", Pi*10000), # calculate the central angle between two men
(assign, ":zig_len", 3),
(assign, ":tmp", 0),
(store_div, ":zig", ":row_width", ":zig_len"),
(val_mul, ":row_width", -1),
(get_player_agent_no, ":player"),
(assign, ":layer", 0),
(store_mul, ":offset", ":step_ang", ":width"),
(val_div, ":offset", -2),
(position_rotate_z, pos11, ":offset"),
(try_for_agents, ":agent"),
(neq, ":agent", ":player"),
(agent_get_team, ":agent_team", ":agent"),
(eq, ":agent_team", ":team_no"),
#(agent_is_ally, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
# Make sure the agent is not in another line
(agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states),
(assign, ":agent_array", 0),
(store_and, ":agent_array", ":formation_states", safs_array_no),
(eq, ":agent_array", ":array_no"),
(try_begin),
(eq, ":width", ":num"),
(assign, ":num", 0),
(val_add, ":width", ":inc"),
(init_position, pos11),
(val_add, ":layer", 2),
(position_rotate_z, pos11, ":layer"),
(position_move_y, pos12, ":row_width"),
#(assign, ":ang", 0),
#(assign, ":dir", 1),
(val_sub, ":radius", ":row_width"),
(store_mul, ":dist", -1, ":radius"),
(position_set_y, pos12, ":dist"),
(store_mul, ":step_ang", 180, ":column_width"),
(val_div, ":step_ang", ":radius"),
(val_mul, ":step_ang", 10000),
(val_div, ":step_ang", Pi*10000), # calculate the central angle between two men
(store_mul, ":offset", ":step_ang", ":width"),
(val_div, ":offset", -2),
(position_rotate_z, pos11, ":offset"),
(assign, ":tmp", 0),
(try_end),
(assign, ":in_formation", 0),
(store_and, ":in_formation", ":formation_states", safs_in_formation),
(eq, ":in_formation", 0),
#(store_mul, ":move", ":step", ":dir"),
#(val_add, ":offset", ":move"),
(position_transform_position_to_parent, pos13, pos11, pos12),
(position_get_x, ":pos_x", pos13),
(position_get_y, ":pos_y", pos13),
(agent_set_slot, ":agent", slot_agent_formation_x_pos, ":pos_x"),
(agent_set_slot, ":agent", slot_agent_formation_y_pos, ":pos_y"),
# Make sure other lines don't include this agent
(val_or, ":formation_states", safs_in_formation),
(agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"),
#(val_add, ":step", ":column_width"),
#(store_mul, ":zig", ":tmp", ":row_width"),
#(val_div, ":zig", ":zig_len"),
(val_add, ":tmp", 1),
(try_begin),
(eq, ":tmp", ":zig_len"),
(assign, ":tmp", 0),
(try_end),
(try_begin),
(eq, ":tmp", 0),
(position_move_y, pos12, ":row_width"),
(else_try),
(position_move_y, pos12, ":zig"),
(try_end),
#(val_add, ":ang", ":step_ang"),
#(store_mul, ":rotation", ":ang", ":dir"),
(position_rotate_z, pos11, ":step_ang"),
(val_add, ":num", 1),
#(val_mul, ":dir", -1),
(try_end),
]),
# script_formation_reassign_array
# Script to reassign men of array with no leader to another array
# Input: arg1: team_no, arg2: array_no,
# Output: reg0 - no of array assigned to
("formation_reassign_array",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
#(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_max_array_no),
#(party_get_slot, ":max_array_no", formation_vector, reg0),
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(val_or, ":array_selection", ":mark"),
(val_sub, ":array_selection", ":mark"),
(party_set_slot, formation_vector, reg0, ":array_selection"),
(assign, ":dest_array", 0), # assign to main battle by default
# below not yet done, need further update
#(try_for_range, ":array", 1, ":max_array_no"),
# (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader),
# (party_get_slot, ":leader", formation_vector, reg0),
# (agent_is_alive, ":leader"), # a valid candidate array
# (agent_get_class, ":class", ":leader"),
#(try_end),
(assign, ":agent_array", 0),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(eq, ":agent_team", ":team_no"),
(agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states),
(store_and, ":agent_array", ":formation_states", safs_array_no),
(eq, ":agent_array", ":array_no"),
(val_sub, ":formation_states", ":agent_array"),
(val_add, ":formation_states", ":dest_array"),
(val_or, ":formation_states", safs_in_formation),
(val_sub, ":formation_states", safs_in_formation),
(agent_clear_scripted_mode, ":agent"),
(agent_set_slot, ":agent", slot_agent_is_in_scripted_mode, 0),
(agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"),
(try_end),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_num_of_men),
(party_set_slot, formation_vector, reg0, 0),
(assign, reg0, ":dest_array"),
]),
# script_get_closest_distance_of_enemy_at_pos1
# Find an enemy standing closest to the center of enemies
# Input: arg1: team_no, arg2: pos1, arg3: ex_class - one class to be excluded
# Output: reg0 - distance to the closest enemy in cms, pos2 - closest enemy position
("get_closest_distance_of_enemy_at_pos1",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":ex_class"),
(set_fixed_point_multiplier, 100),
(assign, reg0, 100000),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":agent_class", ":agent"),
(neq, ":agent_class", ":ex_class"),
(agent_get_position, pos2, ":agent"),
(get_distance_between_positions, ":dist", pos1, pos2),
(lt, ":dist", reg0),
(assign, reg0, ":dist"),
(copy_position, pos3, pos2),
(try_end),
(copy_position, pos2, pos3),
]
),
# script_formation_tactical_charge_generic
# Infantry formations can use this as tactical charge script
# Input: arg1: team_no, arg2: array_no,
# Output: none
("formation_tactical_charge_generic",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", 0),
(assign, ":slot", reg0),
(store_add, reg0, ":slot", slot_formation_array_ref_x_pos),
(party_get_slot, ":ref_x", formation_vector, reg0),
(store_add, reg0, ":slot", slot_formation_array_ref_y_pos),
(party_get_slot, ":ref_y", formation_vector, reg0),
(store_add, reg0, ":slot", slot_formation_array_ref_rotation),
(party_get_slot, ":rotation", formation_vector, reg0),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, ":ref_x"),
(position_set_y, pos1, ":ref_y"),
(position_rotate_z, pos1, ":rotation"),
(position_set_z_to_ground_level, pos1),
(copy_position, pos4, pos1),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(assign, ":no_infantry", 0),
(assign, ":charge_speed", 2),
(try_begin),
(call_script, "script_cf_calculate_enemy_infantry_centroid", ":team_no"),
(copy_position, pos2, pos4),
# Get distance from enemy infantry, turn formation toward enemy infantry
(get_distance_between_positions, ":dist", pos1, pos2),
(try_begin),
(position_is_behind_position, pos1, pos2),
(position_rotate_z, pos2, 180),
(try_end),
(position_transform_position_to_local, pos3, pos2, pos1),
(set_fixed_point_multiplier, 100),
(position_get_x, ":pos_x", pos3),
(position_get_y, ":pos_y", pos3),
#(position_get_x, reg1, pos3),
#(position_get_y, reg2, pos3),
#(display_message, "@Rel pos: {reg1}, {reg2}", formation_debug_color),
(convert_from_fixed_point, ":pos_y"),
(try_begin),
(neq, ":pos_y", 0),
(store_div, ":tan", ":pos_x", ":pos_y"),
(call_script, "script_arctan", ":tan"),
(else_try),
(gt, ":pos_x", 0),
(assign, reg0, 90),
(else_try),
(assign, reg0, -89),
(try_end),
(val_mul, reg0, -1),
(position_rotate_z, pos2, reg0),
(position_get_rotation_around_z, ":rotation", pos2),
(store_add, reg0, ":slot", slot_formation_array_ref_rotation),
(party_set_slot, formation_vector, reg0, ":rotation"),
(else_try),
(assign, ":dist", 10000),
(assign, ":no_infantry", 1),
(try_end),
(try_begin),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(assign, ":density", 0),
(store_and, ":density", ":array_states", sfas_formation_density),
(val_div, ":density", sfas_density_unit),
(lt, ":dist", 300),
# infantry in melee
(store_sub, ":density", 1, ":density"),
(try_begin),
(neq, ":density", 0),
(call_script, "script_formation_density_change", ":team_no", ":mark", ":density"),
(try_end),
(else_try),
(store_sub, ":density", 0, ":density"),
(neq, ":density", 0),
(call_script, "script_formation_density_change", ":team_no", ":mark", ":density"),
(try_end),
(copy_position, pos1, pos2),
(call_script, "script_get_closest_distance_of_enemy_at_pos1", ":team_no", -1),
(set_fixed_point_multiplier, 100),
(try_begin),
#(gt, reg0, 300),
(lt, reg0, 1000),
(this_or_next|position_is_behind_position, pos2, pos1),
(lt, reg0, 100),
# change formation to engaged stage
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(val_or, ":array_states", sfas_engaged),
(party_set_slot, formation_vector, reg0, ":array_states"),
(assign, ":no_infantry", 1),
(eq, 0, 1),
(else_try),
(eq, ":no_infantry", 1),
# stop march
(call_script, "script_formation_accelerate", ":team_no", ":array_no", 0),
(else_try),
# march with a speed of 2m/s
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(val_or, ":array_states", sfas_engaged),
(val_sub, ":array_states", sfas_engaged),
#(val_or, ":array_states", sfas_auto_rotate),
(party_set_slot, formation_vector, reg0, ":array_states"),
(assign, ":speed", 0),
(assign, ":fall_back", 0),
(store_and, ":speed", ":array_states", sfas_speed),
(store_and, ":fall_back", ":array_states", sfas_fall_back),
(val_div, ":speed", sfas_speed_unit),
(try_begin),
(lt, ":dist", 1500), # enemy close, charge!!
(assign, ":charge_speed", 3),
(try_end),
(try_begin),
(this_or_next|neq, ":fall_back", 0),
(lt, ":speed", ":charge_speed"),
(call_script, "script_formation_accelerate", ":team_no", ":array_no", 1),
(else_try),
(gt, ":speed", ":charge_speed"),
(call_script, "script_formation_accelerate", ":team_no", ":array_no", -1),
(try_end),
(try_end),
]
),
# script_cf_calculate_enemy_infantry_centroid
# Input: arg1: team_no
# Output: pos1 = Centroid
("cf_calculate_enemy_infantry_centroid",
[(store_script_param_1, ":team_no"),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(assign, ":acc_x", 0),
(assign, ":acc_y", 0),
(assign, ":cnt", 0),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(agent_get_position, pos2, ":agent"),
(position_get_x, ":pos_x", pos2),
(position_get_y, ":pos_y", pos2),
(val_add, ":acc_x", ":pos_x"),
(val_add, ":acc_y", ":pos_y"),
(val_add, ":cnt", 1),
(try_end),
(neq, ":cnt", 0),
(val_div, ":acc_x", ":cnt"),
(val_div, ":acc_y", ":cnt"),
(position_set_x, pos1, ":acc_x"),
(position_set_y, pos1, ":acc_y"),
(assign, ":min", -1),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(agent_get_position, pos2, ":agent"),
(get_distance_between_positions, ":dist", pos1, pos2),
(try_begin),
(this_or_next|eq, ":min", -1),
(lt, ":dist", ":min"),
(assign, ":min", ":dist"),
(copy_position, pos3, pos2),
(try_end),
(try_end),
(copy_position, pos1, pos3),
]
),
# script_get_square_distance_between_positions
# Used for script_cf_calculate_enemy_infantry_clustering
# Calculate distance between centroids of two clusters, in square meters
# Input: arg1: pos_no_1, arg2: pos_no_2
# Output: reg0 - square of distance
("get_square_distance_between_positions",
[(store_script_param_1, ":pos_no_1"),
(store_script_param_2, ":pos_no_2"),
(set_fixed_point_multiplier, 1),
(position_get_x, ":pos_x_1", ":pos_no_1"),
(position_get_y, ":pos_y_1", ":pos_no_1"),
(position_get_x, ":pos_x_2", ":pos_no_2"),
(position_get_y, ":pos_y_2", ":pos_no_2"),
(store_sub, reg0, ":pos_x_1", ":pos_x_2"),
(store_mul, reg0, reg0, reg0),
(store_sub, ":tmp", ":pos_y_1", ":pos_y_2"),
(store_mul, ":tmp", ":tmp", ":tmp"),
(val_add, reg0, ":tmp"),
(set_fixed_point_multiplier, 100),
]
),
# script_calculate_enemy_infantry_clustering
# Calculates clustering of enemy infantry and find a sparse cluster
# Use slot_agent_formation_alg_cell_1 to store cluster no of agent during calculation
# Use slot_agent_formation_alg_cell_2 to store cluster no of agent for optimal clustering
# Use pos10 - pos20 to store all _centroids of clusters
# Use formation_temp_vector starting from slot_formation_tmp_alg_stat_begin to store
# cluster size and average square Euclidian distance of clusters
# Input: arg1: team_no, arg2: threshold, marking when to stop joining clusters
# Output: pos1: sparse cluster centroid
# reg0: total count of enemies
("calculate_enemy_infantry_clustering",
[(store_script_param_1, ":team_no"),
(set_fixed_point_multiplier, 100),
# Try cluster number from 1 to 9
(assign, ":RSS", -1), # Residual sum of squares
(assign, ":prev_k", 0),
(assign, ":num", 0),
(assign, ":max_cluster", 10),
(try_for_range, ":k", 1, ":max_cluster"),
(assign, ":continue_1", 0),
(try_for_range, reg10, 0, 4), # Try few times of clustering, now 4
# Randomly assign agents to initial clusters
(try_for_agents, ":agent"),
(agent_is_human, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(store_random_in_range, ":cluster", 0, ":k"),
(agent_set_slot, ":agent", slot_agent_formation_alg_cell_1, ":cluster"),
(try_end),
(assign, ":max_trial", 50), # maximal 50 trials of reassignment
(assign, ":continue", 1),
(try_for_range, reg20, 0, ":max_trial"),
# Initialization
# Use pos10 - pos20 to store all centroids of clusters
# Use formation_temp_vector to store cluster size
(try_for_range, ":cluster", 0, ":k"),
(store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin),
(party_set_slot, formation_temp_vector, ":slot", 0),
(store_add, ":centroid", ":cluster", 10),
(init_position, ":centroid"),
(position_set_x, ":centroid", 0),
(position_set_y, ":centroid", 0),
(try_end),
(try_for_agents, ":agent"),
(agent_is_human, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_1),
(store_add, ":centroid", ":cluster", 10),
(agent_get_position, pos1, ":agent"),
(position_transform_position_to_parent, pos3, ":centroid", pos1), # update centroid
(position_copy_origin, ":centroid", pos3),
(store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin),
(party_get_slot, ":size", formation_temp_vector, ":slot"),
(val_add, ":size", 1),
(party_set_slot, formation_temp_vector, ":slot", ":size"), # update size
(try_end),
(try_for_range, ":cluster", 0, ":k"),
(store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin),
(party_get_slot, ":size", formation_temp_vector, ":slot"),
(store_add, ":centroid", ":cluster", 10),
(position_get_x, ":pos_x", ":centroid"),
(position_get_y, ":pos_y", ":centroid"),
(val_div, ":pos_x", ":size"),
(val_div, ":pos_y", ":size"),
(position_set_x, ":centroid", ":pos_x"),
(position_set_y, ":centroid", ":pos_y"),
(try_end),
(eq, ":continue", 1),
(assign, ":continue", 0),
# Reassign agents to clusters
(try_for_agents, ":agent"),
(agent_is_human, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(agent_get_position, pos1, ":agent"),
(assign, ":min", -1),
(agent_get_slot, ":old_cluster", ":agent", slot_agent_formation_alg_cell_1),
(try_for_range, ":cluster", 0, ":k"),
(store_add, ":centroid", ":cluster", 10),
(call_script, "script_get_square_distance_between_positions", ":centroid", pos1),
(assign, ":dist", reg0),
(this_or_next|eq, ":min", -1),
(lt, ":dist", ":min"),
(assign, ":min", ":dist"),
(agent_set_slot, ":agent", slot_agent_formation_alg_cell_1, ":cluster"),
(try_end),
(neg|agent_slot_eq, ":agent", slot_agent_formation_alg_cell_1, ":old_cluster"),
(assign, ":continue", 1),
(try_end),
(else_try),
(assign, ":max_trial", 0), # clusters fixed, break
(try_end),
# Calculate current RSS
(assign, ":new_RSS", 0),
(try_for_agents, ":agent"),
(agent_is_human, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(agent_get_position, pos1, ":agent"),
(agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_1),
(store_add, ":centroid", ":cluster", 10),
(call_script, "script_get_square_distance_between_positions", pos1, ":centroid"),
(val_add, ":new_RSS", reg0),
(try_end),
(assign, ":continue", 1),
(try_for_range, ":cluster", 0, ":k"),
(store_add, ":centroid", ":cluster", 10),
#(position_get_x, reg1, ":centroid"),
#(position_get_y, reg2, ":centroid"),
#(assign, reg3, ":cluster"),
#(display_message, "@Centroid of {reg3}: ({reg1}, {reg2})", formation_debug_color),
(store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin),
(party_slot_eq, formation_temp_vector, ":slot", 0), # contains empty cluster, invalid partition
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(store_mul, ":tmp", 800, ":prev_k"), # here 800 should be an empirical value
(store_add, ":tmp", ":RSS", ":tmp"),
(store_mul, ":tmp_1", 800, ":k"),
(store_add, ":tmp_1", ":new_RSS", ":tmp_1"),
#(assign, reg1, ":RSS"),
#(assign, reg2, ":new_RSS"),
#(display_message, "@before: {reg1} after: {reg2}", formation_debug_color),
(this_or_next|eq, ":RSS", -1),
(gt, ":tmp", ":tmp_1"),
(assign, ":RSS", ":new_RSS"),
(assign, ":prev_k", ":k"),
(assign, ":continue_1", 1),
# Store current partition
(try_for_agents, ":agent"),
(agent_is_human, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_1),
(agent_set_slot, ":agent", slot_agent_formation_alg_cell_2, ":cluster"),
(try_end),
(try_end),
(eq, ":continue_1", 1),
(else_try),
(assign, ":max_cluster", 0),
(try_end),
# find one cluster most sparse
(try_for_range, ":i", 0, ":prev_k"),
(store_add, ":slot", ":i", slot_formation_tmp_alg_stat_begin),
(party_set_slot, formation_temp_vector, ":slot", 0),
(val_add, ":slot", 10),
(party_set_slot, formation_temp_vector, ":slot", 0), # accumulated square distance
(store_add, ":centroid", ":i", 10),
(init_position, ":centroid"),
(position_set_x, ":centroid", 0),
(position_set_y, ":centroid", 0),
(try_end),
(try_for_agents, ":agent"),
(agent_is_human, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_2),
(store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin),
(party_get_slot, ":stat", formation_temp_vector, ":slot"),
(val_add, ":stat", 1),
(party_set_slot, formation_temp_vector, ":slot", ":stat"),
(store_add, ":centroid", ":cluster", 10),
(agent_get_position, pos1, ":agent"),
(position_transform_position_to_parent, pos3, ":centroid", pos1),
(position_copy_origin, ":centroid", pos3),
(try_end),
(try_for_range, ":i", 0, ":prev_k"),
(store_add, ":slot", ":i", slot_formation_tmp_alg_stat_begin),
(party_get_slot, ":size", formation_temp_vector, ":slot"),
(store_add, ":centroid", ":i", 10),
(position_get_x, ":pos_x", ":centroid"),
(position_get_y, ":pos_y", ":centroid"),
(val_div, ":pos_x", ":size"),
(val_div, ":pos_y", ":size"),
(position_set_x, ":centroid", ":pos_x"),
(position_set_y, ":centroid", ":pos_y"),
(try_end),
(try_for_agents, ":agent"),
(agent_is_human, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(agent_get_position, pos1, ":agent"),
(agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_2),
(store_add, ":centroid", ":cluster", 10),
(call_script, "script_get_square_distance_between_positions", pos1, ":centroid"),
(store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin),
(party_get_slot, ":size", formation_temp_vector, ":slot"),
(val_add, ":slot", 10),
(party_get_slot, ":stat", formation_temp_vector, ":slot"),
(val_div, reg0, ":size"),
(val_add, ":stat", reg0),
(party_set_slot, formation_temp_vector, ":slot", ":stat"),
(val_add, ":num", 1),
(try_end),
(assign, ":max", -1),
(try_for_range, ":cluster", 0, ":prev_k"),
(store_add, ":centroid", ":cluster", 10),
(store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin+10),
(party_get_slot, ":sqdist", formation_temp_vector, ":slot"),
(this_or_next|eq, ":max", -1),
(gt, ":sqdist", ":max"),
(assign, ":max", ":sqdist"),
(copy_position, pos1, ":centroid"),
(try_end),
#(position_get_x, reg1, pos1),
#(position_get_y, reg2, pos1),
#(display_message, "@Selected cluster: ({reg1}, {reg2})", formation_debug_color),
(assign, reg0, ":num"),
]
),
# script_cf_calculate_enemy_infantry_linear_regression_pos
# Model enmey cluster as a line segment and find the estimation
# Input: arg1: team_no
# Output: pos1 = Middle point of the line segment, reg0 = number of enemies
("cf_calculate_enemy_infantry_linear_regression_pos",
[(store_script_param_1, ":team_no"),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(assign, ":acc_x", 0),
(assign, ":acc_y", 0),
(assign, ":cnt", 0),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_position, pos2, ":agent"),
(position_get_x, ":pos_x", pos2),
(position_get_y, ":pos_y", pos2),
(val_add, ":acc_x", ":pos_x"),
(val_add, ":acc_y", ":pos_y"),
(val_add, ":cnt", 1),
(try_end),
(neq, ":cnt", 0),
(val_div, ":acc_x", ":cnt"),
(val_div, ":acc_y", ":cnt"),
(position_set_x, pos1, ":acc_x"),
(position_set_y, pos1, ":acc_y"),
(assign, ":param1", -1),
(val_mul, ":param1", ":cnt"),
(val_mul, ":param1", ":acc_x"),
(val_mul, ":param1", ":acc_y"),
(val_div, ":param1", 10000),
(assign, ":param2", -1),
(val_mul, ":param2", ":cnt"),
(val_mul, ":param2", ":acc_x"),
(val_mul, ":param2", ":acc_x"),
(val_div, ":param2", 10000),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(agent_get_class, ":class", ":agent"),
(neq, ":class", grc_cavalry),
(teams_are_enemies, ":team_no", ":agent_team"),
(agent_get_position, pos2, ":agent"),
(position_get_x, ":pos_x", pos2),
(convert_from_fixed_point, ":pos_x"),
(position_get_y, ":pos_y", pos2),
(convert_from_fixed_point, ":pos_y"),
(store_mul, ":tmp", ":pos_x", ":pos_y"),
(val_add, ":param1", ":tmp"),
(store_mul, ":tmp", ":pos_x", ":pos_x"),
(val_add, ":param2", ":tmp"),
(try_end),
# rotate pos1 so that its x-axis lies along side the regression line
(copy_position, pos3, pos1),
(position_move_x, pos3, ":param2"),
(position_move_y, pos3, ":param1"),
(position_transform_position_to_local, pos4, pos1, pos3),
(position_get_x, ":pos_x", pos4),
(position_get_y, ":pos_y", pos4),
(convert_from_fixed_point, ":pos_x"),
(store_div, ":tan", ":pos_y", ":pos_x"),
(call_script, "script_arctan", ":tan"),
(position_rotate_z, pos1, reg0),
(assign, reg0, ":cnt"),
]
),
# script_formation_tactical_charge_cavalry
# Tactical charge script for cavalries
# Input: arg1: team_no, arg2: array_no
# Output: none
("formation_tactical_charge_cavalry",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
#(try_begin),
#(call_script, "script_cf_calculate_enemy_infantry_linear_regression_pos", ":team_no"),
#(gt, reg0, 10),
(store_mul, ":tmp_slot", ":team_no", formation_arrays*2),
(val_add, ":tmp_slot", ":array_no"),
#(party_get_slot, ":cur_num", formation_temp_vector, ":tmp_slot"),
#(gt, ":cur_num", 10),
(store_add, ":stage_slot", slot_formation_tmp_clustering, ":team_no"),
(party_get_slot, ":stage", formation_temp_vector, ":stage_slot"),
(try_begin),
(eq, ":stage", 0),
(call_script, "script_calculate_enemy_infantry_clustering", ":team_no"),
(set_fixed_point_multiplier, 100),
(position_get_x, ":pos_x", pos1),
(position_get_y, ":pos_y", pos1),
(store_add, ":clustering_slot", slot_formation_tmp_cavalry_target, ":team_no"),
(party_set_slot, formation_temp_vector, ":clustering_slot", ":pos_x"),
(val_add, ":clustering_slot", 4),
(party_set_slot, formation_temp_vector, ":clustering_slot", ":pos_y"),
(val_add, ":clustering_slot", 4),
(party_set_slot, formation_temp_vector, ":clustering_slot", reg0),
(val_add, ":stage", 1),
(party_set_slot, formation_temp_vector, ":stage_slot", ":stage"),
(else_try),
(store_add, ":clustering_slot", slot_formation_tmp_cavalry_target, ":team_no"),
(party_get_slot, ":pos_x", formation_temp_vector, ":clustering_slot"),
(val_add, ":clustering_slot", 4),
(party_get_slot, ":pos_y", formation_temp_vector, ":clustering_slot"),
(val_add, ":clustering_slot", 4),
(party_get_slot, reg0, formation_temp_vector, ":clustering_slot"),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, ":pos_x"),
(position_set_y, pos1, ":pos_y"),
(try_end),
#(position_get_x, reg1, pos1),
#(position_get_y, reg2, pos1),
#(display_message, "@Aiming at: ({reg1}, {reg2})", formation_debug_color),
(position_set_z_to_ground_level, pos1),
#(gt, reg0, 10),
(set_fixed_point_multiplier, 100),
(init_position, pos2),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_ref_x_pos),
(store_sub, ":slot", reg0, slot_formation_array_ref_x_pos),
(party_get_slot, ":ref_x", formation_vector, reg0),
(position_set_x, pos2, ":ref_x"),
(val_add, reg0, 1),
(party_get_slot, ":ref_y", formation_vector, reg0),
(position_set_y, pos2, ":ref_y"),
(val_add, reg0, 1),
(party_get_slot, ":rotation", formation_vector, reg0),
#(assign, reg1, ":ref_x"),
#(assign, reg2, ":ref_y"),
#(display_message, "@Cavalry at: {reg1}, {reg2}", formation_debug_color),
# In case the formation stuck at boundaries, drive it out
(try_begin),
(eq, ":ref_x", "$battle_x_min"),
(try_begin),
(eq, ":ref_y", "$battle_y_min"),
(assign, ":rotation", -45),
(else_try),
(assign, ":rotation", -135),
(try_end),
(else_try),
(try_begin),
(eq, ":ref_y", "$battle_y_min"),
(assign, ":rotation", 45),
(else_try),
(this_or_next|eq, ":ref_y", "$battle_y_max"),
(eq, ":ref_x", "$battle_x_max"),
(assign, ":rotation", 135),
(try_end),
(try_end),
(position_get_rotation_around_z, ":cur_rot", pos2),
(val_sub, ":rotation", ":cur_rot"),
(position_rotate_z, pos2, ":rotation"),
(party_set_slot, formation_vector, reg0, ":rotation"),
(get_distance_between_positions, ":dist", pos1, pos2),
(store_add, ":states_slot", ":slot", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, ":states_slot"),
(assign, ":speed", 0),
(assign, ":fall_back", 0),
(assign, ":density", 0),
(store_and, ":speed", ":array_states", sfas_speed),
(val_div, ":speed", sfas_speed_unit),
(store_and, ":fall_back", ":array_states", sfas_fall_back),
(store_and, ":density", ":array_states", sfas_formation_density),
(val_div, ":density", sfas_density_unit),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(try_begin),
(store_sub, ":density", 2, ":density"),
(neq, ":density", 0),
(call_script, "script_formation_density_change", ":team_no", ":mark", ":density"),
(try_end),
(try_begin),
(le, ":dist", 3500),
#(val_or, ":array_states", sfas_engaged),
(try_begin),
(le, ":dist", 2500),
(val_or, ":array_states", sfas_roar),
(try_end),
(party_set_slot, formation_vector, ":states_slot", ":array_states"),
(try_begin),
(this_or_next|neq, ":fall_back", 0),
(lt, ":speed", 9),
(call_script, "script_formation_accelerate", ":team_no", ":array_no", 1),
(else_try),
(gt, ":speed", 9),
(call_script, "script_formation_accelerate", ":team_no", ":array_no", -1),
(try_end),
(else_try),
(val_or, ":array_states", sfas_roar),
(val_sub, ":array_states", sfas_roar),
#(val_or, ":array_states", sfas_engaged),
#(val_sub, ":array_states", sfas_engaged),
(party_set_slot, formation_vector, ":states_slot", ":array_states"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(position_rotate_z, pos1, 180),
(try_end),
(position_transform_position_to_local, pos3, pos1, pos2),
(set_fixed_point_multiplier, 100),
(position_get_x, ":pos_x", pos3),
(position_get_y, ":pos_y", pos3),
(convert_to_fixed_point, ":pos_x"),
(store_div, ":tan", ":pos_x", ":pos_y"),
(call_script, "script_arctan", ":tan"),
(val_abs, reg0),
#(assign, ":cut_in_angle", reg0),
(try_begin),
#(le, reg0, 80),
#(ge, ":dist", 6000),
(init_position, pos4),
(position_set_x, pos4, 0),
(position_set_y, pos4, ":dist"),
(position_transform_position_to_parent, pos6, pos1, pos4),
#(neg|position_is_behind_position, pos6, pos2),
(position_transform_position_to_local, pos5, pos2, pos1),
(position_get_x, ":pos_x", pos5),
(position_get_y, ":pos_y", pos5),
(set_fixed_point_multiplier, 100),
(convert_to_fixed_point, ":pos_y"),
(try_begin),
(eq, ":pos_x", 0),
(assign, ":pos_x", 1),
(try_end),
(try_begin),
(gt, ":pos_x", 0),
(assign, ":sign", -1),
(else_try),
(assign, ":sign", 1),
(try_end),
(val_abs, ":pos_x"),
(store_div, ":tan", ":pos_y", ":pos_x"),
(call_script, "script_arctan", ":tan"),
(store_sub, reg0, 90, reg0),
(try_begin),
# (gt, reg0, tactical_charge_cut_in),
# (store_mul, ":rotation", ":sign", tactical_charge_cut_in),
# (call_script, "script_formation_turn", ":team_no", ":array_no", ":rotation"),
#(else_try),
(gt, reg0, tactical_charge_adjust_in),
(try_begin),
(gt, reg0, 30),
(lt, reg0, 120),
(store_mul, ":rotation", ":sign", tactical_charge_cut_in),
(else_try),
(store_mul, ":rotation", ":sign", tactical_charge_adjust_in),
(try_end),
(call_script, "script_formation_turn", ":team_no", ":array_no", ":rotation"),
(assign, ":charge_speed", 6),
(else_try),
(assign, ":charge_speed", 7),
(try_end),
(try_begin),
(this_or_next|neq, ":fall_back", 0),
(lt, ":speed", ":charge_speed"),
(call_script, "script_formation_accelerate", ":team_no", ":array_no", 1),
(else_try),
(gt, ":speed", ":charge_speed"),
(call_script, "script_formation_accelerate", ":team_no", ":array_no", -1),
(try_end),
#(else_try),
# (store_mul, ":perimeter", ":dist", 2*Pi),
# (store_div, ":time", ":perimeter", ":speed"),
# (val_div, ":time", 100*tactical_charge_listen_interval),
# (store_div, ":omega", 360, ":time"),
# (position_transform_position_to_local, pos5, pos2, pos1),
# (position_get_x, ":pos_x", pos5),
# (position_get_y, ":pos_y", pos5),
# (assign, ":sign", 1),
# (try_begin),
# (gt, ":pos_x", 0),
# (assign, ":sign", -1),
# (try_end),
# (convert_from_fixed_point, ":pos_x"),
# (store_div, ":tan", ":pos_y", ":pos_x"),
# (call_script, "script_arctan", ":tan"),
# (val_abs, reg0),
# (try_begin),
# (this_or_next|gt, reg0, 3),
# (lt, ":dist", 4500),
# (gt, ":pos_y", 0),
# (val_sub, ":omega", tactical_charge_adjust_out),
# (else_try),
# (gt, reg0, 3),
# (val_add, ":omega", tactical_charge_adjust_in),
# (try_end),
# (val_mul, ":omega", ":sign"),
# (call_script, "script_formation_turn", ":team_no", ":array_no", ":omega"),
(try_end),
(try_end),
]
),
# script_formation_check_array_ammo
# Check the ratio of agents having ammo left
# Input: arg1: team_no, arg2: array_no,
# Output: reg0 - ratio in percentage
("formation_check_array_ammo",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(assign, ":cnt", 0),
(assign, ":cnt_1", 0),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_team, ":agent_team", ":agent"),
(eq, ":agent_team", ":team_no"),
(agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states),
(val_and, ":formation_states", safs_array_no),
(eq, ":formation_states", ":array_no"),
(agent_get_ammo, ":ammo", ":agent"),
(val_add, ":cnt", 1),
(neq, ":ammo", 0),
(val_add, ":cnt_1", 1),
(try_end),
(val_mul, ":cnt_1", 100),
(store_div, reg0, ":cnt_1", ":cnt"),
]
),
# script_formation_tactical_charge_ranged
# Infantry formations can use this as tactical charge script
# Input: arg1: team_no, arg2: array_no,
# Output: none
("formation_tactical_charge_ranged",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(set_fixed_point_multiplier, 100),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", 0),
(assign, ":slot", reg0),
(store_add, reg0, ":slot", slot_formation_array_ref_x_pos),
(party_get_slot, ":ref_x", formation_vector, reg0),
(store_add, reg0, ":slot", slot_formation_array_ref_y_pos),
(party_get_slot, ":ref_y", formation_vector, reg0),
(store_add, reg0, ":slot", slot_formation_array_ref_rotation),
(party_get_slot, ":rotation", formation_vector, reg0),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, ":ref_x"),
(position_set_y, pos1, ":ref_y"),
(position_rotate_z, pos1, ":rotation"),
(position_set_z_to_ground_level, pos1),
(copy_position, pos4, pos1),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
#(assign, ":no_infantry", 0),
(try_begin),
(call_script, "script_cf_calculate_enemy_infantry_centroid", ":team_no", grc_cavalry),
(copy_position, pos2, pos4),
# Get distance from enemy infantry, turn formation toward enemy infantry
(get_distance_between_positions, ":dist", pos1, pos2),
(try_begin),
(position_is_behind_position, pos1, pos2),
(position_rotate_z, pos2, 180),
(try_end),
(position_transform_position_to_local, pos3, pos2, pos1),
(set_fixed_point_multiplier, 100),
(position_get_x, ":pos_x", pos3),
(position_get_y, ":pos_y", pos3),
#(position_get_x, reg1, pos2),
#(position_get_y, reg2, pos2),
#(display_message, "@Rel pos: {reg1}, {reg2}", formation_debug_color),
(convert_from_fixed_point, ":pos_y"),
(try_begin),
(neq, ":pos_y", 0),
(store_div, ":tan", ":pos_x", ":pos_y"),
(call_script, "script_arctan", ":tan"),
(else_try),
(gt, ":pos_x", 0),
(assign, reg0, 90),
(else_try),
(assign, reg0, -89),
(try_end),
(val_mul, reg0, -1),
(position_rotate_z, pos2, reg0),
(position_get_rotation_around_z, ":rotation", pos2),
(store_add, reg0, ":slot", slot_formation_array_ref_rotation),
(party_set_slot, formation_vector, reg0, ":rotation"),
(else_try),
(assign, ":dist", 4000),
(try_end),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(assign, ":states_slot", reg0),
(party_get_slot, ":array_states", formation_vector, reg0),
(assign, ":density", 0),
(store_and, ":density", ":array_states", sfas_formation_density),
(val_div, ":density", sfas_density_unit),
(store_sub, ":density", 0, ":density"),
(store_add, ":mark", slot_formation_array_marks_begin, ":array_no"),
(party_get_slot, ":mark", formation_vector, ":mark"),
(try_begin),
(neq, ":density", 0),
(call_script, "script_formation_density_change", ":team_no", ":mark", ":density"),
(try_end),
(try_begin),
(lt, ":dist", 1000),
# change formation to engaged stage
(party_get_slot, ":array_states", formation_vector, ":states_slot"),
(val_or, ":array_states", sfas_engaged),
(party_set_slot, formation_vector, reg0, ":array_states"),
(try_end),
(try_begin),
(lt, ":dist", 7500),
# stop march
(call_script, "script_formation_accelerate", ":team_no", ":array_no", 0),
(else_try),
# march with a speed of 2m/s
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(val_or, ":array_states", sfas_engaged),
(val_sub, ":array_states", sfas_engaged),
(party_set_slot, formation_vector, reg0, ":array_states"),
(assign, ":speed", 0),
(assign, ":fall_back", 0),
(store_and, ":speed", ":array_states", sfas_speed),
(store_and, ":fall_back", ":array_states", sfas_fall_back),
(val_div, ":speed", sfas_speed_unit),
(try_begin),
(this_or_next|neq, ":fall_back", 0),
(lt, ":speed", 2),
(call_script, "script_formation_accelerate", ":team_no", ":array_no", 1),
(else_try),
(gt, ":speed", 2),
(call_script, "script_formation_accelerate", ":team_no", ":array_no", -1),
(try_end),
(try_end),
]
),
# script_formation_tactical_charge_horse_archer
# Dedicated for harassing arcs of horse archers
# Input: arg1: team_no, arg2: array_no
# Destories position registers: pos1, pos2, pos3
# Output: none
("formation_tactical_charge_horse_archer",
[(store_script_param_1, ":team_no", 1),
(store_script_param_2, ":array_no", 2),
(set_fixed_point_multiplier, 100),
(call_script, "script_convert_to_slot_no", ":team_no", ":array_no", 0),
(store_add, ":slot", reg0, slot_formation_array_ref_x_pos),
(party_get_slot, ":ref_x", formation_vector, ":slot"),
(store_add, ":slot", reg0, slot_formation_array_ref_y_pos),
(party_get_slot, ":ref_y", formation_vector, ":slot"),
(store_add, ":slot", reg0, slot_formation_array_ref_rotation),
(party_get_slot, ":rotation", formation_vector, ":slot"),
(init_position, pos1),
(position_set_x, pos1, ":ref_x"),
(position_set_y, pos1, ":ref_y"),
(position_rotate_z, pos1, ":rotation"),
(position_move_y, pos1, -tactical_charge_arc_radius/2),
(call_script, "script_get_closest_distance_of_enemy_at_pos1", ":team_no", grc_cavalry),
(position_move_y, pos1, tactical_charge_arc_radius/2),
(position_set_z_to_ground_level, pos1),
(position_set_z_to_ground_level, pos2),
(get_distance_between_positions, ":dist", pos1, pos2),
(try_begin),
(gt, ":dist", 800),
(position_transform_position_to_local, pos3, pos1, pos2),
(position_normalize_origin, ":dist", pos3),
(position_get_x, ":pos_x", pos3),
(val_mul, ":pos_x", 8),
(position_get_y, ":pos_y", pos3),
(val_mul, ":pos_y", 8),
(position_set_x, pos3, ":pos_x"),
(position_set_y, pos3, ":pos_y"),
#(position_copy_rotation, pos2, pos1),
(position_transform_position_to_parent, pos2, pos1, pos3), # move 8 metres toward enemy
(position_copy_origin, pos1, pos2),
(call_script, "script_formation_move_to_pos", ":team_no", ":array_no"),
(else_try),
debug_point,
(position_copy_origin, pos1, pos2),
(call_script, "script_formation_move_to_pos", ":team_no", ":array_no"),
(call_script, "script_formation_turn", ":team_no", ":array_no", 12), # rotate formation counter-clcokwise
(try_end),
]),
# script_convert_to_slot_no
# Convert to slot no in formation vector
# Input: arg1: team_no - -1 if not in team slots,
# arg2: array_no - -1 if not in array slots,
# arg3: slot name
# Output: reg0 = slot no
("convert_to_slot_no",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
(store_script_param, ":slot", 3),
(try_begin),
(eq, ":team_no", -1),
(else_try),
(store_mul, ":base", ":team_no", sft_team_section_size),
(val_add, ":base", slot_formation_teams_begin),
(eq, ":array_no", -1),
(val_add, ":slot", ":base"),
(else_try),
(store_mul, ":offset", ":array_no", sfa_array_section_size),
(val_add, ":offset", slot_formation_team_arrays_begin),
(val_add, ":slot", ":base"),
(val_add, ":slot", ":offset"),
(try_end),
(assign, reg0, ":slot"),
]),
# script_arctan
# Input: arg1: fixed_point
# Output: reg0 = angle in degrees
("arctan",
[(store_script_param_1, ":fixed_point"),
(set_fixed_point_multiplier, 100),
(assign, reg0, 90),
(assign, ":tangent", 0),
(assign, ":lower_bound", -89),
(assign, ":upper_bound", 90),
(try_for_range, ":angle", ":lower_bound", ":upper_bound"),
(assign, ":fixed_angle", ":angle"),
(convert_to_fixed_point, ":fixed_angle"),
(store_tan, ":tangent", ":fixed_angle"),
(try_begin),
(ge, ":tangent", ":fixed_point"),
(assign, reg0, ":angle"),
(assign, ":upper_bound", ":angle"),
(try_end),
(try_end),
]),
################# MISC functions end ##############
############## Tactical charge code ###############
#### Code corresponding to different formations ###
#### Add you own formations here. #####
##################################################################
# Notes: intending to align the following scripts the same as in string file
# and in constants assignment, so that scripts can be called by
# index instead of trying all names.
# In such case do not insert scripts in between.
# If you want to add new formations:
# Append new formation scripts right after the last formation script,
# and change module_strings.py, module_constants.py accordingly.
# All formation scripts shall take the same parameters:
# arg1: team_no, arg2:array_no, arg3: num_of_men
###################################################################
# script_formation_tactical_charge_line
# Tactical unit for charge of line formation
# Input: arg1: team_no, arg2: array_no
# Output: none
("formation_tactical_charge_line",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(call_script, "script_formation_tactical_charge_ranged", ":team_no", ":array_no"),
]
),
########DO NOT INSERT scripts here!!###############
# #### ############################################
## ## #############################################
### ##############################################
### ####### DO NOT INSERT SCRIPTS HERE!!!! #######
## ## #############################################
# #### ############################################
########DO NOT INSERT scripts here!!###############
# script_formation_tactical_charge_phalanx
# Tactical unit for charge of line formation
# Input: arg1: team_no, arg2: array_no
# Output: none
("formation_tactical_charge_phalanx",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(call_script, "script_formation_tactical_charge_generic", ":team_no", ":array_no"),
]
),
########DO NOT INSERT scripts here!!###############
# #### ############################################
## ## #############################################
### ##############################################
### ####### DO NOT INSERT SCRIPTS HERE!!!! #######
## ## #############################################
# #### ############################################
########DO NOT INSERT scripts here!!###############
# script_formation_tactical_charge_wedge
# Tactical unit for charge of line formation
# Input: arg1: team_no, arg2: array_no
# Output: none
("formation_tactical_charge_wedge",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(call_script, "script_formation_tactical_charge_cavalry", ":team_no", ":array_no"),
]
),
########DO NOT INSERT scripts here!!###############
# #### ############################################
## ## #############################################
### ##############################################
### ####### DO NOT INSERT SCRIPTS HERE!!!! #######
## ## #############################################
# #### ############################################
########DO NOT INSERT scripts here!!###############
# script_formation_tactical_charge_square
# Tactical unit for charge of line formation
# Input: arg1: team_no, arg2: array_no
# Output: none
("formation_tactical_charge_square",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(call_script, "script_formation_tactical_charge_generic", ":team_no", ":array_no"),
]
),
########DO NOT INSERT scripts here!!###############
# #### ############################################
## ## #############################################
### ##############################################
### ####### DO NOT INSERT SCRIPTS HERE!!!! #######
## ## #############################################
# #### ############################################
########DO NOT INSERT scripts here!!###############
# script_formation_tactical_charge_cantabrian_circle
# Tactical unit for charge of cantabrian_circle formation
# Input: arg1: team_no, arg2: array_no
# Output: none
("formation_tactical_charge_cantabrian_circle",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(call_script, "script_formation_tactical_charge_horse_archer", ":team_no", ":array_no"),
]
),
############# Tactical charge code end ############
################# Formations code #################
#### Code for forming formations. Add your own ####
#### formations here. #######
########DO NOT INSERT scripts here!!###############
# #### ############################################
## ## #############################################
### ##############################################
### ####### DO NOT INSERT SCRIPTS HERE!!!! #######
## ## #############################################
# #### ############################################
########DO NOT INSERT scripts here!!###############
# script_formation_line
# Calculate line formation
# Input: arg1: team_no, arg2: array_no,
# arg3: num_of_men
# Output: none
("formation_line",
[(store_script_param_1, ":team_no"),
(store_script_param_2, ":array_no"),
(store_script_param, ":num_of_men", 3),
(call_script, "script_calculate_formation_row", ":team_no", ":array_no", sfas_density_base*3, ":num_of_men", sfas_density_base*3, 0),
]
),
########DO NOT INSERT scripts here!!###############
# #### ############################################
## ## #############################################
### ##############################################
### ####### DO NOT INSERT SCRIPTS HERE!!!! #######
## ## #############################################
# #### ############################################
########DO NOT INSERT scripts here!!###############
# script_formation_phalanx
# Calculate phalanx formation
# Input: arg1: team_no, arg2: array_no,
# arg3: num_of_men
# Output: none
("formation_phalanx",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
(store_script_param, ":num_of_men", 3),
(try_begin),
(ge, ":num_of_men", 4),
(store_div, ":width", ":num_of_men", 4),
(else_try),
(assign, ":width", ":num_of_men"),
(try_end),
(call_script, "script_calculate_formation_row", ":team_no", ":array_no", sfas_density_base*3, ":width", sfas_density_base*3, 0),
]
),
########DO NOT INSERT scripts here!!###############
# #### ############################################
## ## #############################################
### ##############################################
### ####### DO NOT INSERT SCRIPTS HERE!!!! #######
## ## #############################################
# #### ############################################
########DO NOT INSERT scripts here!!###############
# script_formation_wedge
# Calculate wedge formation
# Input: arg1: team_no, arg2: array_no,
# arg3: num_of_men
# Output: none
("formation_wedge",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
#(store_script_param, ":num_of_men", 3),
(call_script, "script_calculate_formation_row", ":team_no", ":array_no", sfas_density_base*3, 1, sfas_density_base*4*3, 2),
]
),
########DO NOT INSERT scripts here!!###############
# #### ############################################
## ## #############################################
### ##############################################
### ####### DO NOT INSERT SCRIPTS HERE!!!! #######
## ## #############################################
# #### ############################################
########DO NOT INSERT scripts here!!###############
# script_formation_square
# Calculate square formation
# Input: arg1: team_no, arg2: array_no
# arg3: num_of_men
# Output: none
("formation_square",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
(store_script_param, ":num_of_men", 3),
(set_fixed_point_multiplier, 100),
(convert_to_fixed_point, ":num_of_men"),
(store_sqrt, ":width", ":num_of_men"),
(convert_from_fixed_point, ":width"),
(call_script, "script_calculate_formation_row", ":team_no", ":array_no", sfas_density_base*3, ":width", sfas_density_base*3, 0),
]
),
########DO NOT INSERT scripts here!!###############
# #### ############################################
## ## #############################################
### ##############################################
### ####### DO NOT INSERT SCRIPTS HERE!!!! #######
## ## #############################################
# #### ############################################
########DO NOT INSERT scripts here!!###############
# script_formation_cantabrian_circle
# Calculate harassing arc formation
# Input: arg1: team_no, arg2: array_no
# arg3: num_of_men
# Output: none
("formation_cantabrian_circle",
[(store_script_param, ":team_no", 1),
(store_script_param, ":array_no", 2),
(store_script_param, ":num_of_men", 3),
(set_fixed_point_multiplier, 100),
#(convert_to_fixed_point, ":num_of_men"),
#(val_div, ":num_of_men", 2),
(call_script, "script_calculate_formation_arc", ":team_no", ":array_no", sfas_density_base*1.5*3, ":num_of_men", sfas_density_base*2*3, 3),
]
),
################# Formations code end #############
################ Presentation scripts #############
#### No change should be done to code here ########
# script_update_formation_key_config_buttons
# Refresh button content in prsnt_formation_key_config
# Input: none
# Output: none
("update_formation_key_config_buttons",
concatenate_scripts([
[(party_get_slot, ":key", "p_main_party", slot_party_formation_keys_begin+y),
(try_begin),
]+concatenate_scripts([
[
(eq, ":key", all_keys_list[x][0]),
(overlay_set_text, "$g_presentation_obj_"+str(y*2+2), all_keys_list[x][1], 0),
(overlay_set_color, "$g_presentation_obj_"+str(y*2+2), 0x0),
(else_try),
] for x in range(0, len(all_keys_list))
])+[
(eq, ":key", 0xff),
(overlay_set_text, "$g_presentation_obj_"+str(y*2+2), "@Disabled"),
(overlay_set_color, "$g_presentation_obj_"+str(y*2+2), 0x800000),
(else_try),
(overlay_set_text, "$g_presentation_obj_"+str(y*2+2), "@Undefined!"),
(overlay_set_color, "$g_presentation_obj_"+str(y*2+2), 0xFF0000),
(try_end),
] for y in range(0, len(formation_keys_list)) ])+[
(party_get_slot, ":state", "p_main_party", slot_party_formation_ai_switch),
(try_begin),
(eq, ":state", 0),
(overlay_set_text, "$formation_key_config_ai_switch", "@Disabled"),
(overlay_set_color, "$formation_key_config_ai_switch", 0x800000),
(else_try),
(overlay_set_text, "$formation_key_config_ai_switch", "@Enabled"),
(overlay_set_color, "$formation_key_config_ai_switch", 0x0),
(try_end),
]
),
# script_update_formation_order_panel
# Input: arg1 = team_no
# Output: none
("update_formation_order_panel",
[(store_script_param_1, ":team_no"),
(set_fixed_point_multiplier, 1000),
(assign, ":tactical_charge", 0),
(assign, ":charge", 0),
(assign, ":fall_back", 0),
(assign, ":formation_type", 0),
(assign, ":density", 0),
(assign, ":auto_rotation", 0),
(position_set_y, pos1, 660),
]+concatenate_scripts([
[
(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(party_get_slot, ":mark", formation_vector, slot_formation_array_marks_begin+x),
(val_and, ":mark", ":array_selection"),
(try_begin),
(eq, ":mark", 0),
(overlay_set_text, "$g_presentation_array_formation_"+str(x+1), "@Dismissed"),
(overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Charging"),
(overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Scattered"),
(overlay_set_text, "$g_presentation_array_facing_"+str(x+1), "@Free"),
(else_try),
(call_script, "script_convert_to_slot_no", ":team_no", x, slot_formation_array_states),
(party_get_slot, ":array_states", formation_vector, reg0),
(store_and, ":formation_type", ":array_states", sfas_formation_type),
(store_add, ":formation_name", formation_commands_begin, ":formation_type"),
(overlay_set_text, "$g_presentation_array_formation_"+str(x+1), ":formation_name"),
(try_begin),
(store_and, ":tactical_charge", ":array_states", sfas_tactical_charge),
(neq, ":tactical_charge", 0),
(overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Charging(Tactical)"),
(else_try),
(store_and, ":charge", ":array_states", sfas_charge),
(neq, ":charge", 0),
(store_and, reg1, ":array_states", sfas_speed),
(val_div, reg1, sfas_speed_base),
(overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Charging({reg1}m/s)"),
(else_try),
(store_and, ":fall_back", ":array_states", sfas_fall_back),
(neq, ":fall_back", 0),
(store_and, reg1, ":array_states", sfas_speed),
(val_div, reg1, sfas_speed_base),
(overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Retreating({reg1}m/s)"),
(else_try),
(overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Holding"),
(try_end),
(store_and, ":density", ":array_states", sfas_formation_density),
(val_div, ":density", sfas_density_unit),
(try_begin),
(eq, ":density", 0),
(overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Densest"),
(else_try),
(eq, ":density", 1),
(overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Dense"),
(else_try),
(eq, ":density", 2),
(overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Sparse"),
(else_try),
(overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Sparsest"),
(try_end),
(store_and, ":auto_rotation", ":array_states", sfas_auto_rotate),
(try_begin),
(neq, ":auto_rotation", 0),
(overlay_set_text, "$g_presentation_array_facing_"+str(x+1), "@Toward enemies"),
(else_try),
(overlay_set_text, "$g_presentation_array_facing_"+str(x+1), "@Free"),
(try_end),
(try_end),
(set_fixed_point_multiplier, 1000),
#(position_set_x, pos2, 900),
#(position_set_y, pos2, 900),
#(position_set_x, pos1, 215),
#(overlay_set_position, "$g_presentation_array_formation_"+str(x+1), pos1),
#(overlay_set_size, "$g_presentation_array_formation_"+str(x+1), pos2),
#(position_set_x, pos1, 330),
#(overlay_set_position, "$g_presentation_array_movement_"+str(x+1), pos1),
#(overlay_set_size, "$g_presentation_array_movement_"+str(x+1), pos2),
#(position_set_x, pos1, 430),
#(overlay_set_position, "$g_presentation_array_density_"+str(x+1), pos1),
#(overlay_set_size, "$g_presentation_array_density_"+str(x+1), pos2),
#(position_set_x, pos1, 540),
#(overlay_set_position, "$g_presentation_array_facing_"+str(x+1), pos1),
#(overlay_set_size, "$g_presentation_array_facing_"+str(x+1), pos2),
#(position_move_y, pos1, -5),
] for x in range(0, formation_arrays)
])+[
]),
# script_update_formation_order_flags_on_map
# Input: none
# Output: none
("update_formation_order_flags_on_map",
[(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(get_scene_boundaries, pos2, pos3),
]+concatenate_scripts([
[
(try_begin),
(set_fixed_point_multiplier, 100),
(call_script, "script_convert_to_slot_no", ":player_team", -1, slot_formation_team_array_selection),
(party_get_slot, ":array_selection", formation_vector, reg0),
(party_get_slot, ":mark", formation_vector, slot_formation_array_marks_begin+x),
(val_and, ":mark", ":array_selection"),
(neq, ":mark", 0),
(call_script, "script_convert_to_slot_no", ":player_team", x, 0),
(store_add, ":x_slot", reg0, slot_formation_array_ref_x_pos),
(party_get_slot, ":ref_x", formation_vector, ":x_slot"),
(store_add, ":y_slot", reg0, slot_formation_array_ref_y_pos),
(party_get_slot, ":ref_y", formation_vector, ":y_slot"),
(position_set_x, pos1, ":ref_x"),
(position_set_y, pos1, ":ref_y"),
(call_script, "script_convert_3d_pos_to_map_pos"),
(overlay_set_alpha, "$g_battle_map_array_"+str(x+1)+"_flag", 0xFF),
(overlay_set_position, "$g_battle_map_array_"+str(x+1)+"_flag", pos0),
(else_try),
(overlay_set_alpha, "$g_battle_map_array_"+str(x+1)+"_flag", 0),
(try_end),
] for x in range(0, formation_arrays)
])+[
]),
# script_update_formation_order_panel_checked_arrays
# Input: none
# Output: none
("update_formation_order_panel_checked_arrays",
[#(get_player_agent_no, ":player_agent"),
#(agent_get_team, ":player_team", ":player_agent"),
]+concatenate_scripts([
[
(try_begin),
(party_get_slot, ":mark", formation_vector, slot_formation_array_marks_begin+x),
(val_and, ":mark", "$formation_array_selected"),
(neq, ":mark", 0),
(overlay_set_val, "$g_presentation_obj_"+str(x+1+formation_arrays), 1),
(overlay_animate_to_alpha, "$g_presentation_obj_"+str(x+1), 250, 0x44),
(else_try),
(overlay_set_val, "$g_presentation_obj_"+str(x+1+formation_arrays), 0),
(overlay_animate_to_alpha, "$g_presentation_obj_"+str(x+1), 250, 0),
(try_end),
] for x in range(0, formation_arrays)
])+[
]),
# script_update_formation_order_panel_statistics_and_map
# Input: none
# Output: none
("update_formation_order_panel_statistics_and_map", #TODO: Call this in every battle mission template, once per second
[(set_fixed_point_multiplier, 1000),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(get_scene_boundaries, pos2, pos3),
(try_for_agents,":cur_agent"),
(agent_is_human, ":cur_agent"),
#(agent_get_class, ":agent_class", ":cur_agent"),
(agent_get_party_id, ":agent_party", ":cur_agent"),
(agent_get_slot, ":agent_overlay", ":cur_agent", slot_agent_map_overlay_id),
(try_begin),
(eq, ":agent_party", "p_main_party"),
(try_begin),
(agent_is_alive, ":cur_agent"),
(call_script, "script_update_agent_position_on_map", ":cur_agent"),
(else_try),
(overlay_set_alpha, ":agent_overlay", 0),
(try_end),
(else_try),
(agent_is_ally, ":cur_agent"),
(try_begin),
(agent_is_alive, ":cur_agent"),
(call_script, "script_update_agent_position_on_map", ":cur_agent"),
(else_try),
(overlay_set_alpha, ":agent_overlay", 0),
(try_end),
(else_try),
(try_begin),
(agent_is_alive, ":cur_agent"),
(call_script, "script_update_agent_position_on_map", ":cur_agent"),
(else_try),
(overlay_set_alpha, ":agent_overlay", 0),
(try_end),
(try_end),
(try_end),
(store_mul, ":base", ":player_team", formation_arrays*2),
(val_add, ":base", slot_formation_tmp_maintain),
]+concatenate_scripts([
[
(store_add, ":num_slot", ":base", x),
(party_get_slot, reg1, formation_temp_vector, ":num_slot"),
(store_add, ":array_name", formation_order_panel_array_names_begin, x),
(str_store_string, s1, ":array_name"),
(overlay_set_text, "$g_presentation_obj_"+str(x+1+formation_arrays*2), "@{s1} ({reg1})"),
] for x in range(0, formation_arrays)
])+[
(call_script, "script_update_formation_order_flags_on_map"),
]),
################ Presentation scripts end #########
################ Command Cursor script ############
("cf_shift_pos1_along_y_axis_to_ground", [
(store_script_param_1, ":max_trial"),
(set_fixed_point_multiplier, 100),
(assign, ":result", 1),
(try_for_range, reg10, 0, ":max_trial"),
(position_move_y, pos1, 100),
(copy_position, pos2, pos1),
(position_set_z_to_ground_level, pos2),
(position_get_z, ":ground_level", pos2),
(position_get_x, ":x_pos", pos1),
(position_get_y, ":y_pos", pos1),
(try_begin),
(this_or_next|gt, ":x_pos", "$battle_x_max"),
(this_or_next|lt, ":x_pos", "$battle_x_min"),
(this_or_next|gt, ":y_pos", "$battle_y_max"),
(lt, ":y_pos", "$battle_y_min"),
(assign, ":result", 0), # function fails
(assign, ":max_trial", 0), # break
(try_end),
(position_get_z, ":pos1_height", pos1),
(gt, ":pos1_height", ":ground_level"),
(else_try),
# ground reached
(assign, ":max_trial", 0), # break
(try_end),
(eq, ":result", 1),
]
),
################ Command Cursor script end ########
# Form Ranks Scripts Section End
###################################################
] | Python |
file = open("module_scripts.py","r")
lines = file.readlines()
file.close()
file = open("module_scripts.py","w")
level = 0
for line in lines:
line = line.strip()
acceptableindex = line.find("#")
if (acceptableindex == -1):
acceptableindex = len(line)
level -= line.count("try_end", 0, acceptableindex)
level -= line.count("end_try", 0, acceptableindex)
level -= line.count("else_try", 0, acceptableindex)
newlevel = level
level_positive_change = 0
newlevel += line.count("else_try", 0, acceptableindex)
newlevel += line.count("(", 0, acceptableindex)
newlevel += line.count("[", 0, acceptableindex)
newlevel += line.count("try_begin", 0, acceptableindex)
newlevel += line.count("try_for", 0, acceptableindex)
level_positive_change = newlevel - level
newlevel -= line.count(")", 0, acceptableindex)
newlevel -= line.count("]", 0, acceptableindex)
if (level_positive_change == 0):
level = newlevel
for i in xrange(level):
file.write(" ")
level = newlevel
file.write("%s\n"%line)
file.close()
| Python |
icon_player = 0
icon_player_horseman = 1
icon_gray_knight = 2
icon_vaegir_knight = 3
icon_flagbearer_a = 4
icon_flagbearer_b = 5
icon_peasant = 6
icon_khergit = 7
icon_khergit_horseman_b = 8
icon_axeman = 9
icon_woman = 10
icon_woman_b = 11
icon_town = 12
icon_town_steppe = 13
icon_village_a = 14
icon_village_burnt_a = 15
icon_village_deserted_a = 16
icon_camp = 17
icon_ship = 18
icon_ship_on_land = 19
icon_castle_a = 20
icon_castle_b = 21
icon_castle_c = 22
icon_castle_d = 23
icon_town_snow = 24
icon_village_snow_a = 25
icon_village_snow_burnt_a = 26
icon_village_snow_deserted_a = 27
icon_castle_snow_a = 28
icon_castle_snow_b = 29
icon_mule = 30
icon_cattle = 31
icon_training_ground = 32
icon_bridge_a = 33
icon_bridge_b = 34
icon_bridge_snow_a = 35
icon_custom_banner_01 = 36
icon_custom_banner_02 = 37
icon_custom_banner_03 = 38
icon_banner_01 = 39
icon_banner_02 = 40
icon_banner_03 = 41
icon_banner_04 = 42
icon_banner_05 = 43
icon_banner_06 = 44
icon_banner_07 = 45
icon_banner_08 = 46
icon_banner_09 = 47
icon_banner_10 = 48
icon_banner_11 = 49
icon_banner_12 = 50
icon_banner_13 = 51
icon_banner_14 = 52
icon_banner_15 = 53
icon_banner_16 = 54
icon_banner_17 = 55
icon_banner_18 = 56
icon_banner_19 = 57
icon_banner_20 = 58
icon_banner_21 = 59
icon_banner_22 = 60
icon_banner_23 = 61
icon_banner_24 = 62
icon_banner_25 = 63
icon_banner_26 = 64
icon_banner_27 = 65
icon_banner_28 = 66
icon_banner_29 = 67
icon_banner_30 = 68
icon_banner_31 = 69
icon_banner_32 = 70
icon_banner_33 = 71
icon_banner_34 = 72
icon_banner_35 = 73
icon_banner_36 = 74
icon_banner_37 = 75
icon_banner_38 = 76
icon_banner_39 = 77
icon_banner_40 = 78
icon_banner_41 = 79
icon_banner_42 = 80
icon_banner_43 = 81
icon_banner_44 = 82
icon_banner_45 = 83
icon_banner_46 = 84
icon_banner_47 = 85
icon_banner_48 = 86
icon_banner_49 = 87
icon_banner_50 = 88
icon_banner_51 = 89
icon_banner_52 = 90
icon_banner_53 = 91
icon_banner_54 = 92
icon_banner_55 = 93
icon_banner_56 = 94
icon_banner_57 = 95
icon_banner_58 = 96
icon_banner_59 = 97
icon_banner_60 = 98
icon_banner_61 = 99
icon_banner_62 = 100
icon_banner_63 = 101
icon_banner_64 = 102
icon_banner_65 = 103
icon_banner_66 = 104
icon_banner_67 = 105
icon_banner_68 = 106
icon_banner_69 = 107
icon_banner_70 = 108
icon_banner_71 = 109
icon_banner_72 = 110
icon_banner_73 = 111
icon_banner_74 = 112
icon_banner_75 = 113
icon_banner_76 = 114
icon_banner_77 = 115
icon_banner_78 = 116
icon_banner_79 = 117
icon_banner_80 = 118
icon_banner_81 = 119
icon_banner_82 = 120
icon_banner_83 = 121
icon_banner_84 = 122
icon_banner_85 = 123
icon_banner_86 = 124
icon_banner_87 = 125
icon_banner_88 = 126
icon_banner_89 = 127
icon_banner_90 = 128
icon_banner_91 = 129
icon_banner_92 = 130
icon_banner_93 = 131
icon_banner_94 = 132
icon_banner_95 = 133
icon_banner_96 = 134
icon_banner_97 = 135
icon_banner_98 = 136
icon_banner_99 = 137
icon_banner_100 = 138
icon_banner_101 = 139
icon_banner_102 = 140
icon_banner_103 = 141
icon_banner_104 = 142
icon_banner_105 = 143
icon_banner_106 = 144
icon_banner_107 = 145
icon_banner_108 = 146
icon_banner_109 = 147
icon_banner_110 = 148
icon_banner_111 = 149
icon_banner_112 = 150
icon_banner_113 = 151
icon_banner_114 = 152
icon_banner_115 = 153
icon_banner_116 = 154
icon_banner_117 = 155
icon_banner_118 = 156
icon_banner_119 = 157
icon_banner_120 = 158
icon_banner_121 = 159
icon_banner_122 = 160
icon_banner_123 = 161
icon_banner_124 = 162
icon_banner_125 = 163
icon_banner_126 = 164
| Python |
from header_common import *
from header_operations import *
from header_parties import *
from header_items import *
from header_skills import *
from header_triggers import *
from header_troops import *
from header_music import *
from module_constants import *
####################################################################################################################
# Simple triggers are the alternative to old style triggers. They do not preserve state, and thus simpler to maintain.
#
# Each simple trigger contains the following fields:
# 1) Check interval: How frequently this trigger will be checked
# 2) Operation block: This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################
simple_triggers = [
# This trigger is deprecated. Use "script_game_event_party_encounter" in module_scripts.py instead
(ti_on_party_encounter,
[
]),
# This trigger is deprecated. Use "script_game_event_simulate_battle" in module_scripts.py instead
(ti_simulate_battle,
[
]),
(1,
[
(gt,"$auto_besiege_town",0),
(gt,"$g_player_besiege_town", 0),
(ge, "$g_siege_method", 1),
(store_current_hours, ":cur_hours"),
(eq, "$g_siege_force_wait", 0),
(ge, ":cur_hours", "$g_siege_method_finish_hours"),
(neg|is_currently_night),
(rest_for_hours, 0, 0, 0), #stop resting
]),
(0,
[
(eq,"$g_player_is_captive",1),
(gt, "$capturer_party", 0),
(party_is_active, "$capturer_party"),
(party_relocate_near_party, "p_main_party", "$capturer_party", 0),
]),
#Auto-menu
(0,
[
(try_begin),
(gt, "$g_last_rest_center", 0),
(party_get_battle_opponent, ":besieger_party", "$g_last_rest_center"),
(gt, ":besieger_party", 0),
(store_faction_of_party, ":encountered_faction", "$g_last_rest_center"),
(store_relation, ":faction_relation", ":encountered_faction", "fac_player_supporters_faction"),
(store_faction_of_party, ":besieger_party_faction", ":besieger_party"),
(store_relation, ":besieger_party_relation", ":besieger_party_faction", "fac_player_supporters_faction"),
(ge, ":faction_relation", 0),
(lt, ":besieger_party_relation", 0),
(start_encounter, "$g_last_rest_center"),
(rest_for_hours, 0, 0, 0), #stop resting
(else_try),
(store_current_hours, ":cur_hours"),
(assign, ":check", 0),
(try_begin),
(neq, "$g_check_autos_at_hour", 0),
(ge, ":cur_hours", "$g_check_autos_at_hour"),
(assign, ":check", 1),
(assign, "$g_check_autos_at_hour", 0),
(try_end),
(this_or_next|eq, ":check", 1),
(map_free),
(try_begin),
(ge,"$auto_menu",1),
(jump_to_menu,"$auto_menu"),
(assign,"$auto_menu",-1),
(else_try),
(ge,"$auto_enter_town",1),
(start_encounter, "$auto_enter_town"),
(else_try),
(ge,"$auto_besiege_town",1),
(assign, reg0, 200|opmask_variable),
#(display_message, "@content of supposed variable: {reg0}", formation_debug_color),
#(display_message, "@Error here?", formation_debug_color),
(start_encounter, "$auto_besiege_town"),
(else_try),
(ge,"$g_camp_mode", 1),
(assign, "$g_camp_mode", 0),
(assign, "$g_player_icon_state", pis_normal),
(display_message, "@Breaking camp..."),
(try_end),
(try_end),
]),
#Notification menus
(0,
[
(troop_slot_ge, "trp_notification_menu_types", 0, 1),
(troop_get_slot, ":menu_type", "trp_notification_menu_types", 0),
(troop_get_slot, "$g_notification_menu_var1", "trp_notification_menu_var1", 0),
(troop_get_slot, "$g_notification_menu_var2", "trp_notification_menu_var2", 0),
(jump_to_menu, ":menu_type"),
(assign, ":end_cond", 2),
(try_for_range, ":cur_slot", 1, ":end_cond"),
(try_begin),
(troop_slot_ge, "trp_notification_menu_types", ":cur_slot", 1),
(val_add, ":end_cond", 1),
(try_end),
(store_sub, ":cur_slot_minus_one", ":cur_slot", 1),
(troop_get_slot, ":local_temp", "trp_notification_menu_types", ":cur_slot"),
(troop_set_slot, "trp_notification_menu_types", ":cur_slot_minus_one", ":local_temp"),
(troop_get_slot, ":local_temp", "trp_notification_menu_var1", ":cur_slot"),
(troop_set_slot, "trp_notification_menu_var1", ":cur_slot_minus_one", ":local_temp"),
(troop_get_slot, ":local_temp", "trp_notification_menu_var2", ":cur_slot"),
(troop_set_slot, "trp_notification_menu_var2", ":cur_slot_minus_one", ":local_temp"),
(try_end),
]),
#Music,
(1,
[
(map_free),
(call_script, "script_music_set_situation_with_culture", mtf_sit_travel),
]),
#Player raiding a village
# This trigger will check if player's raid has been completed and will lead control to village menu.
(1,
[
(ge,"$g_player_raiding_village",1),
(try_begin),
(neq, "$g_player_is_captive", 0),
(rest_for_hours, 0, 0, 0), #stop resting - abort
(assign,"$g_player_raiding_village",0),
(else_try),
(map_free), #we have been attacked during raid
(assign,"$g_player_raiding_village",0),
(else_try),
(this_or_next|party_slot_eq, "$g_player_raiding_village", slot_village_state, svs_looted),
(party_slot_eq, "$g_player_raiding_village", slot_village_state, svs_deserted),
(start_encounter, "$g_player_raiding_village"),
(rest_for_hours, 0),
(assign,"$g_player_raiding_village",0),
(assign,"$g_player_raid_complete",1),
(else_try),
(party_slot_eq, "$g_player_raiding_village", slot_village_state, svs_being_raided),
(rest_for_hours, 3, 5, 1), #rest while attackable
(else_try),
(rest_for_hours, 0, 0, 0), #stop resting - abort
(assign,"$g_player_raiding_village",0),
(assign,"$g_player_raid_complete",0),
(try_end),
]),
#Pay day.
(24 * 7,
[
(call_script, "script_calculate_player_faction_wage"),
(assign, ":total_wages", reg0),
(store_add, ":total_debt", ":total_wages", "$g_player_debt_to_party_members"),
(try_begin),
(gt, ":total_debt", 0),
(jump_to_menu,"mnu_pay_day"),
(try_end),
(assign, "$g_cur_week_half_daily_wage_payments", 0),#Reseting the weekly half wage payments
]),
#Mercenary Pay day.
(6,
[
(store_current_hours, ":cur_hours"),
(try_begin),
(ge, ":cur_hours", "$mercenary_service_next_pay_time"),
(call_script, "script_party_calculate_strength", "p_main_party", 0),
(assign, ":offer_value", reg0),
(val_div, ":offer_value", 2),
(val_add, ":offer_value", 30),
(call_script, "script_round_value", ":offer_value"),
(val_add, "$mercenary_service_accumulated_pay", reg0),
(store_add, "$mercenary_service_next_pay_time", ":cur_hours", 7 * 24),
(try_end),
]),
# Oath fulfilled?
(24,
[
(le, "$auto_menu", 0),
(gt, "$players_kingdom", 0),
(neq, "$players_kingdom", "fac_player_supporters_faction"),
(eq, "$player_has_homage", 0),
(store_current_day, ":cur_day"),
(gt, ":cur_day", "$mercenary_service_next_renew_day"),
(jump_to_menu, "mnu_oath_fulfilled"),
]),
# Reducing luck by 1 in every 180 hours
(180,
[
(val_sub, "$g_player_luck", 1),
(val_max, "$g_player_luck", 0),
]),
# Banner selection menu
(24,
[
(eq, "$g_player_banner_granted", 1),
(troop_slot_eq, "trp_player", slot_troop_banner_scene_prop, 0),
(le,"$auto_menu",0),
#normal_banner_begin
(start_presentation, "prsnt_banner_selection"),
#custom_banner_begin
# (start_presentation, "prsnt_custom_banner"),
]),
# Party Morale: Move morale towards target value.
(24,
[
(call_script, "script_get_player_party_morale_values"),
(assign, ":target_morale", reg0),
(party_get_morale, ":cur_morale", "p_main_party"),
(store_sub, ":dif", ":target_morale", ":cur_morale"),
(store_div, ":dif_to_add", ":dif", 5),
(store_mul, ":dif_to_add_correction", ":dif_to_add", 5),
(try_begin),#finding ceiling of the value
(neq, ":dif_to_add_correction", ":dif"),
(try_begin),
(gt, ":dif", 0),
(val_add, ":dif_to_add", 1),
(else_try),
(val_sub, ":dif_to_add", 1),
(try_end),
(try_end),
(val_add, ":cur_morale", ":dif_to_add"),
(party_set_morale, "p_main_party", ":cur_morale"),
]),
#Party AI: pruning some of the prisoners in each center (once a week)
(24*7,
[
(try_for_range, ":center_no", centers_begin, centers_end),
(party_get_num_prisoner_stacks, ":num_prisoner_stacks",":center_no"),
(try_for_range_backwards, ":stack_no", 0, ":num_prisoner_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop",":center_no",":stack_no"),
(neg|troop_is_hero, ":stack_troop"),
(party_prisoner_stack_get_size, ":stack_size",":center_no",":stack_no"),
(store_random_in_range, ":rand_no", 0, 40),
(val_mul, ":stack_size", ":rand_no"),
(val_div, ":stack_size", 100),
(party_remove_prisoners, ":center_no", ":stack_troop", ":stack_size"),
(try_end),
(try_end),
]),
#Adding net incomes to heroes (once a week)
#Increasing debts to heroes by 1% (once a week)
#Adding net incomes to centers (once a week)
(24*7,
[
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_get_slot, ":cur_debt", ":troop_no", slot_troop_player_debt),#Increasing debt
(val_mul, ":cur_debt", 101),
(val_div, ":cur_debt", 100),
(troop_set_slot, ":troop_no", slot_troop_player_debt, ":cur_debt"),
(call_script, "script_calculate_hero_weekly_net_income_and_add_to_wealth", ":troop_no"),#Adding net income
(try_end),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
#If non-player center, adding income to wealth
(neg|party_slot_eq, ":center_no", slot_town_lord, "trp_player"), #center does not belong to player.
(party_slot_ge, ":center_no", slot_town_lord, 1), #center belongs to someone.
(party_get_slot, ":cur_wealth", ":center_no", slot_town_wealth),
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(store_mul, ":added_wealth", ":prosperity", 15),
(val_add, ":added_wealth", 700),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(val_mul, ":added_wealth", 3),
(val_div, ":added_wealth", 2),
(try_end),
(val_add, ":cur_wealth", ":added_wealth"),
(call_script, "script_calculate_weekly_party_wage", ":center_no"),
(val_sub, ":cur_wealth", reg0),
(val_max, ":cur_wealth", 0),
(party_set_slot, ":center_no", slot_town_wealth, ":cur_wealth"),
(try_end),
]),
#Hiring men with hero wealths (once a day)
#Hiring men with center wealths (once a day)
(24,
[
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(ge, ":party_no", 1),
(party_get_attached_to, ":cur_attached_party", ":party_no"),
(is_between, ":cur_attached_party", centers_begin, centers_end),
(party_slot_eq, ":cur_attached_party", slot_center_is_besieged_by, -1), #center not under siege
(call_script, "script_hire_men_to_kingdom_hero_party", ":troop_no"), #Hiring men with current wealth
(try_end),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(neg|party_slot_eq, ":center_no", slot_town_lord, "trp_player"), #center does not belong to player.
(party_slot_ge, ":center_no", slot_town_lord, 1), #center belongs to someone.
(party_get_slot, ":cur_wealth", ":center_no", slot_town_wealth),
(party_slot_eq, ":center_no", slot_center_is_besieged_by, -1), #center not under siege
(assign, ":hiring_budget", ":cur_wealth"),
(val_div, ":hiring_budget", 5),
(gt, ":hiring_budget", reinforcement_cost),
(call_script, "script_cf_reinforce_party", ":center_no"),
(val_sub, ":cur_wealth", reinforcement_cost),
(party_set_slot, ":center_no", slot_town_wealth, ":cur_wealth"),
(try_end),
]),
#Converging center prosperity to ideal prosperity once in every 15 days
(24*15,
[(try_for_range, ":center_no", centers_begin, centers_end),
(call_script, "script_get_center_ideal_prosperity", ":center_no"),
(assign, ":ideal_prosperity", reg0),
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(try_begin),
(gt, ":prosperity", ":ideal_prosperity"),
(call_script, "script_change_center_prosperity", ":center_no", -1),
(else_try),
(lt, ":prosperity", ":ideal_prosperity"),
(call_script, "script_change_center_prosperity", ":center_no", 1),
(try_end),
(try_end),
]),
#Checking if the troops are resting at a half payment point
(6,
[(store_current_day, ":cur_day"),
(try_begin),
(neq, ":cur_day", "$g_last_half_payment_check_day"),
(assign, "$g_last_half_payment_check_day", ":cur_day"),
(try_begin),
(eq, "$g_half_payment_checkpoint", 1),
(val_add, "$g_cur_week_half_daily_wage_payments", 1), #half payment for yesterday
(try_end),
(assign, "$g_half_payment_checkpoint", 1),
(try_end),
(assign, ":resting_at_manor_or_walled_center", 0),
(try_begin),
(neg|map_free),
(ge, "$g_last_rest_center", 0),
(this_or_next|party_slot_eq, "$g_last_rest_center", slot_center_has_manor, 1),
(is_between, "$g_last_rest_center", walled_centers_begin, walled_centers_end),
(assign, ":resting_at_manor_or_walled_center", 1),
(try_end),
(eq, ":resting_at_manor_or_walled_center", 0),
(assign, "$g_half_payment_checkpoint", 0),
]),
# Give some xp to hero parties
(48,
[
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 30),
(troop_get_slot, ":hero_party", ":troop_no", slot_troop_leaded_party),
(gt, ":hero_party", centers_end),
(party_is_active, ":hero_party"),
(store_skill_level, ":trainer_level", skl_trainer, ":troop_no"),
(val_add, ":trainer_level", 2),
(store_mul, ":xp_gain", ":trainer_level", 500),
(party_upgrade_with_xp, ":hero_party", ":xp_gain"),
(try_end),
#################################
# Form Ranks kit section
#
(assign, ":xp_accum", 0),
(party_get_num_attached_parties, ":num", "p_main_party"),
(try_for_range, ":i", 0, ":num"),
#(store_add, ":array", ":i", 1),
(store_add, ":slot", slot_party_array_parties_begin, ":i"),
(val_add, ":slot", 1),
(party_get_slot, ":array_party", "p_main_party", ":slot"),
(party_get_skill_level, ":party_trainer", ":array_party", skl_trainer),
(party_get_num_companions, ":size", ":array_party"),
(store_mul, ":xp_gain", ":size", ":party_trainer"),
(val_mul, ":xp_gain", 5),
(party_upgrade_with_xp, ":array_party", ":xp_gain"),
(val_add, ":xp_accum", ":xp_gain"),
(try_end),
(try_begin),
(neq, ":xp_accum", 0),
(assign, reg0, ":xp_accum"),
(display_message, "@Other battles gain {reg0} experience in total by training."),
(try_end),
#
# Form Ranks kit section end
#################################
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 10),
(party_get_slot, ":center_lord", ":center_no", slot_town_lord),
(neq, ":center_lord", "trp_player"),
(party_upgrade_with_xp, ":center_no", 3000),
(try_end),
]),
# Process sieges
(24,
[
(call_script, "script_process_sieges"),
]),
# Process village raids
(2,
[
(call_script, "script_process_village_raids"),
]),
# Decide vassal ai
(7,
[
(call_script, "script_init_ai_calculation"),
(call_script, "script_decide_kingdom_party_ais"),
]),
# Hold regular marshall elections for players_kingdom
(24,
[
(val_add, "$g_election_date", 1),
(ge, "$g_election_date", 90),
(is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
(neq, "$players_kingdom", "fac_player_supporters_faction"),
(assign, "$g_presentation_input", -1),
(assign, "$g_presentation_marshall_selection_1_vote", 0),
(assign, "$g_presentation_marshall_selection_2_vote", 0),
(assign, "$g_presentation_marshall_selection_max_renown_1", -10000),
(assign, "$g_presentation_marshall_selection_max_renown_2", -10000),
(assign, "$g_presentation_marshall_selection_max_renown_3", -10000),
(assign, "$g_presentation_marshall_selection_max_renown_1_troop", -10000),
(assign, "$g_presentation_marshall_selection_max_renown_2_troop", -10000),
(assign, "$g_presentation_marshall_selection_max_renown_3_troop", -10000),
(assign, ":num_men", 0),
(try_for_range, ":loop_var", "trp_kingdom_heroes_including_player_begin", kingdom_heroes_end),
(assign, ":cur_troop", ":loop_var"),
(assign, ":continue", 0),
(try_begin),
(eq, ":loop_var", "trp_kingdom_heroes_including_player_begin"),
(assign, ":cur_troop", "trp_player"),
(try_begin),
(eq, "$g_player_is_captive", 0),
(assign, ":continue", 1),
(try_end),
(else_try),
(store_troop_faction, ":cur_troop_faction", ":cur_troop"),
(eq, "$players_kingdom", ":cur_troop_faction"),
#(troop_slot_eq, ":cur_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":cur_troop", slot_troop_prisoner_of_party, 0),
(troop_slot_ge, ":cur_troop", slot_troop_leaded_party, 1),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(neg|faction_slot_eq, ":cur_troop_faction", slot_faction_leader, ":cur_troop"),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(gt, ":cur_party", 0),
(party_is_active, ":cur_party"),
(call_script, "script_party_count_fit_for_battle", ":cur_party"),
(assign, ":party_fit_for_battle", reg0),
(call_script, "script_party_get_ideal_size", ":cur_party"),
(assign, ":ideal_size", reg0),
(store_mul, ":relative_strength", ":party_fit_for_battle", 100),
(val_div, ":relative_strength", ":ideal_size"),
(ge, ":relative_strength", 25),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(val_add, ":num_men", 1),
(troop_get_slot, ":renown", ":cur_troop", slot_troop_renown),
(try_begin),
(gt, ":renown", "$g_presentation_marshall_selection_max_renown_1"),
(assign, "$g_presentation_marshall_selection_max_renown_3", "$g_presentation_marshall_selection_max_renown_2"),
(assign, "$g_presentation_marshall_selection_max_renown_2", "$g_presentation_marshall_selection_max_renown_1"),
(assign, "$g_presentation_marshall_selection_max_renown_1", ":renown"),
(assign, "$g_presentation_marshall_selection_max_renown_3_troop", "$g_presentation_marshall_selection_max_renown_2_troop"),
(assign, "$g_presentation_marshall_selection_max_renown_2_troop", "$g_presentation_marshall_selection_max_renown_1_troop"),
(assign, "$g_presentation_marshall_selection_max_renown_1_troop", ":cur_troop"),
(else_try),
(gt, ":renown", "$g_presentation_marshall_selection_max_renown_2"),
(assign, "$g_presentation_marshall_selection_max_renown_3", "$g_presentation_marshall_selection_max_renown_2"),
(assign, "$g_presentation_marshall_selection_max_renown_2", ":renown"),
(assign, "$g_presentation_marshall_selection_max_renown_3_troop", "$g_presentation_marshall_selection_max_renown_2_troop"),
(assign, "$g_presentation_marshall_selection_max_renown_2_troop", ":cur_troop"),
(else_try),
(gt, ":renown", "$g_presentation_marshall_selection_max_renown_3"),
(assign, "$g_presentation_marshall_selection_max_renown_3", ":renown"),
(assign, "$g_presentation_marshall_selection_max_renown_3_troop", ":cur_troop"),
(try_end),
(try_end),
(ge, "$g_presentation_marshall_selection_max_renown_1_troop", 0),
(ge, "$g_presentation_marshall_selection_max_renown_2_troop", 0),
(ge, "$g_presentation_marshall_selection_max_renown_3_troop", 0),
(gt, ":num_men", 2), #at least 1 voter
(assign, "$g_election_date", 0),
(assign, "$g_presentation_marshall_selection_ended", 0),
(try_begin),
(neq, "$g_presentation_marshall_selection_max_renown_1_troop", "trp_player"),
(neq, "$g_presentation_marshall_selection_max_renown_2_troop", "trp_player"),
(start_presentation, "prsnt_marshall_selection"),
(else_try),
(jump_to_menu, "mnu_marshall_selection_candidate_ask"),
(try_end),
]),
# Changing readiness to join army
(10,
[
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(assign, ":modifier", 1),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(try_begin),
(gt, ":party_no", 0),
(party_get_slot, ":commander_party", ":party_no", slot_party_commander_party),
(ge, ":commander_party", 0),
(store_faction_of_party, ":faction_no", ":party_no"),
(faction_get_slot, ":faction_marshall", ":faction_no", slot_faction_marshall),
(ge, ":faction_marshall", 0),
(troop_get_slot, ":marshall_party", ":faction_marshall", slot_troop_leaded_party),
(eq, ":commander_party", ":marshall_party"),
(assign, ":modifier", -1),
(try_end),
(troop_get_slot, ":readiness", ":troop_no", slot_troop_readiness_to_join_army),
(val_add, ":readiness", ":modifier"),
(val_clamp, ":readiness", 0, 100),
(troop_set_slot, ":troop_no", slot_troop_readiness_to_join_army, ":readiness"),
(assign, ":modifier", 1),
(try_begin),
(gt, ":party_no", 0),
(store_troop_faction, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", "fac_player_supporters_faction"),
(neg|troop_slot_eq, ":troop_no", slot_troop_player_order_state, spai_undefined),
(party_get_slot, ":party_ai_state", ":party_no", slot_party_ai_state),
(party_get_slot, ":party_ai_object", ":party_no", slot_party_ai_object),
#Check if party is following player orders
(try_begin),
(troop_slot_eq, ":troop_no", slot_troop_player_order_state, ":party_ai_state"),
(troop_slot_eq, ":troop_no", slot_troop_player_order_object, ":party_ai_object"),
(assign, ":modifier", -1),
(else_try),
#Leaving following player orders if the current party order is not the same.
(troop_set_slot, ":troop_no", slot_troop_player_order_state, spai_undefined),
(troop_set_slot, ":troop_no", slot_troop_player_order_object, -1),
(try_end),
(try_end),
(troop_get_slot, ":readiness", ":troop_no", slot_troop_readiness_to_follow_orders),
(val_add, ":readiness", ":modifier"),
(val_clamp, ":readiness", 0, 100),
(troop_set_slot, ":troop_no", slot_troop_readiness_to_follow_orders, ":readiness"),
(try_begin),
(lt, ":readiness", 10),
(troop_set_slot, ":troop_no", slot_troop_player_order_state, spai_undefined),
(troop_set_slot, ":troop_no", slot_troop_player_order_object, -1),
(try_end),
(try_end),
]),
# Process vassal ai
(2,
[
(call_script, "script_process_kingdom_parties_ai"),
]),
# Process alarms
(3,
[
(call_script, "script_process_alarms"),
]),
# Process siege ai
(3,
[
(store_current_hours, ":cur_hours"),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(party_get_slot, ":besieger_party", ":center_no", slot_center_is_besieged_by),
(gt, ":besieger_party", 0),
(party_is_active, ":besieger_party"),
(store_faction_of_party, ":besieger_faction", ":besieger_party"),
(party_slot_ge, ":center_no", slot_center_is_besieged_by, 1),
(party_get_slot, ":siege_begin_hours", ":center_no", slot_center_siege_begin_hours),
(store_sub, ":siege_begin_hours", ":cur_hours", ":siege_begin_hours"),
(assign, ":launch_attack", 0),
(assign, ":call_attack_back", 0),
(assign, ":attacker_strength", 0),
(assign, ":marshall_attacking", 0),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(gt, ":party_no", 0),
(store_troop_faction, ":troop_faction_no", ":troop_no"),
(eq, ":troop_faction_no", ":besieger_faction"),
(assign, ":continue", 0),
(try_begin),
(party_slot_eq, ":party_no", slot_party_ai_state, spai_besieging_center),
(party_slot_eq, ":party_no", slot_party_ai_object, ":center_no"),
(assign, ":continue", 1),
(else_try),
(party_get_slot, ":commander_party", ":party_no", slot_party_commander_party),
(gt, ":commander_party", 0),
(party_is_active, ":commander_party"),
(party_slot_eq, ":commander_party", slot_party_ai_state, spai_besieging_center),
(party_slot_eq, ":commander_party", slot_party_ai_object, ":center_no"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(party_get_battle_opponent, ":opponent", ":party_no"),
(this_or_next|lt, ":opponent", 0),
(eq, ":opponent", ":center_no"),
(try_begin),
(faction_slot_eq, ":besieger_faction", slot_faction_marshall, ":troop_no"),
(assign, ":marshall_attacking", 1),
(try_end),
(call_script, "script_party_calculate_regular_strength", ":party_no"),
(val_add, ":attacker_strength", reg0),
(try_end),
(try_begin),
(gt, ":attacker_strength", 0),
(party_collect_attachments_to_party, ":center_no", "p_collective_enemy"),
(call_script, "script_party_calculate_regular_strength", "p_collective_enemy"),
(assign, ":defender_strength", reg0),
(try_begin),
(eq, "$auto_enter_town", ":center_no"),
(eq, "$g_player_is_captive", 0),
(call_script, "script_party_calculate_regular_strength", "p_main_party"),
(val_add, ":defender_strength", reg0),
(val_mul, ":attacker_strength", 2), #double the power of attackers if the player is in the campaign
(try_end),
(party_get_slot, ":siege_hardness", ":center_no", slot_center_siege_hardness),
(val_add, ":siege_hardness", 100),
(val_mul, ":defender_strength", ":siege_hardness"),
(val_div, ":defender_strength", 100),
(val_max, ":defender_strength", 1),
(try_begin),
(eq, ":marshall_attacking", 1),
(eq, ":besieger_faction", "$players_kingdom"),
(check_quest_active, "qst_follow_army"),
(val_mul, ":attacker_strength", 2), #double the power of attackers if the player is in the campaign
(try_end),
(store_mul, ":strength_ratio", ":attacker_strength", 100),
(val_div, ":strength_ratio", ":defender_strength"),
(store_sub, ":random_up_limit", ":strength_ratio", 300),
(try_begin),
(gt, ":random_up_limit", -100), #never attack if the strength ratio is less than 200%
(store_div, ":siege_begin_hours_effect", ":siege_begin_hours", 3),
(val_add, ":random_up_limit", ":siege_begin_hours_effect"),
(try_end),
(val_div, ":random_up_limit", 5),
(val_max, ":random_up_limit", 0),
(store_sub, ":random_down_limit", 200, ":strength_ratio"),
(val_max, ":random_down_limit", 0),
(try_begin),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", ":random_up_limit"),
(gt, ":siege_begin_hours", 24),#initial preparation
(assign, ":launch_attack", 1),
(else_try),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", ":random_down_limit"),
(assign, ":call_attack_back", 1),
(try_end),
(else_try),
(assign, ":call_attack_back", 1),
(try_end),
(try_begin),
(eq, ":launch_attack", 1),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(gt, ":party_no", 0),
(assign, ":continue", 0),
(try_begin),
(party_slot_eq, ":party_no", slot_party_ai_state, spai_besieging_center),
(party_slot_eq, ":party_no", slot_party_ai_object, ":center_no"),
(party_slot_eq, ":party_no", slot_party_ai_substate, 0),
(assign, ":continue", 1),
(else_try),
(party_get_slot, ":commander_party", ":party_no", slot_party_commander_party),
(gt, ":commander_party", 0),
(party_is_active, ":commander_party"),
(party_slot_eq, ":commander_party", slot_party_ai_state, spai_besieging_center),
(party_slot_eq, ":commander_party", slot_party_ai_object, ":center_no"),
(call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, ":center_no"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(party_set_ai_behavior, ":party_no", ai_bhvr_attack_party),
(party_set_ai_object, ":party_no", ":center_no"),
(party_set_flags, ":party_no", pf_default_behavior, 1),
(party_set_slot, ":party_no", slot_party_ai_substate, 1),
(try_end),
(else_try),
(eq, ":call_attack_back", 1),
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(gt, ":party_no", 0),
(party_slot_eq, ":party_no", slot_party_ai_state, spai_besieging_center),
(party_slot_eq, ":party_no", slot_party_ai_object, ":center_no"),
(party_slot_eq, ":party_no", slot_party_ai_substate, 1),
(call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
(call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, ":center_no"),
#resetting siege begin time if at least 1 party retreats
(party_set_slot, ":center_no", slot_center_siege_begin_hours, ":cur_hours"),
(try_end),
(try_end),
(try_end),
]),
# Decide faction ai
(36,
[
(assign, "$g_recalculate_ais", 1),
]),
# Decide faction ai flag check
(0,
[
(eq, "$g_recalculate_ais", 1),
(assign, "$g_recalculate_ais", 0),
(call_script, "script_recalculate_ais"),
]),
# Count faction armies
(24,
[
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(call_script, "script_faction_recalculate_strength", ":faction_no"),
(try_end),
]),
# Reset hero quest status
# Change hero relation
(36,
[
(try_for_range, ":troop_no", heroes_begin, heroes_end),
(troop_set_slot, ":troop_no", slot_troop_does_not_give_quest, 0),
(try_end),
(try_for_range, ":troop_no", village_elders_begin, village_elders_end),
(troop_set_slot, ":troop_no", slot_troop_does_not_give_quest, 0),
(try_end),
]),
# Refresh merchant inventories
(24,
[
(try_for_range, ":village_no", villages_begin, villages_end),
(call_script, "script_refresh_village_merchant_inventory", ":village_no"),
(try_end),
]),
#Refreshing village defenders
#Clearing slot_village_player_can_not_steal_cattle flags
(48,
[
(try_for_range, ":village_no", villages_begin, villages_end),
(call_script, "script_refresh_village_defenders", ":village_no"),
(party_set_slot, ":village_no", slot_village_player_can_not_steal_cattle, 0),
(try_end),
]),
# Refresh number of cattle in villages
(24,
[(try_for_range, ":village_no", villages_begin, villages_end),
(party_get_slot, ":num_cattle", ":village_no", slot_village_number_of_cattle),
(store_random_in_range, ":random_no", 0, 100),
(try_begin),
(lt, ":random_no", 3),#famine
(assign, ":num_cattle", 0),
(try_begin),
# (eq, "$cheat_mode", 1),
# (str_store_party_name, s1, ":village_no"),
# (display_message, "@Cattle in {s1} are exterminated due to famine."),
(try_end),
(else_try),
(lt, ":random_no", 10),#double growth
(store_random_in_range, ":random_no", 111, 121),
(val_mul, ":num_cattle", ":random_no"),
(val_div, ":num_cattle", 100),
(store_random_in_range, ":random_no", 1, 3),
(val_add, ":num_cattle", ":random_no"),
(else_try),
(lt, ":random_no", 50),#negative growth
(store_random_in_range, ":random_no", 3, 8),
(val_sub, ":num_cattle", ":random_no"),
(else_try),#positive growth
(store_random_in_range, ":random_no", 101, 111),
(val_mul, ":num_cattle", ":random_no"),
(val_div, ":num_cattle", 100),
(store_random_in_range, ":random_no", 1, 3),
(val_add, ":num_cattle", ":random_no"),
(try_end),
(val_clamp, ":num_cattle", 0, 101),
(party_set_slot, ":village_no", slot_village_number_of_cattle, ":num_cattle"),
#Reassigning the cattle production in the village
(store_sub, ":production", ":num_cattle", 10),
(val_div, ":production", 2),
(call_script, "script_center_change_trade_good_production", ":village_no", "itm_cattle_meat", ":production", 0),
(try_end),
]),
# Accumulate taxes
(24 * 7,
[
(try_for_range, ":center_no", centers_begin, centers_end),
(party_get_slot, ":accumulated_rents", ":center_no", slot_center_accumulated_rents),
(assign, ":cur_rents", 0),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(try_begin),
(party_slot_eq, ":center_no", slot_village_state, svs_normal),
(assign, ":cur_rents", 500),
(try_end),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(assign, ":cur_rents", 250),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(assign, ":cur_rents", 1000),
(try_end),
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(store_add, ":multiplier", 10, ":prosperity"),
(val_mul, ":cur_rents", ":multiplier"),
(val_div, ":cur_rents", 110),#Prosperity of 100 gives the default values
(val_add, ":accumulated_rents", ":cur_rents"),
(party_set_slot, ":center_no", slot_center_accumulated_rents, ":accumulated_rents"),
(try_end),
#Adding earnings to town lords' wealths.
(try_for_range, ":center_no", centers_begin, centers_end),
(party_get_slot, ":town_lord", ":center_no", slot_town_lord),
(neq, ":town_lord", "trp_player"),
(is_between, ":town_lord", kingdom_heroes_begin, kingdom_heroes_end),
(party_get_slot, ":accumulated_rents", ":center_no", slot_center_accumulated_rents),
(party_get_slot, ":accumulated_tariffs", ":center_no", slot_center_accumulated_tariffs),
(troop_get_slot, ":troop_wealth", ":town_lord", slot_troop_wealth),
(val_add, ":troop_wealth", ":accumulated_rents"),
(val_add, ":troop_wealth", ":accumulated_tariffs"),
(troop_set_slot, ":town_lord", slot_troop_wealth, ":troop_wealth"),
(party_set_slot, ":center_no", slot_center_accumulated_rents, 0),
(party_set_slot, ":center_no", slot_center_accumulated_tariffs, 0),
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg1, ":troop_wealth"),
(add_troop_note_from_sreg, ":town_lord", 1, "@Current wealth: {reg1}", 0),
(try_end),
(try_end),
]),
# (7 * 24,
# [
## (call_script, "script_get_number_of_unclaimed_centers_by_player"),
## (assign, ":unclaimed_centers", reg0),
## (gt, ":unclaimed_centers", 0),
# You are holding an estate without a lord.
# (try_for_range, ":troop_no", heroes_begin, heroes_end),
# (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
# (troop_get_slot, ":relation", ":troop_no", slot_troop_player_relation),
# (val_sub, ":relation", 1),
# (val_max, ":relation", -100),
# (troop_set_slot, ":troop_no", slot_troop_player_relation, ":relation"),
# (try_end),
# You relation with all kingdoms other than your own has decreased by 1.
# (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
# (neq, ":faction_no", "$players_kingdom"),
# (store_relation,":faction_relation",":faction_no","fac_player_supporters_faction"),
# (val_sub, ":faction_relation", 1),
# (val_max, ":faction_relation", -100),
# WARNING: Never use set_relation!
# (set_relation, ":faction_no", "fac_player_supporters_faction", ":faction_relation"),
# (try_end),
# ]),
# Offer player to join faction
(32,
[
(eq, "$players_kingdom", 0),
(le, "$g_invite_faction", 0),
(eq, "$g_player_is_captive", 0),
(store_random_in_range, ":kingdom_no", kingdoms_begin, kingdoms_end),
(assign, ":min_distance", 999999),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", ":kingdom_no"),
(store_distance_to_party_from_party, ":cur_distance", "p_main_party", ":center_no"),
(val_min, ":min_distance", ":cur_distance"),
(try_end),
(lt, ":min_distance", 30),
(store_relation, ":kingdom_relation", ":kingdom_no", "fac_player_supporters_faction"),
(faction_get_slot, ":kingdom_lord", ":kingdom_no", slot_faction_leader),
(call_script, "script_troop_get_player_relation", ":kingdom_lord"),
(assign, ":lord_relation", reg0),
#(troop_get_slot, ":lord_relation", ":kingdom_lord", slot_troop_player_relation),
(call_script, "script_get_number_of_hero_centers", "trp_player"),
(assign, ":num_centers_owned", reg0),
(try_begin),
(eq, ":num_centers_owned", 0),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(ge, ":player_renown", 160),
(ge, ":kingdom_relation", 0),
(ge, ":lord_relation", 0),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 50),
(call_script, "script_get_poorest_village_of_faction", ":kingdom_no"),
(assign, "$g_invite_offered_center", reg0),
(ge, "$g_invite_offered_center", 0),
(assign, "$g_invite_faction", ":kingdom_no"),
(jump_to_menu, "mnu_invite_player_to_faction"),
(else_try),
(gt, ":num_centers_owned", 0),
(neq, "$players_oath_renounced_against_kingdom", ":kingdom_no"),
(ge, ":kingdom_relation", -80),
(ge, ":lord_relation", -30),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 20),
(assign, "$g_invite_faction", ":kingdom_no"),
(assign, "$g_invite_offered_center", -1),
(jump_to_menu, "mnu_invite_player_to_faction_without_center"),
(try_end),
]),
# Change kingdom relations
(24 * 7,
[(call_script, "script_randomly_start_war_peace", 1),
]),
# During rebellion, removing troops from player faction randomly because of low relation points
(5,
[
(gt, "$supported_pretender", 0),
(try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end),
(store_troop_faction, ":cur_faction", ":cur_troop"),
(eq, ":cur_faction", "fac_player_supporters_faction"),
(neg|troop_slot_ge, ":cur_troop", slot_troop_change_to_faction, 1),
(call_script, "script_troop_get_player_relation", ":cur_troop"),
(assign, ":player_relation", reg0),
#(troop_get_slot, ":player_relation", ":cur_troop", slot_troop_player_relation),
(lt, ":player_relation", -5),
(neq, "$supported_pretender", ":cur_troop"),
(val_mul, ":player_relation", -1),
(val_sub, ":player_relation", 5),
(store_random_in_range, ":random_no", 0, 2000),
(lt, ":random_no", ":player_relation"),
(call_script, "script_cf_get_random_active_faction_except_player_faction_and_faction", -1),
(troop_set_slot, ":cur_troop", slot_troop_change_to_faction, reg0),
(try_end),
]),
# Reset kingdom lady current centers
## (28,
## [
## (try_for_range, ":troop_no", heroes_begin, heroes_end),
## (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_lady),
##
## # Find the active quest ladies
## (assign, ":not_ok", 0),
## (try_for_range, ":quest_no", lord_quests_begin, lord_quests_end),
## (eq, ":not_ok", 0),
## (check_quest_active, ":quest_no"),
## (quest_slot_eq, ":quest_no", slot_quest_object_troop, ":troop_no"),
## (assign, ":not_ok", 1),
## (try_end),
## (eq, ":not_ok", 0),
##
## (troop_get_slot, ":troop_center", ":troop_no", slot_troop_cur_center),
## (assign, ":is_under_siege", 0),
## (try_begin),
## (is_between, ":troop_center", walled_centers_begin, walled_centers_end),
## (party_get_battle_opponent, ":besieger_party", ":troop_center"),
## (gt, ":besieger_party", 0),
## (assign, ":is_under_siege", 1),
## (try_end),
##
## (eq, ":is_under_siege", 0),# Omit ladies in centers under siege
##
## (try_begin),
## (store_random_in_range, ":random_num",0, 100),
## (lt, ":random_num", 20),
## (store_troop_faction, ":cur_faction", ":troop_no"),
## (call_script, "script_cf_select_random_town_with_faction", ":cur_faction"),#Can fail
## (troop_set_slot, ":troop_no", slot_troop_cur_center, reg0),
## (try_end),
##
## (store_random_in_range, ":random_num",0, 100),
## (lt, ":random_num", 50),
## (troop_get_slot, ":lord_no", ":troop_no", slot_troop_father),
## (try_begin),
## (eq, ":lord_no", 0),
## (troop_get_slot, ":lord_no", ":troop_no", slot_troop_spouse),
## (try_end),
## (gt, ":lord_no", 0),
## (troop_get_slot, ":cur_party", ":lord_no", slot_troop_leaded_party),
## (gt, ":cur_party", 0),
## (party_get_attached_to, ":cur_center", ":cur_party"),
## (gt, ":cur_center", 0),
##
## (troop_set_slot, ":troop_no", slot_troop_cur_center, ":cur_center"),
## (try_end),
## ]),
# Attach Lord Parties to the town they are in
(0.1,
[
(try_for_range, ":troop_no", heroes_begin, heroes_end),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":troop_party_no", ":troop_no", slot_troop_leaded_party),
(ge, ":troop_party_no", 1),
(party_get_attached_to, ":cur_attached_town", ":troop_party_no"),
(lt, ":cur_attached_town", 1),
(party_get_cur_town, ":destination", ":troop_party_no"),
(is_between, ":destination", centers_begin, centers_end),
(call_script, "script_get_relation_between_parties", ":destination", ":troop_party_no"),
(try_begin),
(ge, reg0, 0),
(party_attach_to_party, ":troop_party_no", ":destination"),
(else_try),
(party_set_ai_behavior, ":troop_party_no", ai_bhvr_hold),
(try_end),
(try_begin),
(this_or_next|party_slot_eq, ":destination", slot_party_type, spt_town),
(party_slot_eq, ":destination", slot_party_type, spt_castle),
(store_faction_of_party, ":troop_faction_no", ":troop_party_no"),
(store_faction_of_party, ":destination_faction_no", ":destination"),
(eq, ":troop_faction_no", ":destination_faction_no"),
(party_get_num_prisoner_stacks, ":num_stacks", ":troop_party_no"),
(gt, ":num_stacks", 0),
(assign, "$g_move_heroes", 1),
(call_script, "script_party_prisoners_add_party_prisoners", ":destination", ":troop_party_no"),#Moving prisoners to the center
(assign, "$g_move_heroes", 1),
(call_script, "script_party_remove_all_prisoners", ":troop_party_no"),
(try_end),
(try_end),
]),
# Check escape chances of hero prisoners.
(48,
[
(call_script, "script_randomly_make_prisoner_heroes_escape_from_party", "p_main_party", 50),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
## (party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(assign, ":chance", 30),
(try_begin),
(party_slot_eq, ":center_no", slot_center_has_prisoner_tower, 1),
(assign, ":chance", 5),
(try_end),
(call_script, "script_randomly_make_prisoner_heroes_escape_from_party", ":center_no", ":chance"),
(try_end),
]),
# Asking the ownership of captured centers to the player
(3,
[
(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),
(faction_get_slot, ":leader", "fac_player_supporters_faction", slot_faction_leader),
(start_map_conversation, ":leader"),
]),
# Respawn hero party after kingdom hero is released from captivity.
(48,
[
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_leaded_party, 1),
(store_troop_faction, ":cur_faction", ":troop_no"),
(try_begin),
(call_script, "script_cf_select_random_walled_center_with_faction_and_owner_priority_no_siege", ":cur_faction", ":troop_no"),#Can fail
(assign, ":center_no", reg0),
(call_script, "script_create_kingdom_hero_party", ":troop_no", ":center_no"),
(party_attach_to_party, "$pout_party", ":center_no"),
(else_try),
(neg|faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
(try_begin),
(is_between, ":troop_no", kings_begin, kings_end),
(troop_set_slot, ":troop_no", slot_troop_change_to_faction, "fac_commoners"),
(else_try),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 10),
(call_script, "script_cf_get_random_active_faction_except_player_faction_and_faction", ":cur_faction"),
(troop_set_slot, ":troop_no", slot_troop_change_to_faction, reg0),
(try_end),
(try_end),
(try_end),
]),
# Spawn merchant caravan parties
## (3,
## [
## (try_for_range, ":troop_no", merchants_begin, merchants_end),
## (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_merchant),
## (troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
## (neg|troop_slot_ge, ":troop_no", slot_troop_leaded_party, 1),
##
## (call_script, "script_cf_create_merchant_party", ":troop_no"),
## (try_end),
## ]),
# Spawn village farmer parties
(24,
[
(try_for_range, ":village_no", villages_begin, villages_end),
(party_slot_eq, ":village_no", slot_village_state, svs_normal),
(party_get_slot, ":farmer_party", ":village_no", slot_village_farmer_party),
(this_or_next|eq, ":farmer_party", 0),
(neg|party_is_active, ":farmer_party"),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 30),
(call_script, "script_create_village_farmer_party", ":village_no"),
(party_set_slot, ":village_no", slot_village_farmer_party, reg0),
# (str_store_party_name, s1, ":village_no"),
# (display_message, "@Village farmers created at {s1}."),
(try_end),
]),
(72,
[
# Updating trade good prices according to the productions
(call_script, "script_update_trade_good_prices"),
# Updating player odds
(try_for_range, ":cur_center", centers_begin, centers_end),
(party_get_slot, ":player_odds", ":cur_center", slot_town_player_odds),
(try_begin),
(gt, ":player_odds", 1000),
(val_mul, ":player_odds", 95),
(val_div, ":player_odds", 100),
(val_max, ":player_odds", 1000),
(else_try),
(lt, ":player_odds", 1000),
(val_mul, ":player_odds", 105),
(val_div, ":player_odds", 100),
(val_min, ":player_odds", 1000),
(try_end),
(party_set_slot, ":cur_center", slot_town_player_odds, ":player_odds"),
(try_end),
]),
#Troop AI: Merchants thinking
(8,
[
(try_for_parties, ":party_no"),
(party_slot_eq, ":party_no", slot_party_type, spt_kingdom_caravan),
(party_is_in_any_town, ":party_no"),
(store_faction_of_party, ":merchant_faction", ":party_no"),
(faction_get_slot, ":num_towns", ":merchant_faction", slot_faction_num_towns),
(try_begin),
(le, ":num_towns", 0),
(remove_party, ":party_no"),
(else_try),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 35),
(party_get_cur_town, ":cur_center", ":party_no"),
(assign, ":can_leave", 1),
(try_begin),
(is_between, ":cur_center", walled_centers_begin, walled_centers_end),
(neg|party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
(assign, ":can_leave", 0),
(try_end),
(eq, ":can_leave", 1),
(assign, ":do_trade", 0),
(try_begin),
(party_get_slot, ":cur_ai_state", ":party_no", slot_party_ai_state),
(eq, ":cur_ai_state", spai_trading_with_town),
(party_get_slot, ":cur_ai_object", ":party_no", slot_party_ai_object),
(eq, ":cur_center", ":cur_ai_object"),
(assign, ":do_trade", 1),
(try_end),
(assign, ":target_center", -1),
(try_begin), #Make sure escorted caravan continues to its original destination.
(eq, "$caravan_escort_party_id", ":party_no"),
(neg|party_is_in_town, ":party_no", "$caravan_escort_destination_town"),
(assign, ":target_center", "$caravan_escort_destination_town"),
(else_try),
(call_script, "script_cf_select_random_town_at_peace_with_faction_in_trade_route", ":cur_center", ":merchant_faction"),
(assign, ":target_center", reg0),
(try_end),
(is_between, ":target_center", towns_begin, towns_end),
(neg|party_is_in_town, ":party_no", ":target_center"),
(try_begin),
(eq, ":do_trade", 1),
(call_script, "script_do_merchant_town_trade", ":party_no", ":cur_center"),
(try_end),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party),
(party_set_ai_object, ":party_no", ":target_center"),
(party_set_flags, ":party_no", pf_default_behavior, 0),
(party_set_slot, ":party_no", slot_party_ai_state, spai_trading_with_town),
(party_set_slot, ":party_no", slot_party_ai_object, ":target_center"),
(try_end),
(try_end),
]),
#Troop AI: Village farmers thinking
(8,
[
(try_for_parties, ":party_no"),
(party_slot_eq, ":party_no", slot_party_type, spt_village_farmer),
(party_is_in_any_town, ":party_no"),
(party_get_slot, ":home_center", ":party_no", slot_party_home_center),
(party_get_cur_town, ":cur_center", ":party_no"),
(assign, ":can_leave", 1),
(try_begin),
(is_between, ":cur_center", walled_centers_begin, walled_centers_end),
(neg|party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
(assign, ":can_leave", 0),
(try_end),
(eq, ":can_leave", 1),
(try_begin),
(eq, ":cur_center", ":home_center"),
(try_begin),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 5),
(call_script, "script_do_party_center_trade", ":party_no", ":home_center", 50),
(assign, ":total_change", reg0),
(party_get_slot, ":prosperity", ":home_center", slot_town_prosperity),
(val_add, ":prosperity", 30),
(val_mul, ":total_change", ":prosperity"),
(val_div, ":total_change", 2600), #(30 + prosperity) / 130 * 5% of the sales.
#Adding tax revenue to the center
(party_get_slot, ":accumulated_tariffs", ":home_center", slot_center_accumulated_tariffs),
(val_add, ":accumulated_tariffs", ":total_change"),
(party_set_slot, ":home_center", slot_center_accumulated_tariffs, ":accumulated_tariffs"),
#Moving farmers to the home town
(party_get_slot, ":market_town", ":home_center", slot_village_market_town),
(party_set_slot, ":party_no", slot_party_ai_object, ":market_town"),
(party_set_slot, ":party_no", slot_party_ai_state, spai_trading_with_town),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party),
(party_set_ai_object, ":party_no", ":market_town"),
## (try_begin),
## (eq, "$cheat_mode", 1),
## (str_store_party_name, s1, ":home_center"),
## (assign, reg1, ":total_change"),
## (display_message, "@Village farmers traded with {s1} merchants. Tax={reg1}"),
## (try_end),
(try_end),
(else_try),
(try_begin),
(party_get_slot, ":cur_ai_object", ":party_no", slot_party_ai_object),
(eq, ":cur_center", ":cur_ai_object"),
(call_script, "script_do_party_center_trade", ":party_no", ":cur_ai_object", 10),
(assign, ":total_change", reg0),
(party_get_slot, ":prosperity", ":cur_ai_object", slot_town_prosperity),
(val_add, ":prosperity", 30),
(val_mul, ":total_change", ":prosperity"),
(val_div, ":total_change", 2600), #(30 + prosperity) / 130 * 5% of the sales.
#Adding tax revenue to the center
(party_get_slot, ":accumulated_tariffs", ":cur_ai_object", slot_center_accumulated_tariffs),
(val_add, ":accumulated_tariffs", ":total_change"),
(party_set_slot, ":cur_ai_object", slot_center_accumulated_tariffs, ":accumulated_tariffs"),
#Adding tax revenue to the home center
(party_get_slot, ":accumulated_tariffs", ":home_center", slot_center_accumulated_tariffs),
(val_add, ":accumulated_tariffs", ":total_change"),
(party_set_slot, ":home_center", slot_center_accumulated_tariffs, ":accumulated_tariffs"),
#Increasing food stocks of the town
(party_get_slot, ":town_food_store", ":cur_ai_object", slot_party_food_store),
(call_script, "script_center_get_food_store_limit", ":cur_ai_object"),
(assign, ":food_store_limit", reg0),
(val_add, ":town_food_store", 1000),
(val_min, ":town_food_store", ":food_store_limit"),
(party_set_slot, ":cur_ai_object", slot_party_food_store, ":town_food_store"),
#Adding 1 to village prosperity
(try_begin),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 35),
(call_script, "script_change_center_prosperity", ":home_center", 1),
(try_end),
(try_end),
#Moving farmers to their home village
(party_set_slot, ":party_no", slot_party_ai_object, ":home_center"),
(party_set_slot, ":party_no", slot_party_ai_state, spai_trading_with_town),
(party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party),
(party_set_ai_object, ":party_no", ":home_center"),
## (try_begin),
## (eq, "$cheat_mode", 1),
## (str_store_party_name, s1, ":cur_ai_object"),
## (assign, reg1, ":total_change"),
## (display_message, "@Village farmers traded with {s1} merchants. Tax={reg1} to both sides"),
## (try_end),
(try_end),
(try_end),
]),
#Increase castle food stores
(2,
[
(try_for_range, ":center_no", castles_begin, castles_end),
(party_slot_eq, ":center_no", slot_center_is_besieged_by, -1), #castle is not under siege
(party_get_slot, ":center_food_store", ":center_no", slot_party_food_store),
(val_add, ":center_food_store", 100),
(call_script, "script_center_get_food_store_limit", ":center_no"),
(assign, ":food_store_limit", reg0),
(val_min, ":center_food_store", ":food_store_limit"),
(party_set_slot, ":center_no", slot_party_food_store, ":center_food_store"),
(try_end),
]),
#cache party strengths (to avoid re-calculating)
## (2,
## [
## (try_for_range, ":cur_troop", heroes_begin, heroes_end),
## (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
## (troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
## (ge, ":cur_party", 0),
## (call_script, "script_party_calculate_strength", ":cur_party", 0), #will update slot_party_cached_strength
## (try_end),
## ]),
##
## (6,
## [
## (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
## (call_script, "script_party_calculate_strength", ":cur_center", 0), #will update slot_party_cached_strength
## (try_end),
## ]),
## (1,
## [
## (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
## (store_random_in_range, ":rand", 0, 100),
## (lt, ":rand", 10),
## (store_faction_of_party, ":center_faction", ":cur_center"),
## (assign, ":friend_strength", 0),
## (try_for_range, ":cur_troop", heroes_begin, heroes_end),
## (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
## (troop_get_slot, ":cur_troop_party", ":cur_troop", slot_troop_leaded_party),
## (gt, ":cur_troop_party", 0),
## (store_distance_to_party_from_party, ":distance", ":cur_troop_party", ":cur_center"),
## (lt, ":distance", 10),
## (store_troop_faction, ":army_faction", ":cur_troop"),
## (store_relation, ":rel", ":army_faction", ":center_faction"),
## (try_begin),
## (gt, ":rel", 10),
## (party_get_slot, ":str", ":cur_troop_party", slot_party_cached_strength),
## (val_add, ":friend_strength", ":str"),
## (try_end),
## (try_end),
## (party_set_slot, ":cur_center", slot_party_nearby_friend_strength, ":friend_strength"),
## (try_end),
## ]),
# Make heroes running away from someone retreat to friendly centers
(0.5,
[
(try_for_range, ":cur_troop", heroes_begin, heroes_end),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(gt, ":cur_party", 0),
(try_begin),
(party_is_active, ":cur_party"),
(try_begin),
(get_party_ai_current_behavior, ":ai_bhvr", ":cur_party"),
(eq, ":ai_bhvr", ai_bhvr_avoid_party),
(store_faction_of_party, ":party_faction", ":cur_party"),
(party_get_slot, ":commander_party", ":cur_party", slot_party_commander_party),
(faction_get_slot, ":faction_marshall", ":party_faction", slot_faction_marshall),
(neq, ":faction_marshall", ":cur_troop"),
(assign, ":continue", 1),
(try_begin),
(ge, ":faction_marshall", 0),
(troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party),
(ge, ":faction_marshall_party", 0),
(eq, ":commander_party", ":faction_marshall_party"),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(assign, ":done", 0),
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(eq, ":done", 0),
(party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
(store_faction_of_party, ":center_faction", ":cur_center"),
(store_relation, ":cur_relation", ":center_faction", ":party_faction"),
(gt, ":cur_relation", 0),
(store_distance_to_party_from_party, ":cur_distance", ":cur_party", ":cur_center"),
(lt, ":cur_distance", 20),
(party_get_position, pos1, ":cur_party"),
(party_get_position, pos2, ":cur_center"),
(neg|position_is_behind_position, pos2, pos1),
(call_script, "script_party_set_ai_state", ":cur_party", spai_retreating_to_center, ":cur_center"),
(assign, ":done", 1),
(try_end),
(try_end),
(else_try),
(troop_set_slot, ":cur_troop", slot_troop_leaded_party, -1),
(try_end),
(try_end),
]),
# Centers give alarm if the player is around
(0.5,
[
(store_current_hours, ":cur_hours"),
(store_mod, ":cur_hours_mod", ":cur_hours", 11),
(store_sub, ":hour_limit", ":cur_hours", 5),
(party_get_num_companions, ":num_men", "p_main_party"),
(party_get_num_prisoners, ":num_prisoners", "p_main_party"),
(val_add, ":num_men", ":num_prisoners"),
(convert_to_fixed_point, ":num_men"),
(store_sqrt, ":num_men_effect", ":num_men"),
(convert_from_fixed_point, ":num_men_effect"),
(try_begin),
(eq, ":cur_hours_mod", 0),
#Reduce alarm by 2 in every 11 hours.
(try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
(faction_get_slot, ":player_alarm", ":cur_faction", slot_faction_player_alarm),
(val_sub, ":player_alarm", 1),
(val_max, ":player_alarm", 0),
(faction_set_slot, ":cur_faction", slot_faction_player_alarm, ":player_alarm"),
(try_end),
(try_end),
(eq, "$g_player_is_captive", 0),
(try_for_range, ":cur_center", centers_begin, centers_end),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(store_relation, ":reln", ":cur_faction", "fac_player_supporters_faction"),
(lt, ":reln", 0),
(store_distance_to_party_from_party, ":dist", "p_main_party", ":cur_center"),
(lt, ":dist", 5),
(store_mul, ":dist_sqr", ":dist", ":dist"),
(store_sub, ":dist_effect", 20, ":dist_sqr"),
(store_sub, ":reln_effect", 20, ":reln"),
(store_mul, ":total_effect", ":dist_effect", ":reln_effect"),
(val_mul, ":total_effect", ":num_men_effect"),
(store_div, ":spot_chance", ":total_effect", 10),
(store_random_in_range, ":random_spot", 0, 1000),
(lt, ":random_spot", ":spot_chance"),
(faction_get_slot, ":player_alarm", ":cur_faction", slot_faction_player_alarm),
(val_add, ":player_alarm", 1),
(val_min, ":player_alarm", 100),
(faction_set_slot, ":cur_faction", slot_faction_player_alarm, ":player_alarm"),
(try_begin),
(neg|party_slot_ge, ":cur_center", slot_center_last_player_alarm_hour, ":hour_limit"),
(str_store_party_name_link, s1, ":cur_center"),
(display_message, "@Your party is spotted by {s1}."),
(party_set_slot, ":cur_center", slot_center_last_player_alarm_hour, ":cur_hours"),
(try_end),
(try_end),
]),
# Consuming food at every 14 hours
(14,
[#(store_sub, ":num_food", food_end, food_begin),
(eq, "$g_player_is_captive", 0),
(party_get_num_companion_stacks, ":num_stacks","p_main_party"),
(assign, ":num_men", 0),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_size, ":stack_size","p_main_party",":i_stack"),
(val_add, ":num_men", ":stack_size"),
(try_end),
##############################
# Changed by Form Ranks kit
#
(party_get_num_attached_parties, ":arrays", "p_main_party"),
(try_for_range, ":i", 0, ":arrays"),
(party_get_attached_party_with_rank, ":array_party", "p_main_party", ":i"),
(store_party_size, ":array_size", ":array_party"),
(val_add, ":num_men", ":array_size"),
(try_end),
#
# Change of Form Ranks kit end
###############################
(val_div, ":num_men", 3),
(try_begin),
(eq, ":num_men", 0),
(val_add, ":num_men", 1),
(try_end),
(assign, ":consumption_amount", ":num_men"),
(assign, ":no_food_displayed", 0),
(try_for_range, ":unused", 0, ":consumption_amount"),
(assign, ":available_food", 0),
(try_for_range, ":cur_food", food_begin, food_end),
(item_set_slot, ":cur_food", slot_item_is_checked, 0),
(call_script, "script_cf_player_has_item_without_modifier", ":cur_food", imod_rotten),
(val_add, ":available_food", 1),
(try_end),
(try_begin),
(gt, ":available_food", 0),
(store_random_in_range, ":selected_food", 0, ":available_food"),
(call_script, "script_consume_food", ":selected_food"),
(else_try),
(eq, ":no_food_displayed", 0),
(display_message, "@Party has nothing to eat!", 0xFF0000),
(call_script, "script_change_player_party_morale", -3),
(assign, ":no_food_displayed", 1),
#NPC companion changes begin
(try_begin),
(call_script, "script_party_count_fit_regulars", "p_main_party"),
(gt, reg0, 0),
(call_script, "script_objectionable_action", tmt_egalitarian, "str_men_hungry"),
(try_end),
#NPC companion changes end
(try_end),
(try_end),
]),
# Setting item modifiers for food
(24,
[
(troop_get_inventory_capacity, ":inv_size", "trp_player"),
(try_for_range, ":i_slot", 0, ":inv_size"),
(troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
(eq, ":item_id", "itm_cattle_meat"),
(troop_get_inventory_slot_modifier, ":modifier", "trp_player", ":i_slot"),
(try_begin),
(ge, ":modifier", imod_fresh),
(lt, ":modifier", imod_rotten),
(val_add, ":modifier", 1),
(troop_set_inventory_slot_modifier, "trp_player", ":i_slot", ":modifier"),
(else_try),
(lt, ":modifier", imod_fresh),
(troop_set_inventory_slot_modifier, "trp_player", ":i_slot", imod_fresh),
(try_end),
(try_end),
]),
# Assigning lords to centers with no leaders
(72,
[(call_script, "script_assign_lords_to_empty_centers"),
]),
# Updating player icon in every frame
(0,
[(troop_get_inventory_slot, ":cur_horse", "trp_player", 8), #horse slot
(assign, ":new_icon", -1),
(try_begin),
(eq, "$g_player_icon_state", pis_normal),
(try_begin),
(ge, ":cur_horse", 0),
(assign, ":new_icon", "icon_player_horseman"),
(else_try),
(assign, ":new_icon", "icon_player"),
(try_end),
(else_try),
(eq, "$g_player_icon_state", pis_camping),
(assign, ":new_icon", "icon_camp"),
(else_try),
(eq, "$g_player_icon_state", pis_ship),
(assign, ":new_icon", "icon_ship"),
(try_end),
(neq, ":new_icon", "$g_player_party_icon"),
(assign, "$g_player_party_icon", ":new_icon"),
(party_set_icon, "p_main_party", ":new_icon"),
]),
#Update how good a target player is for bandits
(2,
[
(store_troop_gold, ":total_value", "trp_player"),
(store_div, ":bandit_attraction", ":total_value", (10000/100)), #10000 gold = excellent_target
(troop_get_inventory_capacity, ":inv_size", "trp_player"),
(try_for_range, ":i_slot", 0, ":inv_size"),
(troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
(ge, ":item_id", 0),
(try_begin),
(is_between, ":item_id", trade_goods_begin, trade_goods_end),
(store_item_value, ":item_value", ":item_id"),
(val_add, ":total_value", ":item_value"),
(try_end),
(try_end),
(val_clamp, ":bandit_attraction", 0, 100),
(party_set_bandit_attraction, "p_main_party", ":bandit_attraction"),
]),
# Checking escape chances of prisoners that joined the party recently.
(6,
[(gt, "$g_prisoner_recruit_troop_id", 0),
(gt, "$g_prisoner_recruit_size", 0),
(gt, "$g_prisoner_recruit_last_time", 0),
(is_currently_night),
(try_begin),
(store_skill_level, ":leadership", "skl_leadership", "trp_player"),
(val_mul, ":leadership", 5),
(store_sub, ":chance", 66, ":leadership"),
(gt, ":chance", 0),
(assign, ":num_escaped", 0),
(try_for_range, ":unused", 0, "$g_prisoner_recruit_size"),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":chance"),
(val_add, ":num_escaped", 1),
(try_end),
(party_remove_members, "p_main_party", "$g_prisoner_recruit_troop_id", ":num_escaped"),
(assign, ":num_escaped", reg0),
(gt, ":num_escaped", 0),
(try_begin),
(gt, ":num_escaped", 1),
(assign, reg2, 1),
(else_try),
(assign, reg2, 0),
(try_end),
(assign, reg1, ":num_escaped"),
(str_store_troop_name_by_count, s1, "$g_prisoner_recruit_troop_id", ":num_escaped"),
(display_log_message, "@{reg1} {s1} {reg2?have:has} escaped from your party during the night."),
(try_end),
(assign, "$g_prisoner_recruit_troop_id", 0),
(assign, "$g_prisoner_recruit_size", 0),
]),
# Offering ransom fees for player's prisoner heroes
(24,
[(neq, "$g_ransom_offer_rejected", 1),
(call_script, "script_offer_ransom_amount_to_player_for_prisoners_in_party", "p_main_party"),
(eq, reg0, 0),#no prisoners offered
(assign, ":end_cond", walled_centers_end),
(try_for_range, ":center_no", walled_centers_begin, ":end_cond"),
(party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(call_script, "script_offer_ransom_amount_to_player_for_prisoners_in_party", ":center_no"),
(eq, reg0, 1),#a prisoner is offered
(assign, ":end_cond", 0),#break
(try_end),
]),
# Exchanging hero prisoners between factions and clearing old ransom offers
(72,
[(assign, "$g_ransom_offer_rejected", 0),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(party_get_slot, ":town_lord", ":center_no", slot_town_lord),
(gt, ":town_lord", 0),
(party_get_num_prisoner_stacks, ":num_stacks", ":center_no"),
(try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop", ":center_no", ":i_stack"),
(troop_is_hero, ":stack_troop"),
(troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero),
(store_random_in_range, ":random_no", 0, 100),
(try_begin),
(le, ":random_no", 10),
(call_script, "script_calculate_ransom_amount_for_troop", ":stack_troop"),
(assign, ":ransom_amount", reg0),
(troop_get_slot, ":wealth", ":town_lord", slot_troop_wealth),
(val_add, ":wealth", ":ransom_amount"),
(troop_set_slot, ":town_lord", slot_troop_wealth, ":wealth"),
(party_remove_prisoners, ":center_no", ":stack_troop", 1),
(call_script, "script_remove_troop_from_prison", ":stack_troop"),
(store_troop_faction, ":faction_no", ":town_lord"),
(store_troop_faction, ":troop_faction", ":stack_troop"),
(str_store_troop_name, s1, ":stack_troop"),
(str_store_faction_name, s2, ":faction_no"),
(str_store_faction_name, s3, ":troop_faction"),
(display_log_message, "@{s1} of {s3} has been released from captivity."),
(try_end),
(try_end),
(try_end),
]),
# Adding mercenary troops to the towns
(72,
[(call_script, "script_update_mercenary_units_of_towns"),
#NPC changes begin
# removes (call_script, "script_update_companion_candidates_in_taverns"),
#NPC changes end
(call_script, "script_update_ransom_brokers"),
(call_script, "script_update_tavern_travelers"),
(call_script, "script_update_tavern_minstels"),
(call_script, "script_update_booksellers"),
(call_script, "script_update_villages_infested_by_bandits"),
(try_for_range, ":village_no", villages_begin, villages_end),
(call_script, "script_update_volunteer_troops_in_village", ":village_no"),
(call_script, "script_update_npc_volunteer_troops_in_village", ":village_no"),
(try_end),
]),
# Setting random walker types
(36,
[(try_for_range, ":center_no", centers_begin, centers_end),
(this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town),
( party_slot_eq, ":center_no", slot_party_type, spt_village),
(call_script, "script_center_remove_walker_type_from_walkers", ":center_no", walkert_needs_money),
(call_script, "script_center_remove_walker_type_from_walkers", ":center_no", walkert_needs_money_helped),
(store_random_in_range, ":rand", 0, 100),
(try_begin),
(lt, ":rand", 70),
(neg|party_slot_ge, ":center_no", slot_town_prosperity, 60),
(call_script, "script_cf_center_get_free_walker", ":center_no"),
(call_script, "script_center_set_walker_to_type", ":center_no", reg0, walkert_needs_money),
(try_end),
(try_end),
]),
# Checking center upgrades
(12,
[(try_for_range, ":center_no", centers_begin, centers_end),
(party_get_slot, ":cur_improvement", ":center_no", slot_center_current_improvement),
(gt, ":cur_improvement", 0),
(party_get_slot, ":cur_improvement_end_time", ":center_no", slot_center_improvement_end_hour),
(store_current_hours, ":cur_hours"),
(ge, ":cur_hours", ":cur_improvement_end_time"),
(party_set_slot, ":center_no", ":cur_improvement", 1),
(party_set_slot, ":center_no", slot_center_current_improvement, 0),
(call_script, "script_get_improvement_details", ":cur_improvement"),
(try_begin),
(party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(str_store_party_name, s4, ":center_no"),
(display_log_message, "@Building of {s0} in {s4} has been completed."),
(try_end),
(try_begin),
(is_between, ":center_no", villages_begin, villages_end),
(eq, ":cur_improvement", slot_center_has_fish_pond),
(call_script, "script_change_center_prosperity", ":center_no", 5),
(try_end),
(try_end),
]),
# Adding tournaments to towns
# Adding bandits to towns and villages
(24,
[(assign, ":num_active_tournaments", 0),
(try_for_range, ":center_no", towns_begin, towns_end),
(party_get_slot, ":has_tournament", ":center_no", slot_town_has_tournament),
(try_begin),
(eq, ":has_tournament", 1),#tournament ended, simulate
(call_script, "script_fill_tournament_participants_troop", ":center_no", 0),
(call_script, "script_sort_tournament_participant_troops"),#may not be needed
(call_script, "script_get_num_tournament_participants"),
(store_sub, ":needed_to_remove_randomly", reg0, 1),
(call_script, "script_remove_tournament_participants_randomly", ":needed_to_remove_randomly"),
(call_script, "script_sort_tournament_participant_troops"),
(troop_get_slot, ":winner_troop", "trp_tournament_participants", 0),
(try_begin),
(is_between, ":winner_troop", kingdom_heroes_begin, kingdom_heroes_end),
(str_store_troop_name_link, s1, ":winner_troop"),
(str_store_party_name_link, s2, ":center_no"),
(display_message, "@{s1} has won the tournament at {s2}."),
(call_script, "script_change_troop_renown", ":winner_troop", 20),
(try_end),
(try_end),
(val_sub, ":has_tournament", 1),
(val_max, ":has_tournament", 0),
(party_set_slot, ":center_no", slot_town_has_tournament, ":has_tournament"),
(try_begin),
(gt, ":has_tournament", 0),
(val_add, ":num_active_tournaments", 1),
(try_end),
(try_end),
(try_for_range, ":center_no", centers_begin, centers_end),
(this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(party_get_slot, ":has_bandits", ":center_no", slot_center_has_bandits),
(try_begin),
(le, ":has_bandits", 0),
(assign, ":continue", 0),
(try_begin),
(check_quest_active, "qst_deal_with_night_bandits"),
(quest_slot_eq, "qst_deal_with_night_bandits", slot_quest_target_center, ":center_no"),
(neg|check_quest_succeeded, "qst_deal_with_night_bandits"),
(assign, ":continue", 1),
(else_try),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 3),
(assign, ":continue", 1),
(try_end),
(try_begin),
(eq, ":continue", 1),
(store_random_in_range, ":random_no", 0, 3),
(try_begin),
(eq, ":random_no", 0),
(assign, ":bandit_troop", "trp_bandit"),
(else_try),
(eq, ":random_no", 1),
(assign, ":bandit_troop", "trp_mountain_bandit"),
(else_try),
(assign, ":bandit_troop", "trp_forest_bandit"),
(try_end),
(party_set_slot, ":center_no", slot_center_has_bandits, ":bandit_troop"),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_party_name, s1, ":center_no"),
(display_message, "@{s1} is infested by bandits (at night)."),
(try_end),
(try_end),
(else_try),
(try_begin),
(assign, ":random_chance", 40),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(assign, ":random_chance", 20),
(try_end),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":random_chance"),
(party_set_slot, ":center_no", slot_center_has_bandits, 0),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_party_name, s1, ":center_no"),
(display_message, "@{s1} is no longer infested by bandits (at night)."),
(try_end),
(try_end),
(try_end),
(try_end),
(try_begin),
(lt, ":num_active_tournaments", 3),
(store_random_in_range, ":random_no", 0, 100),
#Add new tournaments with a 30% chance if there are less than 3 tournaments going on
(lt, ":random_no", 30),
(store_random_in_range, ":random_town", towns_begin, towns_end),
(store_random_in_range, ":random_days", 12, 15),
(party_set_slot, ":random_town", slot_town_has_tournament, ":random_days"),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_party_name, s1, ":random_town"),
(display_message, "@{s1} is holding a tournament."),
(try_end),
(try_end),
]),
# Asking to give center to player
(8,
[
(assign, ":done", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(eq, ":done", 0),
(party_slot_eq, ":center_no", slot_town_lord, stl_reserved_for_player),
(assign, "$g_center_to_give_to_player", ":center_no"),
(try_begin),
(eq, "$g_center_to_give_to_player", "$g_castle_requested_by_player"),
(assign, "$g_castle_requested_by_player", 0),
(jump_to_menu, "mnu_requested_castle_granted_to_player"),
(else_try),
(jump_to_menu, "mnu_give_center_to_player"),
(try_end),
(assign, ":done", 1),
(else_try),
(eq, ":center_no", "$g_castle_requested_by_player"),
(party_slot_ge, ":center_no", slot_town_lord, kingdom_heroes_begin),
(assign, "$g_castle_requested_by_player", 0),
(store_faction_of_party, ":faction", ":center_no"),
(eq, ":faction", "$players_kingdom"),
(assign, "$g_center_to_give_to_player", ":center_no"),
(jump_to_menu, "mnu_requested_castle_granted_to_another"),
(assign, ":done", 1),
(try_end),
]),
# Taking denars from player while resting in not owned centers
(1,
[(neg|map_free),
(is_currently_night),
(ge, "$g_last_rest_center", 0),
(neg|party_slot_eq, "$g_last_rest_center", slot_town_lord, "trp_player"),
(store_current_hours, ":cur_hours"),
(ge, ":cur_hours", "$g_last_rest_payment_until"),
(store_add, "$g_last_rest_payment_until", ":cur_hours", 24),
(store_troop_gold, ":gold", "trp_player"),
(party_get_num_companions, ":num_men", "p_main_party"),
##############################
# Changed by Form Ranks kit
#
(party_get_num_attached_parties, ":arrays", "p_main_party"),
(try_for_range, ":i", 0, ":arrays"),
(party_get_attached_party_with_rank, ":array_party", "p_main_party", ":i"),
(store_party_size, ":array_size", ":array_party"),
(val_add, ":num_men", ":array_size"),
(try_end),
#
# Change of Form Ranks kit end
###############################
(store_div, ":total_cost", ":num_men", 4),
(val_add, ":total_cost", 1),
(try_begin),
(ge, ":gold", ":total_cost"),
(display_message, "@You pay for accommodation."),
(troop_remove_gold, "trp_player", ":total_cost"),
(else_try),
(gt, ":gold", 0),
(troop_remove_gold, "trp_player", ":gold"),
(try_end),
]),
# Spawn some bandits.
(36,
[
(call_script, "script_spawn_bandits"),
]),
# Make parties larger as game progresses.
(24,
[
(call_script, "script_update_party_creation_random_limits"),
]),
# Check if a faction is defeated every day
(24,
[
(assign, ":num_active_factions", 0),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
(faction_set_slot, ":cur_kingdom", slot_faction_number_of_parties, 0),
(try_end),
(try_for_parties, ":cur_party"),
(store_faction_of_party, ":party_faction", ":cur_party"),
(is_between, ":party_faction", kingdoms_begin, kingdoms_end),
(this_or_next|is_between, ":cur_party", centers_begin, centers_end),
(party_slot_eq, ":cur_party", slot_party_type, spt_kingdom_hero_party),
(faction_get_slot, ":kingdom_num_parties", ":party_faction", slot_faction_number_of_parties),
(val_add, ":kingdom_num_parties", 1),
(faction_set_slot, ":party_faction", slot_faction_number_of_parties, ":kingdom_num_parties"),
(try_end),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
## (try_begin),
## (eq, "$cheat_mode", 1),
## (str_store_faction_name, s1, ":cur_kingdom"),
## (faction_get_slot, reg1, ":cur_kingdom", slot_faction_number_of_parties),
## (display_message, "@Number of parties belonging to {s1}: {reg1}"),
## (try_end),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(val_add, ":num_active_factions", 1),
(faction_slot_eq, ":cur_kingdom", slot_faction_number_of_parties, 0),
(assign, ":faction_removed", 0),
(try_begin),
(eq, ":cur_kingdom", "fac_player_supporters_faction"),
(try_begin),
(le, "$supported_pretender", 0),
(faction_set_slot, ":cur_kingdom", slot_faction_state, sfs_inactive),
(assign, ":faction_removed", 1),
(try_end),
(else_try),
(neq, "$players_kingdom", ":cur_kingdom"),
(faction_set_slot, ":cur_kingdom", slot_faction_state, sfs_defeated),
(try_for_parties, ":cur_party"),
(store_faction_of_party, ":party_faction", ":cur_party"),
(eq, ":party_faction", ":cur_kingdom"),
(party_get_slot, ":home_center", ":cur_party", slot_party_home_center),
(store_faction_of_party, ":home_center_faction", ":home_center"),
(party_set_faction, ":cur_party", ":home_center_faction"),
(try_end),
(assign, ":kingdom_pretender", -1),
(try_for_range, ":cur_pretender", pretenders_begin, pretenders_end),
(troop_slot_eq, ":cur_pretender", slot_troop_original_faction, ":cur_kingdom"),
(assign, ":kingdom_pretender", ":cur_pretender"),
(try_end),
(try_begin),
(is_between, ":kingdom_pretender", pretenders_begin, pretenders_end),
(neq, ":kingdom_pretender", "$supported_pretender"),
(troop_set_slot, ":kingdom_pretender", slot_troop_cur_center, 0), #remove pretender from the world
(try_end),
(assign, ":faction_removed", 1),
(try_begin),
(eq, "$players_oath_renounced_against_kingdom", ":cur_kingdom"),
(assign, "$players_oath_renounced_against_kingdom", 0),
(assign, "$players_oath_renounced_given_center", 0),
(assign, "$players_oath_renounced_begin_time", 0),
(call_script, "script_add_notification_menu", "mnu_notification_oath_renounced_faction_defeated", ":cur_kingdom", 0),
(try_end),
#This menu must be at the end because faction banner will change after this menu if the player's supported pretender's original faction is cur_kingdom
(call_script, "script_add_notification_menu", "mnu_notification_faction_defeated", ":cur_kingdom", 0),
(try_end),
(try_begin),
(eq, ":faction_removed", 1),
(val_sub, ":num_active_factions", 1),
(call_script, "script_store_average_center_value_per_faction"),
(try_end),
(try_for_range, ":cur_kingdom_2", kingdoms_begin, kingdoms_end),
(call_script, "script_update_faction_notes", ":cur_kingdom_2"),
(try_end),
(try_end),
(try_begin),
(eq, ":num_active_factions", 1),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(call_script, "script_add_notification_menu", "mnu_notification_one_faction_left", ":cur_kingdom", 0),
(try_end),
(try_end),
]),
# Reduce renown slightly by 0.5% every week
(7 * 24,
[
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(store_div, ":renown_decrease", ":player_renown", 200),
(val_sub, ":player_renown", ":renown_decrease"),
(troop_set_slot, "trp_player", slot_troop_renown, ":player_renown"),
]),
# Read books if player is resting.
(1, [(neg|map_free),
(gt, "$g_player_reading_book", 0),
(player_has_item, "$g_player_reading_book"),
(store_attribute_level, ":int", "trp_player", ca_intelligence),
(item_get_slot, ":int_req", "$g_player_reading_book", slot_item_intelligence_requirement),
(le, ":int_req", ":int"),
(item_get_slot, ":book_reading_progress", "$g_player_reading_book", slot_item_book_reading_progress),
(item_get_slot, ":book_read", "$g_player_reading_book", slot_item_book_read),
(eq, ":book_read", 0),
(val_add, ":book_reading_progress", 7),
(item_set_slot, "$g_player_reading_book", slot_item_book_reading_progress, ":book_reading_progress"),
(ge, ":book_reading_progress", 1000),
(item_set_slot, "$g_player_reading_book", slot_item_book_read, 1),
(str_store_item_name, s1, "$g_player_reading_book"),
(str_clear, s2),
(try_begin),
(eq, "$g_player_reading_book", "itm_book_tactics"),
(troop_raise_skill, "trp_player", "skl_tactics", 1),
(str_store_string, s2, "@ Your tactics skill has increased by 1."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_persuasion"),
(troop_raise_skill, "trp_player", "skl_persuasion", 1),
(str_store_string, s2, "@ Your persuasion skill has increased by 1."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_leadership"),
(troop_raise_skill, "trp_player", "skl_leadership", 1),
(str_store_string, s2, "@ Your leadership skill has increased by 1."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_intelligence"),
(troop_raise_attribute, "trp_player", ca_intelligence, 1),
(str_store_string, s2, "@ Your intelligence has increased by 1."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_trade"),
(troop_raise_skill, "trp_player", "skl_trade", 1),
(str_store_string, s2, "@ Your trade skill has increased by 1."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_weapon_mastery"),
(troop_raise_skill, "trp_player", "skl_weapon_master", 1),
(str_store_string, s2, "@ Your weapon master skill has increased by 1."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_engineering"),
(troop_raise_skill, "trp_player", "skl_engineer", 1),
(str_store_string, s2, "@ Your engineer skill has increased by 1."),
(try_end),
(dialog_box, "@You have finished reading {s1}.{s2}", "@Book Read"),
(assign, "$g_player_reading_book", 0),
]),
# Removing cattle herds if they are way out of range
(12, [(try_for_parties, ":cur_party"),
(party_slot_eq, ":cur_party", slot_party_type, spt_cattle_herd),
(store_distance_to_party_from_party, ":dist",":cur_party", "p_main_party"),
(try_begin),
(gt, ":dist", 30),
(remove_party, ":cur_party"),
(try_begin),
#Fail quest if the party is the quest party
(check_quest_active, "qst_move_cattle_herd"),
(neg|check_quest_concluded, "qst_move_cattle_herd"),
(quest_slot_eq, "qst_move_cattle_herd", slot_quest_target_party, ":cur_party"),
(call_script, "script_fail_quest", "qst_move_cattle_herd"),
(end_try),
(else_try),
(gt, ":dist", 10),
(party_set_slot, ":cur_party", slot_cattle_driven_by_player, 0),
(party_set_ai_behavior, ":cur_party", ai_bhvr_hold),
(try_end),
(try_end),
]),
#####!!!!!
# Village upgrade triggers
# School
(30 * 24,
[(try_for_range, ":cur_village", villages_begin, villages_end),
(party_slot_eq, ":cur_village", slot_town_lord, "trp_player"),
(party_get_slot, ":cur_relation", ":cur_village", slot_center_player_relation),
(val_add, ":cur_relation", 1),
(val_min, ":cur_relation", 100),
(party_set_slot, ":cur_village", slot_center_player_relation, ":cur_relation"),
(try_end),
]),
# Quest triggers:
# Remaining days text update
(24, [(try_for_range, ":cur_quest", all_quests_begin, all_quests_end),
(try_begin),
(check_quest_active, ":cur_quest"),
(try_begin),
(neg|check_quest_concluded, ":cur_quest"),
(quest_slot_ge, ":cur_quest", slot_quest_expiration_days, 1),
(quest_get_slot, ":exp_days", ":cur_quest", slot_quest_expiration_days),
(val_sub, ":exp_days", 1),
(try_begin),
(eq, ":exp_days", 0),
(call_script, "script_abort_quest", ":cur_quest", 1),
(else_try),
(quest_set_slot, ":cur_quest", slot_quest_expiration_days, ":exp_days"),
(assign, reg0, ":exp_days"),
(add_quest_note_from_sreg, ":cur_quest", 7, "@You have {reg0} days to finish this quest.", 0),
(try_end),
(try_end),
(else_try),
(quest_slot_ge, ":cur_quest", slot_quest_dont_give_again_remaining_days, 1),
(quest_get_slot, ":value", ":cur_quest", slot_quest_dont_give_again_remaining_days),
(val_sub, ":value", 1),
(quest_set_slot, ":cur_quest", slot_quest_dont_give_again_remaining_days, ":value"),
(try_end),
(try_end),
]),
# Report to army quest
(6,
[
(is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
(eq, "$g_player_is_captive", 0),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
(neg|check_quest_active, "qst_report_to_army"),
(neg|check_quest_active, "qst_follow_army"),
(neg|quest_slot_ge, "qst_report_to_army", slot_quest_dont_give_again_remaining_days, 1),
(faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall),
(gt, ":faction_marshall", 0),
(troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party),
(gt, ":faction_marshall_party", 0),
(assign, ":has_no_quests", 1),
(try_for_range, ":cur_quest", lord_quests_begin, lord_quests_end),
(check_quest_active, ":cur_quest"),
(quest_slot_eq, ":cur_quest", slot_quest_giver_troop, ":faction_marshall"),
(assign, ":has_no_quests", 0),
(try_end),
(eq, ":has_no_quests", 1),
(try_for_range, ":cur_quest", army_quests_begin, army_quests_end),
(check_quest_active, ":cur_quest"),
(assign, ":has_no_quests", 0),
(try_end),
(eq, ":has_no_quests", 1),
(store_character_level, ":level", "trp_player"),
(ge, ":level", 8),
(assign, ":cur_target_amount", 2),
(try_for_range, ":cur_center", centers_begin, centers_end),
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(try_begin),
(party_slot_eq, ":cur_center", slot_party_type, spt_town),
(val_add, ":cur_target_amount", 3),
(else_try),
(party_slot_eq, ":cur_center", slot_party_type, spt_castle),
(val_add, ":cur_target_amount", 1),
(else_try),
(val_add, ":cur_target_amount", 1),
(try_end),
(try_end),
(val_mul, ":cur_target_amount", 4),
(val_min, ":cur_target_amount", 60),
(quest_set_slot, "qst_report_to_army", slot_quest_giver_troop, ":faction_marshall"),
(quest_set_slot, "qst_report_to_army", slot_quest_target_troop, ":faction_marshall"),
(quest_set_slot, "qst_report_to_army", slot_quest_target_amount, ":cur_target_amount"),
(quest_set_slot, "qst_report_to_army", slot_quest_expiration_days, 4),
(quest_set_slot, "qst_report_to_army", slot_quest_dont_give_again_period, 28),
(jump_to_menu, "mnu_kingdom_army_quest_report_to_army"),
]),
# Army quest initializer
(3,
[
(assign, "$g_random_army_quest", -1),
(check_quest_active, "qst_follow_army", 1),
(is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
#Rebellion changes begin
# (neg|is_between, "$players_kingdom", rebel_factions_begin, rebel_factions_end),
#Rebellion changes end
(neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
(faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall),
(neq, ":faction_marshall", "trp_player"),
(gt, ":faction_marshall", 0),
(troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party),
(gt, ":faction_marshall_party", 0),
(store_distance_to_party_from_party, ":dist", ":faction_marshall_party", "p_main_party"),
(try_begin),
(lt, ":dist", 15),
(assign, "$g_player_follow_army_warnings", 0),
(store_current_hours, ":cur_hours"),
(faction_get_slot, ":last_offensive_time", "$players_kingdom", slot_faction_ai_last_offensive_time),
(store_sub, ":passed_time", ":cur_hours", ":last_offensive_time"),
(assign, ":result", -1),
(try_begin),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 30),
(troop_slot_eq, ":faction_marshall", slot_troop_does_not_give_quest, 0),
(try_for_range, ":unused", 0, 20), #Repeat trial twenty times
(eq, ":result", -1),
(store_random_in_range, ":quest_no", army_quests_begin, army_quests_end),
(neg|quest_slot_ge, ":quest_no", slot_quest_dont_give_again_remaining_days, 1),
(try_begin),
(eq, ":quest_no", "qst_deliver_cattle_to_army"),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_attacking_center),
(gt, ":passed_time", 120),#5 days
(store_random_in_range, ":quest_target_amount", 5, 10),
(assign, ":result", ":quest_no"),
(quest_set_slot, ":result", slot_quest_target_amount, ":quest_target_amount"),
(quest_set_slot, ":result", slot_quest_expiration_days, 10),
(quest_set_slot, ":result", slot_quest_dont_give_again_period, 30),
(try_end),
(else_try),
(eq, ":quest_no", "qst_join_siege_with_army"),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_attacking_center),
(faction_get_slot, ":ai_object", "$players_kingdom", slot_faction_ai_object),
(is_between, ":ai_object", walled_centers_begin, walled_centers_end),
(party_get_battle_opponent, ":besieged_center", ":faction_marshall_party"),
(eq, ":besieged_center", ":ai_object"),
#army is assaulting the center
(assign, ":result", ":quest_no"),
(quest_set_slot, ":result", slot_quest_target_center, ":ai_object"),
(quest_set_slot, ":result", slot_quest_expiration_days, 2),
(quest_set_slot, ":result", slot_quest_dont_give_again_period, 15),
(try_end),
(else_try),
(eq, ":quest_no", "qst_scout_waypoints"),
(try_begin),
(assign, ":end_cond", 100),
(assign, "$qst_scout_waypoints_wp_1", -1),
(assign, "$qst_scout_waypoints_wp_2", -1),
(assign, "$qst_scout_waypoints_wp_3", -1),
(assign, ":continue", 0),
(try_for_range, ":unused", 0, ":end_cond"),
(try_begin),
(lt, "$qst_scout_waypoints_wp_1", 0),
(call_script, "script_cf_get_random_enemy_center_within_range", ":faction_marshall_party", 50),
(assign, "$qst_scout_waypoints_wp_1", reg0),
(try_end),
(try_begin),
(lt, "$qst_scout_waypoints_wp_2", 0),
(call_script, "script_cf_get_random_enemy_center_within_range", ":faction_marshall_party", 50),
(neq, "$qst_scout_waypoints_wp_1", reg0),
(assign, "$qst_scout_waypoints_wp_2", reg0),
(try_end),
(try_begin),
(lt, "$qst_scout_waypoints_wp_3", 0),
(call_script, "script_cf_get_random_enemy_center_within_range", ":faction_marshall_party", 50),
(neq, "$qst_scout_waypoints_wp_1", reg0),
(neq, "$qst_scout_waypoints_wp_2", reg0),
(assign, "$qst_scout_waypoints_wp_3", reg0),
(try_end),
(neq, "$qst_scout_waypoints_wp_1", "$qst_scout_waypoints_wp_2"),
(neq, "$qst_scout_waypoints_wp_1", "$qst_scout_waypoints_wp_2"),
(neq, "$qst_scout_waypoints_wp_2", "$qst_scout_waypoints_wp_3"),
(ge, "$qst_scout_waypoints_wp_1", 0),
(ge, "$qst_scout_waypoints_wp_2", 0),
(ge, "$qst_scout_waypoints_wp_3", 0),
(assign, ":end_cond", 0),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(assign, "$qst_scout_waypoints_wp_1_visited", 0),
(assign, "$qst_scout_waypoints_wp_2_visited", 0),
(assign, "$qst_scout_waypoints_wp_3_visited", 0),
(assign, ":result", ":quest_no"),
(quest_set_slot, ":result", slot_quest_expiration_days, 7),
(quest_set_slot, ":result", slot_quest_dont_give_again_period, 25),
(try_end),
(try_end),
(try_end),
(try_begin),
(neq, ":result", -1),
(quest_set_slot, ":result", slot_quest_current_state, 0),
(quest_set_slot, ":result", slot_quest_giver_troop, ":faction_marshall"),
(try_begin),
(eq, ":result", "qst_join_siege_with_army"),
(jump_to_menu, "mnu_kingdom_army_quest_join_siege_order"),
(else_try),
(assign, "$g_random_army_quest", ":result"),
(quest_set_slot, "$g_random_army_quest", slot_quest_giver_troop, ":faction_marshall"),
(jump_to_menu, "mnu_kingdom_army_quest_messenger"),
(try_end),
(try_end),
(try_end),
(else_try),
(val_add, "$g_player_follow_army_warnings", 1),
(try_begin),
(lt, "$g_player_follow_army_warnings", 12),
(try_begin),
(store_mod, ":follow_mod", "$g_player_follow_army_warnings", 4),
(eq, ":follow_mod", 0),
(str_store_troop_name_link, s1, ":faction_marshall"),
(try_begin),
(lt, "$g_player_follow_army_warnings", 8),
(display_message, "@You must follow {s1}!"),
(else_try),
(display_message, "@You must follow {s1}! This is your last warning!"),
(try_end),
(try_end),
(else_try),
(jump_to_menu, "mnu_kingdom_army_follow_failed"),
(try_end),
(try_end),
]),
# Move cattle herd
(0.5, [(check_quest_active,"qst_move_cattle_herd"),
(neg|check_quest_concluded,"qst_move_cattle_herd"),
(quest_get_slot, ":target_party", "qst_move_cattle_herd", slot_quest_target_party),
(quest_get_slot, ":target_center", "qst_move_cattle_herd", slot_quest_target_center),
(store_distance_to_party_from_party, ":dist",":target_party", ":target_center"),
(lt, ":dist", 3),
(remove_party, ":target_party"),
(call_script, "script_succeed_quest", "qst_move_cattle_herd"),
]),
(2, [
(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(ge, ":party_no", 1),
(party_slot_eq, ":party_no", slot_party_following_player, 1),
(store_current_hours, ":cur_time"),
(neg|party_slot_ge, ":party_no", slot_party_follow_player_until_time, ":cur_time"),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(party_set_slot, ":party_no", slot_party_following_player, 0),
(assign, ":dont_follow_period", 200),
(store_add, ":dont_follow_time", ":cur_time", ":dont_follow_period"),
(party_set_slot, ":party_no", slot_party_dont_follow_player_until_time, ":dont_follow_time"),
(try_end),
]),
# Deliver cattle and deliver cattle to army
(0.5,
[
(try_begin),
(check_quest_active,"qst_deliver_cattle"),
(neg|check_quest_succeeded, "qst_deliver_cattle"),
(quest_get_slot, ":target_center", "qst_deliver_cattle", slot_quest_target_center),
(quest_get_slot, ":target_amount", "qst_deliver_cattle", slot_quest_target_amount),
(quest_get_slot, ":cur_amount", "qst_deliver_cattle", slot_quest_current_state),
(store_sub, ":left_amount", ":target_amount", ":cur_amount"),
(call_script, "script_remove_cattles_if_herd_is_close_to_party", ":target_center", ":left_amount"),
(val_add, ":cur_amount", reg0),
(quest_set_slot, "qst_deliver_cattle", slot_quest_current_state, ":cur_amount"),
(le, ":target_amount", ":cur_amount"),
(call_script, "script_succeed_quest", "qst_deliver_cattle"),
(try_end),
(try_begin),
(check_quest_active, "qst_deliver_cattle_to_army"),
(neg|check_quest_succeeded, "qst_deliver_cattle_to_army"),
(quest_get_slot, ":giver_troop", "qst_deliver_cattle_to_army", slot_quest_giver_troop),
(troop_get_slot, ":target_party", ":giver_troop", slot_troop_leaded_party),
(try_begin),
(gt, ":target_party", 0),
(quest_get_slot, ":target_amount", "qst_deliver_cattle_to_army", slot_quest_target_amount),
(quest_get_slot, ":cur_amount", "qst_deliver_cattle_to_army", slot_quest_current_state),
(store_sub, ":left_amount", ":target_amount", ":cur_amount"),
(call_script, "script_remove_cattles_if_herd_is_close_to_party", ":target_party", ":left_amount"),
(val_add, ":cur_amount", reg0),
(quest_set_slot, "qst_deliver_cattle_to_army", slot_quest_current_state, ":cur_amount"),
(try_begin),
(le, ":target_amount", ":cur_amount"),
(call_script, "script_succeed_quest", "qst_deliver_cattle_to_army"),
(try_end),
(else_try),
(call_script, "script_abort_quest", "qst_deliver_cattle_to_army", 0),
(try_end),
(try_end),
]),
# Train peasants against bandits
(1,
[
(neg|map_free),
(check_quest_active, "qst_train_peasants_against_bandits"),
(neg|check_quest_concluded, "qst_train_peasants_against_bandits"),
(eq, "$qst_train_peasants_against_bandits_currently_training", 1),
(val_add, "$qst_train_peasants_against_bandits_num_hours_trained", 1),
(call_script, "script_get_max_skill_of_player_party", "skl_trainer"),
(assign, ":trainer_skill", reg0),
(store_sub, ":needed_hours", 20, ":trainer_skill"),
(val_mul, ":needed_hours", 3),
(val_div, ":needed_hours", 5),
(ge, "$qst_train_peasants_against_bandits_num_hours_trained", ":needed_hours"),
(assign, "$qst_train_peasants_against_bandits_num_hours_trained", 0),
(rest_for_hours, 0, 0, 0), #stop resting
(jump_to_menu, "mnu_train_peasants_against_bandits_ready"),
]),
# Scout waypoints
(1,
[
(check_quest_active,"qst_scout_waypoints"),
(neg|check_quest_succeeded, "qst_scout_waypoints"),
(try_begin),
(eq, "$qst_scout_waypoints_wp_1_visited", 0),
(store_distance_to_party_from_party, ":distance", "$qst_scout_waypoints_wp_1", "p_main_party"),
(le, ":distance", 3),
(assign, "$qst_scout_waypoints_wp_1_visited", 1),
(str_store_party_name_link, s1, "$qst_scout_waypoints_wp_1"),
(display_message, "@{s1} is scouted."),
(try_end),
(try_begin),
(eq, "$qst_scout_waypoints_wp_2_visited", 0),
(store_distance_to_party_from_party, ":distance", "$qst_scout_waypoints_wp_2", "p_main_party"),
(le, ":distance", 3),
(assign, "$qst_scout_waypoints_wp_2_visited", 1),
(str_store_party_name_link, s1, "$qst_scout_waypoints_wp_2"),
(display_message, "@{s1} is scouted."),
(try_end),
(try_begin),
(eq, "$qst_scout_waypoints_wp_3_visited", 0),
(store_distance_to_party_from_party, ":distance", "$qst_scout_waypoints_wp_3", "p_main_party"),
(le, ":distance", 3),
(assign, "$qst_scout_waypoints_wp_3_visited", 1),
(str_store_party_name_link, s1, "$qst_scout_waypoints_wp_3"),
(display_message, "@{s1} is scouted."),
(try_end),
(eq, "$qst_scout_waypoints_wp_1_visited", 1),
(eq, "$qst_scout_waypoints_wp_2_visited", 1),
(eq, "$qst_scout_waypoints_wp_3_visited", 1),
(call_script, "script_succeed_quest", "qst_scout_waypoints"),
]),
# Kill local merchant
(3, [(neg|map_free),
(check_quest_active, "qst_kill_local_merchant"),
(quest_slot_eq, "qst_kill_local_merchant", slot_quest_current_state, 0),
(quest_set_slot, "qst_kill_local_merchant", slot_quest_current_state, 1),
(rest_for_hours, 0, 0, 0), #stop resting
(assign, "$auto_enter_town", "$qst_kill_local_merchant_center"),
(assign, "$quest_auto_menu", "mnu_kill_local_merchant_begin"),
]),
# Collect taxes
(1, [(neg|map_free),
(check_quest_active, "qst_collect_taxes"),
(eq, "$g_player_is_captive", 0),
(eq, "$qst_collect_taxes_currently_collecting", 1),
(quest_get_slot, ":quest_current_state", "qst_collect_taxes", slot_quest_current_state),
(this_or_next|eq, ":quest_current_state", 1),
(this_or_next|eq, ":quest_current_state", 2),
(eq, ":quest_current_state", 3),
(quest_get_slot, ":left_hours", "qst_collect_taxes", slot_quest_target_amount),
(val_sub, ":left_hours", 1),
(quest_set_slot, "qst_collect_taxes", slot_quest_target_amount, ":left_hours"),
(call_script, "script_get_max_skill_of_player_party", "skl_trade"),
(try_begin),
(lt, ":left_hours", 0),
(assign, ":quest_current_state", 4),
(quest_set_slot, "qst_collect_taxes", slot_quest_current_state, 4),
(rest_for_hours, 0, 0, 0), #stop resting
(jump_to_menu, "mnu_collect_taxes_complete"),
(else_try),
#Continue collecting taxes
(assign, ":max_collected_tax", "$qst_collect_taxes_hourly_income"),
(party_get_slot, ":prosperity", "$g_encountered_party", slot_town_prosperity),
(store_add, ":multiplier", 30, ":prosperity"),
(val_mul, ":max_collected_tax", ":multiplier"),
(val_div, ":max_collected_tax", 80),#Prosperity of 50 gives the default values
(try_begin),
(eq, "$qst_collect_taxes_halve_taxes", 1),
(val_div, ":max_collected_tax", 2),
(try_end),
(val_max, ":max_collected_tax", 2),
(store_random_in_range, ":collected_tax", 1, ":max_collected_tax"),
(quest_get_slot, ":cur_collected", "qst_collect_taxes", slot_quest_gold_reward),
(val_add, ":cur_collected", ":collected_tax"),
(quest_set_slot, "qst_collect_taxes", slot_quest_gold_reward, ":cur_collected"),
(call_script, "script_troop_add_gold", "trp_player", ":collected_tax"),
(try_end),
(try_begin),
(eq, ":quest_current_state", 1),
(val_sub, "$qst_collect_taxes_menu_counter", 1),
(le, "$qst_collect_taxes_menu_counter", 0),
(quest_set_slot, "qst_collect_taxes", slot_quest_current_state, 2),
(jump_to_menu, "mnu_collect_taxes_revolt_warning"),
(else_try), #Chance of revolt against player
(eq, ":quest_current_state", 2),
(val_sub, "$qst_collect_taxes_unrest_counter", 1),
(le, "$qst_collect_taxes_unrest_counter", 0),
(eq, "$qst_collect_taxes_halve_taxes", 0),
(quest_set_slot, "qst_collect_taxes", slot_quest_current_state, 3),
(store_div, ":unrest_chance", 10000, "$qst_collect_taxes_total_hours"),
(val_add, ":unrest_chance",30),
(store_random_in_range, ":unrest_roll", 0, 1000),
(try_begin),
(lt, ":unrest_roll", ":unrest_chance"),
(jump_to_menu, "mnu_collect_taxes_revolt"),
(try_end),
(try_end),
]),
#persuade_lords_to_make_peace begin
(72, [(gt, "$g_force_peace_faction_1", 0),
(gt, "$g_force_peace_faction_2", 0),
(try_begin),
(store_relation, ":relation", "$g_force_peace_faction_1", "$g_force_peace_faction_2"),
(lt, ":relation", 0),
(call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_force_peace_faction_1", "$g_force_peace_faction_2", 1),
(try_end),
(assign, "$g_force_peace_faction_1", 0),
(assign, "$g_force_peace_faction_2", 0),
]),
#NPC changes begin
(1,
[
#Resolve one issue each hour
(try_begin),
### Here do NPC that is quitting
(gt, "$npc_is_quitting", 0),
(try_begin),
(main_party_has_troop, "$npc_is_quitting"),
(neq, "$g_player_is_captive", 1),
(start_map_conversation, "$npc_is_quitting"),
(else_try),
(assign, "$npc_is_quitting", 0),
(try_end),
(else_try),
#### Grievance
(gt, "$npc_with_grievance", 0),
(eq, "$disable_npc_complaints", 0),
(try_begin),
(main_party_has_troop, "$npc_with_grievance"),
(neq, "$g_player_is_captive", 1),
(assign, "$npc_map_talk_context", slot_troop_morality_state),
(start_map_conversation, "$npc_with_grievance"),
(else_try),
(assign, "$npc_with_grievance", 0),
(try_end),
(else_try),
(gt, "$npc_with_personality_clash", 0),
(eq, "$disable_npc_complaints", 0),
(troop_get_slot, ":object", "$npc_with_personality_clash", slot_troop_personalityclash_object),
(try_begin),
(main_party_has_troop, "$npc_with_personality_clash"),
(main_party_has_troop, ":object"),
(neq, "$g_player_is_captive", 1),
(assign, "$npc_map_talk_context", slot_troop_personalityclash_state),
(start_map_conversation, "$npc_with_personality_clash"),
(else_try),
(assign, "$npc_with_personality_clash", 0),
(try_end),
(else_try), ###check for regional background
(eq, "$disable_local_histories", 0),
(try_for_range, ":npc", companions_begin, companions_end),
(main_party_has_troop, ":npc"),
(troop_slot_eq, ":npc", slot_troop_home_speech_delivered, 0),
# (eq, "$npc_map_talk_context", 0),
(troop_get_slot, ":home", ":npc", slot_troop_home),
(gt, ":home", 0),
(store_distance_to_party_from_party, ":distance", ":home", "p_main_party"),
(lt, ":distance", 7),
(assign, "$npc_map_talk_context", slot_troop_home),
(start_map_conversation, ":npc"),
(try_end),
(try_end),
]),
#NPC changes end
##(1,
## [(store_random_in_range, ":random_troop", kingdom_heroes_begin, kingdom_heroes_end),
## (store_random_in_range, ":random_faction", kingdoms_begin, kingdoms_end),
## (store_troop_faction, ":troop_faction", ":random_troop"),
## (neq, ":troop_faction", ":random_faction"),
## (faction_slot_eq, ":random_faction", slot_faction_state, sfs_active),
## (troop_set_slot, ":random_troop", slot_troop_change_to_faction, ":random_faction"),
## (str_store_troop_name, s1, ":random_troop"),
## (str_store_faction_name, s2, ":troop_faction"),
## (str_store_faction_name, s3, ":random_faction"),
## (display_message, "@{s1} is willing to switch from {s2} to {s3}."),
## ]),
(4,
[(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
(troop_slot_ge, ":troop_no", slot_troop_change_to_faction, 1),
(store_troop_faction, ":faction_no", ":troop_no"),
(troop_get_slot, ":new_faction_no", ":troop_no", slot_troop_change_to_faction),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(assign, ":continue", 0),
(try_begin),
(le, ":party_no", 0),
#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(assign, ":continue", 1),
(else_try),
(gt, ":party_no", 0),
#checking if the party is outside the centers
(party_get_attached_to, ":cur_center_no", ":party_no"),
(try_begin),
(lt, ":cur_center_no", 0),
(party_get_cur_town, ":cur_center_no", ":party_no"),
(try_end),
(this_or_next|neg|is_between, ":cur_center_no", centers_begin, centers_end),
(party_slot_eq, ":cur_center_no", slot_town_lord, ":troop_no"),
#checking if the party is away from his original faction parties
(assign, ":end_cond", kingdom_heroes_end),
(try_for_range, ":enemy_troop_no", kingdom_heroes_begin, ":end_cond"),
(troop_get_slot, ":enemy_party_no", ":enemy_troop_no", slot_troop_leaded_party),
(gt, ":enemy_party_no", 0),
(store_faction_of_party, ":enemy_faction_no", ":enemy_party_no"),
(eq, ":enemy_faction_no", ":faction_no"),
(store_distance_to_party_from_party, ":dist", ":party_no", ":enemy_party_no"),
(lt, ":dist", 4),
(assign, ":end_cond", 0),
(try_end),
(neq, ":end_cond", 0),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(call_script, "script_change_troop_faction", ":troop_no", ":new_faction_no"),
(troop_set_slot, ":troop_no", slot_troop_change_to_faction, 0),
(try_begin),
(is_between, ":new_faction_no", kingdoms_begin, kingdoms_end),
(str_store_troop_name_link, s1, ":troop_no"),
(str_store_faction_name_link, s2, ":faction_no"),
(str_store_faction_name_link, s3, ":new_faction_no"),
(display_message, "@{s1} has switched from {s2} to {s3}."),
(try_begin),
(eq, ":faction_no", "$players_kingdom"),
(call_script, "script_add_notification_menu", "mnu_notification_troop_left_players_faction", ":troop_no", ":new_faction_no"),
(else_try),
(eq, ":new_faction_no", "$players_kingdom"),
(call_script, "script_add_notification_menu", "mnu_notification_troop_joined_players_faction", ":troop_no", ":faction_no"),
(try_end),
(try_end),
(try_end),
])
]
| Python |
import random
from header_common import *
from header_items import *
from header_troops import *
from header_skills import *
from ID_factions import *
from ID_items import *
from ID_scenes import *
####################################################################################################################
# Each troop contains the following fields:
# 1) Troop id (string): used for referencing troops in other files. The prefix trp_ is automatically added before each troop-id .
# 2) Toop name (string).
# 3) Plural troop name (string).
# 4) Troop flags (int). See header_troops.py for a list of available flags
# 5) Scene (int) (only applicable to heroes) For example: scn_reyvadin_castle|entry(1) puts troop in reyvadin castle's first entry point
# 6) Reserved (int). Put constant "reserved" or 0.
# 7) Faction (int)
# 8) Inventory (list): Must be a list of items
# 9) Attributes (int): Example usage:
# str_6|agi_6|int_4|cha_5|level(5)
# 10) Weapon proficiencies (int): Example usage:
# wp_one_handed(55)|wp_two_handed(90)|wp_polearm(36)|wp_archery(80)|wp_crossbow(24)|wp_throwing(45)
# The function wp(x) will create random weapon proficiencies close to value x.
# To make an expert archer with other weapon proficiencies close to 60 you can use something like:
# wp_archery(160) | wp(60)
# 11) Skills (int): See header_skills.py to see a list of skills. Example:
# knows_ironflesh_3|knows_power_strike_2|knows_athletics_2|knows_riding_2
# 12) Face code (int): You can obtain the face code by pressing ctrl+E in face generator screen
# 13) Face code (int)(2) (only applicable to regular troops, can be omitted for heroes):
# The game will create random faces between Face code 1 and face code 2 for generated troops
# town_1 Sargoth
# town_2 Tihr
# town_3 Veluca
# town_4 Suno
# town_5 Jelkala
# town_6 Praven
# town_7 Uxkhal
# town_8 Reyvadin
# town_9 Khudan
# town_10 Tulga
# town_11 Curaw
# town_12 Wercheg
# town_13 Rivacheg
# town_14 Halmar
####################################################################################################################
# Some constant and function declarations to be used below...
def wp(x):
n = 0
r = 10 + int(x / 10)
n |= wp_one_handed(x + random.randrange(r))
n |= wp_two_handed(x + random.randrange(r))
n |= wp_polearm(x + random.randrange(r))
n |= wp_archery(x + random.randrange(r))
n |= wp_crossbow(x + random.randrange(r))
n |= wp_throwing(x + random.randrange(r))
return n
def wp_melee(x):
n = 0
r = 10 + int(x / 10)
n |= wp_one_handed(x + random.randrange(r))
n |= wp_two_handed(x + random.randrange(r))
n |= wp_polearm(x + random.randrange(r))
return n
#Skills
knows_common = knows_riding_1|knows_trade_2|knows_inventory_management_2|knows_prisoner_management_1|knows_leadership_1
def_attrib = str_7 | agi_5 | int_4 | cha_4
knows_lord_1 = knows_riding_3|knows_trade_2|knows_inventory_management_2|knows_tactics_4|knows_prisoner_management_4|knows_leadership_7
knows_warrior_npc = knows_weapon_master_2|knows_ironflesh_1|knows_athletics_1|knows_power_strike_2|knows_riding_2|knows_shield_1|knows_inventory_management_2
knows_merchant_npc = knows_riding_2|knows_trade_3|knows_inventory_management_3 #knows persuasion
knows_tracker_npc = knows_weapon_master_1|knows_athletics_2|knows_spotting_2|knows_pathfinding_2|knows_tracking_2|knows_ironflesh_1|knows_inventory_management_2
lord_attrib = str_20|agi_20|int_20|cha_20|level(38)
knight_attrib_1 = str_15|agi_14|int_8|cha_16|level(22)
knight_attrib_2 = str_16|agi_16|int_10|cha_18|level(26)
knight_attrib_3 = str_18|agi_17|int_12|cha_20|level(30)
knight_attrib_4 = str_19|agi_19|int_13|cha_22|level(35)
knight_attrib_5 = str_20|agi_20|int_15|cha_25|level(41)
knight_skills_1 = knows_riding_3|knows_ironflesh_2|knows_power_strike_3|knows_athletics_1|knows_tactics_2|knows_prisoner_management_1|knows_leadership_3
knight_skills_2 = knows_riding_4|knows_ironflesh_3|knows_power_strike_4|knows_athletics_2|knows_tactics_3|knows_prisoner_management_2|knows_leadership_5
knight_skills_3 = knows_riding_5|knows_ironflesh_4|knows_power_strike_5|knows_athletics_3|knows_tactics_4|knows_prisoner_management_2|knows_leadership_6
knight_skills_4 = knows_riding_6|knows_ironflesh_5|knows_power_strike_6|knows_athletics_4|knows_tactics_5|knows_prisoner_management_3|knows_leadership_7
knight_skills_5 = knows_riding_7|knows_ironflesh_6|knows_power_strike_7|knows_athletics_5|knows_tactics_6|knows_prisoner_management_3|knows_leadership_9
#These face codes are generated by the in-game face generator.
#Enable edit mode and press ctrl+E in face generator screen to obtain face codes.
reserved = 0
no_scene = 0
swadian_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000
swadian_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000
swadian_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000
swadian_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000
swadian_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000
swadian_face_younger_2 = 0x00000000000062c76ddcdf7feefbffff00000000001efdbc0000000000000000
swadian_face_young_2 = 0x00000003c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
swadian_face_middle_2 = 0x00000007c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
swadian_face_old_2 = 0x0000000bc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
swadian_face_older_2 = 0x0000000fc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
vaegir_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000
vaegir_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000
vaegir_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000
vaegir_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000
vaegir_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000
vaegir_face_younger_2 = 0x000000003f00230c4deeffffffffffff00000000001efff90000000000000000
vaegir_face_young_2 = 0x00000003bf00230c4deeffffffffffff00000000001efff90000000000000000
vaegir_face_middle_2 = 0x00000007bf00230c4deeffffffffffff00000000001efff90000000000000000
vaegir_face_old_2 = 0x0000000cbf00230c4deeffffffffffff00000000001efff90000000000000000
vaegir_face_older_2 = 0x0000000ff100230c4deeffffffffffff00000000001efff90000000000000000
khergit_face_younger_1 = 0x0000000009003109207000000000000000000000001c80470000000000000000
khergit_face_young_1 = 0x00000003c9003109207000000000000000000000001c80470000000000000000
khergit_face_middle_1 = 0x00000007c9003109207000000000000000000000001c80470000000000000000
khergit_face_old_1 = 0x0000000b89003109207000000000000000000000001c80470000000000000000
khergit_face_older_1 = 0x0000000fc9003109207000000000000000000000001c80470000000000000000
khergit_face_younger_2 = 0x000000003f0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
khergit_face_young_2 = 0x00000003bf0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
khergit_face_middle_2 = 0x000000077f0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
khergit_face_old_2 = 0x0000000b3f0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
khergit_face_older_2 = 0x0000000fff0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
nord_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000
nord_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000
nord_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000
nord_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000
nord_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000
nord_face_younger_2 = 0x00000000310023084deeffffffffffff00000000001efff90000000000000000
nord_face_young_2 = 0x00000003b10023084deeffffffffffff00000000001efff90000000000000000
nord_face_middle_2 = 0x00000008310023084deeffffffffffff00000000001efff90000000000000000
nord_face_old_2 = 0x0000000c710023084deeffffffffffff00000000001efff90000000000000000
nord_face_older_2 = 0x0000000ff10023084deeffffffffffff00000000001efff90000000000000000
rhodok_face_younger_1 = 0x0000000009002003140000000000000000000000001c80400000000000000000
rhodok_face_young_1 = 0x0000000449002003140000000000000000000000001c80400000000000000000
rhodok_face_middle_1 = 0x0000000849002003140000000000000000000000001c80400000000000000000
rhodok_face_old_1 = 0x0000000cc9002003140000000000000000000000001c80400000000000000000
rhodok_face_older_1 = 0x0000000fc9002003140000000000000000000000001c80400000000000000000
rhodok_face_younger_2 = 0x00000000000062c76ddcdf7feefbffff00000000001efdbc0000000000000000
rhodok_face_young_2 = 0x00000003c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
rhodok_face_middle_2 = 0x00000007c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
rhodok_face_old_2 = 0x0000000bc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
rhodok_face_older_2 = 0x0000000fc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
man_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000
man_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000
man_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000
man_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000
man_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000
man_face_younger_2 = 0x000000003f0052064deeffffffffffff00000000001efff90000000000000000
man_face_young_2 = 0x00000003bf0052064deeffffffffffff00000000001efff90000000000000000
man_face_middle_2 = 0x00000007bf0052064deeffffffffffff00000000001efff90000000000000000
man_face_old_2 = 0x0000000bff0052064deeffffffffffff00000000001efff90000000000000000
man_face_older_2 = 0x0000000fff0052064deeffffffffffff00000000001efff90000000000000000
merchant_face_1 = man_face_young_1
merchant_face_2 = man_face_older_2
woman_face_1 = 0x0000000000000001000000000000000000000000001c00000000000000000000
woman_face_2 = 0x00000003bf0030067ff7fbffefff6dff00000000001f6dbf0000000000000000
refugee_face1 = woman_face_1
refugee_face2 = woman_face_2
girl_face1 = woman_face_1
girl_face2 = woman_face_2
mercenary_face_1 = 0x0000000000000000000000000000000000000000001c00000000000000000000
mercenary_face_2 = 0x0000000cff00730b6db6db6db7fbffff00000000001efffe0000000000000000
vaegir_face1 = vaegir_face_young_1
vaegir_face2 = vaegir_face_older_2
bandit_face1 = man_face_young_1
bandit_face2 = man_face_older_2
undead_face1 = 0x00000000002000000000000000000000
undead_face2 = 0x000000000020010000001fffffffffff
#NAMES:
#
troops = [
["player","Player","Player",tf_hero|tf_unmoveable_in_party_window,no_scene,reserved,fac_player_faction,
[],
str_4|agi_4|int_4|cha_4,wp(15),0,0x000000018000000136db6db6db6db6db00000000001db6db0000000000000000],
["temp_troop","Temp Troop","Temp Troop",tf_hero,no_scene,reserved,fac_commoners,[],def_attrib,0,knows_common|knows_inventory_management_10,0],
["game","Game","Game",tf_hero,no_scene,reserved,fac_commoners,[],def_attrib,0,knows_common,0],
["unarmed_troop","Unarmed Troop","Unarmed Troops",tf_hero,no_scene,reserved,fac_commoners,[itm_arrows,itm_short_bow],def_attrib|str_14,0,knows_common|knows_power_draw_2,0],
####################################################################################################################
# Troops before this point are hardwired into the game and their order should not be changed!
####################################################################################################################
["random_town_sequence","Random Town Sequence","Random Town Sequence",tf_hero,no_scene,reserved,fac_commoners,[],def_attrib,0,knows_common|knows_inventory_management_10,0],
["tournament_participants","Tournament Participants","Tournament Participants",tf_hero,no_scene,reserved,fac_commoners,[],def_attrib,0,knows_common|knows_inventory_management_10,0],
["tutorial_maceman","Maceman","Maceman",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_tutorial_club,itm_leather_jerkin,itm_hide_boots],
str_6|agi_6|level(1),wp(50),knows_common,mercenary_face_1,mercenary_face_2],
["tutorial_archer","Archer","Archer",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged,no_scene,reserved,fac_commoners,
[itm_tutorial_short_bow,itm_tutorial_arrows,itm_linen_tunic,itm_hide_boots],
str_6|agi_6|level(5),wp(100),knows_common|knows_power_draw_4,mercenary_face_1,mercenary_face_2],
["tutorial_swordsman","Swordsman","Swordsman",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_tutorial_sword,itm_leather_vest,itm_hide_boots],
str_6|agi_6|level(5),wp(80),knows_common,mercenary_face_1,mercenary_face_2],
["novice_fighter","Novice Fighter","Novice Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_6|agi_6|level(5),wp(60),knows_common,mercenary_face_1, mercenary_face_2],
["regular_fighter","Regular Fighter","Regular Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_8|agi_8|level(11),wp(90),knows_common|knows_ironflesh_1|knows_power_strike_1|knows_athletics_1|knows_riding_1|knows_shield_2,mercenary_face_1, mercenary_face_2],
["veteran_fighter","Veteran Fighter","Veteran Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,0,fac_commoners,
[itm_hide_boots],
str_10|agi_10|level(17),wp(110),knows_common|knows_ironflesh_3|knows_power_strike_2|knows_athletics_2|knows_riding_2|knows_shield_3,mercenary_face_1, mercenary_face_2],
["champion_fighter","Champion Fighter","Champion Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_12|agi_11|level(22),wp(140),knows_common|knows_ironflesh_4|knows_power_strike_3|knows_athletics_3|knows_riding_3|knows_shield_4,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_1","Novice Fighter","Novice Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_6|agi_6|level(5),wp(60),knows_common,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_2","Novice Fighter","Novice Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_7|agi_6|level(7),wp(70),knows_common,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_3","Regular Fighter","Regular Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_8|agi_7|level(9),wp(80),knows_common,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_4","Regular Fighter","Regular Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_8|agi_8|level(11),wp(90),knows_common,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_5","Regular Fighter","Regular Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_9|agi_8|level(13),wp(100),knows_common,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_6","Veteran Fighter","Veteran Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_10|agi_9|level(15),wp(110),knows_common,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_7","Veteran Fighter","Veteran Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_10|agi_10|level(17),wp(120),knows_common,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_8","Veteran Fighter","Veteran Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_11|agi_10|level(19),wp(130),knows_common,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_9","Champion Fighter","Champion Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_12|agi_11|level(21),wp(140),knows_common,mercenary_face_1, mercenary_face_2],
["arena_training_fighter_10","Champion Fighter","Champion Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_hide_boots],
str_12|agi_12|level(23),wp(150),knows_common,mercenary_face_1, mercenary_face_2],
["cattle","Cattle","Cattle",0,no_scene,reserved,fac_neutral, [], def_attrib|level(1),wp(60),0,mercenary_face_1, mercenary_face_2],
#soldiers:
#This troop is the troop marked as soldiers_begin
["farmer","Farmer","Farmers",tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_cleaver,itm_knife,itm_pitch_fork,itm_sickle,itm_club,itm_stones,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_linen_tunic,itm_coarse_tunic,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(4),wp(60),knows_common,man_face_middle_1, man_face_old_2],
["townsman","Townsman","Townsmen",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_cleaver,itm_knife,itm_club,itm_quarter_staff,itm_dagger,itm_stones,itm_leather_cap,itm_linen_tunic,itm_coarse_tunic,itm_leather_apron,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(4),wp(60),knows_common,mercenary_face_1, mercenary_face_2],
["watchman","Watchman","Watchmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,no_scene,reserved,fac_commoners,
[itm_bolts,itm_spiked_club,itm_fighting_pick,itm_sword_medieval_a,itm_boar_spear,itm_hunting_crossbow,itm_light_crossbow,itm_tab_shield_round_a,itm_tab_shield_round_b,itm_padded_cloth,itm_leather_jerkin,itm_leather_cap,itm_padded_coif,itm_footman_helmet,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(9),wp(75),knows_common|knows_shield_1,mercenary_face_1, mercenary_face_2],
["caravan_guard","Caravan Guard","Caravan Guards",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_shield,no_scene,0,fac_commoners,
[itm_spear,itm_fighting_pick,itm_sword_medieval_a,itm_voulge,itm_tab_shield_round_b,itm_tab_shield_round_c,itm_leather_jerkin,itm_leather_vest,itm_hide_boots,itm_padded_coif,itm_nasal_helmet,itm_footman_helmet,itm_saddle_horse],
def_attrib|level(14),wp(85),knows_common|knows_riding_2|knows_ironflesh_1|knows_shield_3,mercenary_face_1, mercenary_face_2],
["mercenary_swordsman","Mercenary Swordsman","Mercenary Swordsmen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners,
[itm_bastard_sword_a,itm_sword_medieval_b,itm_sword_medieval_b_small,itm_tab_shield_heater_c,itm_mail_hauberk,itm_haubergeon,itm_hide_boots,itm_kettle_hat,itm_mail_coif,itm_flat_topped_helmet, itm_helmet_with_neckguard],
def_attrib|level(20),wp(100),knows_common|knows_riding_3|knows_ironflesh_2|knows_shield_3|knows_power_strike_2,mercenary_face_1, mercenary_face_2],
["hired_blade","Hired Blade","Hired Blades",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners,
[itm_bastard_sword_b,itm_sword_medieval_c,itm_tab_shield_heater_cav_a,itm_haubergeon,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_great_helmet,itm_bascinet, itm_leather_gloves],
def_attrib|level(25),wp(130),knows_common|knows_riding_3|knows_athletics_5|knows_shield_4|knows_power_strike_4|knows_ironflesh_3,mercenary_face_1, mercenary_face_2],
["mercenary_crossbowman","Mercenary Crossbowman","Mercenary Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged,no_scene,reserved,fac_commoners,
[itm_bolts,itm_spiked_club,itm_fighting_pick,itm_sword_medieval_a,itm_boar_spear,itm_crossbow,itm_tab_shield_pavise_a,itm_tab_shield_round_b,itm_padded_cloth,itm_leather_jerkin,itm_leather_cap,itm_padded_coif,itm_footman_helmet,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(19),wp_melee(90)|wp_crossbow(120),knows_common|knows_athletics_2|knows_shield_1,mercenary_face_1, mercenary_face_2],
["mercenary_horseman","Mercenary Horseman","Mercenary Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners,
[itm_lance,itm_bastard_sword_a,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_mail_shirt,itm_haubergeon,itm_hide_boots,itm_norman_helmet,itm_mail_coif,itm_helmet_with_neckguard,itm_saddle_horse,itm_courser,itm_hunter],
def_attrib|level(20),wp(100),knows_common|knows_riding_4|knows_ironflesh_2|knows_shield_2|knows_power_strike_2,mercenary_face_1, mercenary_face_2],
["mercenary_cavalry","Mercenary Cavalry","Mercenary Cavalry",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners,
[itm_lance,itm_bastard_sword_a,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_mail_hauberk,itm_banded_armor,itm_hide_boots,itm_kettle_hat,itm_mail_coif,itm_flat_topped_helmet,itm_helmet_with_neckguard,itm_saddle_horse,itm_courser,itm_hunter],
def_attrib|level(25),wp(120),knows_common|knows_riding_5|knows_ironflesh_3|knows_shield_3|knows_power_strike_3,mercenary_face_1, mercenary_face_2],
["mercenaries_end","mercenaries_end","mercenaries_end",0,no_scene,reserved,fac_commoners,
[],
def_attrib|level(4),wp(60),knows_common,mercenary_face_1, mercenary_face_2],
#peasant - retainer - footman - man-at-arms - knight
["swadian_recruit","Swadian Recruit","Swadian Recruits",tf_guarantee_armor,0,0,fac_neutral,
[itm_scythe,itm_hatchet,itm_pickaxe,itm_club,itm_stones,itm_tab_shield_heater_a,itm_leather_cap,itm_felt_hat,itm_felt_hat,
itm_shirt,itm_coarse_tunic,itm_leather_apron,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(4),wp(60),knows_common,swadian_face_younger_1, swadian_face_middle_2],
["swadian_militia","Swadian Militia","Swadian Militia",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral,
[itm_bolts,itm_spiked_club,itm_fighting_pick,itm_boar_spear,itm_hunting_crossbow,itm_tab_shield_heater_a,
itm_padded_cloth,itm_leather_armor,itm_leather_cap,itm_arming_cap,itm_padded_coif,itm_ankle_boots,itm_wrapping_boots],
def_attrib|level(9),wp(75),knows_common,swadian_face_young_1, swadian_face_old_2],
["swadian_footman","Swadian Footman","Swadian Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral,
[itm_spear,itm_fighting_pick,itm_sword_medieval_b_small,itm_sword_medieval_a,itm_tab_shield_heater_b,
itm_leather_jerkin,itm_padded_leather,itm_leather_armor,itm_ankle_boots,itm_padded_coif,itm_footman_helmet],
def_attrib|level(14),wp_melee(85),knows_common|knows_ironflesh_1|knows_shield_2,swadian_face_young_1, swadian_face_old_2],
["swadian_infantry","Swadian Infantry","Swadian Infantry",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_pike,itm_fighting_pick,itm_bastard_sword_a,itm_sword_medieval_a,itm_sword_medieval_b_small,itm_tab_shield_heater_c,
itm_mail_with_surcoat,itm_haubergeon,itm_hide_boots,itm_ankle_boots,itm_kettle_hat,itm_mail_coif,itm_flat_topped_helmet,itm_helmet_with_neckguard],
def_attrib|level(20),wp_melee(105),knows_common|knows_riding_3|knows_ironflesh_2|knows_shield_3,swadian_face_middle_1, swadian_face_old_2],
["swadian_sergeant","Swadian Sergeant","Swadian Sergeants",tf_mounted|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_awlpike,itm_bastard_sword_b,itm_morningstar,itm_sword_medieval_c,itm_tab_shield_heater_d,
itm_coat_of_plates,itm_mail_with_surcoat,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_helmet_with_neckguard,itm_bascinet,itm_guard_helmet,itm_leather_gloves],
def_attrib|level(25),wp_melee(135),knows_common|knows_shield_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_older_2],
["swadian_skirmisher","Swadian Skirmisher","Swadian Skirmishers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_bolts,itm_light_crossbow,itm_hunting_crossbow,itm_dagger,itm_club,itm_voulge,itm_tab_shield_heater_a,
itm_leather_armor,itm_padded_cloth,itm_ankle_boots,itm_padded_coif,itm_arming_cap,itm_footman_helmet],
def_attrib|level(14),wp(80),knows_common|knows_riding_2|knows_ironflesh_1,swadian_face_young_1, swadian_face_middle_2],
["swadian_crossbowman","Swadian Crossbowman","Swadian Crossbowmen",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_bolts,itm_crossbow,itm_light_crossbow,itm_fighting_pick,itm_dagger,itm_sword_medieval_a,itm_voulge,itm_tab_shield_heater_b,
itm_leather_jerkin,itm_leather_armor,itm_hide_boots,itm_ankle_boots,itm_padded_coif,itm_nasal_helmet,itm_footman_helmet],
def_attrib|level(19),wp_melee(90)|wp_crossbow(100),knows_common|knows_riding_2|knows_ironflesh_1,swadian_face_young_1, swadian_face_old_2],
["swadian_sharpshooter","Swadian Sharpshooter","Swadian Sharpshooters",tf_guarantee_ranged|tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_bolts,itm_arrows,itm_crossbow,itm_crossbow,itm_heavy_crossbow,itm_sword_medieval_b_small,itm_sword_medieval_a,itm_voulge,itm_tab_shield_heater_c,
itm_haubergeon,itm_padded_leather,itm_hide_boots,itm_norman_helmet,itm_nasal_helmet,itm_kettle_hat,itm_kettle_hat,itm_leather_gloves],
def_attrib|str_14|level(24),wp_melee(100)|wp_crossbow(130),knows_common|knows_power_draw_3|knows_ironflesh_1,swadian_face_middle_1, swadian_face_older_2],
["swadian_man_at_arms","Swadian Man at Arms","Swadian Men at Arms",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_neutral,
[itm_lance,itm_fighting_pick,itm_bastard_sword_a,itm_sword_medieval_b,itm_sword_medieval_c_small,itm_tab_shield_heater_cav_a,
itm_haubergeon,itm_mail_with_surcoat,itm_hide_boots,itm_norman_helmet,itm_mail_coif,itm_flat_topped_helmet,itm_helmet_with_neckguard,itm_warhorse,itm_warhorse,itm_hunter],
def_attrib|level(20),wp_melee(100),knows_common|knows_riding_4|knows_ironflesh_2|knows_shield_2|knows_power_strike_3,swadian_face_young_1, swadian_face_old_2],
["swadian_knight","Swadian Knight","Swadian Knights",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_neutral,
[itm_heavy_lance,itm_bastard_sword_b,itm_morningstar,itm_sword_medieval_c,itm_tab_shield_heater_cav_b,
itm_coat_of_plates,itm_cuir_bouilli,itm_mail_with_surcoat,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_great_helmet,itm_bascinet,itm_hunter,itm_warhorse,itm_leather_gloves,itm_mail_mittens],
def_attrib|level(25),wp_melee(130),knows_common|knows_riding_5|knows_shield_3|knows_ironflesh_4|knows_power_strike_5,swadian_face_middle_1, swadian_face_older_2],
["swadian_messenger","Swadian Messenger","Swadian Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral,
[itm_sword_medieval_a,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_light_crossbow,itm_bolts],
def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5,swadian_face_young_1, swadian_face_old_2],
["swadian_deserter","Swadian Deserter","Swadian Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters,
[itm_bolts,itm_light_crossbow,itm_hunting_crossbow,itm_dagger,itm_club,itm_voulge,itm_wooden_shield,itm_leather_jerkin,itm_padded_cloth,itm_hide_boots,itm_padded_coif,itm_nasal_helmet,itm_footman_helmet],
def_attrib|level(14),wp(80),knows_common|knows_riding_2|knows_ironflesh_1,swadian_face_young_1, swadian_face_old_2],
["swadian_prison_guard","Prison Guard","Prison Guards",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_awlpike,itm_pike,itm_great_sword,itm_morningstar,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_coat_of_plates,itm_plate_armor,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_helmet_with_neckguard,itm_bascinet,itm_guard_helmet,itm_leather_gloves],
def_attrib|level(25),wp(130),knows_common|knows_shield_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_young_1, swadian_face_old_2],
["swadian_castle_guard","Castle Guard","Castle Guards",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_awlpike,itm_pike,itm_great_sword,itm_morningstar,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_tab_shield_heater_d,itm_coat_of_plates,itm_plate_armor,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_helmet_with_neckguard,itm_bascinet,itm_guard_helmet,itm_leather_gloves],
def_attrib|level(25),wp(130),knows_common|knows_shield_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_young_1, swadian_face_old_2],
# Vaegir watchman?
["vaegir_recruit","Vaegir Recruit","Vaegir Recruits",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_scythe,itm_hatchet,itm_cudgel,itm_axe,itm_stones,itm_tab_shield_kite_a, itm_tab_shield_kite_a,itm_rawhide_coat,itm_nomad_armor,itm_nomad_boots],
def_attrib|level(4),wp(60),knows_common, vaegir_face_younger_1, vaegir_face_middle_2],
["vaegir_footman","Vaegir Footman","Vaegir Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral,
[itm_spiked_club,itm_hand_axe,itm_sword_viking_1,itm_two_handed_axe,itm_tab_shield_kite_a,itm_tab_shield_kite_b,itm_spear,itm_nomad_cap,itm_skullcap,itm_rawhide_coat,itm_nomad_armor,itm_nomad_boots],
def_attrib|level(9),wp(75),knows_common, vaegir_face_young_1, vaegir_face_middle_2],
["vaegir_skirmisher","Vaegir Skirmisher","Vaegir Skirmishers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_arrows,itm_spiked_mace,itm_axe,itm_sword_khergit_1,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots],
def_attrib|str_10|level(14),wp(60),knows_ironflesh_1|knows_power_draw_1|knows_power_throw_1,vaegir_face_young_1, vaegir_face_old_2],
["vaegir_archer","Vaegir Archer","Vaegir Archers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_arrows,itm_axe,itm_sword_khergit_1,itm_nomad_bow,itm_nomad_bow,itm_short_bow,itm_leather_jerkin,itm_leather_vest,itm_nomad_boots,itm_spiked_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_nomad_cap],
def_attrib|str_12|level(19),wp_melee(70)|wp_archery(110),knows_ironflesh_1|knows_power_draw_2|knows_athletics_2|knows_power_throw_1,vaegir_face_young_1, vaegir_face_older_2],
["vaegir_marksman","Vaegir Marksman","Vaegir Marksmen",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_arrows,itm_axe,itm_voulge,itm_sword_khergit_2,itm_strong_bow,itm_nomad_bow,itm_nomad_bow,itm_leather_vest,itm_studded_leather_coat,itm_nomad_boots,itm_spiked_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_nomad_cap],
def_attrib|str_14|level(24),wp_melee(80)|wp_archery(140),knows_ironflesh_2|knows_power_draw_4|knows_athletics_3|knows_power_throw_1,vaegir_face_young_1, vaegir_face_older_2],
["vaegir_veteran","Vaegir Veteran","Vaegir Veterans",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral,
[itm_spiked_mace,itm_two_handed_axe,itm_sword_viking_1,itm_tab_shield_kite_b,itm_tab_shield_kite_c,itm_spear,
itm_steppe_cap,itm_nomad_cap,itm_leather_jerkin,itm_studded_leather_coat,itm_nomad_boots,itm_saddle_horse],
def_attrib|level(14),wp_melee(85),knows_athletics_1|knows_ironflesh_1|knows_shield_2,vaegir_face_young_1, vaegir_face_old_2],
["vaegir_infantry","Vaegir Infantry","Vaegir Infantries",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_pike,itm_battle_axe,itm_sword_viking_2,itm_sword_khergit_2,itm_tab_shield_kite_c,itm_spear,
itm_mail_hauberk,itm_lamellar_vest,itm_nomad_boots,itm_spiked_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_nomad_cap],
def_attrib|level(19),wp_melee(100),knows_athletics_2|knows_ironflesh_2|knows_power_strike_2|knows_shield_2,vaegir_face_young_1, vaegir_face_older_2],
["vaegir_guard","Vaegir Guard","Vaegir Guards",tf_mounted|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_ashwood_pike,itm_battle_fork,itm_bardiche,itm_battle_axe,itm_fighting_axe,itm_tab_shield_kite_d,
itm_banded_armor,itm_lamellar_vest,itm_lamellar_armor,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves],
def_attrib|level(24),wp_melee(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3|knows_power_strike_2,vaegir_face_middle_1, vaegir_face_older_2],
["vaegir_horseman","Vaegir Horseman","Vaegir Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_neutral,
[itm_battle_axe,itm_sword_khergit_2,itm_lance,itm_tab_shield_kite_cav_a,itm_spear,
itm_studded_leather_coat,itm_lamellar_vest,itm_nomad_boots,itm_spiked_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_nomad_cap,itm_steppe_horse,itm_hunter],
def_attrib|level(19),wp(100),knows_riding_3|knows_ironflesh_2|knows_power_strike_1,vaegir_face_young_1, vaegir_face_older_2],
["vaegir_knight","Vaegir Knight","Vaegir Knights",tf_mounted|tf_guarantee_boots|tf_guarantee_gloves|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_neutral,
[itm_bardiche,itm_war_axe,itm_fighting_axe,itm_lance,itm_lance,itm_tab_shield_kite_cav_b,
itm_banded_armor,itm_lamellar_vest,itm_lamellar_armor,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_hunter, itm_warhorse,itm_leather_gloves],
def_attrib|level(24),wp(130),knows_riding_4|knows_shield_2|knows_ironflesh_3|knows_power_strike_2,vaegir_face_middle_1, vaegir_face_older_2],
["vaegir_messenger","Vaegir Messenger","Vaegir Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral,
[itm_sword_medieval_b,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_short_bow,itm_arrows],
def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5|knows_power_draw_5,vaegir_face_young_1, vaegir_face_older_2],
["vaegir_deserter","Vaegir Deserter","Vaegir Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters,
[itm_arrows,itm_spiked_mace,itm_axe,itm_falchion,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots],
def_attrib|str_10|level(14),wp(80),knows_ironflesh_1|knows_power_draw_1,vaegir_face_young_1, vaegir_face_older_2],
["vaegir_prison_guard","Prison Guard","Prison Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_ashwood_pike,itm_battle_fork,itm_bardiche,itm_battle_axe,itm_fighting_axe,itm_tab_shield_kite_b,itm_studded_leather_coat,itm_lamellar_armor,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves],
def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,vaegir_face_middle_1, vaegir_face_older_2],
["vaegir_castle_guard","Castle Guard","Castle Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_ashwood_pike,itm_battle_fork,itm_bardiche,itm_battle_axe,itm_fighting_axe,itm_tab_shield_kite_d,itm_studded_leather_coat,itm_lamellar_armor,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves],
def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,vaegir_face_middle_1, vaegir_face_older_2],
["khergit_tribesman","Khergit Tribesman","Khergit Tribesmen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_khergits,
[itm_arrows,itm_club,itm_spear,itm_hunting_bow,
itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_steppe_armor,itm_nomad_boots,itm_steppe_horse,itm_sumpter_horse],
def_attrib|level(5),wp(50),knows_common|knows_riding_3|knows_power_draw_2|knows_horse_archery_2,khergit_face_younger_1, khergit_face_old_2],
["khergit_skirmisher","Khergit Skirmisher","Khergit Skirmishers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_khergits,
[itm_arrows,itm_sword_khergit_1,itm_winged_mace,itm_spear,itm_nomad_bow,itm_javelin,itm_tab_shield_small_round_a,
itm_steppe_cap,itm_nomad_cap,itm_leather_steppe_cap_a,itm_khergit_armor,itm_steppe_armor,itm_leather_vest,itm_nomad_boots,itm_steppe_horse,itm_saddle_horse],
def_attrib|level(10),wp(60)|wp_archery(80)|wp_throwing(80),knows_common|knows_riding_4|knows_power_draw_3|knows_power_throw_1|knows_horse_archery_3,khergit_face_younger_1, khergit_face_old_2],
["khergit_horseman","Khergit Horseman","Khergit Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_horse,0,0,fac_khergits,
[itm_arrows,itm_light_lance,itm_nomad_bow,itm_sword_khergit_2,itm_tab_shield_small_round_a,itm_tab_shield_small_round_b,itm_spear,
itm_leather_steppe_cap_a, itm_leather_steppe_cap_b,itm_nomad_robe,itm_nomad_vest,itm_nomad_boots,itm_hide_boots,itm_spiked_helmet,itm_nomad_cap,itm_steppe_horse,itm_hunter],
def_attrib|level(14),wp(80),knows_common|knows_riding_5|knows_power_draw_4|knows_ironflesh_1|knows_power_throw_1,khergit_face_young_1, khergit_face_older_2],
["khergit_horse_archer","Khergit Horse Archer","Khergit Horse Archers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_horse,0,0,fac_khergits,
[itm_arrows,itm_sword_khergit_2,itm_winged_mace,itm_spear,itm_khergit_bow,itm_tab_shield_small_round_a,itm_tab_shield_small_round_a,itm_tab_shield_small_round_b,itm_bodkin_arrows,itm_arrows,itm_javelin,
itm_leather_steppe_cap_b,itm_leather_steppe_cap_c,itm_tribal_warrior_outfit,itm_nomad_robe,itm_hide_boots,itm_tab_shield_small_round_a,itm_tab_shield_small_round_b,itm_steppe_horse],
def_attrib|level(14),wp(80)|wp_archery(110),knows_riding_5|knows_power_draw_3|knows_ironflesh_1|knows_horse_archery_4|knows_power_throw_1,khergit_face_young_1, khergit_face_older_2],
["khergit_veteran_horse_archer","Khergit Veteran Horse Archer","Khergit Veteran Horse Archers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_khergits,
[itm_sword_khergit_3,itm_winged_mace,itm_spear,itm_khergit_bow,itm_nomad_bow,itm_nomad_bow,itm_arrows,itm_khergit_arrows,itm_khergit_arrows,itm_javelin,itm_tab_shield_small_round_b,itm_tab_shield_small_round_c,
itm_leather_steppe_cap_c,itm_leather_warrior_cap,itm_lamellar_vest,itm_tribal_warrior_outfit,itm_hide_boots,itm_saddle_horse,itm_courser],
def_attrib|level(21),wp(90)|wp_archery(130),knows_riding_6|knows_power_draw_4|knows_ironflesh_2|knows_horse_archery_5|knows_power_throw_3,khergit_face_middle_1, khergit_face_older_2],
["khergit_lancer","Khergit Lancer","Khergit Lancers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_khergits,
[itm_arrows,itm_sword_khergit_4,itm_winged_mace,itm_spear,itm_lance,itm_lance,itm_khergit_bow, itm_strong_bow,itm_short_bow,itm_khergit_arrows,itm_arrows,
itm_khergit_guard_helmet,itm_khergit_cavalry_helmet,itm_lamellar_vest,itm_lamellar_armor,itm_hide_boots,itm_leather_gloves,itm_tab_shield_small_round_b,itm_tab_shield_small_round_c,itm_courser],
def_attrib|level(23),wp(120),knows_riding_6|knows_power_strike_2|knows_power_draw_2|knows_power_throw_2|knows_ironflesh_2|knows_horse_archery_1,khergit_face_middle_1, khergit_face_older_2],
["khergit_messenger","Khergit Messenger","Khergit Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral,
[itm_sword_khergit_2,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_short_bow,itm_arrows],
def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5|knows_power_draw_5,khergit_face_young_1, khergit_face_older_2],
["khergit_deserter","Khergit Deserter","Khergit Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters,
[itm_arrows,itm_spiked_mace,itm_axe,itm_sword_khergit_1,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots],
def_attrib|str_10|level(14),wp(80),knows_ironflesh_1|knows_power_draw_1,khergit_face_young_1, khergit_face_older_2],
["khergit_prison_guard","Prison Guard","Prison Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_sword_khergit_3,itm_tab_shield_small_round_b,itm_tab_shield_small_round_a,itm_lamellar_vest,itm_lamellar_armor,itm_hide_boots,itm_iron_greaves,itm_khergit_guard_helmet,itm_khergit_cavalry_helmet,itm_leather_warrior_cap],
def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,khergit_face_middle_1, khergit_face_older_2],
["khergit_castle_guard","Castle Guard","Castle Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_sword_khergit_4,itm_tab_shield_small_round_b,itm_tab_shield_small_round_a,itm_lamellar_vest,itm_lamellar_armor,itm_hide_boots,itm_iron_greaves,itm_khergit_guard_helmet,itm_khergit_cavalry_helmet,itm_leather_warrior_cap],
def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,khergit_face_middle_1, khergit_face_older_2],
["nord_recruit","Nord Recruit","Nord Recruits",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_outlaws,
[itm_axe,itm_hatchet,itm_spear,itm_tab_shield_round_a,itm_tab_shield_round_a,
itm_shirt,itm_coarse_tunic,itm_hide_boots,itm_nomad_boots],
def_attrib|level(6),wp(50),knows_power_strike_1|knows_power_throw_1|knows_riding_1|knows_athletics_1,nord_face_younger_1, nord_face_old_2],
["nord_footman","Nord Footman","Nord Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_outlaws,
[itm_fighting_axe,itm_one_handed_war_axe_a,itm_spear,itm_tab_shield_round_a,itm_tab_shield_round_b,itm_javelin,itm_throwing_axes,
itm_leather_cap,itm_skullcap,itm_nomad_vest,itm_shirt,itm_leather_boots,itm_nomad_boots],
def_attrib|level(10),wp(70),knows_ironflesh_2|knows_power_strike_2|knows_power_throw_2|knows_riding_2|knows_athletics_2|knows_shield_1,nord_face_young_1, nord_face_old_2],
["nord_trained_footman","Nord Trained Footman","Nord Trained Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_arrows,itm_one_handed_war_axe_a,itm_one_handed_war_axe_b,itm_one_handed_battle_axe_a,itm_tab_shield_round_b,
itm_skullcap,itm_nasal_helmet,itm_byrnie,itm_studded_leather_coat,itm_leather_jerkin,itm_leather_boots],
def_attrib|level(14),wp(100),knows_ironflesh_3|knows_power_strike_3|knows_power_throw_2|knows_riding_2|knows_athletics_3|knows_shield_2,nord_face_young_1, nord_face_old_2],
["nord_warrior","Nord Warrior","Nord Warriors",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_arrows,itm_sword_viking_1,itm_one_handed_war_axe_b,itm_one_handed_battle_axe_a,itm_tab_shield_round_c,itm_javelin,
itm_nasal_helmet,itm_byrnie,itm_mail_shirt,itm_mail_hauberk,itm_studded_leather_coat,itm_hunter_boots,itm_leather_boots],
def_attrib|level(19),wp(115),knows_ironflesh_4|knows_power_strike_4|knows_power_throw_3|knows_riding_2|knows_athletics_4|knows_shield_3,nord_face_young_1, nord_face_older_2],
["nord_veteran","Nord Veteran","Nord Veterans",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_arrows,itm_sword_viking_2,itm_sword_viking_2_small,itm_one_handed_battle_axe_b,itm_spiked_mace,itm_tab_shield_round_d,itm_javelin,itm_throwing_axes,
itm_nordic_helmet,itm_nasal_helmet,itm_byrnie,itm_mail_hauberk,itm_splinted_leather_greaves,itm_leather_boots,itm_leather_gloves],
def_attrib|level(24),wp(130),knows_ironflesh_5|knows_power_strike_5|knows_power_throw_4|knows_riding_3|knows_athletics_5|knows_shield_4,nord_face_young_1, nord_face_older_2],
["nord_champion","Nord Huscarl","Nord Huscarls",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_arrows,itm_sword_viking_3,itm_sword_viking_3_small,itm_great_axe,itm_one_handed_battle_axe_c,itm_tab_shield_round_e,itm_javelin,itm_throwing_axes,itm_throwing_axes,
itm_nordic_helmet,itm_banded_armor,itm_mail_boots,itm_leather_boots,itm_mail_mittens],
def_attrib|level(28),wp(145),knows_ironflesh_6|knows_power_strike_7|knows_power_throw_5|knows_riding_2|knows_athletics_6|knows_shield_5,nord_face_middle_1, nord_face_older_2],
["nord_huntsman","Nord Huntsman","Nord Huntsmen",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_arrows,itm_hatchet,itm_hunting_bow,itm_shirt,itm_shirt,itm_hide_boots],
def_attrib|str_10|level(11),wp_melee(60)|wp_archery(70),knows_ironflesh_1|knows_power_draw_1|knows_athletics_2,nord_face_young_1, nord_face_old_2],
["nord_archer","Nord Archer","Nord Archers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_arrows,itm_axe,itm_short_bow,itm_leather_jerkin,itm_shirt,itm_leather_boots,itm_nasal_helmet,itm_leather_cap],
def_attrib|str_11|level(15),wp_melee(80)|wp_archery(90),knows_ironflesh_1|knows_power_draw_2|knows_athletics_3,nord_face_young_1, nord_face_old_2],
["nord_veteran_archer","Nord Veteran Archer","Nord Veteran Archers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_arrows,itm_one_handed_war_axe_a,itm_sword_viking_1,itm_long_bow,itm_leather_jerkin,itm_padded_leather,itm_leather_boots,itm_nasal_helmet,itm_leather_cap],
def_attrib|str_12|level(19),wp_melee(95)|wp_archery(110),knows_power_strike_1|knows_ironflesh_2|knows_power_draw_3|knows_athletics_4,nord_face_middle_1, nord_face_older_2],
["nord_messenger","Nord Messenger","Nord Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral,
[itm_sword_viking_2,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_short_bow,itm_arrows],
def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5|knows_power_draw_5,nord_face_young_1, nord_face_older_2],
["nord_deserter","Nord Deserter","Nord Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters,
[itm_arrows,itm_spiked_mace,itm_axe,itm_falchion,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots],
def_attrib|str_10|level(14),wp(80),knows_ironflesh_1|knows_power_draw_1,nord_face_young_1, nord_face_older_2],
["nord_prison_guard","Prison Guard","Prison Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_ashwood_pike,itm_battle_fork,itm_battle_axe,itm_fighting_axe,itm_tab_shield_round_d,itm_mail_hauberk,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves],
def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,nord_face_middle_1, nord_face_older_2],
["nord_castle_guard","Castle Guard","Castle Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_ashwood_pike,itm_battle_fork,itm_battle_axe,itm_fighting_axe,itm_tab_shield_round_d,itm_tab_shield_round_e,itm_mail_hauberk,itm_heraldic_mail_with_tabard,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves],
def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,nord_face_middle_1, nord_face_older_2],
["rhodok_tribesman","Rhodok Tribesman","Rhodok Tribesmen",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_kingdom_5,
[itm_pitch_fork,itm_tab_shield_pavise_a,
itm_shirt,itm_coarse_tunic,itm_wrapping_boots,itm_nomad_boots,itm_head_wrappings],
def_attrib|level(4),wp(55),knows_common|knows_power_draw_2|knows_ironflesh_1,rhodok_face_younger_1, rhodok_face_old_2],
["rhodok_spearman","Rhodok Spearman","Rhodok Spearmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_kingdom_5,
[itm_spear,itm_tab_shield_pavise_a,itm_tab_shield_pavise_a,
itm_leather_cap,itm_common_hood,itm_leather_vest,itm_leather_vest,itm_wrapping_boots,itm_nomad_boots],
def_attrib|level(9),wp(80),knows_common|knows_ironflesh_2|knows_shield_1|knows_power_strike_2|knows_athletics_1,rhodok_face_young_1, rhodok_face_old_2],
["rhodok_trained_spearman","Rhodok Trained Spearman","Rhodok Trained Spearmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_kingdom_5,
[itm_pike,itm_spear,itm_tab_shield_pavise_b,
itm_leather_cap,itm_leather_vest,itm_ragged_outfit,itm_padded_cloth,itm_gambeson,itm_nomad_boots],
def_attrib|level(14),wp(105),knows_common|knows_ironflesh_3|knows_shield_2|knows_power_strike_2|knows_athletics_2,rhodok_face_young_1, rhodok_face_older_2],
["rhodok_veteran_spearman","Rhodok Veteran Spearman","Rhodok Veteran Spearmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield,0,0,fac_kingdom_5,
[itm_ashwood_pike,itm_war_spear,itm_pike,itm_club_with_spike_head,itm_tab_shield_pavise_c,itm_sword_medieval_a,
itm_leather_cap,itm_byrnie,itm_ragged_outfit,itm_nomad_boots],
def_attrib|level(19),wp(115),knows_common|knows_ironflesh_5|knows_shield_3|knows_power_strike_4|knows_athletics_3,rhodok_face_young_1, rhodok_face_older_2],
["rhodok_sergeant","Rhodok Sergeant","Rhodok Sergeants",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield,0,0,fac_kingdom_5,
[itm_glaive,itm_war_spear,itm_sword_medieval_b,itm_tab_shield_pavise_d,
itm_kettle_hat, itm_guard_helmet,itm_spiked_helmet,itm_byrnie,itm_surcoat_over_mail,itm_banded_armor,itm_nomad_boots,],
def_attrib|level(24),wp(130),knows_common|knows_ironflesh_7|knows_shield_5|knows_power_strike_5|knows_athletics_5,rhodok_face_middle_1, rhodok_face_older_2],
["rhodok_crossbowman","Rhodok Crossbowman","Rhodok Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_ranged,0,0,fac_kingdom_5,
[itm_sword_medieval_a,itm_falchion,itm_club_with_spike_head,itm_tab_shield_pavise_a,itm_crossbow,itm_bolts,
itm_leather_jerkin,itm_ragged_outfit,itm_nomad_boots],
def_attrib|level(10),wp(85),knows_common|knows_ironflesh_2|knows_shield_1|knows_power_strike_1|knows_athletics_2,rhodok_face_young_1, rhodok_face_older_2],
["rhodok_trained_crossbowman","Rhodok Trained Crossbowman","Rhodok Trained Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_ranged|tf_guarantee_shield,0,0,fac_kingdom_5,
[itm_sword_medieval_a,itm_sword_medieval_b_small,itm_club_with_spike_head,itm_tab_shield_pavise_a,itm_tab_shield_pavise_a,itm_crossbow,itm_bolts,
itm_leather_cap,itm_leather_jerkin,itm_ragged_outfit,itm_nomad_boots],
def_attrib|level(15),wp_melee(90)|wp_crossbow(105),knows_common|knows_ironflesh_3|knows_shield_2|knows_power_strike_2|knows_athletics_3,rhodok_face_young_1, rhodok_face_older_2],
["rhodok_veteran_crossbowman","Rhodok Veteran Crossbowman","Rhodok Veteran Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_ranged|tf_guarantee_shield,0,0,fac_kingdom_5,
[itm_sword_medieval_a,itm_sword_medieval_b_small,itm_fighting_pick,itm_club_with_spike_head,itm_tab_shield_pavise_a,itm_tab_shield_pavise_b,itm_tab_shield_pavise_c,itm_heavy_crossbow,itm_bolts,
itm_leather_cap,itm_leather_jerkin,itm_padded_leather,itm_nomad_boots],
def_attrib|level(20),wp_melee(100)|wp_crossbow(120),knows_common|knows_ironflesh_4|knows_shield_3|knows_power_strike_3|knows_athletics_4,rhodok_face_middle_1, rhodok_face_older_2],
["rhodok_sharpshooter","Rhodok Sharpshooter","Rhodok Sharpshooters",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_ranged|tf_guarantee_shield,0,0,fac_kingdom_5,
[itm_sword_medieval_b,itm_military_pick,itm_tab_shield_pavise_c,itm_sniper_crossbow,itm_steel_bolts,
itm_kettle_hat,itm_leather_cap,itm_byrnie,itm_padded_leather,itm_leather_boots],
def_attrib|level(25),wp_melee(110)|wp_crossbow(140),knows_common|knows_ironflesh_5|knows_shield_4|knows_power_strike_4|knows_athletics_6,rhodok_face_middle_1, rhodok_face_older_2],
["rhodok_messenger","Rhodok Messenger","Rhodok Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral,
[itm_sword_medieval_b,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_short_bow,itm_arrows],
def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5|knows_power_draw_5,rhodok_face_middle_1, rhodok_face_older_2],
["rhodok_deserter","Rhodok Deserter","Rhodok Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters,
[itm_arrows,itm_spiked_mace,itm_axe,itm_falchion,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots],
def_attrib|str_10|level(14),wp(80),knows_ironflesh_1|knows_power_draw_1,rhodok_face_middle_1, rhodok_face_older_2],
["rhodok_prison_guard","Prison Guard","Prison Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_ashwood_pike,itm_battle_fork,itm_battle_axe,itm_fighting_axe,itm_tab_shield_pavise_b,itm_mail_hauberk,itm_byrnie,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_leather_gloves],
def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,rhodok_face_middle_1, rhodok_face_older_2],
["rhodok_castle_guard","Castle Guard","Castle Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_ashwood_pike,itm_battle_fork,itm_battle_axe,itm_fighting_axe,itm_tab_shield_pavise_c,itm_mail_hauberk,itm_byrnie,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_leather_gloves],
def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,rhodok_face_middle_1, rhodok_face_older_2],
# Ryan BEGIN
["looter","Looter","Looters",0,0,0,fac_outlaws,
[itm_hatchet,itm_club,itm_butchering_knife,itm_falchion,itm_rawhide_coat,itm_stones,itm_nomad_armor,itm_nomad_armor,itm_woolen_cap,itm_woolen_cap,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(4),wp(20),knows_common,bandit_face1, bandit_face2],
# Ryan END
["bandit","Bandit","Bandits",tf_guarantee_armor,0,0,fac_outlaws,
[itm_arrows,itm_spiked_mace,itm_sword_viking_1,itm_short_bow,itm_falchion,itm_nordic_shield,itm_rawhide_coat,itm_leather_cap,itm_leather_jerkin,itm_nomad_armor,itm_nomad_boots,itm_wrapping_boots,itm_saddle_horse],
def_attrib|level(10),wp(60),knows_common|knows_power_draw_1,bandit_face1, bandit_face2],
["brigand","Brigand","Brigands",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_outlaws,
[itm_arrows,itm_spiked_mace,itm_sword_viking_1,itm_falchion,itm_wooden_shield,itm_hide_covered_round_shield,itm_long_bow,itm_leather_cap,itm_leather_jerkin,itm_nomad_boots,itm_saddle_horse],
def_attrib|level(16),wp(90),knows_common|knows_power_draw_3,bandit_face1, bandit_face2],
["mountain_bandit","Mountain Bandit","Mountain Bandits",tf_guarantee_armor|tf_guarantee_boots,0,0,fac_outlaws,
[itm_arrows,itm_sword_viking_1,itm_spear,itm_winged_mace,itm_maul,itm_falchion,itm_short_bow,itm_javelin,itm_fur_covered_shield,itm_hide_covered_round_shield,
itm_felt_hat,itm_head_wrappings,itm_skullcap,itm_khergit_armor,itm_nomad_armor,itm_rawhide_coat,itm_nomad_vest,itm_hide_boots,itm_nomad_boots,itm_wooden_shield,itm_nordic_shield,itm_saddle_horse],
def_attrib|level(11),wp(90),knows_common|knows_power_draw_2,rhodok_face_young_1, rhodok_face_old_2],
["forest_bandit","Forest Bandit","Forest Bandits",tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_boots,0,0,fac_outlaws,
[itm_arrows,itm_axe,itm_hatchet,itm_quarter_staff,itm_short_bow,itm_hunting_bow,
itm_common_hood,itm_black_hood,itm_shirt,itm_padded_leather,itm_leather_jerkin,itm_ragged_outfit,itm_hide_boots,itm_leather_boots],
def_attrib|level(11),wp(90),knows_common|knows_power_draw_3,swadian_face_young_1, swadian_face_old_2],
["sea_raider","Sea Raider","Sea Raiders",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_outlaws,
[itm_arrows,itm_sword_viking_1,itm_sword_viking_2,itm_fighting_axe,itm_battle_axe,itm_spear,itm_nordic_shield,itm_nordic_shield,itm_nordic_shield,itm_wooden_shield,itm_long_bow,itm_javelin,itm_throwing_axes,
itm_nordic_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_leather_jerkin,itm_byrnie,itm_leather_jerkin,itm_leather_boots, itm_nomad_boots],
def_attrib|level(16),wp(110),knows_ironflesh_2|knows_power_strike_2|knows_power_draw_3|knows_power_throw_2|knows_riding_1|knows_athletics_2,nord_face_young_1, nord_face_old_2],
["steppe_bandit","Steppe Bandit","Steppe Bandits",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_ranged|tf_mounted,0,0,fac_outlaws,
[itm_arrows,itm_sword_khergit_1,itm_winged_mace,itm_spear, itm_light_lance,itm_nomad_bow,itm_nomad_bow,itm_short_bow,itm_jarid,itm_leather_steppe_cap_a,itm_leather_steppe_cap_b,itm_leather_steppe_cap_c,itm_khergit_armor,itm_nomad_armor,itm_steppe_armor,itm_leather_vest,itm_hide_boots,itm_nomad_boots,itm_leather_covered_round_shield,itm_leather_covered_round_shield,itm_saddle_horse,itm_steppe_horse,itm_steppe_horse],
def_attrib|level(12),wp(100),knows_riding_4|knows_horse_archery_3|knows_power_draw_3,khergit_face_young_1, khergit_face_old_2],
["black_khergit_horseman","Black Khergit Horseman","Black Khergit Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_black_khergits,
[itm_arrows,itm_sword_khergit_2,itm_scimitar,itm_scimitar,itm_winged_mace,itm_spear,itm_lance,itm_khergit_bow,itm_khergit_bow,itm_nomad_bow,itm_nomad_bow,itm_steppe_cap,itm_nomad_cap,itm_khergit_war_helmet,itm_khergit_war_helmet,itm_mail_hauberk,itm_lamellar_armor,itm_hide_boots,itm_plate_covered_round_shield,itm_plate_covered_round_shield,itm_saddle_horse,itm_steppe_horse],
def_attrib|level(21),wp(100),knows_riding_3|knows_ironflesh_3|knows_horse_archery_3|knows_power_draw_3,khergit_face_young_1, khergit_face_old_2],
["manhunter","Manhunter","Manhunters",tf_guarantee_armor,0,0,fac_manhunters,
[itm_spiked_mace,itm_club,itm_woolen_cap,itm_rawhide_coat,itm_coarse_tunic,itm_nomad_armor,itm_nordic_shield,itm_nomad_boots,itm_wrapping_boots,itm_sumpter_horse],
def_attrib|level(10),wp(50),knows_common,bandit_face1, bandit_face2],
## ["deserter","Deserter","Deserters",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_swadian_deserters,
## [itm_arrows,itm_spear,itm_fighting_pick,itm_short_bow,itm_sword,itm_voulge,itm_nordic_shield,itm_round_shield,itm_kettle_hat,itm_leather_cap,itm_padded_cloth,itm_leather_armor,itm_scale_armor,itm_saddle_horse],
## def_attrib|level(12),wp(60),knows_common,bandit_face1, bandit_face2],
#fac_slavers
## ["slave_keeper","Slave Keeper","Slave Keepers",tf_guarantee_armor,0,0,fac_slavers,
## [itm_cudgel,itm_club,itm_woolen_cap,itm_rawhide_coat,itm_coarse_tunic,itm_nomad_armor,itm_nordic_shield,itm_nomad_boots,itm_wrapping_boots,itm_sumpter_horse],
## def_attrib|level(10),wp(60),knows_common,bandit_face1, bandit_face2],
["slave_driver","Slave Driver","Slave Drivers",tf_guarantee_armor,0,0,fac_slavers,
[itm_spiked_mace,itm_club,itm_woolen_cap,itm_rawhide_coat,itm_coarse_tunic,itm_nomad_armor,itm_nordic_shield,itm_nomad_boots,itm_wrapping_boots,itm_sumpter_horse],
def_attrib|level(14),wp(80),knows_common,bandit_face1, bandit_face2],
["slave_hunter","Slave Hunter","Slave Hunters",tf_guarantee_armor,0,0,fac_slavers,
[itm_winged_mace,itm_club,itm_woolen_cap,itm_rawhide_coat,itm_coarse_tunic,itm_nomad_armor,itm_nordic_shield,itm_nomad_boots,itm_wrapping_boots,itm_sumpter_horse],
def_attrib|level(18),wp(90),knows_common,bandit_face1, bandit_face2],
["slave_crusher","Slave Crusher","Slave Crushers",tf_mounted|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_slavers,
[itm_maul,itm_winged_mace,itm_leather_vest,itm_nordic_shield,itm_nomad_boots,itm_leather_boots,itm_saddle_horse],
def_attrib|level(22),wp(110),knows_common|knows_power_strike_2,bandit_face1, bandit_face2],
["slaver_chief","Slaver Chief","Slaver Chiefs",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse,0,0,fac_slavers,
[itm_maul,itm_winged_mace,itm_mail_hauberk,itm_steel_shield,itm_nomad_boots,itm_leather_boots,itm_hunter],
def_attrib|level(26),wp(130),knows_common|knows_riding_3|knows_power_strike_3,bandit_face1, bandit_face2],
#Rhodok tribal, Hunter, warrior, veteran, warchief
# ["undead_walker","undead_walker","undead_walkers",tf_undead|tf_allways_fall_dead,0,0,fac_undeads,
# [],
# def_attrib|level(3),wp(60),knows_common,undead_face1, undead_face2],
# ["undead_horseman","undead_horseman","undead_horsemen",tf_undead|tf_allways_fall_dead|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse,0,0,fac_undeads,
# [],
# def_attrib|level(19),wp(100),knows_common,undead_face1, undead_face2],
# ["undead_nomad","undead_nomad","undead_nomads",tf_undead|tf_allways_fall_dead|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_black_khergits,
# [],
# def_attrib|level(21),wp(100),knows_common|knows_riding_4,khergit_face1, khergit_face2],
# ["undead","undead","undead",tf_undead|tf_allways_fall_dead,0,0,fac_undeads,
# [],
# def_attrib|level(3),wp(60),knows_common,undead_face1, undead_face2],
# ["hell_knight","hell_knight","hell_knights",tf_undead|tf_allways_fall_dead|tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_undeads,
# [],
# def_attrib|level(23),wp(100),knows_common|knows_riding_3,undead_face1, undead_face2],
["follower_woman","Camp Follower","Camp Follower",tf_female|tf_guarantee_armor,0,0,fac_commoners,
[itm_bolts,itm_light_crossbow,itm_short_bow,itm_crossbow,itm_nordic_shield,itm_hide_covered_round_shield,itm_hatchet,itm_hand_axe,itm_voulge,itm_fighting_pick,itm_club,itm_dress,itm_woolen_dress, itm_skullcap, itm_wrapping_boots],
def_attrib|level(5),wp(70),knows_common,refugee_face1,refugee_face2],
["hunter_woman","Huntress","Huntresses",tf_female|tf_guarantee_armor,0,0,fac_commoners,
[itm_bolts,itm_arrows,itm_light_crossbow,itm_short_bow,itm_crossbow,itm_nordic_shield,itm_hide_covered_round_shield,itm_hatchet,itm_hand_axe,itm_voulge,itm_fighting_pick,itm_club,itm_dress,itm_woolen_dress, itm_skullcap, itm_wrapping_boots],
def_attrib|level(10),wp(85),knows_common,refugee_face1,refugee_face2],
["fighter_woman","Camp Defender","Camp Defenders",tf_female|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners,
[itm_bolts,itm_arrows,itm_light_crossbow,itm_short_bow,itm_crossbow,itm_fur_covered_shield,itm_hide_covered_round_shield,itm_hatchet,itm_voulge,itm_leather_jerkin,itm_leather_vest, itm_skullcap, itm_wrapping_boots],
def_attrib|level(16),wp(100),knows_common|knows_riding_3|knows_athletics_2|knows_ironflesh_1,refugee_face1,refugee_face2],
["sword_sister","Sword Sister","Sword Sisters",tf_female|tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_shield|tf_guarantee_horse,0,0,fac_commoners,
[itm_bolts,itm_sword_medieval_b,itm_sword_khergit_3,itm_plate_covered_round_shield,itm_tab_shield_small_round_c, itm_crossbow,itm_plate_armor,itm_coat_of_plates,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_helmet_with_neckguard,itm_courser,itm_leather_gloves],
def_attrib|level(22),wp(140),knows_common|knows_riding_5|knows_athletics_3|knows_ironflesh_2|knows_shield_2,refugee_face1,refugee_face2],
["refugee","Refugee","Refugees",tf_female|tf_guarantee_armor,0,0,fac_commoners,
[itm_knife,itm_pitch_fork,itm_sickle,itm_hatchet,itm_club,itm_dress,itm_robe,itm_woolen_dress, itm_headcloth, itm_woolen_hood, itm_wrapping_boots],
def_attrib|level(1),wp(45),knows_common,refugee_face1,refugee_face2],
["peasant_woman","Peasant Woman","Peasant Women",tf_female|tf_guarantee_armor,0,0,fac_commoners,
[itm_knife,itm_pitch_fork,itm_sickle,itm_hatchet,itm_club,itm_dress,itm_woolen_dress, itm_headcloth, itm_woolen_hood, itm_wrapping_boots],
def_attrib|level(1),wp(40),knows_common,refugee_face1,refugee_face2],
["caravan_master","Caravan Master","Caravan Masters",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_commoners,
[itm_sword_medieval_c,itm_fur_coat,itm_hide_boots,itm_saddle_horse,
itm_saddle_horse,itm_saddle_horse,itm_saddle_horse,
itm_leather_jacket, itm_leather_cap],
def_attrib|level(9),wp(100),knows_common|knows_riding_4|knows_ironflesh_3,mercenary_face_1, mercenary_face_2],
["kidnapped_girl","Kidnapped Girl","Kidnapped Girls",tf_hero|tf_female|tf_randomize_face|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_dress,itm_leather_boots],
def_attrib|level(2),wp(50),knows_common|knows_riding_2,woman_face_1, woman_face_2],
#This troop is the troop marked as soldiers_end
["town_walker_1","Townsman","Townsmen",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners,
[itm_short_tunic, itm_linen_tunic,itm_fur_coat, itm_coarse_tunic, itm_tabard, itm_leather_vest, itm_arena_tunic_white, itm_leather_apron, itm_shirt, itm_arena_tunic_green, itm_arena_tunic_blue, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_hide_boots, itm_ankle_boots, itm_leather_boots, itm_fur_hat, itm_leather_cap, itm_straw_hat, itm_felt_hat],
def_attrib|level(4),wp(60),knows_common,man_face_young_1, man_face_old_2],
["town_walker_2","Townswoman","Townswomen",tf_female|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners,
[itm_blue_dress, itm_dress, itm_woolen_dress, itm_peasant_dress, itm_woolen_hose, itm_blue_hose, itm_wimple_a, itm_wimple_with_veil, itm_female_hood],
def_attrib|level(2),wp(40),knows_common,woman_face_1,woman_face_2],
["village_walker_1","Villager","Villagers",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners,
[itm_short_tunic, itm_linen_tunic, itm_coarse_tunic, itm_leather_vest, itm_leather_apron, itm_shirt, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_hide_boots, itm_ankle_boots, itm_leather_boots, itm_fur_hat, itm_leather_cap, itm_straw_hat, itm_felt_hat],
def_attrib|level(4),wp(60),knows_common,man_face_younger_1, man_face_older_2],
["village_walker_2","Villager","Villagers",tf_female|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners,
[itm_blue_dress, itm_dress, itm_woolen_dress, itm_peasant_dress, itm_woolen_hose, itm_blue_hose, itm_wimple_a, itm_wimple_with_veil, itm_female_hood],
def_attrib|level(2),wp(40),knows_common,woman_face_1,woman_face_2],
["spy_walker_1","Townsman","Townsmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_commoners,
[itm_short_tunic, itm_linen_tunic, itm_coarse_tunic, itm_tabard, itm_leather_vest, itm_robe, itm_leather_apron, itm_shirt, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_hide_boots, itm_ankle_boots, itm_leather_boots, itm_fur_hat, itm_leather_cap, itm_straw_hat, itm_felt_hat],
def_attrib|level(4),wp(60),knows_common,man_face_middle_1, man_face_old_2],
["spy_walker_2","Townswoman","Townswomen",tf_female|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_commoners,
[itm_blue_dress, itm_dress, itm_woolen_dress, itm_peasant_dress, itm_woolen_hose, itm_blue_hose, itm_wimple_a, itm_wimple_with_veil, itm_female_hood],
def_attrib|level(2),wp(40),knows_common,woman_face_1,woman_face_2],
# Ryan END
# Zendar
["tournament_master","Tournament Master","Tournament Master",tf_hero, scn_zendar_center|entry(1),reserved, fac_commoners,[itm_nomad_armor,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common,0x000000000008414401e28f534c8a2d09],
["trainer","Trainer","Trainer",tf_hero, scn_zendar_center|entry(2),reserved, fac_commoners,[itm_leather_jerkin,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x00000000000430c701ea98836781647f],
["Constable_Hareck","Constable Hareck","Constable Hareck",tf_hero, scn_zendar_center|entry(5),reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,0x00000000000c41c001fb15234eb6dd3f],
# Ryan BEGIN
["Ramun_the_slave_trader","Ramun, the slave trader","Ramun, the slave trader",tf_hero, no_scene,reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,0x0000000fd5105592385281c55b8e44eb00000000001d9b220000000000000000],
["guide","Quick Jimmy","Quick Jimmy",tf_hero, no_scene,0, fac_commoners,[itm_coarse_tunic,itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x00000000000c318301f24e38a36e38e3],
# Ryan END
["Xerina","Xerina","Xerina",tf_hero|tf_female, scn_the_happy_boar|entry(5),reserved, fac_commoners,[itm_leather_jerkin,itm_hide_boots],def_attrib|str_15|agi_15|level(39),wp(312),knows_power_strike_5|knows_ironflesh_5|knows_riding_6|knows_power_draw_4|knows_athletics_8|knows_shield_3,0x00000001ac0820074920561d0b51e6ed00000000001d40ed0000000000000000],
["Dranton","Dranton","Dranton",tf_hero, scn_the_happy_boar|entry(2),reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|str_15|agi_14|level(42),wp(324),knows_power_strike_5|knows_ironflesh_7|knows_riding_4|knows_power_draw_4|knows_athletics_4|knows_shield_3,0x0000000a460c3002470c50f3502879f800000000001ce0a00000000000000000],
["Kradus","Kradus","Kradus",tf_hero, scn_the_happy_boar|entry(3),reserved, fac_commoners,[itm_padded_leather,itm_hide_boots],def_attrib|str_15|agi_14|level(43),wp(270),knows_power_strike_5|knows_ironflesh_7|knows_riding_4|knows_power_draw_4|knows_athletics_4|knows_shield_3,0x0000000f5b1052c61ce1a9521db1375200000000001ed31b0000000000000000],
#Tutorial
["tutorial_trainer","Training Ground Master","Training Ground Master",tf_hero, scn_training_ground|entry(2),reserved, fac_commoners,[itm_robe,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common,0x000000000008414401e28f534c8a2d09],
#Sargoth
#halkard, hardawk. lord_taucard lord_caupard. lord_paugard
#Salt mine
["Galeas","Galeas","Galeas",tf_hero, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,0x000000000004718201c073191a9bb10c],
#Dhorak keep
["farmer_from_bandit_village","Farmer","Farmers",tf_guarantee_armor,no_scene,reserved,fac_commoners,
[itm_linen_tunic,itm_coarse_tunic,itm_shirt,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(4),wp(60),knows_common,man_face_middle_1, man_face_older_2],
["trainer_1","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_1|entry(6),reserved, fac_commoners,[itm_leather_jerkin,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000d0d1030c74ae8d661b651c6840000000000000e220000000000000000],
["trainer_2","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_2|entry(6),reserved, fac_commoners,[itm_nomad_vest,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000e5a04360428ec253846640b5d0000000000000ee80000000000000000],
["trainer_3","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_3|entry(6),reserved, fac_commoners,[itm_padded_leather,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000e4a0445822ca1a11ab1e9eaea0000000000000f510000000000000000],
["trainer_4","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_4|entry(6),reserved, fac_commoners,[itm_leather_jerkin,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000e600452c32ef8e5bb92cf1c970000000000000fc20000000000000000],
["trainer_5","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_5|entry(6),reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000e77082000150049a34c42ec960000000000000e080000000000000000],
# Ransom brokers.
["ransom_broker_1","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["ransom_broker_2","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_tabard,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["ransom_broker_3","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["ransom_broker_4","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_short_tunic,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["ransom_broker_5","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_gambeson,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["ransom_broker_6","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_blue_gambeson,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["ransom_broker_7","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_red_gambeson,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["ransom_broker_8","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["ransom_broker_9","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["ransom_broker_10","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
# Tavern traveler.
["tavern_traveler_1","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_traveler_2","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_tabard,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_traveler_3","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_traveler_4","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_blue_gambeson,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_traveler_5","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_short_tunic,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_traveler_6","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_traveler_7","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_traveler_8","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_tabard,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_traveler_9","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_traveler_10","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
# Tavern traveler.
["tavern_bookseller_1","Book_Merchant","Book_Merchant",tf_hero|tf_is_merchant|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots,
itm_book_tactics, itm_book_persuasion, itm_book_wound_treatment_reference, itm_book_leadership,
itm_book_intelligence, itm_book_training_reference, itm_book_surgery_reference],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
["tavern_bookseller_2","Book_Merchant","Book_Merchant",tf_hero|tf_is_merchant|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots,
itm_book_wound_treatment_reference, itm_book_leadership, itm_book_intelligence, itm_book_trade,
itm_book_engineering, itm_book_weapon_mastery],def_attrib|level(5),wp(20),knows_common,merchant_face_1, merchant_face_2],
# Tavern minstrel.
["tavern_minstrel_1","Minstrel","Minstrel",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
#NPC system changes begin
#Companions
["npc1","Borcha","Borcha",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_khergit_armor,itm_nomad_boots,itm_knife],
str_8|agi_7|int_12|cha_7|level(3),wp(60),knows_tracker_npc|
knows_ironflesh_1|knows_power_strike_1|knows_pathfinding_3|knows_athletics_2|knows_tracking_1|knows_riding_2, #skills 2/3 player at that level
0x00000004bf086143259d061a9046e23500000000001db52c0000000000000000],
["npc2","Marnid","Marnid", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_commoners,[itm_linen_tunic,itm_hide_boots,itm_club],
str_7|agi_7|int_11|cha_6|level(1),wp(40),knows_merchant_npc|
knows_trade_2|knows_weapon_master_1|knows_ironflesh_1|knows_wound_treatment_1|knows_athletics_2|knows_first_aid_1|knows_leadership_1,
0x000000019d004001570b893712c8d28d00000000001dc8990000000000000000],
["npc3","Ymira","Ymira",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_dress,itm_woolen_hose,itm_knife],
str_6|agi_9|int_11|cha_6|level(1),wp(20),knows_merchant_npc|
knows_wound_treatment_1|knows_trade_1|knows_first_aid_3|knows_surgery_1|knows_athletics_1|knows_riding_1,
0x0000000083040001583b6db8dec5925b00000000001d80980000000000000000],
["npc4","Rolf","Rolf",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_leather_jerkin,itm_nomad_boots, itm_sword_medieval_a],
str_10|agi_9|int_13|cha_10|level(10),wp(110),knows_warrior_npc|
knows_weapon_master_2|knows_power_strike_2|knows_riding_2|knows_athletics_2|knows_power_throw_2|knows_first_aid_1|knows_surgery_1|knows_tactics_2|knows_leadership_2,
0x000000057f1074002c75c6a8a58ad72e00000000001e1a890000000000000000],
["npc5","Baheshtur","Baheshtur",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_nomad_vest,itm_nomad_boots, itm_sword_khergit_1],
str_9|agi_9|int_12|cha_7|level(5),wp(90),knows_warrior_npc|
knows_riding_2|knows_horse_archery_3|knows_power_draw_3|knows_leadership_2|knows_weapon_master_1,
0x000000088910318b5c6f972328324a6200000000001cd3310000000000000000],
["npc6","Firentis","Firentis",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_tabard,itm_nomad_boots, itm_sword_medieval_a],
str_10|agi_12|int_10|cha_5|level(6),wp(105),knows_warrior_npc|
knows_riding_2|knows_weapon_master_2|knows_power_strike_2|knows_athletics_3|knows_trainer_1|knows_leadership_1,
0x00000002050052036a1895d0748f3ca30000000000000f0b0000000000000000],
["npc7","Deshavi","Deshavi",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_ragged_outfit,itm_wrapping_boots, itm_hunting_bow, itm_arrows, itm_quarter_staff],
str_8|agi_9|int_10|cha_6|level(2),wp(80),knows_tracker_npc|
knows_tracking_2|knows_athletics_2|knows_spotting_1|knows_pathfinding_1|knows_power_draw_2,
0x00000001fc08400533a15297634d44f400000000001e02db0000000000000000],
["npc8","Matheld","Matheld",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_tribal_warrior_outfit,itm_nomad_boots, itm_sword_viking_1],
str_9|agi_10|int_9|cha_10|level(7),wp(90),knows_warrior_npc|
knows_weapon_master_3|knows_power_strike_2|knows_athletics_2|knows_leadership_3|knows_tactics_1,
0x00000005800c000637db8314e331e76e00000000001c46db0000000000000000],
["npc9","Alayen","Alayen",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_tabard,itm_nomad_boots, itm_sword_medieval_b_small],
str_11|agi_8|int_7|cha_8|level(2),wp(100),knows_warrior_npc|
knows_weapon_master_1|knows_riding_1|knows_athletics_1|knows_leadership_1|knows_tactics_1|knows_power_strike_1,
0x000000030100300f499d5b391b6db8d300000000001dc2e10000000000000000],
["npc10","Bunduk","Bunduk",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_padded_leather,itm_nomad_boots, itm_crossbow, itm_bolts, itm_pickaxe],
str_12|agi_8|int_9|cha_11|level(9),wp(105),knows_warrior_npc|
knows_weapon_master_3|knows_tactics_1|knows_leadership_1|knows_ironflesh_3|knows_trainer_2|knows_first_aid_2,
0x0000000a3f081006572c91c71c8d46cb00000000001e468a0000000000000000],
["npc11","Katrin","Katrin",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_leather_apron, itm_falchion, itm_wrapping_boots],
str_8|agi_11|int_10|cha_10|level(8),wp(70),knows_merchant_npc|
knows_weapon_master_1|knows_first_aid_1|knows_wound_treatment_2|knows_ironflesh_3|knows_inventory_management_5,
0x0000000d7f0400035915aa226b4d975200000000001ea49e0000000000000000],
["npc12","Jeremus","Jeremus",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_pilgrim_disguise,itm_nomad_boots, itm_staff],
str_8|agi_7|int_13|cha_7|level(4),wp(30), knows_merchant_npc|
knows_ironflesh_1|knows_power_strike_1|knows_surgery_4|knows_wound_treatment_3|knows_first_aid_3,
0x000000078000500e4f8ba62a9cd5d36d00000000001e36250000000000000000],
["npc13","Nizar","Nizar",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_nomad_robe,itm_nomad_boots, itm_scimitar, itm_courser],
str_7|agi_7|int_12|cha_8|level(3),wp(80),knows_warrior_npc|
knows_riding_2|knows_leadership_2|knows_athletics_2|knows_ironflesh_2|knows_power_strike_1|knows_weapon_master_1,
0x00000004bf0475c85f4e9592de4e574c00000000001e369c0000000000000000],
["npc14","Lezalit","Lezalit",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_nobleman_outfit,itm_nomad_boots, itm_sword_medieval_b_small],
str_9|agi_8|int_11|cha_8|level(5),wp(100),knows_warrior_npc|
knows_trainer_4|knows_weapon_master_3|knows_leadership_2|knows_power_strike_1,
0x00000001a410259144d5d1d6eb55e96a00000000001db0db0000000000000000],
["npc15","Artimenner","Artimenner",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_rich_outfit,itm_nomad_boots, itm_sword_medieval_b_small],
str_9|agi_9|int_12|cha_8|level(7),wp(80),knows_warrior_npc|
knows_tactics_2|knows_engineer_4|knows_trade_3|knows_tracking_1|knows_spotting_1,
0x0000000f2e1021862b4b9123594eab5300000000001d55360000000000000000],
["npc16","Klethi","Klethi",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_peasant_dress,itm_nomad_boots, itm_dagger, itm_throwing_knives],
str_7|agi_11|int_8|cha_7|level(2),wp(80),knows_tracker_npc|
knows_power_throw_3|knows_athletics_2|knows_power_strike_1,
0x00000000000c100739ce9c805d2f381300000000001cc7ad0000000000000000],
#NPC system changes end
["kingdom_heroes_including_player_begin", "kingdom_heroes_including_player_begin", "kingdom_heroes_including_player_begin", tf_hero, 0,reserved, fac_kingdom_1,[], lord_attrib,wp(220),knows_lord_1, 0x000000000010918a01f248377289467d],
#governers olgrel rasevas Horse Bodywear Footwear_in Footwear_out Armor Weapon Shield Headwaer
["kingdom_1_lord", "King Harlaus", "Kingdom 1 Lord", tf_hero, 0,reserved, fac_kingdom_1,[itm_charger, itm_rich_outfit, itm_blue_hose, itm_iron_greaves, itm_plate_armor, itm_gauntlets, itm_bastard_sword_b, itm_tab_shield_heater_cav_b, itm_great_helmet], knight_attrib_5,wp(220),knight_skills_5|knows_trainer_5, 0x0000000f45041105241acd2b5a66a86900000000001e98310000000000000000,swadian_face_older_2],
["kingdom_2_lord", "King Yaroglek", "Kingdom 2 Lord", tf_hero, 0,reserved, fac_kingdom_2,[itm_hunter, itm_courtly_outfit, itm_leather_boots, itm_mail_chausses, itm_heraldic_mail_with_surcoat, itm_gauntlets, itm_military_pick, itm_tab_shield_kite_cav_b, itm_helmet_with_neckguard], knight_attrib_5,wp(220),knight_skills_5|knows_trainer_4, 0x0000000ec50001400a2269f919dee11700000000001cc57d0000000000000000, vaegir_face_old_2],
["kingdom_3_lord", "Sanjar Khan", "Kingdom 3 Lord", tf_hero, 0,reserved, fac_kingdom_3,[itm_courser, itm_nomad_robe, itm_leather_boots, itm_splinted_greaves, itm_khergit_guard_armor, itm_scale_gauntlets, itm_sword_khergit_3, itm_tab_shield_small_round_c, itm_guard_helmet], knight_attrib_5,wp(220),knight_skills_5|knows_trainer_6, 0x0000000cee0051cc44be2d14d370c65c00000000001ed6df0000000000000000,khergit_face_old_2],
["kingdom_4_lord", "King Ragnar", "Kingdom 4 Lord", tf_hero, 0,reserved, fac_kingdom_4,[itm_hunter, itm_nobleman_outfit, itm_leather_boots, itm_mail_boots, itm_cuir_bouilli, itm_gauntlets, itm_great_axe, itm_tab_shield_round_e, itm_nordic_helmet], knight_attrib_5,wp(220),knight_skills_5|knows_trainer_4, 0x0000000e2c0c028a068e8c18557b12a500000000001c0fe80000000000000000, nord_face_older_2],
["kingdom_5_lord", "King Graveth", "Kingdom 5 Lord", tf_hero, 0,reserved, fac_kingdom_5,[itm_warhorse, itm_tabard, itm_leather_boots, itm_splinted_leather_greaves, itm_heraldic_mail_with_tabard, itm_gauntlets, itm_bastard_sword_b, itm_tab_shield_heater_cav_b, itm_spiked_helmet], knight_attrib_3,wp(220),knight_skills_4|knows_trainer_5, 0x0000000efc04119225848dac5d50d62400000000001d48b80000000000000000, rhodok_face_old_2],
# Imbrea Belinda Ruby Qaelmas Rose Willow
# Alin Ganzo Zelka Rabugti
# Qlurzach Ruhbus Givea_alsev Belanz Bendina
# Dunga Agatha Dibus Crahask
# Horse Bodywear Armor Footwear_in Footwear_out Headwear Weapon Shield
#Swadian civilian clothes: itm_courtly_outfit itm_gambeson itm_blue_gambeson itm_red_gambeson itm_nobleman_outfit itm_rich_outfit itm_short_tunic itm_tabard
["knight_1_1", "Lord Klargus", "knight_1_1", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_courtly_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_splinted_greaves, itm_great_helmet, itm_sword_medieval_c, itm_scale_gauntlets, itm_tab_shield_heater_cav_a], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_1|knows_trainer_3, 0x0000000c3e08601414ab4dc6e39296b200000000001e231b0000000000000000, swadian_face_middle_2],
["knight_1_2", "Lord Plais", "knight_1_2", tf_hero, 0, reserved, fac_kingdom_1, [itm_steppe_horse, itm_gambeson, itm_heraldic_mail_with_surcoat, itm_blue_hose, itm_mail_boots, itm_nasal_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2, 0x0000000c0f08000458739a9a1476199800000000001fb6f10000000000000000, swadian_face_old_2],
["knight_1_3", "Lord Mirchaud", "knight_1_3", tf_hero, 0, reserved, fac_kingdom_1, [itm_courser, itm_blue_gambeson, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_guard_helmet, itm_gauntlets, itm_sword_two_handed_b, itm_tab_shield_heater_cav_b], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c0610351048e325361d7236cd00000000001d532a0000000000000000, swadian_face_older_2],
["knight_1_4", "Lord Stamar", "knight_1_4", tf_hero, 0, reserved, fac_kingdom_1, [itm_courser, itm_red_gambeson, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_iron_greaves, itm_guard_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_cav_b], knight_attrib_4,wp(220),knight_skills_4, 0x0000000c03104490280a8cb2a24196ab00000000001eb4dc0000000000000000, swadian_face_older_2],
["knight_1_5", "Lord Ryis", "knight_1_5", tf_hero, 0, reserved, fac_kingdom_1, [itm_warhorse, itm_nobleman_outfit, itm_coat_of_plates, itm_leather_boots, itm_splinted_leather_greaves, itm_winged_great_helmet, itm_gauntlets,itm_bastard_sword_b, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_5,wp(250),knight_skills_5, 0x0000000c330855054aa9aa431a48d74600000000001ed5240000000000000000, swadian_face_older_2],
["knight_1_6", "Lord Meltor", "knight_1_6", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_rich_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_mail_boots, itm_guard_helmet, itm_gauntlets, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c2a0805442b2c6cc98c8dbaac00000000001d389b0000000000000000, swadian_face_middle_2],
["knight_1_7", "Lord Beranz", "knight_1_7", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_ragged_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_splinted_greaves, itm_guard_helmet, itm_gauntlets, itm_sword_medieval_c, itm_sword_two_handed_a, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2, 0x0000000c380c30c2392a8e5322a5392c00000000001e5c620000000000000000, swadian_face_old_2],
["knight_1_8", "Lord Rafard", "knight_1_8", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_short_tunic, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_chausses, itm_nasal_helmet, itm_scale_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_cav_a], knight_attrib_3,wp(190),knight_skills_3|knows_trainer_6, 0x0000000c3f10000532d45203954e192200000000001e47630000000000000000, swadian_face_older_2],
["knight_1_9", "Lord Regas", "knight_1_9", tf_hero, 0, reserved, fac_kingdom_1, [itm_hunter, itm_rich_outfit, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_great_helmet, itm_gauntlets, itm_sword_viking_3, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_4,wp(210),knight_skills_4, 0x0000000c5c0840034895654c9b660c5d00000000001e34530000000000000000, swadian_face_older_2],
["knight_1_10", "Lord Grainwad", "knight_1_0", tf_hero, 0, reserved, fac_kingdom_1, [itm_hunter, itm_tabard, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_boots, itm_flat_topped_helmet, itm_gauntlets, itm_bastard_sword_b, itm_sword_two_handed_b, itm_tab_shield_heater_cav_b], knight_attrib_5,wp(290),knight_skills_5|knows_trainer_5, 0x0000000c1e001500589dae4094aa291c00000000001e37a80000000000000000, swadian_face_older_2],
["knight_1_11", "Lord Devlian", "knight_1_1", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_courtly_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_splinted_greaves, itm_great_helmet, itm_gauntlets, itm_sword_medieval_c, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1, 0x000000095108144657a1ba3ad456e8cb00000000001e325a0000000000000000, swadian_face_middle_2],
["knight_1_12", "Lord Rafarch", "knight_1_2", tf_hero, 0, reserved, fac_kingdom_1, [itm_steppe_horse, itm_gambeson, itm_heraldic_mail_with_surcoat, itm_blue_hose, itm_mail_boots, itm_nasal_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_heater_cav_b], knight_attrib_2,wp(190),knight_skills_2|knows_trainer_4, 0x0000000c010c42c14d9d6918bdb336e200000000001dd6a30000000000000000, swadian_face_old_2],
["knight_1_13", "Lord Rochabarth", "knight_1_3", tf_hero, 0, reserved, fac_kingdom_1, [itm_courser, itm_blue_gambeson, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_winged_great_helmet, itm_gauntlets, itm_sword_two_handed_a, itm_tab_shield_heater_cav_a], knight_attrib_3,wp(210),knight_skills_3, 0x0000000c150045c6365d8565932a8d6400000000001ec6940000000000000000, swadian_face_older_2],
["knight_1_14", "Lord Delinard", "knight_1_4", tf_hero, 0, reserved, fac_kingdom_1, [itm_courser, itm_red_gambeson, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_iron_greaves, itm_guard_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_cav_b], knight_attrib_4,wp(240),knight_skills_4, 0x0000000c0f0c320627627238dcd6599400000000001c573d0000000000000000, swadian_face_older_2],
["knight_1_15", "Lord Haringoth", "knight_1_5", tf_hero, 0, reserved, fac_kingdom_1, [itm_warhorse, itm_nobleman_outfit, itm_coat_of_plates, itm_leather_boots, itm_splinted_leather_greaves, itm_flat_topped_helmet, itm_gauntlets, itm_bastard_sword_b, itm_tab_shield_heater_d], knight_attrib_5,wp(260),knight_skills_5|knows_trainer_3, 0x0000000cb700210214ce89db276aa2f400000000001d36730000000000000000, swadian_face_older_2],
["knight_1_16", "Lord Despin", "knight_1_6", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_rich_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_mail_boots, itm_great_helmet, itm_gauntlets, itm_fighting_pick, itm_sword_two_handed_a, itm_tab_shield_heater_cav_a], knight_attrib_1,wp(120),knight_skills_1, 0x00000008200012033d9b6d4a92ada53500000000001cc1180000000000000000, swadian_face_middle_2],
["knight_1_17", "Lord Montewar", "knight_1_7", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_ragged_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_splinted_greaves, itm_great_helmet, itm_gauntlets, itm_sword_medieval_c, itm_sword_two_handed_a, itm_tab_shield_heater_cav_a], knight_attrib_2,wp(150),knight_skills_2, 0x0000000c4d0840d24a9b2ab4ac2a332400000000001d34db0000000000000000, swadian_face_old_2],
["knight_1_18", "Lord Clais", "knight_1_8", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_short_tunic, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_chausses, itm_winged_great_helmet, itm_gauntlets, itm_bastard_sword_a, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_3,wp(180),knight_skills_3|knows_trainer_4, 0x0000000c370c1194546469ca6c4e450e00000000001ebac40000000000000000, swadian_face_older_2],
["knight_1_19", "Lord Deglan", "knight_1_9", tf_hero, 0, reserved, fac_kingdom_1, [itm_hunter, itm_rich_outfit, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_guard_helmet, itm_gauntlets, itm_sword_medieval_c, itm_tab_shield_heater_d], knight_attrib_4,wp(200),knight_skills_4|knows_trainer_6, 0x0000000c0c1064864ba34e2ae291992b00000000001da8720000000000000000, swadian_face_older_2],
["knight_1_20", "Lord Tredian", "knight_1_0", tf_hero, 0, reserved, fac_kingdom_1, [itm_hunter, itm_tabard, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_boots, itm_winged_great_helmet, itm_gauntlets, itm_bastard_sword_b, itm_sword_two_handed_b, itm_tab_shield_heater_cav_b], knight_attrib_5,wp(240),knight_skills_5|knows_trainer_5, 0x0000000c0a08038736db74c6a396a8e500000000001db8eb0000000000000000, swadian_face_older_2],
["knight_2_1", "Lord Vuldrat", "knight_2_1", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_fur_coat, itm_padded_cloth, itm_nomad_boots, itm_splinted_leather_greaves, itm_skullcap, itm_mail_mittens, itm_sword_viking_3, itm_tab_shield_kite_c], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_3, 0x00000005590011c33d9b6d4a92ada53500000000001cc1180000000000000000, vaegir_face_middle_2],
["knight_2_2", "Lord Naldera", "knight_2_2", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_rich_outfit, itm_lamellar_armor, itm_woolen_hose, itm_mail_chausses, itm_nasal_helmet, itm_mail_mittens, itm_shortened_military_scythe, itm_tab_shield_kite_cav_a], knight_attrib_2,wp(160),knight_skills_2, 0x0000000c2a0015d249b68b46a98e176400000000001d95a40000000000000000, vaegir_face_old_2],
["knight_2_3", "Lord Meriga", "knight_2_3", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_short_tunic, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_nordic_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_b], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c131031c546a38a2765b4c86000000000001e58d30000000000000000, vaegir_face_older_2],
["knight_2_4", "Lord Khavel", "knight_2_4", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_courtly_outfit, itm_lamellar_armor, itm_leather_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_bastard_sword_b, itm_tab_shield_kite_cav_b], knight_attrib_4,wp(220),knight_skills_4, 0x0000000c2f0832c748f272540d8ab65900000000001d34e60000000000000000, vaegir_face_older_2],
["knight_2_5", "Lord Doru", "knight_2_5", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_rich_outfit, itm_haubergeon, itm_leather_boots, itm_mail_chausses, itm_segmented_helmet, itm_scale_gauntlets, itm_bastard_sword_b, itm_tab_shield_kite_d], knight_attrib_5,wp(250),knight_skills_5, 0x0000000e310061435d76bb5f55bad9ad00000000001ed8ec0000000000000000, vaegir_face_older_2],
["knight_2_6", "Lord Belgaru", "knight_2_6", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_nomad_vest, itm_padded_cloth, itm_woolen_hose, itm_mail_chausses, itm_khergit_guard_helmet, itm_mail_mittens, itm_sword_viking_3, itm_tab_shield_kite_c], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_3, 0x0000000a0100421038da7157aa4e430a00000000001da8bc0000000000000000, vaegir_face_middle_2],
["knight_2_7", "Lord Ralcha", "Ralcha", tf_hero, 0, reserved, fac_kingdom_2, [itm_steppe_horse, itm_leather_jacket, itm_mail_hauberk, itm_leather_boots, itm_mail_boots, itm_nordic_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_a], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_4, 0x0000000c04100153335ba9390b2d277500000000001d89120000000000000000, vaegir_face_old_2],
["knight_2_8", "Lord Vlan", "knight_2_8", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_nomad_robe, itm_nomad_vest, itm_woolen_hose, itm_mail_chausses, itm_nasal_helmet, itm_scale_gauntlets, itm_shortened_military_scythe, itm_tab_shield_kite_d], knight_attrib_3,wp(200),knight_skills_3|knows_trainer_5, 0x0000000c00046581234e8da2cdd248db00000000001f569c0000000000000000, vaegir_face_older_2],
["knight_2_9", "Lord Mleza", "knight_2_9", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_rich_outfit, itm_haubergeon, itm_leather_boots, itm_mail_chausses, itm_kettle_hat, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_d], knight_attrib_4,wp(230),knight_skills_4, 0x0000000c160451d2136469c4d9b159ad00000000001e28f10000000000000000, vaegir_face_older_2],
["knight_2_10", "Lord Nelag", "knight_2_0", tf_hero, 0, reserved, fac_kingdom_2, [itm_warhorse, itm_fur_coat, itm_lamellar_armor, itm_woolen_hose, itm_mail_boots, itm_great_helmet, itm_scale_gauntlets, itm_military_pick, itm_tab_shield_kite_cav_b], knight_attrib_5,wp(260),knight_skills_5|knows_trainer_6, 0x0000000f7c00520e66b76edd5cd5eb6e00000000001f691e0000000000000000, vaegir_face_older_2],
["knight_2_11", "Lord Crahask", "knight_2_1", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_leather_jacket, itm_padded_cloth, itm_nomad_boots, itm_splinted_leather_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_viking_3, itm_tab_shield_kite_cav_a], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c1d0821d236acd6991b74d69d00000000001e476c0000000000000000, vaegir_face_middle_2],
["knight_2_12", "Lord Bracha", "knight_2_2", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_rich_outfit, itm_lamellar_armor, itm_woolen_hose, itm_mail_chausses, itm_nasal_helmet, itm_mail_mittens, itm_great_bardiche, itm_tab_shield_kite_cav_a], knight_attrib_2,wp(170),knight_skills_2, 0x0000000c0f04024b2509d5d53944c6a300000000001d5b320000000000000000, vaegir_face_old_2],
["knight_2_13", "Lord Druli", "knight_2_3", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_short_tunic, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_nordic_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_b], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c680432d3392230cb926d56ca00000000001da69b0000000000000000, vaegir_face_older_2],
["knight_2_14", "Lord Marmun", "knight_2_4", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_courtly_outfit, itm_lamellar_armor, itm_leather_boots, itm_mail_boots, itm_guard_helmet, itm_scale_gauntlets, itm_shortened_military_scythe, itm_tab_shield_kite_cav_b], knight_attrib_4,wp(220),knight_skills_4|knows_trainer_6, 0x0000000c27046000471bd2e93375b52c00000000001dd5220000000000000000, vaegir_face_older_2],
["knight_2_15", "Lord Gastya", "knight_2_5", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_rich_outfit, itm_haubergeon, itm_leather_boots, itm_mail_chausses, itm_segmented_helmet, itm_scale_gauntlets, itm_bastard_sword_b, itm_shortened_military_scythe, itm_tab_shield_kite_cav_b], knight_attrib_5,wp(250),knight_skills_5, 0x0000000de50052123b6bb36de5d6eb7400000000001dd72c0000000000000000, vaegir_face_older_2],
["knight_2_16", "Lord Harish", "knight_2_6", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_nomad_vest, itm_padded_cloth, itm_woolen_hose, itm_mail_chausses, itm_nordic_helmet, itm_mail_mittens, itm_great_bardiche, itm_tab_shield_kite_c], knight_attrib_1,wp(120),knight_skills_1, 0x000000085f00000539233512e287391d00000000001db7200000000000000000, vaegir_face_middle_2],
["knight_2_17", "Lord Taisa", "Ralcha", tf_hero, 0, reserved, fac_kingdom_2, [itm_steppe_horse, itm_leather_jacket, itm_mail_hauberk, itm_leather_boots, itm_mail_boots, itm_guard_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_a], knight_attrib_2,wp(150),knight_skills_2, 0x0000000a070c4387374bd19addd2a4ab00000000001e32cc0000000000000000, vaegir_face_old_2],
["knight_2_18", "Lord Valishin", "knight_2_8", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_nomad_robe, itm_nomad_vest, itm_woolen_hose, itm_mail_chausses, itm_nasal_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_a], knight_attrib_3,wp(180),knight_skills_3, 0x0000000b670012c23d9b6d4a92ada53500000000001cc1180000000000000000, vaegir_face_older_2],
["knight_2_19", "Lord Rudin", "knight_2_9", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_rich_outfit, itm_haubergeon, itm_leather_boots, itm_mail_chausses, itm_guard_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_shortened_military_scythe, itm_tab_shield_kite_d], knight_attrib_4,wp(210),knight_skills_4|knows_trainer_4, 0x0000000e070050853b0a6e4994ae272a00000000001db4e10000000000000000, vaegir_face_older_2],
["knight_2_20", "Lord Kumipa", "knight_2_0", tf_hero, 0, reserved, fac_kingdom_2, [itm_warhorse, itm_fur_coat, itm_lamellar_armor, itm_woolen_hose, itm_mail_boots, itm_great_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_b], knight_attrib_5,wp(240),knight_skills_5|knows_trainer_5, 0x0000000f800021c63b0a6e4994ae272a00000000001db4e10000000000000000, vaegir_face_older_2],
#khergit civilian clothes: itm_leather_vest, itm_nomad_vest, itm_nomad_robe, itm_lamellar_vest,itm_tribal_warrior_outfit
["knight_3_1", "Lord Alagur", "knight_3_1", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_leather_vest, itm_studded_leather_coat,itm_nomad_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_leather_gloves, itm_sword_khergit_3, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_3|knows_power_draw_4, 0x000000043000318b54b246b7094dc39c00000000001d31270000000000000000, khergit_face_middle_2],
["knight_3_2", "Lord Tonju", "knight_3_2", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_vest, itm_lamellar_armor, itm_hide_boots, itm_mail_boots, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_leather_gloves, itm_shortened_military_scythe, itm_tab_shield_small_round_b, itm_khergit_bow, itm_arrows], knight_attrib_2,wp(160),knight_skills_2|knows_power_draw_4, 0x0000000c280461004929b334ad632aa200000000001e05120000000000000000, khergit_face_old_2],
["knight_3_3", "Lord Belir", "knight_3_3", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_robe, itm_lamellar_armor,itm_nomad_boots, itm_splinted_leather_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_3,wp(190),knight_skills_3|knows_trainer_5|knows_power_draw_4, 0x0000000e880062c53b0a6e4994ae272a00000000001db4e10000000000000000, khergit_face_older_2],
["knight_3_4", "Lord Asugan", "knight_3_4", tf_hero, 0, reserved, fac_kingdom_3, [itm_courser, itm_lamellar_vest, itm_mail_and_plate, itm_hide_boots, itm_splinted_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_shortened_military_scythe, itm_tab_shield_small_round_c], knight_attrib_4,wp(220),knight_skills_4|knows_power_draw_4, 0x0000000c23085386391b5ac72a96d95c00000000001e37230000000000000000, khergit_face_older_2],
["knight_3_5", "Lord Brula", "knight_3_5", tf_hero, 0, reserved, fac_kingdom_3, [itm_charger, itm_ragged_outfit, itm_lamellar_vest, itm_hide_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_khergit_3, itm_tab_shield_small_round_c], knight_attrib_5,wp(250),knight_skills_5|knows_power_draw_4, 0x0000000efe0051ca4b377b4964b6eb6500000000001f696c0000000000000000, khergit_face_older_2],
["knight_3_6", "Lord Imirza", "knight_3_6", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_tribal_warrior_outfit,itm_hide_boots, itm_splinted_leather_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_sword_khergit_4, itm_tab_shield_small_round_b], knight_attrib_1,wp(130),knight_skills_1|knows_power_draw_4, 0x00000006f600418b54b246b7094dc31a00000000001d37270000000000000000, khergit_face_middle_2],
["knight_3_7", "Lord Urumuda","knight_3_7", tf_hero, 0, reserved, fac_kingdom_3, [itm_courser, itm_leather_vest,itm_leather_boots, itm_hide_boots, itm_skullcap, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_khergit_3, itm_tab_shield_small_round_b], knight_attrib_2,wp(160),knight_skills_2|knows_power_draw_4, 0x0000000bdd00510a44be2d14d370c65c00000000001ed6df0000000000000000, khergit_face_old_2],
["knight_3_8", "Lord Kramuk", "knight_3_8", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_vest, itm_lamellar_armor, itm_woolen_hose, itm_splinted_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_small_round_c], knight_attrib_3,wp(190),knight_skills_3|knows_power_draw_4, 0x0000000abc00518b5af4ab4b9c8e596400000000001dc76d0000000000000000, khergit_face_older_2],
["knight_3_9", "Lord Chaurka","knight_3_9", tf_hero, 0, reserved, fac_kingdom_3, [itm_hunter, itm_nomad_robe, itm_lamellar_vest, itm_leather_boots, itm_splinted_leather_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_military_pick, itm_tab_shield_small_round_c], knight_attrib_4,wp(220),knight_skills_4|knows_power_draw_4, 0x0000000a180441c921a30ea68b54971500000000001e54db0000000000000000, khergit_face_older_2],
["knight_3_10", "Lord Sebula","knight_3_0", tf_hero, 0, reserved, fac_kingdom_3, [itm_warhorse, itm_lamellar_vest, itm_lamellar_armor, itm_hide_boots, itm_mail_chausses, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_khergit_4, itm_shortened_military_scythe, itm_tab_shield_small_round_c], knight_attrib_5,wp(250),knight_skills_5|knows_trainer_6|knows_power_draw_4, 0x0000000a3b00418c5b36c686d920a76100000000001c436f0000000000000000, khergit_face_older_2],
["knight_3_11", "Lord Tulug", "knight_3_1", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_leather_vest, itm_studded_leather_coat, itm_nomad_boots, itm_mail_boots, itm_khergit_cavalry_helmet, itm_leather_gloves, itm_sword_khergit_4, itm_tab_shield_small_round_b, itm_khergit_bow, itm_arrows], knight_attrib_1,wp(150),knight_skills_1|knows_power_draw_4, 0x00000007d100534b44962d14d370c65c00000000001ed6df0000000000000000, khergit_face_middle_2],
["knight_3_12", "Lord Nasugei", "knight_3_2", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_vest, itm_lamellar_armor, itm_hide_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_leather_gloves, itm_sword_khergit_3, itm_tab_shield_small_round_b], knight_attrib_2,wp(190),knight_skills_2|knows_power_draw_4, 0x0000000bf400610c5b33d3c9258edb6c00000000001eb96d0000000000000000, khergit_face_old_2],
["knight_3_13", "Lord Urubay","knight_3_3", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_robe, itm_lamellar_vest, itm_nomad_boots, itm_splinted_leather_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_3,wp(200),knight_skills_3|knows_trainer_3|knows_power_draw_4, 0x0000000bfd0061c65b6eb33b25d2591d00000000001f58eb0000000000000000, khergit_face_older_2],
["knight_3_14", "Lord Hugu", "knight_3_4", tf_hero, 0, reserved, fac_kingdom_3, [itm_courser, itm_lamellar_vest, itm_lamellar_vest, itm_hide_boots, itm_splinted_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_shortened_military_scythe, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_4,wp(300),knight_skills_4|knows_trainer_6|knows_power_draw_4, 0x0000000b6900514144be2d14d370c65c00000000001ed6df0000000000000000, khergit_face_older_2],
["knight_3_15", "Lord Tansugai", "knight_3_5", tf_hero, 0, reserved, fac_kingdom_3, [itm_charger, itm_ragged_outfit, itm_lamellar_vest, itm_hide_boots, itm_mail_boots, itm_khergit_cavalry_helmet, itm_sword_khergit_4, itm_shortened_military_scythe, itm_tab_shield_small_round_c], knight_attrib_5,wp(240),knight_skills_5|knows_trainer_4|knows_power_draw_4, 0x0000000c360c524b6454465b59b9d93500000000001ea4860000000000000000, khergit_face_older_2],
["knight_3_16", "Lord Tirida","knight_3_6", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_tribal_warrior_outfit, itm_lamellar_vest, itm_hide_boots, itm_splinted_leather_greaves, itm_khergit_guard_helmet, itm_leather_gloves, itm_sword_khergit_4, itm_tab_shield_small_round_b, itm_khergit_bow, itm_arrows], knight_attrib_1,wp(120),knight_skills_1|knows_power_draw_4, 0x0000000c350c418438ab85b75c61b8d300000000001d21530000000000000000, khergit_face_middle_2],
["knight_3_17", "Lord Ulusamai", "knight_3_7", tf_hero, 0, reserved, fac_kingdom_3, [itm_courser, itm_leather_vest, itm_lamellar_vest, itm_leather_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_leather_gloves, itm_great_bardiche, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_2,wp(150),knight_skills_2|knows_power_draw_4, 0x0000000c3c0821c647264ab6e68dc4d500000000001e42590000000000000000, khergit_face_old_2],
["knight_3_18", "Lord Karaban", "knight_3_8", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_vest, itm_lamellar_vest, itm_hide_boots, itm_splinted_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_war_axe, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_3,wp(180),knight_skills_3|knows_trainer_4|knows_power_draw_4, 0x0000000c0810500347ae7acd0d3ad74a00000000001e289a0000000000000000, khergit_face_older_2],
["knight_3_19", "Lord Akadan","knight_3_9", tf_hero, 0, reserved, fac_kingdom_3, [itm_hunter, itm_nomad_robe, itm_lamellar_vest, itm_leather_boots, itm_splinted_leather_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_sword_khergit_4, itm_shortened_military_scythe, itm_tab_shield_small_round_c], knight_attrib_4,wp(210),knight_skills_4|knows_trainer_5|knows_power_draw_4, 0x0000000c1500510528f50d52d20b152300000000001d66db0000000000000000, khergit_face_older_2],
["knight_3_20", "Lord Dundush","knight_3_0", tf_hero, 0, reserved, fac_kingdom_3, [itm_warhorse, itm_lamellar_vest, itm_lamellar_armor, itm_hide_boots, itm_mail_chausses, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_khergit_4, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_5,wp(240),knight_skills_5|knows_power_draw_4, 0x0000000f7800620d66b76edd5cd5eb6e00000000001f691e0000000000000000, khergit_face_older_2],
["knight_4_1", "Lord Aedin", "knight_4_1", tf_hero, 0, reserved, fac_kingdom_4, [itm_rich_outfit, itm_banded_armor, itm_woolen_hose, itm_mail_boots, itm_nordic_helmet, itm_mail_mittens, itm_great_axe, itm_tab_shield_round_d, itm_throwing_axes], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c13002254340eb1d91159392d00000000001eb75a0000000000000000, nord_face_middle_2],
["knight_4_2", "Lord Irya", "knight_4_2", tf_hero, 0, reserved, fac_kingdom_4, [ itm_short_tunic, itm_banded_armor, itm_blue_hose, itm_splinted_greaves, itm_nordic_helmet, itm_scale_gauntlets, itm_one_handed_battle_axe_c, itm_tab_shield_round_d, itm_throwing_axes], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_3, 0x0000000c1610218368e29744e9a5985b00000000001db2a10000000000000000, nord_face_old_2],
["knight_4_3", "Lord Olaf", "knight_4_3", tf_hero, 0, reserved, fac_kingdom_4, [itm_warhorse, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_nomad_boots, itm_mail_chausses, itm_scale_gauntlets, itm_nasal_helmet, itm_great_axe, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c03040289245a314b744b30a400000000001eb2a90000000000000000, nord_face_older_2],
["knight_4_4", "Lord Reamald", "knight_4_4", tf_hero, 0, reserved, fac_kingdom_4, [itm_hunter, itm_leather_vest, itm_banded_armor, itm_woolen_hose, itm_mail_boots, itm_scale_gauntlets, itm_nordic_helmet, itm_fighting_pick, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_4,wp(210),knight_skills_4, 0x0000000c3f1001ca3d6955b26a8939a300000000001e39b60000000000000000, nord_face_older_2],
["knight_4_5", "Lord Turya", "knight_4_5", tf_hero, 0, reserved, fac_kingdom_4, [ itm_fur_coat, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_splinted_leather_greaves, itm_scale_gauntlets, itm_nordic_helmet, itm_bastard_sword_b, itm_tab_shield_round_e, itm_throwing_axes, itm_throwing_axes], knight_attrib_5,wp(250),knight_skills_5, 0x0000000ff508330546dc4a59422d450c00000000001e51340000000000000000, nord_face_older_2],
["knight_4_6", "Lord Gundur", "knight_4_6", tf_hero, 0, reserved, fac_kingdom_4, [ itm_nomad_robe, itm_banded_armor, itm_nomad_boots, itm_mail_chausses, itm_nordic_helmet, itm_mail_mittens, itm_war_axe, itm_tab_shield_round_d], knight_attrib_1,wp(130),knight_skills_1, 0x00000005b00011813d9b6d4a92ada53500000000001cc1180000000000000000, nord_face_middle_2],
["knight_4_7", "Lord Harald", "knight_4_7", tf_hero, 0, reserved, fac_kingdom_4, [ itm_fur_coat, itm_studded_leather_coat, itm_nomad_boots, itm_mail_boots, itm_nasal_helmet, itm_mail_mittens, itm_sword_viking_3, itm_shortened_military_scythe, itm_tab_shield_round_d], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_4, 0x00000006690002873d9b6d4a92ada53500000000001cc1180000000000000000, nord_face_old_2],
["knight_4_8", "Lord Knudarr", "knight_4_8", tf_hero, 0, reserved, fac_kingdom_4, [ itm_rich_outfit, itm_mail_and_plate, itm_woolen_hose, itm_mail_chausses, itm_segmented_helmet, itm_scale_gauntlets, itm_war_axe, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_3,wp(190),knight_skills_3, 0x0000000f830051c53b026e4994ae272a00000000001db4e10000000000000000, nord_face_older_2],
["knight_4_9", "Lord Haeda", "knight_4_9", tf_hero, 0, reserved, fac_kingdom_4, [itm_warhorse, itm_nomad_robe, itm_haubergeon, itm_blue_hose, itm_mail_boots, itm_guard_helmet, itm_scale_gauntlets, itm_arrows, itm_long_bow, itm_one_handed_battle_axe_c, itm_tab_shield_round_e], knight_attrib_4,wp(220),knight_skills_4|knows_trainer_5|knows_power_draw_4, 0x0000000c230401c6349c2e9b2168eb1a00000000001eb0630000000000000000, nord_face_older_2],
["knight_4_10", "Lord Turegor", "knight_4_0", tf_hero, 0, reserved, fac_kingdom_4, [itm_hunter, itm_courtly_outfit, itm_coat_of_plates, itm_nomad_boots, itm_splinted_greaves, itm_scale_gauntlets, itm_winged_great_helmet,itm_great_axe, itm_tab_shield_round_e], knight_attrib_5,wp(250),knight_skills_5|knows_trainer_6, 0x000000084b0002063d9b6d4a92ada53500000000001cc1180000000000000000, nord_face_older_2],
["knight_4_11", "Lord Logarson", "knight_4_1", tf_hero, 0, reserved, fac_kingdom_4, [ itm_rich_outfit, itm_banded_armor, itm_woolen_hose, itm_mail_boots, itm_nordic_helmet, itm_mail_mittens, itm_great_bardiche, itm_tab_shield_round_d], knight_attrib_1,wp(140),knight_skills_1, 0x0000000ca100224d56a5d5c65c70c40a00000000001d54de0000000000000000, nord_face_middle_2],
["knight_4_12", "Lord Aeric", "knight_4_2", tf_hero, 0, reserved, fac_kingdom_4, [ itm_short_tunic, itm_banded_armor, itm_blue_hose, itm_splinted_greaves, itm_nordic_helmet, itm_mail_mittens, itm_one_handed_battle_axe_c, itm_tab_shield_round_d], knight_attrib_2,wp(200),knight_skills_2, 0x0000000b9500020824936cc51cb5bb2500000000001dd4d80000000000000000, nord_face_old_2],
["knight_4_13", "Lord Faarn", "knight_4_3", tf_hero, 0, reserved, fac_kingdom_4, [itm_warhorse, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_nomad_boots, itm_mail_chausses, itm_scale_gauntlets, itm_nasal_helmet, itm_war_axe, itm_tab_shield_round_e], knight_attrib_3,wp(250),knight_skills_3|knows_trainer_3, 0x0000000a300012c439233512e287391d00000000001db7200000000000000000, nord_face_older_2],
["knight_4_14", "Lord Bulba", "knight_4_4", tf_hero, 0, reserved, fac_kingdom_4, [ itm_leather_vest, itm_banded_armor, itm_woolen_hose, itm_mail_boots, itm_nordic_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_4,wp(200),knight_skills_4, 0x0000000c0700414f2cb6aa36ea50a69d00000000001dc55c0000000000000000, nord_face_older_2],
["knight_4_15", "Lord Rayeck", "knight_4_5", tf_hero, 0, reserved, fac_kingdom_4, [itm_hunter, itm_leather_jacket, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_scale_gauntlets, itm_splinted_leather_greaves, itm_nordic_helmet, itm_shortened_military_scythe, itm_tab_shield_round_e], knight_attrib_5,wp(290),knight_skills_5|knows_trainer_6, 0x0000000d920801831715d1aa9221372300000000001ec6630000000000000000, nord_face_older_2],
["knight_4_16", "Lord Dirigun", "knight_4_6", tf_hero, 0, reserved, fac_kingdom_4, [ itm_nomad_robe, itm_banded_armor, itm_nomad_boots, itm_mail_chausses, itm_nordic_helmet, itm_mail_mittens, itm_war_axe, itm_tab_shield_round_d, itm_throwing_axes], knight_attrib_1,wp(120),knight_skills_1, 0x000000099700124239233512e287391d00000000001db7200000000000000000, nord_face_middle_2],
["knight_4_17", "Lord Marayirr", "knight_4_7", tf_hero, 0, reserved, fac_kingdom_4, [ itm_fur_coat, itm_banded_armor, itm_nomad_boots, itm_mail_boots, itm_nasal_helmet, itm_mail_mittens, itm_sword_viking_3, itm_tab_shield_round_d, itm_throwing_axes], knight_attrib_2,wp(150),knight_skills_2|knows_trainer_4, 0x0000000c2f0442036d232a2324b5b81400000000001e55630000000000000000, nord_face_old_2],
["knight_4_18", "Lord Gearth", "knight_4_8", tf_hero, 0, reserved, fac_kingdom_4, [ itm_rich_outfit, itm_mail_and_plate, itm_woolen_hose, itm_mail_chausses, itm_segmented_helmet, itm_scale_gauntlets, itm_sword_viking_3, itm_shortened_military_scythe, itm_tab_shield_round_d], knight_attrib_3,wp(180),knight_skills_3, 0x0000000c0d00118866e22e3d9735a72600000000001eacad0000000000000000, nord_face_older_2],
["knight_4_19", "Lord Surdun", "knight_4_9", tf_hero, 0, reserved, fac_kingdom_4, [itm_warhorse, itm_nomad_robe, itm_haubergeon, itm_blue_hose, itm_mail_boots, itm_guard_helmet, itm_scale_gauntlets, itm_one_handed_battle_axe_c, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_4,wp(210),knight_skills_4|knows_trainer_5, 0x0000000c0308225124e26d4a6295965a00000000001d23e40000000000000000, nord_face_older_2],
["knight_4_20", "Lord Gerlad", "knight_4_0", tf_hero, 0, reserved, fac_kingdom_4, [itm_hunter, itm_courtly_outfit, itm_coat_of_plates, itm_nomad_boots, itm_splinted_greaves, itm_scale_gauntlets, itm_winged_great_helmet,itm_great_axe, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_5,wp(240),knight_skills_5, 0x0000000f630052813b6bb36de5d6eb7400000000001dd72c0000000000000000, nord_face_older_2],
["knight_5_1", "Lord Matheas", "knight_5_1", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_tabard, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_boots, itm_guard_helmet, itm_leather_gloves, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_3, 0x0000000a1b0c00483adcbaa5ac9a34a200000000001ca2d40000000000000000, rhodok_face_middle_2],
["knight_5_2", "Lord Gutlans", "knight_5_2", tf_hero, 0, reserved, fac_kingdom_5, [itm_courser, itm_red_gambeson, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_boots, itm_nasal_helmet, itm_leather_gloves, itm_military_pick, itm_sword_two_handed_a, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_4, 0x0000000c390c659229136db45a75251300000000001f16930000000000000000, rhodok_face_old_2],
["knight_5_3", "Lord Laruqen", "knight_5_3", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_short_tunic, itm_mail_and_plate, itm_nomad_boots, itm_splinted_leather_greaves, itm_kettle_hat, itm_gauntlets, itm_shortened_military_scythe, itm_tab_shield_heater_d], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c2f10415108b1aacba27558d300000000001d329c0000000000000000, rhodok_face_older_2],
["knight_5_4", "Lord Raichs", "knight_5_4", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_leather_jacket, itm_brigandine_a, itm_woolen_hose, itm_splinted_greaves, itm_flat_topped_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_d], knight_attrib_4,wp(220),knight_skills_4, 0x0000000c3c005110345c59d56975ba1200000000001e24e40000000000000000, rhodok_face_older_2],
["knight_5_5", "Lord Reland", "knight_5_5", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_boots, itm_great_helmet, itm_gauntlets, itm_shortened_military_scythe, itm_tab_shield_heater_d], knight_attrib_5,wp(250),knight_skills_5, 0x0000000c060400c454826e471092299a00000000001d952d0000000000000000, rhodok_face_older_2],
["knight_5_6", "Lord Tarchias", "knight_5_6", tf_hero, 0, reserved, fac_kingdom_5, [itm_sumpter_horse, itm_ragged_outfit, itm_heraldic_mail_with_tabard, itm_woolen_hose, itm_splinted_greaves, itm_gauntlets, itm_skullcap, itm_sword_two_handed_b, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c040804d2293c46a6a5669ce400000000001db7120000000000000000, rhodok_face_middle_2],
["knight_5_7", "Lord Gharmall", "knight_5_7", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_coarse_tunic, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_chausses, itm_gauntlets, itm_nasal_helmet, itm_bastard_sword_a, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2, 0x0000000c3a0455c443d46e4c8b91291a00000000001ca51b0000000000000000, rhodok_face_old_2],
["knight_5_8", "Lord Talbar", "knight_5_8", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_courtly_outfit, itm_heraldic_mail_with_tabard, itm_woolen_hose, itm_mail_boots, itm_nasal_helmet, itm_gauntlets, itm_military_pick, itm_sword_two_handed_b, itm_tab_shield_heater_c], knight_attrib_3,wp(190),knight_skills_3|knows_trainer_3, 0x0000000c2c0844d42914d19b2369b4ea00000000001e331b0000000000000000, rhodok_face_older_2],
["knight_5_9", "Lord Rimusk", "knight_5_9", tf_hero, 0, reserved, fac_kingdom_5, [itm_warhorse, itm_leather_jacket, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_splinted_leather_greaves, itm_kettle_hat, itm_gauntlets, itm_great_bardiche, itm_tab_shield_heater_d], knight_attrib_4,wp(220),knight_skills_4|knows_trainer_6, 0x0000000c130461054af448eb19cd40e400000000001d488a0000000000000000, rhodok_face_older_2],
["knight_5_10", "Lord Falsevor", "knight_5_0", tf_hero, 0, reserved, fac_kingdom_5, [itm_warhorse, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_blue_hose, itm_mail_chausses, itm_great_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_d], knight_attrib_5,wp(250),knight_skills_5|knows_trainer_4, 0x00000008e20011063d9b6d4a92ada53500000000001cc1180000000000000000, rhodok_face_older_2],
["knight_5_11", "Lord Etrosq", "knight_5_1", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_tabard, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_boots, itm_skullcap, itm_leather_gloves, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c170c14874752adb6eb3228d500000000001c955c0000000000000000, rhodok_face_middle_2],
["knight_5_12", "Lord Kurnias", "knight_5_2", tf_hero, 0, reserved, fac_kingdom_5, [itm_courser, itm_red_gambeson, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_boots, itm_nasal_helmet, itm_leather_gloves, itm_military_pick, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_5, 0x0000000c080c13d056ec8da85e3126ed00000000001d4ce60000000000000000, rhodok_face_old_2],
["knight_5_13", "Lord Tellrog", "knight_5_3", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_short_tunic, itm_mail_and_plate, itm_nomad_boots, itm_splinted_leather_greaves, itm_winged_great_helmet, itm_gauntlets, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_3,wp(190),knight_skills_3, 0x0000000cbf10100562a4954ae731588a00000000001d6b530000000000000000, rhodok_face_older_2],
["knight_5_14", "Lord Tribidan", "knight_5_4", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_leather_jacket, itm_brigandine_a, itm_woolen_hose, itm_splinted_greaves, itm_flat_topped_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_d], knight_attrib_4,wp(220),knight_skills_4, 0x0000000c330805823baa77556c4e331a00000000001cb9110000000000000000, rhodok_face_older_2],
["knight_5_15", "Lord Gerluchs", "knight_5_5", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_boots, itm_great_helmet, itm_gauntlets, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_5,wp(250),knight_skills_5, 0x0000000d51000106370c4d4732b536de00000000001db9280000000000000000, rhodok_face_older_2],
["knight_5_16", "Lord Fudreim", "knight_5_6", tf_hero, 0, reserved, fac_kingdom_5, [itm_sumpter_horse, itm_ragged_outfit, itm_heraldic_mail_with_tabard, itm_woolen_hose, itm_splinted_greaves, itm_guard_helmet, itm_leather_gloves, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_1,wp(120),knight_skills_1, 0x0000000c06046151435b5122a37756a400000000001c46e50000000000000000, rhodok_face_middle_2],
["knight_5_17", "Lord Nealcha", "knight_5_7", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_coarse_tunic, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_chausses, itm_nasal_helmet, itm_leather_gloves, itm_bastard_sword_a, itm_tab_shield_heater_c], knight_attrib_2,wp(150),knight_skills_2, 0x0000000c081001d3465c89a6a452356300000000001cda550000000000000000, rhodok_face_old_2],
["knight_5_18", "Lord Fraichin", "knight_5_8", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_courtly_outfit, itm_heraldic_mail_with_tabard, itm_woolen_hose, itm_mail_boots, itm_nasal_helmet, itm_gauntlets, itm_military_pick, itm_tab_shield_heater_d], knight_attrib_3,wp(180),knight_skills_3, 0x0000000a3d0c13c3452aa967276dc95c00000000001dad350000000000000000, rhodok_face_older_2],
["knight_5_19", "Lord Trimbau", "knight_5_9", tf_hero, 0, reserved, fac_kingdom_5, [itm_warhorse, itm_leather_jacket, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_splinted_leather_greaves, itm_kettle_hat, itm_gauntlets, itm_fighting_pick, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_4,wp(210),knight_skills_4|knows_trainer_5, 0x0000000c3f08038245545e3b236a68de00000000001e37230000000000000000, rhodok_face_older_2],
["knight_5_20", "Lord Reichsin", "knight_5_0", tf_hero, 0, reserved, fac_kingdom_5, [itm_warhorse, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_blue_hose, itm_mail_chausses, itm_great_helmet, itm_gauntlets, itm_bastard_sword_b, itm_tab_shield_heater_d], knight_attrib_5,wp(240),knight_skills_5|knows_trainer_6, 0x0000000d8a00514544be2d14d370c65c00000000001ed6df0000000000000000, rhodok_face_older_2],
["kingdom_1_pretender", "Lady Isolla of Suno", "Kingdom 1 Lord", tf_hero|tf_female|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_1,[itm_charger, itm_rich_outfit, itm_blue_hose, itm_iron_greaves, itm_mail_shirt, itm_sword_medieval_c_small, itm_tab_shield_small_round_c, itm_bascinet], lord_attrib,wp(220),knows_lord_1, 0x00000000ef00000237dc71b90c31631200000000001e371b0000000000000000],
#claims pre-salic descent
["kingdom_2_pretender", "Prince Valdym the Bastard", "Kingdom 2 Lord", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_2,[itm_hunter, itm_courtly_outfit, itm_leather_boots, itm_mail_chausses, itm_lamellar_armor, itm_military_pick, itm_tab_shield_heater_b, itm_flat_topped_helmet], lord_attrib,wp(220),knows_lord_1, 0x00000000200412142452ed631b30365c00000000001c94e80000000000000000, vaegir_face_middle_2],
#had his patrimony falsified
["kingdom_3_pretender", "Dustum Khan", "Kingdom 3 Lord", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_3,[itm_courser, itm_nomad_robe, itm_leather_boots, itm_splinted_greaves, itm_khergit_guard_armor, itm_sword_khergit_2, itm_tab_shield_small_round_c, itm_segmented_helmet], lord_attrib,wp(220),knows_lord_1, 0x000000065504310b30d556b51238f66100000000001c256d0000000000000000, khergit_face_middle_2],
#of the family
["kingdom_4_pretender", "Lethwin Far-Seeker", "Kingdom 4 Lord", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_4,[itm_hunter, itm_tabard, itm_leather_boots, itm_mail_boots, itm_brigandine_a, itm_sword_medieval_c, itm_tab_shield_heater_cav_a, itm_kettle_hat], lord_attrib,wp(220),knows_lord_1, 0x00000004340c01841d89949529a6776a00000000001c910a0000000000000000, nord_face_young_2],
#dispossessed and wronged
["kingdom_5_pretender", "Lord Kastor of Veluca", "Kingdom 5 Lord", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_5,[itm_warhorse, itm_nobleman_outfit, itm_leather_boots, itm_splinted_leather_greaves, itm_mail_hauberk, itm_sword_medieval_c, itm_tab_shield_heater_d, itm_spiked_helmet], lord_attrib,wp(220),knows_lord_1, 0x0000000bed1031051da9abc49ecce25e00000000001e98680000000000000000, rhodok_face_old_2],
#republican
## ["kingdom_1_lord_a", "Kingdom 1 Lord A", "Kingdom 1 Lord A", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_b", "Kingdom 1 Lord B", "Kingdom 1 Lord B", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_c", "Kingdom 1 Lord C", "Kingdom 1 Lord C", tf_hero, 0,reserved, fac_kingdom_3,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_d", "Kingdom 1 Lord D", "Kingdom 1 Lord D", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_e", "Kingdom 1 Lord E", "Kingdom 1 Lord E", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_f", "Kingdom 1 Lord F", "Kingdom 1 Lord F", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_g", "Kingdom 1 Lord G", "Kingdom 1 Lord G", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_h", "Kingdom 1 Lord H", "Kingdom 1 Lord H", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_i", "Kingdom 1 Lord I", "Kingdom 1 Lord I", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_j", "Kingdom 1 Lord J", "Kingdom 1 Lord J", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_k", "Kingdom 1 Lord K", "Kingdom 1 Lord K", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_l", "Kingdom 1 Lord L", "Kingdom 1 Lord L", tf_hero, 0,reserved, fac_kingdom_3,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_m", "Kingdom 1 Lord M", "Kingdom 1 Lord M", tf_hero, 0,reserved, fac_kingdom_3,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
## ["kingdom_1_lord_n", "Kingdom 1 Lord N", "Kingdom 1 Lord N", tf_hero, 0,reserved, fac_kingdom_3,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721],
# ["town_1_ruler_a", "King Harlaus", "King Harlaus", tf_hero, scn_town_1_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_courtly_outfit,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000010908101e36db44b75b6dd],
# ["town_2_ruler_a", "Duke Taugard", "Duke Taugard", tf_hero, scn_town_2_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_courtly_outfit,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000000310401e06db86375f6da],
# ["town_3_ruler_a", "Count Grimar", "Count Grimar", tf_hero, scn_town_3_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000004430301e46136eb75bc0a],
# ["town_4_ruler_a", "Count Haxalye", "Count Haxalye", tf_hero, scn_town_4_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000010918701e77136e905bc0e
# ["town_5_ruler_a", "Count Belicha", "Count Belicha", tf_hero, scn_town_5_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000421c801e7713729c5b8ce],
# ["town_6_ruler_a", "Count Nourbis", "Count Nourbis", tf_hero, scn_town_6_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000c640501e371b72bcdb724],
# ["town_7_ruler_a", "Count Rhudolg", "Count Rhudolg", tf_hero, scn_town_7_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000c710201fa51b7286db721],
# ["town_8_ruler_b", "King Yaroglek", "King_yaroglek", tf_hero, scn_town_8_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000000128801f294ca6d66d555],
# ["town_9_ruler_b", "Count Aolbrug", "Count_Aolbrug", tf_hero, scn_town_9_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000004234401f26a271c8d38ea],
# ["town_10_ruler_b","Count Rasevas", "Count_Rasevas", tf_hero, scn_town_10_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000001032c201f38e269372471c],
# ["town_11_ruler_b","Count Leomir", "Count_Leomir", tf_hero, scn_town_11_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000c538001f55148936d3895],
# ["town_12_ruler_b","Count Haelbrad","Count_Haelbrad",tf_hero, scn_town_12_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000410c701f38598ac8aaaab],
# ["town_13_ruler_b","Count Mira", "Count_Mira", tf_hero, scn_town_13_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000004204401f390c515555594],
# ["town_14_ruler_b","Count Camechaw","Count_Camechaw",tf_hero, scn_town_14_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_a", "Kingdom 2 Lord A", "Kingdom 2 Lord A", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_b", "Kingdom 2 Lord B", "Kingdom 2 Lord B", tf_hero, 0,reserved, fac_kingdom_11,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_c", "Kingdom 2 Lord C", "Kingdom 2 Lord C", tf_hero, 0,reserved, fac_kingdom_12,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_d", "Kingdom 2 Lord D", "Kingdom 2 Lord D", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_e", "Kingdom 2 Lord E", "Kingdom 2 Lord E", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_f", "Kingdom 2 Lord F", "Kingdom 2 Lord F", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_g", "Kingdom 2 Lord G", "Kingdom 2 Lord G", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_h", "Kingdom 2 Lord H", "Kingdom 2 Lord H", tf_hero, 0,reserved, fac_kingdom_11,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_i", "Kingdom 2 Lord I", "Kingdom 2 Lord I", tf_hero, 0,reserved, fac_kingdom_11,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_j", "Kingdom 2 Lord J", "Kingdom 2 Lord J", tf_hero, 0,reserved, fac_kingdom_11,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_k", "Kingdom 2 Lord K", "Kingdom 2 Lord K", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_l", "Kingdom 2 Lord L", "Kingdom 2 Lord L", tf_hero, 0,reserved, fac_kingdom_12,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_m", "Kingdom 2 Lord M", "Kingdom 2 Lord M", tf_hero, 0,reserved, fac_kingdom_12,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
## ["kingdom_2_lord_n", "Kingdom 2 Lord N", "Kingdom 2 Lord N", tf_hero, 0,reserved, fac_kingdom_12,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594],
#Royal family members
["knight_1_1_wife","Lady Anna","knight_1_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_1, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000055910200107632d675a92b92d00000000001e45620000000000000000],
["knight_2_1_wife","Lady Junitha","knight_2_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_2, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000007c0101002588caf17142ab93d00000000001ddfa40000000000000000],
["knight_3_1_wife","Lady Borge","knight_3_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_3, [ itm_nomad_vest, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000056e082002471c91c8aa2a130b00000000001d48a40000000000000000],
["knight_4_1_wife","Lady Jadeth","knight_4_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_4, [ itm_court_dress , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000054b100003274d65d2d239eb1300000000001d49080000000000000000],
["knight_5_1_wife","Lady Brina","knight_5_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_5, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000007e900200416ed96e88b8d595a00000000001cb8ac0000000000000000],
["knight_1_2_wife","Lady Nelda","knight_1_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_1, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000054f08100232636aa90d6e194b00000000001e43130000000000000000],
["knight_2_2_wife","Lady Katia","knight_2_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_2, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000008c00c20032aa5ae36b4259b9300000000001da6a50000000000000000],
["knight_3_2_wife","Lady Tuan","knight_3_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_3, [ itm_nomad_vest, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000008ec0820062ce4d246b38e632e00000000001d52910000000000000000],
["knight_4_2_wife","Lady Miar","knight_4_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_4, [ itm_court_dress , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000058610000664d3693664f0c54b00000000001d332d0000000000000000],
["knight_5_2_wife","Lady Aliena","knight_5_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_5, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000057008200222d432cf6d4a2ae300000000001d37a10000000000000000],
["knight_1_1_daughter","Lady Bela","knight_1_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_1, [ itm_lady_dress_blue, itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000018f0410064854c742db74b52200000000001d448b0000000000000000],
["knight_2_1_daughter","Lady Seomis","knight_2_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_2, [ itm_peasant_dress , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x0000000007080004782a6cc4ecae4d1e00000000001eb6e30000000000000000],
["knight_3_1_daughter","Lady Chedina","knight_3_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_3, [ itm_nomad_robe , itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000000320c30023ce23a145a8f27a300000000001ea6dc0000000000000000],
["knight_4_1_daughter","Lady Dria","knight_4_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_4, [ itm_peasant_dress, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000000000c000469a4d5cda4b1349c00000000001cd6600000000000000000],
["knight_5_1_daughter","Lady Aneth","knight_5_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_5, [ itm_lady_dress_ruby , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000001b9002002364dd8aa5475d76400000000001db8d30000000000000000],
["knight_1_2_daughter","Lady Elina","knight_1_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_1, [ itm_lady_dress_blue, itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000204200629b131e90d6a8ae400000000001e28dd0000000000000000],
["knight_2_2_daughter","Lady Drina","knight_2_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_2, [ itm_peasant_dress , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000054008200638db99d89eccbd3500000000001ec91d0000000000000000],
["knight_3_2_daughter","Lady Ayasu","knight_3_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_3, [ itm_nomad_robe , itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000002a0c200348a28f2a54aa391c00000000001e46d10000000000000000],
["knight_4_2_daughter","Lady Glunde","knight_4_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_4, [ itm_peasant_dress, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000000000000021564d196e2aa279400000000001dc4ed0000000000000000],
["knight_5_2_daughter","Lady Reada","knight_5_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_5, [ itm_lady_dress_ruby , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000057a0000014123dae69e8e48e200000000001e08db0000000000000000],
# ["kingdom_11_lord_daughter","kingdom_11_lord_daughter","kingdom_11_lord_daughter",tf_hero|tf_female,0,reserved,fac_kingdom_10, [ itm_lady_dress_blue , itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008300701c08d34a450ce43],
# ["kingdom_13_lord_daughter","kingdom_13_lord_daughter","kingdom_13_lord_daughter",tf_hero|tf_female,0,reserved,fac_kingdom_10, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008000401db10a45b41d6d8],
## ["kingdom_1_lady_a","kingdom_1_lady_a","kingdom_1_lady_a",tf_hero|tf_female,0,reserved,fac_kingdom_1, [ itm_lady_dress_blue , itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008500201d8ad93708e4694],
## ["kingdom_1_lady_b","kingdom_1_lady_b","kingdom_1_lady_b",tf_hero|tf_female,0,reserved,fac_kingdom_1, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000004000101c3ae68e0e944ac],
## ["kingdom_2_lady_a","Kingdom 2 Lady a","Kingdom 2 Lady a",tf_hero|tf_female,0,reserved,fac_kingdom_2, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008100501d8ad93708e4694],
## ["kingdom_2_lady_b","Kingdom 2 Lady b","Kingdom 2 Lady b",tf_hero|tf_female,0,reserved,fac_kingdom_2, [ itm_lady_dress_blue , itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000004000401d8ad93708e4694],
## ["kingdom_3_lady_a","Kingdom 3 Lady a","Kingdom 3 Lady a",tf_hero|tf_female,0,reserved,fac_kingdom_3, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000010500301d8ad93708e4694],
##
## ["kingdom_3_lady_b","Kingdom 3 Lady b","Kingdom 3 Lady b",tf_hero|tf_female,0,reserved,fac_kingdom_3, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000000100601d8b08d76d14a24],
## ["kingdom_4_lady_a","Kingdom 4 Lady a","Kingdom 4 Lady a",tf_hero|tf_female,0,reserved,fac_kingdom_4, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000010500601d8ad93708e4694],
## ["kingdom_4_lady_b","Kingdom 4 Lady b","Kingdom 4 Lady b",tf_hero|tf_female,0,reserved,fac_kingdom_4, [ itm_lady_dress_blue , itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008500201d8ad93708e4694],
["heroes_end", "heroes end", "heroes end", tf_hero, 0,reserved, fac_neutral,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000008318101f390c515555594],
#Merchants AT SILAH ZIRH BOT Head_wear
## ["merchant_1", "merchant_1_F", "merchant_1_F",tf_hero|tf_female, 0,0, fac_kingdom_1,[itm_courser, itm_fighting_axe, itm_leather_jerkin, itm_leather_boots, itm_straw_hat], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008200201e54c137a940c91],
## ["merchant_2", "merchant_2", "merchant_2", tf_hero, 0,0, fac_kingdom_2,[itm_saddle_horse, itm_arming_sword, itm_light_leather, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000000000601db6db6db6db6db],
## ["merchant_3", "merchant_3", "merchant_3", tf_hero, 0,0, fac_kingdom_3,[itm_courser, itm_nordic_sword, itm_leather_jerkin, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008100701db6db6db6db6db],
## ["merchant_4", "merchant_4_F", "merchant_4_F",tf_hero|tf_female, 0,0, fac_kingdom_4,[itm_saddle_horse, itm_falchion, itm_light_leather, itm_blue_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000010500401e54c137a945c91],
## ["merchant_5", "merchant_5", "merchant_5", tf_hero, 0,0, fac_kingdom_5,[itm_saddle_horse, itm_sword, itm_ragged_outfit, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008038001e54c135a945c91],
## ["merchant_6", "merchant_6", "merchant_6", tf_hero, 0,0, fac_kingdom_1,[itm_saddle_horse, itm_scimitar, itm_leather_jerkin, itm_leather_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000000248e01e54c1b5a945c91],
## ["merchant_7", "merchant_7_F", "merchant_7_F",tf_hero|tf_female, 0,0, fac_kingdom_2,[itm_hunter, itm_arming_sword, itm_padded_leather, itm_blue_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000004200601c98ad39c97557a],
## ["merchant_8", "merchant_8", "merchant_8", tf_hero, 0,0, fac_kingdom_3,[itm_saddle_horse, itm_nordic_sword, itm_light_leather, itm_leather_boots, itm_woolen_hood], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000001095ce01d6aad3a497557a],
## ["merchant_9", "merchant_9", "merchant_9", tf_hero, 0,0, fac_kingdom_4,[itm_saddle_horse, itm_sword, itm_padded_leather, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000010519601ec26ae99898697],
## ["merchant_10","merchant_10","merchant_10",tf_hero, 0,0, fac_merchants,[itm_hunter, itm_bastard_sword, itm_light_leather, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000000884c401f6837d3294e28a],
## ["merchant_11","merchant_11","merchant_11",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_sword, itm_leather_jacket, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000000c450501e289dd2c692694],
## ["merchant_12","merchant_12","merchant_12",tf_hero, 0,0, fac_merchants,[itm_hunter, itm_falchion, itm_leather_jerkin, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000000c660a01e5af3cb2763401],
## ["merchant_13","merchant_13","merchant_13",tf_hero, 0,0, fac_merchants,[itm_sumpter_horse, itm_nordic_sword, itm_padded_leather, itm_leather_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000001001d601ec912a89e4d534],
## ["merchant_14","merchant_14","merchant_14",tf_hero, 0,0, fac_merchants,[itm_courser, itm_bastard_sword, itm_light_leather, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000004335601ea2c04a8b6a394],
## ["merchant_15","merchant_15","merchant_15",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_sword, itm_padded_leather, itm_woolen_hose, itm_fur_hat], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008358e01dbf27b6436089d],
## ["merchant_16","merchant_16_F","merchant_16_F",tf_hero|tf_female, 0,0, fac_merchants,[itm_hunter, itm_bastard_sword, itm_light_leather, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000000c300101db0b9921494add],
## ["merchant_17","merchant_17","merchant_17",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_sword, itm_leather_jacket, itm_blue_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008740f01e945c360976a0a],
## ["merchant_18","merchant_18","merchant_18",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_nordic_sword, itm_padded_leather, itm_leather_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008020c01fc2db3b4c97685],
## ["merchant_19","merchant_19","merchant_19",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_falchion, itm_leather_jerkin, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008118301f02af91892725b],
## ["merchant_20","merchant_20_F","merchant_20_F",tf_hero|tf_female, 0,0, fac_merchants,[itm_courser, itm_arming_sword, itm_padded_leather, itm_leather_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000010500401f6837d27688212],
#Seneschals
["town_1_seneschal", "Town 1 Seneschal", "Town 1 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026],
["town_2_seneschal", "Town 2 Seneschal", "Town 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd],
["town_3_seneschal", "Town 3 Seneschal", "Town 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd],
["town_4_seneschal", "Town 4 Seneschal", "Town 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b],
["town_5_seneschal", "Town 5 Seneschal", "Town 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000000249101e7898999ac54c6],
["town_6_seneschal", "Town 6 Seneschal", "Town 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000010360b01cef8b57553d34e],
["town_7_seneschal", "Town 7 Seneschal", "Town 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000000018101f9487aa831dce4],
["town_8_seneschal", "Town 8 Seneschal", "Town 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae],
["town_9_seneschal", "Town 9 Seneschal", "Town 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550],
["town_10_seneschal", "Town 10 Seneschal", "Town 10 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000010230c01ef41badb50465e],
["town_11_seneschal", "Town 11 Seneschal", "Town 11 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jacket, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f],
["town_12_seneschal", "Town 12 Seneschal", "Town 12 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82],
["town_13_seneschal", "Town 13 Seneschal", "Town 13 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a],
["town_14_seneschal", "Town 14 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05],
["town_15_seneschal", "Town 15 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05],
["town_16_seneschal", "Town 16 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05],
["town_17_seneschal", "Town 17 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05],
["town_18_seneschal", "Town 18 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05],
["castle_1_seneschal", "Castle 1 Seneschal", "Castle 1 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000010360b01cef8b57553d34e],
["castle_2_seneschal", "Castle 2 Seneschal", "Castle 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_nomad_armor, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f],
["castle_3_seneschal", "Castle 3 Seneschal", "Castle 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a],
["castle_4_seneschal", "Castle 4 Seneschal", "Castle 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_linen_tunic, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae],
["castle_5_seneschal", "Castle 5 Seneschal", "Castle 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd],
["castle_6_seneschal", "Castle 6 Seneschal", "Castle 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd],
["castle_7_seneschal", "Castle 7 Seneschal", "Castle 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82],
["castle_8_seneschal", "Castle 8 Seneschal", "Castle 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026],
["castle_9_seneschal", "Castle 9 Seneschal", "Castle 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jacket, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b],
["castle_10_seneschal", "Castle 10 Seneschal", "Castle 10 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550],
["castle_11_seneschal", "Castle 11 Seneschal", "Castle 11 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550],
["castle_12_seneschal", "Castle 2 Seneschal", "Castle 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_nomad_armor, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f],
["castle_13_seneschal", "Castle 3 Seneschal", "Castle 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a],
["castle_14_seneschal", "Castle 4 Seneschal", "Castle 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_linen_tunic, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae],
["castle_15_seneschal", "Castle 5 Seneschal", "Castle 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd],
["castle_16_seneschal", "Castle 6 Seneschal", "Castle 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd],
["castle_17_seneschal", "Castle 7 Seneschal", "Castle 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82],
["castle_18_seneschal", "Castle 8 Seneschal", "Castle 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026],
["castle_19_seneschal", "Castle 9 Seneschal", "Castle 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jacket, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b],
["castle_20_seneschal", "Castle 20 Seneschal", "Castle 20 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550],
["castle_21_seneschal", "Castle 11 Seneschal", "Castle 11 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550],
["castle_22_seneschal", "Castle 2 Seneschal", "Castle 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_nomad_armor, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f],
["castle_23_seneschal", "Castle 3 Seneschal", "Castle 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a],
["castle_24_seneschal", "Castle 4 Seneschal", "Castle 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_linen_tunic, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae],
["castle_25_seneschal", "Castle 5 Seneschal", "Castle 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd],
["castle_26_seneschal", "Castle 6 Seneschal", "Castle 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd],
["castle_27_seneschal", "Castle 7 Seneschal", "Castle 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82],
["castle_28_seneschal", "Castle 8 Seneschal", "Castle 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026],
["castle_29_seneschal", "Castle 9 Seneschal", "Castle 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jacket, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b],
["castle_30_seneschal", "Castle 20 Seneschal", "Castle 20 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550],
["castle_31_seneschal", "Castle 11 Seneschal", "Castle 11 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550],
["castle_32_seneschal", "Castle 2 Seneschal", "Castle 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_nomad_armor, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f],
["castle_33_seneschal", "Castle 3 Seneschal", "Castle 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a],
["castle_34_seneschal", "Castle 4 Seneschal", "Castle 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_linen_tunic, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae],
["castle_35_seneschal", "Castle 5 Seneschal", "Castle 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd],
["castle_36_seneschal", "Castle 6 Seneschal", "Castle 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd],
["castle_37_seneschal", "Castle 7 Seneschal", "Castle 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82],
["castle_38_seneschal", "Castle 8 Seneschal", "Castle 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026],
["castle_39_seneschal", "Castle 9 Seneschal", "Castle 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jacket, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b],
["castle_40_seneschal", "Castle 20 Seneschal", "Castle 20 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550],
#Arena Masters
["town_1_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_1_arena|entry(52),reserved, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_2_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_2_arena|entry(52),reserved, fac_commoners,[itm_linen_tunic, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_3_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_3_arena|entry(52),reserved, fac_commoners,[itm_nomad_armor, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_4_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_4_arena|entry(52),reserved, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_5_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_5_arena|entry(52),reserved, fac_commoners,[itm_linen_tunic, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_6_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_6_arena|entry(52),reserved, fac_commoners,[itm_leather_jerkin, itm_leather_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_7_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_7_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_8_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_8_arena|entry(52),reserved, fac_commoners,[itm_linen_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_9_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_9_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_10_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_10_arena|entry(52),reserved, fac_commoners,[itm_nomad_armor, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_11_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_11_arena|entry(52),reserved, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_12_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_12_arena|entry(52),reserved, fac_commoners,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_13_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_13_arena|entry(52),reserved, fac_commoners,[itm_coarse_tunic, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_14_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_14_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_15_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_15_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_16_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_16_arena|entry(52),reserved, fac_commoners,[itm_fur_coat, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_17_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_17_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
["town_18_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_18_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2],
# Underground
## ["town_1_crook","Town 1 Crook","Town 1 Crook",tf_hero, 0,0, fac_neutral,[itm_linen_tunic, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x000000000004428401f46e44a27144e3],
## ["town_2_crook","Town 2 Crook","Town 2 Crook",tf_hero|tf_female, 0,0, fac_neutral,[itm_lady_dress_ruby, itm_turret_hat_ruby ],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x000000000004300101c36db6db6db6db],
## ["town_3_crook","Town 3 Crook","Town 3 Crook",tf_hero, 0,0, fac_neutral,[itm_leather_apron, itm_hide_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x00000000000c530701f17944a25164e1],
## ["town_4_crook","Town 4 Crook","Town 4 Crook",tf_hero, 0,0, fac_neutral,[itm_coarse_tunic, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000c840501f36db6db7134db],
## ["town_5_crook","Town 5 Crook","Town 5 Crook",tf_hero, 0,0, fac_neutral,[itm_red_gambeson, itm_blue_hose ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000c000601f36db6db7134db],
## ["town_6_crook","Town 6 Crook","Town 6 Crook",tf_hero, 0,0, fac_neutral,[itm_coarse_tunic, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000c10c801db6db6dd7598aa],
## ["town_7_crook","Town 7 Crook","Town 7 Crook",tf_hero|tf_female, 0,0, fac_neutral,[itm_woolen_dress, itm_woolen_hood ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000010214101de2f64db6db58d],
##
## ["town_8_crook","Town 8 Crook","Town 8 Crook",tf_hero, 0,0, fac_neutral,[itm_leather_jacket, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000010318401c96db4db6db58d],
## ["town_9_crook","Town 9 Crook","Town 9 Crook",tf_hero, 0,0, fac_neutral,[itm_linen_tunic, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000008520501f16db4db6db58d],
## ["town_10_crook","Town 10 Crook","Town 10 Crook",tf_hero, 0,0, fac_neutral,[itm_coarse_tunic, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000008600701f35144db6db8a2],
## ["town_11_crook","Town 11 Crook","Town 11 Crook",tf_hero|tf_female, 0,0, fac_neutral,[itm_blue_dress, itm_wimple_with_veil ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000008408101f386c4db4dd514],
## ["town_12_crook","Town 12 Crook","Town 12 Crook",tf_hero, 0,0, fac_neutral,[itm_coarse_tunic, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000870c501f386c4f34dbaa1],
## ["town_13_crook","Town 13 Crook","Town 13 Crook",tf_hero, 0,0, fac_neutral,[itm_blue_gambeson, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000c114901f245caf34dbaa1],
## ["town_14_crook","Town 14 Crook","Town 14 Crook",tf_hero|tf_female, 0,0, fac_neutral,[itm_woolen_dress, itm_turret_hat_ruby ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000001021c001f545a49b6eb2bc],
# Armor Merchants
#arena_masters_end = zendar_armorer
["town_1_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_2_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_woolen_dress, itm_straw_hat ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_3_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_arena_tunic_red, itm_hide_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_4_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_red_gambeson, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_5_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_6_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_7_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_blue_hose ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_8_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_padded_leather, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_9_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_blue_gambeson, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_10_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_11_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_12_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_red_gambeson, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_13_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_14_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_woolen_dress, itm_headcloth ],def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_15_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_blue_gambeson, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_16_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_17_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_18_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_woolen_dress, itm_headcloth ],def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
# Weapon merchants
["town_1_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_hide_boots,itm_straw_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_2_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_nomad_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_3_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_4_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_5_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_6_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_7_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_8_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_woolen_dress, itm_wrapping_boots,itm_straw_hat],def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_9_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_leather_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_10_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_11_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_woolen_hose],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_12_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_13_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_arena_tunic_red, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_14_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_arena_tunic_blue, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_15_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_woolen_hose],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_16_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_17_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_arena_tunic_green, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["town_18_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
#Tavern keepers
["town_1_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_1_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2],
["town_2_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_2_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2],
["town_3_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_3_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2],
["town_4_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_4_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2],
["town_5_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_5_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2],
["town_6_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_6_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2],
["town_7_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_7_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_leather_boots, itm_headcloth],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2],
["town_8_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_8_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2],
["town_9_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_9_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2],
["town_10_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_10_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2],
["town_11_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_11_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2],
["town_12_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_12_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2],
["town_13_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_13_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots, itm_headcloth],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2],
["town_14_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_14_tavern|entry(9),0, fac_commoners,[itm_shirt, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2],
["town_15_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_15_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2],
["town_16_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_16_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2],
["town_17_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_17_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots, itm_headcloth],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2],
["town_18_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_18_tavern|entry(9),0, fac_commoners,[itm_shirt, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2],
#Goods Merchants
["town_1_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_1_store|entry(9),0, fac_commoners, [itm_coarse_tunic, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_2_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_2_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_3_merchant", "Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_3_store|entry(9),0, fac_commoners, [itm_dress, itm_leather_boots, itm_straw_hat ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_4_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_4_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_5_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_5_store|entry(9),0, fac_commoners, [itm_nomad_armor, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_6_merchant", "Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_6_store|entry(9),0, fac_commoners, [itm_woolen_dress, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_7_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_7_store|entry(9),0, fac_commoners, [itm_leather_jerkin,itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_8_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_8_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_9_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_9_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_10_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_10_store|entry(9),0, fac_commoners, [itm_leather_jerkin,itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_11_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_11_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_12_merchant","Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_12_store|entry(9),0, fac_commoners, [itm_woolen_dress, itm_leather_boots, itm_female_hood ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_13_merchant","Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_13_store|entry(9),0, fac_commoners, [itm_dress, itm_leather_boots, itm_straw_hat ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_14_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_14_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_15_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_15_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_16_merchant","Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_16_store|entry(9),0, fac_commoners, [itm_woolen_dress, itm_leather_boots, itm_female_hood ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_17_merchant","Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_17_store|entry(9),0, fac_commoners, [itm_dress, itm_leather_boots, itm_straw_hat ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_18_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_18_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["salt_mine_merchant","Barezan","Barezan", tf_hero|tf_is_merchant, scn_salt_mine|entry(1),0, fac_commoners, [itm_leather_apron, itm_leather_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x00000000000c528601ea69b6e46dbdb6],
# Horse Merchants
["town_1_horse_merchant","Horse Merchant","Town 1 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_blue_dress, itm_blue_hose, itm_female_hood], def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_2_horse_merchant","Horse Merchant","Town 2 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_nomad_boots,], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_3_horse_merchant","Horse Merchant","Town 3 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_nomad_armor, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_4_horse_merchant","Horse Merchant","Town 4 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_nomad_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_5_horse_merchant","Horse Merchant","Town 5 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_dress, itm_woolen_hose, itm_woolen_hood], def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_6_horse_merchant","Horse Merchant","Town 6 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_7_horse_merchant","Horse Merchant","Town 7 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_8_horse_merchant","Horse Merchant","Town 8 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_9_horse_merchant","Horse Merchant","Town 9 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_woolen_hose], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_10_horse_merchant","Horse Merchant","Town 10 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_blue_dress, itm_blue_hose, itm_straw_hat], def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_11_horse_merchant","Horse Merchant","Town 11 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_nomad_armor, itm_leather_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_12_horse_merchant","Horse Merchant","Town 12 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_13_horse_merchant","Horse Merchant","Town 13 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_14_horse_merchant","Horse Merchant","Town 14 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_peasant_dress, itm_blue_hose, itm_headcloth], def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
["town_15_horse_merchant","Horse Merchant","Town 15 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_nomad_armor, itm_leather_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_16_horse_merchant","Horse Merchant","Town 16 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_17_horse_merchant","Horse Merchant","Town 17 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["town_18_horse_merchant","Horse Merchant","Town 18 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_peasant_dress, itm_blue_hose, itm_headcloth], def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2],
#Town Mayors #itm_courtly_outfit itm_gambeson itm_blue_gambeson itm_red_gambeson itm_nobleman_outfit itm_rich_outfit
["town_1_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_courtly_outfit, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_2_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_gambeson, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_3_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_4_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_fur_coat, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_5_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_nobleman_outfit, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_6_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_7_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_rich_outfit, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_8_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_9_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_courtly_outfit, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_10_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_11_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_leather_jacket, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_12_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_13_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_nobleman_outfit, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_14_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_15_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_leather_jacket, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_16_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_fur_coat, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_17_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_nobleman_outfit, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_18_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
#Village stores
["village_1_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_2_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_3_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_4_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_5_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_6_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_7_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_8_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_9_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_10_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_11_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_12_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_13_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_14_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_15_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_16_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_leather_warrior_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_17_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_18_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_leather_warrior_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_19_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots, itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_20_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_leather_warrior_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_21_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_22_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_23_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_24_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_25_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_26_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_27_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_28_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_29_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_30_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_31_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_32_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_33_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_34_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_35_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_36_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_37_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_38_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_39_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_40_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_41_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_42_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_43_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_44_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_45_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_46_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_47_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_48_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_49_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_50_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_51_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_52_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_53_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_54_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_55_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_56_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_57_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_58_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_59_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_60_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_61_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_62_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_63_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_64_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_65_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_66_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_67_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_68_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_69_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_70_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_71_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_72_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_73_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_74_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_75_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_76_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_77_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_78_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_79_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_80_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_81_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_82_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_83_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_84_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_85_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_86_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_87_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_88_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_89_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
["village_90_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2],
# Place extra merchants before this point
["merchants_end","merchants_end","merchants_end",tf_hero, 0,0, fac_commoners,[],def_attrib|level(2),wp(20),knows_inventory_management_10,0],
# Chests
["zendar_chest","Zendar Chest","Zendar Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,
[],def_attrib|level(18),wp(60),knows_common, 0],
["tutorial_chest_1","Melee Weapons Chest","Melee Weapons Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_tutorial_sword, itm_tutorial_axe, itm_tutorial_spear, itm_tutorial_club, itm_tutorial_battle_axe],def_attrib|level(18),wp(60),knows_common, 0],
["tutorial_chest_2","Ranged Weapons Chest","Ranged Weapons Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_tutorial_short_bow, itm_tutorial_arrows, itm_tutorial_crossbow, itm_tutorial_bolts, itm_tutorial_throwing_daggers],def_attrib|level(18),wp(60),knows_common, 0],
["bonus_chest_1","Bonus Chest","Bonus Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_strange_armor,itm_strange_short_sword],def_attrib|level(18),wp(60),knows_common, 0],
["bonus_chest_2","Bonus Chest","Bonus Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_strange_boots,itm_strange_sword],def_attrib|level(18),wp(60),knows_common, 0],
["bonus_chest_3","Bonus Chest","Bonus Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_strange_helmet,itm_strange_great_sword],def_attrib|level(18),wp(60),knows_common, 0],
# These are used as arrays in the scripts.
["temp_array_a","temp_array_a","temp_array_a",tf_hero|tf_inactive, 0,reserved, fac_neutral,[],def_attrib|level(18),wp(60),knows_common, 0],
["temp_array_b","temp_array_b","temp_array_b",tf_hero|tf_inactive, 0,reserved, fac_neutral,[],def_attrib|level(18),wp(60),knows_common, 0],
["temp_array_c","temp_array_c","temp_array_c",tf_hero|tf_inactive, 0,reserved, fac_neutral,[],def_attrib|level(18),wp(60),knows_common, 0],
["stack_selection_amounts","stack_selection_amounts","stack_selection_amounts",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["stack_selection_ids","stack_selection_ids","stack_selection_ids",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["notification_menu_types","notification_menu_types","notification_menu_types",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["notification_menu_var1","notification_menu_var1","notification_menu_var1",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["notification_menu_var2","notification_menu_var2","notification_menu_var2",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["banner_background_color_array","banner_background_color_array","banner_background_color_array",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
## ["black_khergit_guard","Black Khergit Guard","Black Khergit Guard",tf_mounted|tf_guarantee_ranged|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_helmet|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_black_khergits,
## [itm_arrows,itm_nomad_sabre,itm_scimitar,itm_winged_mace,itm_lance,itm_khergit_bow,itm_khergit_guard_helmet,itm_khergit_cavalry_helmet,itm_khergit_guard_boots,itm_khergit_guard_armor,itm_nomad_shield,itm_steppe_horse,itm_warhorse],
## def_attrib|level(28),wp(140),knows_riding_6|knows_ironflesh_4|knows_horse_archery_6|knows_power_draw_6,khergit_face1, khergit_face2],
# Add Extra Quest NPCs below this point
["local_merchant","Local Merchant","Local Merchants",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
["tax_rebel","Peasant Rebel","Peasant Rebels",tf_guarantee_armor,0,reserved,fac_commoners,
[itm_cleaver,itm_knife,itm_pitch_fork,itm_sickle,itm_club,itm_stones,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_linen_tunic,itm_coarse_tunic,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(4),wp(60),knows_common,vaegir_face1, vaegir_face2],
["trainee_peasant","Peasant","Peasants",tf_guarantee_armor,0,reserved,fac_commoners,
[itm_cleaver,itm_knife,itm_pitch_fork,itm_sickle,itm_club,itm_stones,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_linen_tunic,itm_coarse_tunic,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(4),wp(60),knows_common,vaegir_face1, vaegir_face2],
["fugitive","Nervous Man","Nervous Men",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners,
[itm_short_tunic,itm_linen_tunic,itm_coarse_tunic, itm_tabard, itm_leather_vest, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_wrapping_boots, itm_fur_hat, itm_leather_cap, itm_sword_medieval_b, itm_throwing_daggers],
def_attrib|str_24|agi_25|level(26),wp(180),knows_common|knows_power_throw_6|knows_power_strike_6|knows_ironflesh_9,man_face_middle_1, man_face_old_2],
["spy","Ordinary Townsman","Ordinary Townsmen", tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse,0,0,fac_neutral,
[itm_sword_viking_1,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves],
def_attrib|agi_11|level(20),wp(130),knows_common,man_face_middle_1, man_face_older_2],
["spy_partner","Unremarkable Townsman","Unremarkable Townsmen", tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse,0,0,fac_neutral,
[itm_sword_medieval_b,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves],
def_attrib|agi_11|level(10),wp(130),knows_common,vaegir_face1, vaegir_face2],
## ["conspirator","Conspirator","Conspirators", tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse,0,0,fac_neutral,
## [itm_sword,itm_leather_jerkin,itm_leather_boots,itm_hunter,itm_leather_gloves],
## def_attrib|agi_11|level(10),wp(130),knows_common,vaegir_face1, vaegir_face2],
## ["conspirator_leader","Conspirator","Conspirators", tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse,0,0,fac_neutral,
## [itm_sword,itm_leather_jerkin,itm_leather_boots,itm_hunter,itm_leather_gloves],
## def_attrib|agi_11|level(10),wp(130),knows_common,vaegir_face1, vaegir_face2],
## ["peasant_rebel","Peasant Rebel","Peasant Rebels",tf_guarantee_armor,0,reserved,fac_peasant_rebels,
## [itm_cleaver,itm_knife,itm_pitch_fork,itm_sickle,itm_club,itm_stones,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_linen_tunic,itm_coarse_tunic,itm_nomad_boots,itm_wrapping_boots],
## def_attrib|level(4),wp(60),knows_common,vaegir_face1, vaegir_face2],
## ["noble_refugee","Noble Refugee","Noble Refugees",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_noble_refugees,
## [itm_sword,itm_leather_jacket,itm_hide_boots, itm_saddle_horse, itm_leather_jacket, itm_leather_cap],
## def_attrib|level(9),wp(100),knows_common,swadian_face1, swadian_face2],
## ["noble_refugee_woman","Noble Refugee Woman","Noble Refugee Women",tf_female|tf_guarantee_armor|tf_guarantee_boots,0,0,fac_noble_refugees,
## [itm_knife,itm_dagger,itm_hunting_crossbow,itm_dress,itm_robe,itm_woolen_dress, itm_headcloth, itm_woolen_hood, itm_wrapping_boots],
## def_attrib|level(3),wp(45),knows_common,refugee_face1,refugee_face2],
["quick_battle_6_player", "quick_battle_6_player", "quick_battle_6_player", tf_hero, 0, reserved, fac_player_faction, [itm_padded_cloth,itm_nomad_boots, itm_splinted_leather_greaves, itm_skullcap, itm_sword_medieval_b, itm_crossbow, itm_bolts, itm_plate_covered_round_shield], knight_attrib_1,wp(130),knight_skills_1, 0x000000000008010b01f041a9249f65fd],
#Player history array
["log_array_entry_type", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
["log_array_entry_time", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
["log_array_actor", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
["log_array_center_object", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
["log_array_center_object_lord", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
["log_array_center_object_faction", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
["log_array_troop_object", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
["log_array_troop_object_faction", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
["log_array_faction_object", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2],
]
#Troop upgrade declarations
upgrade(troops,"farmer", "watchman")
upgrade(troops,"townsman","watchman")
upgrade2(troops,"watchman","caravan_guard","mercenary_crossbowman")
upgrade2(troops,"caravan_guard","mercenary_swordsman","mercenary_horseman")
upgrade(troops,"mercenary_swordsman","hired_blade")
upgrade(troops,"mercenary_horseman","mercenary_cavalry")
upgrade(troops,"swadian_recruit","swadian_militia")
upgrade2(troops,"swadian_militia","swadian_footman","swadian_skirmisher")
upgrade2(troops,"swadian_footman","swadian_man_at_arms","swadian_infantry")
upgrade(troops,"swadian_infantry","swadian_sergeant")
upgrade(troops,"swadian_skirmisher","swadian_crossbowman")
upgrade(troops,"swadian_crossbowman","swadian_sharpshooter")
upgrade(troops,"swadian_man_at_arms","swadian_knight")
upgrade(troops,"vaegir_recruit","vaegir_footman")
upgrade2(troops,"vaegir_footman","vaegir_veteran","vaegir_skirmisher")
upgrade(troops,"vaegir_skirmisher","vaegir_archer")
upgrade(troops,"vaegir_archer","vaegir_marksman")
upgrade2(troops,"vaegir_veteran","vaegir_horseman","vaegir_infantry")
upgrade(troops,"vaegir_infantry","vaegir_guard")
upgrade(troops,"vaegir_horseman","vaegir_knight")
upgrade(troops,"khergit_tribesman","khergit_skirmisher")
upgrade(troops,"khergit_skirmisher","khergit_horseman")
upgrade2(troops,"khergit_horseman","khergit_lancer","khergit_horse_archer")
upgrade(troops,"khergit_horse_archer","khergit_veteran_horse_archer")
upgrade2(troops,"nord_recruit","nord_footman","nord_huntsman")
upgrade(troops,"nord_footman","nord_trained_footman")
upgrade(troops,"nord_trained_footman","nord_warrior")
upgrade(troops,"nord_warrior","nord_veteran")
upgrade(troops,"nord_veteran","nord_champion")
upgrade(troops,"nord_huntsman","nord_archer")
upgrade(troops,"nord_archer","nord_veteran_archer")
upgrade2(troops,"rhodok_tribesman","rhodok_spearman","rhodok_crossbowman")
upgrade(troops,"rhodok_spearman","rhodok_trained_spearman")
upgrade(troops,"rhodok_trained_spearman","rhodok_veteran_spearman")
upgrade(troops,"rhodok_veteran_spearman","rhodok_sergeant")
upgrade(troops,"rhodok_crossbowman","rhodok_trained_crossbowman")
upgrade(troops,"rhodok_trained_crossbowman","rhodok_sharpshooter")
upgrade2(troops,"looter","mountain_bandit", "forest_bandit")
upgrade2(troops,"bandit","brigand","mercenary_swordsman")
upgrade(troops,"manhunter","slave_driver")
#upgrade(troops,"forest_bandit","mercenary_crossbowman")
upgrade(troops,"slave_driver","slave_hunter")
upgrade(troops,"slave_hunter","slave_crusher")
upgrade(troops,"slave_crusher","slaver_chief")
upgrade(troops,"follower_woman","hunter_woman")
upgrade(troops,"hunter_woman","fighter_woman")
upgrade(troops,"fighter_woman","sword_sister")
upgrade(troops,"refugee","follower_woman")
upgrade(troops,"peasant_woman","follower_woman")
| Python |
from module_constants import *
from header_items import *
from header_operations import *
from header_triggers import *
####################################################################################################################
# Each item record contains the following fields:
# 1) Item id: used for referencing items in other files.
# The prefix itm_ is automatically added before each item id.
# 2) Item name. Name of item as it'll appear in inventory window
# 3) List of meshes. Each mesh record is a tuple containing the following fields:
# 3.1) Mesh name.
# 3.2) Modifier bits that this mesh matches.
# Note that the first mesh record is the default.
# 4) Item flags. See header_items.py for a list of available flags.
# 5) Item capabilities. Used for which animations this item is used with. See header_items.py for a list of available flags.
# 6) Item value.
# 7) Item stats: Bitwise-or of various stats about the item such as:
# weight, abundance, difficulty, head_armor, body_armor,leg_armor, etc...
# 8) Modifier bits: Modifiers that can be applied to this item.
# 9) [Optional] Triggers: List of simple triggers to be associated with the item.
####################################################################################################################
# Some constants for ease of use.
imodbits_none = 0
imodbits_horse_basic = imodbit_swaybacked|imodbit_lame|imodbit_spirited|imodbit_heavy|imodbit_stubborn
imodbits_cloth = imodbit_tattered | imodbit_ragged | imodbit_sturdy | imodbit_thick | imodbit_hardened
imodbits_armor = imodbit_rusty | imodbit_battered | imodbit_crude | imodbit_thick | imodbit_reinforced |imodbit_lordly
imodbits_plate = imodbit_cracked | imodbit_rusty | imodbit_battered | imodbit_crude | imodbit_thick | imodbit_reinforced |imodbit_lordly
imodbits_polearm = imodbit_cracked | imodbit_bent | imodbit_balanced
imodbits_shield = imodbit_cracked | imodbit_battered |imodbit_thick | imodbit_reinforced
imodbits_sword = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_tempered
imodbits_sword_high = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_tempered|imodbit_masterwork
imodbits_axe = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_heavy
imodbits_mace = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_heavy
imodbits_pick = imodbit_rusty | imodbit_chipped | imodbit_balanced | imodbit_heavy
imodbits_bow = imodbit_cracked | imodbit_bent | imodbit_strong |imodbit_masterwork
imodbits_crossbow = imodbit_cracked | imodbit_bent | imodbit_masterwork
imodbits_missile = imodbit_bent | imodbit_large_bag
imodbits_thrown = imodbit_bent | imodbit_heavy| imodbit_balanced| imodbit_large_bag
imodbits_horse_good = imodbit_spirited|imodbit_heavy
imodbits_good = imodbit_sturdy | imodbit_thick | imodbit_hardened | imodbit_reinforced
imodbits_bad = imodbit_rusty | imodbit_chipped | imodbit_tattered | imodbit_ragged | imodbit_cracked | imodbit_bent
# Replace winged mace/spiked mace with: Flanged mace / Knobbed mace?
# Fauchard (majowski glaive)
items = [
# item_name, mesh_name, item_properties, item_capabilities, slot_no, cost, bonus_flags, weapon_flags, scale, view_dir, pos_offset
["no_item","INVALID ITEM", [("practice_sword",0)], itp_type_one_handed_wpn|itp_primary|itp_secondary, itc_longsword, 3,weight(1.5)|spd_rtng(103)|weapon_length(90)|swing_damage(16,blunt)|thrust_damage(10,blunt),imodbits_none],
["horse_meat","Horse Meat", [("raw_meat",0)], itp_type_goods|itp_consumable|itp_food, 0, 12,weight(40)|food_quality(30)|max_ammo(40),imodbits_none],
# Items before this point are hardwired and their order should not be changed!
["practice_sword","Practice Sword", [("practice_sword",0)], itp_type_one_handed_wpn|itp_primary|itp_secondary|itp_wooden_parry|itp_wooden_attack, itc_longsword, 3,weight(1.5)|spd_rtng(103)|weapon_length(90)|swing_damage(16,blunt)|thrust_damage(10,blunt),imodbits_none],
["heavy_practice_sword","Heavy Practice Sword", [("heavy_practicesword",0)], itp_type_two_handed_wpn|itp_two_handed|itp_primary|itp_wooden_parry|itp_wooden_attack, itc_greatsword,
21, weight(6.25)|spd_rtng(94)|weapon_length(128)|swing_damage(26,blunt)|thrust_damage(18,blunt),imodbits_none],
["practice_axe", "Practice Axe", [("hatchet",0)], itp_type_one_handed_wpn| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 24 , weight(2) | spd_rtng(95) | weapon_length(75) | swing_damage(20, blunt) | thrust_damage(0, pierce), imodbits_axe],
["arena_axe", "Axe", [("arena_axe",0)], itp_type_one_handed_wpn|itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
137 , weight(1.5)|spd_rtng(100) | weapon_length(69)|swing_damage(23 , blunt) | thrust_damage(0 , pierce),imodbits_axe ],
["arena_sword", "Sword", [("arena_sword_one_handed",0),("sword_medieval_b_scabbard", ixmesh_carry),], itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
243 , weight(1.5)|spd_rtng(99) | weapon_length(95)|swing_damage(21 , blunt) | thrust_damage(20 , blunt),imodbits_sword_high ],
["arena_sword_two_handed", "Two Handed Sword", [("arena_sword_two_handed",0)], itp_type_two_handed_wpn|itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back,
670 , weight(2.75)|spd_rtng(93) | weapon_length(110)|swing_damage(29 , blunt) | thrust_damage(24 , blunt),imodbits_sword_high ],
["arena_lance", "Lance", [("arena_lance",0)], itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear,
90 , weight(2.5)|spd_rtng(96) | weapon_length(150)|swing_damage(20 , blunt) | thrust_damage(25 , blunt),imodbits_polearm ],
["practice_staff","Practice Staff", [("wooden_staff",0)],itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack,itc_staff|itcf_carry_sword_back,9, weight(2.5)|spd_rtng(103) | weapon_length(118)|swing_damage(16,blunt) | thrust_damage(16,blunt),imodbits_none],
["practice_lance","Practice Lance", [("joust_of_peace",0)], itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack, itc_greatlance, 18,weight(4.25)|spd_rtng(58)|weapon_length(218)|swing_damage(0,blunt)|thrust_damage(15,blunt),imodbits_none],
["practice_shield","Practice Shield", [("shield_round_a",0)], itp_type_shield|itp_wooden_parry|itp_wooden_attack, 0, 20,weight(3.5)|body_armor(1)|hit_points(200)|spd_rtng(100)|weapon_length(50),imodbits_none],
["practice_bow","Practice Bow", [("hunting_bow",0), ("hunting_bow_carry",ixmesh_carry)], itp_type_bow |itp_primary|itp_two_handed,itcf_shoot_bow|itcf_carry_bow_back, 0, weight(1.5)|spd_rtng(90) | shoot_speed(40) | thrust_damage(19, blunt),imodbits_bow ],
## ("hunting_bow",0)], itp_type_bow|itp_two_handed|itp_primary|itp_attach_left_hand, itcf_shoot_bow, 4,weight(1.5)|spd_rtng(90)|shoot_speed(40)|thrust_damage(19,blunt),imodbits_none],
["practice_crossbow", "Practice Crossbow", [("crossbow",0)], itp_type_crossbow |itp_primary|itp_two_handed ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 0, weight(3)|spd_rtng(42)| shoot_speed(68) | thrust_damage(32,blunt)|max_ammo(1),imodbits_crossbow],
["practice_javelin", "Practice Javelin", [("javelin",0),("javelins_quiver", ixmesh_carry)], itp_type_thrown |itp_primary|itp_bonus_against_shield ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 0, weight(5) | spd_rtng(91) | shoot_speed(28) | thrust_damage(27, blunt) | max_ammo(50) | weapon_length(75), imodbits_thrown],
["practice_throwing_daggers", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_primary ,itcf_throw_knife, 0 , weight(3.5)|spd_rtng(102) | shoot_speed(25) | thrust_damage(16, blunt)|max_ammo(10)|weapon_length(0),imodbits_thrown ],
["practice_throwing_daggers_100_amount", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_primary ,itcf_throw_knife, 0 , weight(3.5)|spd_rtng(102) | shoot_speed(25) | thrust_damage(16, blunt)|max_ammo(100)|weapon_length(0),imodbits_thrown ],
# ["cheap_shirt","Cheap Shirt", [("shirt",0)], itp_type_body_armor|itp_covers_legs, 0, 4,weight(1.25)|body_armor(3),imodbits_none],
["practice_horse","Practice Horse", [("saddle_horse",0)], itp_type_horse, 0, 37,body_armor(10)|horse_speed(40)|horse_maneuver(37)|horse_charge(14),imodbits_none],
["practice_arrows","Practice Arrows", [("arena_arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(1.5)|weapon_length(95)|max_ammo(80),imodbits_missile],
## ["practice_arrows","Practice Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo)], itp_type_arrows, 0, 31,weight(1.5)|weapon_length(95)|max_ammo(80),imodbits_none],
["practice_bolts","Practice Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts, itcf_carry_quiver_right_vertical, 0,weight(2.25)|weapon_length(55)|max_ammo(49),imodbits_missile],
["practice_arrows_10_amount","Practice Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(1.5)|weapon_length(95)|max_ammo(10),imodbits_missile],
["practice_arrows_100_amount","Practice Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(1.5)|weapon_length(95)|max_ammo(100),imodbits_missile],
["practice_bolts_9_amount","Practice Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts, itcf_carry_quiver_right_vertical, 0,weight(2.25)|weapon_length(55)|max_ammo(9),imodbits_missile],
["practice_boots", "Practice Boots", [("boot_nomad_a",0)], itp_type_foot_armor |itp_civilian | itp_attach_armature,0, 11 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(10), imodbits_cloth ],
["red_tourney_armor","Red Tourney Armor", [("tourn_armor_a",0)], itp_type_body_armor|itp_covers_legs, 0, 152,weight(15.0)|body_armor(20)|leg_armor(6),imodbits_none],
["blue_tourney_armor","Blue Tourney Armor", [("mail_shirt",0)], itp_type_body_armor|itp_covers_legs, 0, 152,weight(15.0)|body_armor(20)|leg_armor(6),imodbits_none],
["green_tourney_armor","Green Tourney Armor", [("leather_vest",0)], itp_type_body_armor|itp_covers_legs, 0, 152,weight(15.0)|body_armor(20)|leg_armor(6),imodbits_none],
["gold_tourney_armor","Gold Tourney Armor", [("padded_armor",0)], itp_type_body_armor|itp_covers_legs, 0, 152,weight(15.0)|body_armor(20)|leg_armor(6),imodbits_none],
["red_tourney_helmet","Red Tourney Helmet",[("flattop_helmet",0)],itp_type_head_armor,0,126, weight(2)|head_armor(16),imodbits_none],
["blue_tourney_helmet","Blue Tourney Helmet",[("segmented_helm",0)],itp_type_head_armor,0,126, weight(2)|head_armor(16),imodbits_none],
["green_tourney_helmet","Green Tourney Helmet",[("hood_c",0)],itp_type_head_armor,0,126, weight(2)|head_armor(16),imodbits_none],
["gold_tourney_helmet","Gold Tourney Helmet",[("hood_a",0)],itp_type_head_armor,0,126, weight(2)|head_armor(16),imodbits_none],
["arena_shield_red", "Shield", [("arena_shield_red",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(60),imodbits_shield ],
["arena_shield_blue", "Shield", [("arena_shield_blue",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(60),imodbits_shield ],
["arena_shield_green", "Shield", [("arena_shield_green",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(60),imodbits_shield ],
["arena_shield_yellow", "Shield", [("arena_shield_yellow",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(60),imodbits_shield ],
["arena_armor_white", "Arena Armor White", [("arena_armorW",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ],
["arena_armor_red", "Arena Armor Red", [("arena_armorR",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ],
["arena_armor_blue", "Arena Armor Blue", [("arena_armorB",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ],
["arena_armor_green", "Arena Armor Green", [("arena_armorG",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ],
["arena_armor_yellow", "Arena Armor Yellow", [("arena_armorY",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ],
["arena_tunic_white", "Arena Tunic White ", [("arena_tunicW",0)], itp_type_body_armor |itp_covers_legs ,0, 47 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ],
["arena_tunic_red", "Arena Tunic Red", [("arena_tunicR",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ],
["arena_tunic_blue", "Arena Tunic Blue", [("arena_tunicB",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ],
["arena_tunic_green", "Arena Tunic Green", [("arena_tunicG",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ],
["arena_tunic_yellow", "Arena Tunic Yellow", [("arena_tunicY",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ],
#headwear
["arena_helmet_red", "Arena Helmet Red", [("arena_helmetR",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0), imodbits_plate ],
["arena_helmet_blue", "Arena Helmet Blue", [("arena_helmetB",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0), imodbits_plate ],
["arena_helmet_green", "Arena Helmet Green", [("arena_helmetG",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0), imodbits_plate ],
["arena_helmet_yellow", "Arena Helmet Yellow", [("arena_helmetY",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0), imodbits_plate ],
["steppe_helmet_white", "Steppe Helmet White", [("steppe_helmetW",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ],
["steppe_helmet_red", "Steppe Helmet Red", [("steppe_helmetR",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ],
["steppe_helmet_blue", "Steppe Helmet Blue", [("steppe_helmetB",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ],
["steppe_helmet_green", "Steppe Helmet Green", [("steppe_helmetG",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ],
["steppe_helmet_yellow", "Steppe Helmet Yellow", [("steppe_helmetY",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ],
["tourney_helm_white", "Tourney Helm White", [("tourney_helmR",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ],
["tourney_helm_red", "Tourney Helm Red", [("tourney_helmR",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ],
["tourney_helm_blue", "Tourney Helm Blue", [("tourney_helmB",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ],
["tourney_helm_green", "Tourney Helm Green", [("tourney_helmG",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ],
["tourney_helm_yellow", "Tourney Helm Yellow", [("tourney_helmY",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ],
# A treatise on The Method of Mechanical Theorems Archimedes
#This book must be at the beginning of readable books
["book_tactics","De Re Militari", [("book_a",0)], itp_type_book, 0, 4000,weight(2)|abundance(100),imodbits_none],
["book_persuasion","Rhetorica ad Herennium", [("book_b",0)], itp_type_book, 0, 5000,weight(2)|abundance(100),imodbits_none],
["book_leadership","The Life of Alixenus the Great", [("book_d",0)], itp_type_book, 0, 4200,weight(2)|abundance(100),imodbits_none],
["book_intelligence","Essays on Logic", [("book_e",0)], itp_type_book, 0, 2900,weight(2)|abundance(100),imodbits_none],
["book_trade","A Treatise on the Value of Things", [("book_f",0)], itp_type_book, 0, 3100,weight(2)|abundance(100),imodbits_none],
["book_weapon_mastery", "On the Art of Fighting with Swords", [("book_d",0)], itp_type_book, 0, 4200,weight(2)|abundance(100),imodbits_none],
["book_engineering","Method of Mechanical Theorems", [("book_open",0)], itp_type_book, 0, 4000,weight(2)|abundance(100),imodbits_none],
#Reference books
#This book must be at the beginning of reference books
["book_wound_treatment_reference","The Book of Healing", [("book_c",0)], itp_type_book, 0, 3500,weight(2)|abundance(100),imodbits_none],
["book_training_reference","Manual of Arms", [("book_open",0)], itp_type_book, 0, 3500,weight(2)|abundance(100),imodbits_none],
["book_surgery_reference","The Great Book of Surgery", [("book_c",0)], itp_type_book, 0, 3500,weight(2)|abundance(100),imodbits_none],
# ["dry_bread", "wheat_sack", itp_type_goods|itp_consumable, 0, slt_none,view_goods,95,weight(2),max_ammo(50),imodbits_none],
#foods (first one is smoked_fish)
["smoked_fish","Smoked Fish", [("smoked_fish",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 59,weight(15)|abundance(110)|food_quality(50)|max_ammo(50),imodbits_none],
["dried_meat","Dried Meat", [("smoked_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 72,weight(15)|abundance(100)|food_quality(70)|max_ammo(50),imodbits_none],
["cattle_meat","Beef", [("raw_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 103,weight(20)|abundance(100)|food_quality(80)|max_ammo(70),imodbits_none],
["pork","Pork", [("fried_pig",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 85,weight(15)|abundance(100)|food_quality(70)|max_ammo(50),imodbits_none],
["bread","Bread", [("bread_a",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 32,weight(20)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none],
["apples","Apples", [("apple_basket",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 44,weight(20)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none],
["cheese","Cheese", [("cheese_b",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 95,weight(6)|abundance(110)|food_quality(40)|max_ammo(30),imodbits_none],
["chicken","Chicken", [("chicken_roasted",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 75,weight(10)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none],
["honey","Honey", [("honey_pot",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 136,weight(5)|abundance(110)|food_quality(40)|max_ammo(30),imodbits_none],
["sausages","Sausages", [("sausages",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 60,weight(10)|abundance(110)|food_quality(40)|max_ammo(40),imodbits_none],
["cabbages","Cabbages", [("cabbage",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 30,weight(15)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none],
["butter","Butter", [("butter_pot",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 150,weight(6)|abundance(110)|food_quality(40)|max_ammo(30),imodbits_none],
#other trade goods (first one is wine)
["wine","Wine", [("amphora_slim",0)], itp_merchandise|itp_type_goods|itp_consumable, 0, 141,weight(30)|abundance(60)|max_ammo(50),imodbits_none],
["ale","Ale", [("ale_barrel",0)], itp_merchandise|itp_type_goods|itp_consumable, 0, 84,weight(30)|abundance(70)|max_ammo(50),imodbits_none],
["spice","Spice", [("spice_sack",0)], itp_merchandise|itp_type_goods, 0, 880,weight(40)|abundance(25),imodbits_none],
["salt","Salt", [("salt_sack",0)], itp_merchandise|itp_type_goods, 0, 255,weight(50)|abundance(120),imodbits_none],
["grain","Wheat", [("wheat_sack",0)], itp_merchandise|itp_type_goods|itp_consumable, 0, 77,weight(50)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none],
["flour","Flour", [("salt_sack",0)], itp_merchandise|itp_type_goods|itp_consumable, 0, 91,weight(50)|abundance(100)|food_quality(45)|max_ammo(50),imodbits_none],
["iron","Iron", [("iron",0)], itp_merchandise|itp_type_goods, 0,264,weight(60)|abundance(60),imodbits_none],
["oil","Oil", [("oil",0)], itp_merchandise|itp_type_goods, 0, 484,weight(50)|abundance(60),imodbits_none],
["pottery","Pottery", [("jug",0)], itp_merchandise|itp_type_goods, 0, 126,weight(50)|abundance(90),imodbits_none],
["linen","Linen", [("linen",0)], itp_merchandise|itp_type_goods, 0, 250,weight(40)|abundance(90),imodbits_none],
["furs","Furs", [("fur_pack",0)], itp_merchandise|itp_type_goods, 0, 391,weight(40)|abundance(90),imodbits_none],
["wool","Wool", [("wool_sack",0)], itp_merchandise|itp_type_goods, 0, 130,weight(40)|abundance(90),imodbits_none],
["velvet","Velvet", [("velvet",0)], itp_merchandise|itp_type_goods, 0, 1025,weight(40)|abundance(30),imodbits_none],
["tools","Tools", [("iron_hammer",0)], itp_merchandise|itp_type_goods, 0, 410,weight(50)|abundance(90),imodbits_none],
#************************************************************************************************
# ITEMS before this point are hardcoded into item_codes.h and their order should not be changed!
#************************************************************************************************
# Quest Items
["siege_supply","Supplies", [("ale_barrel",0)], itp_type_goods, 0, 96,weight(40)|abundance(70),imodbits_none],
["quest_wine","Wine", [("amphora_slim",0)], itp_type_goods, 0, 46,weight(40)|abundance(60)|max_ammo(50),imodbits_none],
["quest_ale","Ale", [("ale_barrel",0)], itp_type_goods, 0, 31,weight(40)|abundance(70)|max_ammo(50),imodbits_none],
# Tutorial Items
["tutorial_sword", "Sword", [("long_sword",0),("scab_longsw_a", ixmesh_carry)], itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 0 , weight(1.5)|difficulty(0)|spd_rtng(100) | weapon_length(102)|swing_damage(18 , cut) | thrust_damage(15 , pierce),imodbits_sword ],
["tutorial_axe", "Axe", [("iron_ax",0)], itp_type_two_handed_wpn| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 0 , weight(4)|difficulty(0)|spd_rtng(91) | weapon_length(108)|swing_damage(19 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["tutorial_spear", "Spear", [("spear",0)], itp_type_polearm| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 0 , weight(4.5)|difficulty(0)|spd_rtng(80) | weapon_length(158)|swing_damage(0 , cut) | thrust_damage(19 , pierce),imodbits_polearm ],
["tutorial_club", "Club", [("club",0)], itp_type_one_handed_wpn| itp_primary|itp_wooden_parry|itp_wooden_attack, itc_scimitar, 0 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(11 , blunt) | thrust_damage(0 , pierce),imodbits_none ],
["tutorial_battle_axe", "Battle Axe", [("battle_ax",0)], itp_type_two_handed_wpn| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 0 , weight(5)|difficulty(0)|spd_rtng(88) | weapon_length(108)|swing_damage(27 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["tutorial_arrows","Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(0,pierce)|max_ammo(20),imodbits_missile],
["tutorial_bolts","Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts, itcf_carry_quiver_right_vertical, 0,weight(2.25)|abundance(90)|weapon_length(55)|thrust_damage(0,pierce)|max_ammo(18),imodbits_missile],
["tutorial_short_bow", "Short Bow", [("short_bow",0),("short_bow_carry",ixmesh_carry)], itp_type_bow |itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bow_back, 0 , weight(1)|difficulty(0)|spd_rtng(98) | shoot_speed(49) | thrust_damage(12 , pierce ),imodbits_bow ],
["tutorial_crossbow", "Crossbow", [("crossbow",0)], itp_type_crossbow |itp_primary|itp_two_handed|itp_cant_reload_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 0 , weight(3)|difficulty(0)|spd_rtng(42)| shoot_speed(68) | thrust_damage(32,pierce)|max_ammo(1),imodbits_crossbow ],
["tutorial_throwing_daggers", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_primary ,itcf_throw_knife, 0 , weight(3.5)|difficulty(0)|spd_rtng(102) | shoot_speed(25) | thrust_damage(16 , cut)|max_ammo(14)|weapon_length(0),imodbits_missile ],
["tutorial_saddle_horse", "Saddle Horse", [("saddle_horse",0)], itp_type_horse, 0, 0,abundance(90)|body_armor(3)|difficulty(0)|horse_speed(40)|horse_maneuver(38)|horse_charge(8),imodbits_horse_basic],
["tutorial_shield", "Kite Shield", [("shield_kite_a",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(150),imodbits_shield ],
["tutorial_staff_no_attack","Staff", [("wooden_staff",0)],itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack,itc_parry_polearm|itcf_carry_sword_back,9, weight(3.5)|spd_rtng(120) | weapon_length(115)|swing_damage(0,blunt) | thrust_damage(0,blunt),imodbits_none],
["tutorial_staff","Staff", [("wooden_staff",0)],itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack,itc_staff|itcf_carry_sword_back,9, weight(3.5)|spd_rtng(120) | weapon_length(115)|swing_damage(16,blunt) | thrust_damage(16,blunt),imodbits_none],
# Horses: sumpter horse/ pack horse, saddle horse, steppe horse, warm blood, geldling, stallion, war mount, charger,
# Carthorse, hunter, heavy hunter, hackney, palfrey, courser, destrier.
["sumpter_horse","Sumpter Horse", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 64,abundance(90)|hit_points(110)|body_armor(17)|difficulty(1)|horse_speed(34)|horse_maneuver(33)|horse_charge(9),imodbits_horse_basic],
["saddle_horse","Saddle Horse", [("saddle_horse",0),("horse_c",imodbits_horse_good)], itp_merchandise|itp_type_horse, 0, 112,abundance(90)|body_armor(14)|difficulty(1)|horse_speed(39)|horse_maneuver(36)|horse_charge(8),imodbits_horse_basic],
["steppe_horse","Steppe Horse", [("steppe_horse",0)], itp_merchandise|itp_type_horse, 0, 92,abundance(80)|body_armor(15)|difficulty(2)|horse_speed(37)|horse_maneuver(41)|horse_charge(7),imodbits_horse_basic],
["courser","Courser", [("courser",0)], itp_merchandise|itp_type_horse, 0, 323,abundance(70)|body_armor(16)|difficulty(2)|horse_speed(43)|horse_maneuver(37)|horse_charge(11),imodbits_horse_basic|imodbit_champion],
["hunter","Hunter", [("hunting_horse",0),("hunting_horse",imodbits_horse_good)], itp_merchandise|itp_type_horse, 0, 434,abundance(60)|hit_points(130)|body_armor(29)|difficulty(3)|horse_speed(40)|horse_maneuver(36)|horse_charge(18),imodbits_horse_basic|imodbit_champion],
["warhorse","Warhorse", [("warhorse",0)], itp_merchandise|itp_type_horse, 0, 724,abundance(50)|hit_points(135)|body_armor(52)|difficulty(4)|horse_speed(36)|horse_maneuver(34)|horse_charge(18),imodbits_horse_basic|imodbit_champion],
["charger","Charger", [("charger",0)], itp_merchandise|itp_type_horse, 0, 1411,abundance(40)|hit_points(140)|body_armor(65)|difficulty(4)|horse_speed(35)|horse_maneuver(32)|horse_charge(25),imodbits_horse_basic|imodbit_champion],
#whalebone crossbow, yew bow, war bow, arming sword
["arrows","Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back, 72,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(1,pierce)|max_ammo(30),imodbits_missile],
["khergit_arrows","Khergit Arrows", [("arrow_b",0),("flying_missile",ixmesh_flying_ammo),("quiver_b", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back_right, 410,weight(3.5)|abundance(30)|weapon_length(95)|thrust_damage(3,pierce)|max_ammo(30),imodbits_missile],
["barbed_arrows","Barbed Arrows", [("barbed_arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver_d", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back_right, 124,weight(3)|abundance(70)|weapon_length(95)|thrust_damage(2,pierce)|max_ammo(30),imodbits_missile],
["bodkin_arrows","Bodkin Arrows", [("piercing_arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver_c", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back_right, 350,weight(3)|abundance(50)|weapon_length(91)|thrust_damage(3,pierce)|max_ammo(29),imodbits_missile],
["bolts","Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts|itp_merchandise, itcf_carry_quiver_right_vertical, 64,weight(2.25)|abundance(90)|weapon_length(55)|thrust_damage(1,pierce)|max_ammo(25),imodbits_missile],
["steel_bolts","Steel Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag_c", ixmesh_carry)], itp_type_bolts|itp_merchandise, itcf_carry_quiver_right_vertical, 210,weight(2.5)|abundance(20)|weapon_length(55)|thrust_damage(2,pierce)|max_ammo(25),imodbits_missile],
["cartridges","Cartridges", [("cartridge_a",0)], itp_type_bullets|itp_merchandise, 0, 41,weight(2.25)|abundance(90)|weapon_length(3)|thrust_damage(1,pierce)|max_ammo(40),imodbits_missile],
["pilgrim_disguise", "Pilgrim Disguise", [("pilgrim_outfit",0)], 0| itp_type_body_armor |itp_covers_legs |itp_civilian ,0, 25 , weight(2)|abundance(100)|head_armor(0)|body_armor(19)|leg_armor(8)|difficulty(0) ,imodbits_cloth ],
["pilgrim_hood", "Pilgrim Hood", [("pilgrim_hood",0)], 0| itp_type_head_armor |itp_civilian ,0, 35 , weight(1.25)|abundance(100)|head_armor(14)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
# ARMOR
#handwear
["leather_gloves","Leather Gloves", [("lthr_glove_L",0)], itp_merchandise|itp_type_hand_armor,0, 130, weight(0.25)|abundance(120)|body_armor(2)|difficulty(0),imodbits_cloth],
["mail_mittens","Mail Mittens", [("mail_mitten_L",0)], itp_merchandise|itp_type_hand_armor,0, 550, weight(0.5)|abundance(100)|body_armor(4)|difficulty(0),imodbits_armor],
["scale_gauntlets","Scale Gauntlets", [("scale_gaunt_L",0)], itp_merchandise|itp_type_hand_armor,0, 910, weight(0.75)|abundance(100)|body_armor(5)|difficulty(0),imodbits_armor],
["gauntlets","Gauntlets", [("gauntlet_a_L",0),("gauntlet_b_L",imodbit_reinforced)], itp_merchandise|itp_type_hand_armor,0, 1940, weight(1.0)|abundance(100)|body_armor(6)|difficulty(0),imodbits_armor],
#footwear
["wrapping_boots", "Wrapping Boots", [("shoe_fur",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature ,0,
3 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(3)|difficulty(0) ,imodbits_cloth ],
["woolen_hose", "Woolen Hose", [("woolen_hose",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature ,0,
6 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(4)|difficulty(0) ,imodbits_cloth ],
["blue_hose", "Blue Hose", [("blue_leggings",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature ,0,
11 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(5)|difficulty(0) ,imodbits_cloth ],
["hunter_boots", "Hunter Boots", [("boot_hunter",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0,
19 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(9)|difficulty(0) ,imodbits_cloth ],
["hide_boots", "Hide Boots", [("boot_nomad_a",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0,
34 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["ankle_boots", "Ankle Boots", [("ankle_boots_a",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0,
75 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(12)|difficulty(0) ,imodbits_cloth ],
["nomad_boots", "Nomad Boots", [("boot_nomad_b",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0,
116 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(14)|difficulty(0) ,imodbits_cloth ],
["leather_boots", "Leather Boots", [("boot_khergit",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0,
174 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(16)|difficulty(0) ,imodbits_cloth ],
["mail_chausses", "Mail Chausses", [("chausses_cm",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature ,0,
410 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(21)|difficulty(0) ,imodbits_armor ],
["splinted_leather_greaves", "Splinted Leather Greaves", [("lthr_greaves",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0,
760 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(24)|difficulty(0) ,imodbits_armor ],
["splinted_greaves", "Splinted Greaves", [("spl_greaves",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0,
1153 , weight(3.5)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(28)|difficulty(7) ,imodbits_armor ],
["mail_boots", "Mail Boots", [("shoe_cm",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature ,0,
1746 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(31)|difficulty(8) ,imodbits_armor ],
["iron_greaves", "Iron Greaves", [("iron_greaves",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0,
2374 , weight(3.5)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(33)|difficulty(9) ,imodbits_armor ],
["black_greaves", "Black Greaves", [("black_greaves",0)], itp_type_foot_armor | itp_attach_armature,0,
3561 , weight(3.5)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(35)|difficulty(0) ,imodbits_armor ],
#bodywear
["lady_dress_ruby", "Lady Dress", [("lady_dress_r",0)], itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 500 , weight(3)|abundance(100)|head_armor(0)|body_armor(10)|leg_armor(10)|difficulty(0) ,imodbits_cloth],
["lady_dress_green", "Lady Dress", [("lady_dress_g",0)], itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 500 , weight(3)|abundance(100)|head_armor(0)|body_armor(10)|leg_armor(10)|difficulty(0) ,imodbits_cloth],
["lady_dress_blue", "Lady Dress", [("lady_dress_b",0)], itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 500 , weight(3)|abundance(100)|head_armor(0)|body_armor(10)|leg_armor(10)|difficulty(0) ,imodbits_cloth],
["courtly_outfit", "Courtly Outfit", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian ,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["nobleman_outfit", "Nobleman Outfit", [("nobleman_outfit_b",0)], itp_type_body_armor|itp_covers_legs|itp_civilian ,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(15)|leg_armor(12)|difficulty(0) ,imodbits_cloth ],
["nomad_armor", "Nomad Armor", [("armor_nomad",0)], itp_merchandise| itp_type_body_armor ,0, 25 , weight(2)|abundance(100)|head_armor(0)|body_armor(24)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["khergit_armor", "Khergit Armor", [("armor_nomad_b",0)], itp_merchandise| itp_type_body_armor ,0, 38 , weight(2)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["leather_jacket", "Leather Jacket", [("leather_jacket",0)], itp_merchandise| itp_type_body_armor |itp_civilian ,0, 50 , weight(3)|abundance(100)|head_armor(0)|body_armor(15)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["rawhide_coat", "Rawhide Coat", [("tunic_fur",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0, 12 , weight(5)|abundance(100)|head_armor(0)|body_armor(10)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["leather_armor", "Leather Armor", [("lthr_armor_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 65 , weight(7)|abundance(100)|head_armor(0)|body_armor(18)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["fur_coat", "Fur Coat", [("fur_coat",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs |itp_civilian,0, 117 , weight(6)|abundance(100)|head_armor(0)|body_armor(13)|leg_armor(6)|difficulty(0) ,imodbits_armor ],
#for future:
["coat", "Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["leather_coat", "Leather Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["mail_coat", "Coat of Mail", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["long_mail_coat", "Long Coat of Mail", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["sleeveless_mail_coat", "Sleeveless Coat of Mail", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["sleeveless_coat", "Sleeveless Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["hide_coat", "Hide Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["merchant_outfit", "Merchant Outfit", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["homespun_dress", "Homespun Dress", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["thick_coat", "Thick Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["coat_with_cape", "Coat_with_Cape", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["steppe_outfit", "Steppe Outfit", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["nordic_outfit", "Nordic Outfit", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["nordic_armor", "Nordic Armor", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["hide_armor", "Hide Armor", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["cloaked_tunic", "Cloaked Tunic", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["sleeveless_tunic", "Sleeveless Tunic", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["sleeveless_leather_tunic", "Sleeveless Leather Tunic", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["linen_shirt", "Linen_Shirt", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["wool_coat", "Wool_Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
#end
["dress", "Dress", [("dress",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(0)|body_armor(6)|leg_armor(2)|difficulty(0) ,imodbits_cloth ],
["blue_dress", "Blue Dress", [("blue_dress",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(0)|body_armor(6)|leg_armor(2)|difficulty(0) ,imodbits_cloth ],
["peasant_dress", "Peasant Dress", [("peasant_dress_b",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(0)|body_armor(6)|leg_armor(2)|difficulty(0) ,imodbits_cloth ],
["woolen_dress", "Woolen Dress", [("woolen_dress",0)], itp_merchandise| itp_type_body_armor|itp_civilian |itp_covers_legs ,0,
10 , weight(1.75)|abundance(100)|head_armor(0)|body_armor(8)|leg_armor(2)|difficulty(0) ,imodbits_cloth ],
["shirt", "Shirt", [("shirt",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0,
3 , weight(1)|abundance(100)|head_armor(0)|body_armor(5)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["linen_tunic", "Linen Tunic", [("linen_tunic",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0,
6 , weight(1)|abundance(100)|head_armor(0)|body_armor(6)|leg_armor(1)|difficulty(0) ,imodbits_cloth ],
["short_tunic", "Rich Tunic", [("cvl_costume_a",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0,
10 , weight(1)|abundance(100)|head_armor(0)|body_armor(7)|leg_armor(1)|difficulty(0) ,imodbits_cloth ],
["robe", "Robe", [("robe",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs |itp_civilian,0,
31 , weight(1.5)|abundance(100)|head_armor(0)|body_armor(8)|leg_armor(6)|difficulty(0) ,imodbits_cloth ],
["coarse_tunic", "Coarse Tunic", [("coarse_tunic",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0,
47 , weight(2)|abundance(100)|head_armor(0)|body_armor(11)|leg_armor(6)|difficulty(0) ,imodbits_cloth ],
["leather_apron", "Leather Apron", [("leather_apron",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0,
61 , weight(3)|abundance(100)|head_armor(0)|body_armor(12)|leg_armor(7)|difficulty(0) ,imodbits_cloth ],
["tabard", "Tabard", [("tabard_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs |itp_civilian,0,
107 , weight(3)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(6)|difficulty(0) ,imodbits_cloth ],
["leather_vest", "Leather Vest", [("leather_vest",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0,
146 , weight(4)|abundance(100)|head_armor(0)|body_armor(15)|leg_armor(7)|difficulty(0) ,imodbits_cloth ],
["steppe_armor", "Steppe Armor", [("lamellar_leather",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
195 , weight(5)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(8)|difficulty(0) ,imodbits_cloth ],
["gambeson", "Gambeson", [("white_gambeson",0)], itp_merchandise| itp_type_body_armor|itp_covers_legs|itp_civilian,0,
260 , weight(5)|abundance(100)|head_armor(0)|body_armor(20)|leg_armor(5)|difficulty(0) ,imodbits_cloth ],
["blue_gambeson", "Blue Gambeson", [("blue_gambeson",0)], itp_merchandise| itp_type_body_armor|itp_covers_legs|itp_civilian,0,
270 , weight(5)|abundance(100)|head_armor(0)|body_armor(21)|leg_armor(5)|difficulty(0) ,imodbits_cloth ],
["red_gambeson", "Red Gambeson", [("red_gambeson",0)], itp_merchandise| itp_type_body_armor|itp_covers_legs|itp_civilian,0,
275 , weight(5)|abundance(100)|head_armor(0)|body_armor(21)|leg_armor(5)|difficulty(0) ,imodbits_cloth ],
["padded_cloth", "Padded Cloth", [("aketon_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
297 , weight(11)|abundance(100)|head_armor(0)|body_armor(22)|leg_armor(6)|difficulty(0) ,imodbits_cloth ],
["leather_jerkin", "Leather Jerkin", [("leather_jerkin",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0,
321 , weight(6)|abundance(100)|head_armor(0)|body_armor(23)|leg_armor(6)|difficulty(0) ,imodbits_cloth ],
["nomad_vest", "Nomad Vest", [("nomad_vest_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0,
360 , weight(7)|abundance(50)|head_armor(0)|body_armor(22)|leg_armor(8)|difficulty(0) ,imodbits_cloth ],
["ragged_outfit", "Ragged Outfit", [("ragged_outfit_a",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0,
390 , weight(7)|abundance(100)|head_armor(0)|body_armor(23)|leg_armor(9)|difficulty(0) ,imodbits_cloth ],
["padded_leather", "Padded Leather", [("padded_leather",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian,0,
454 , weight(12)|abundance(100)|head_armor(0)|body_armor(27)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["tribal_warrior_outfit", "Tribal Warrior Outfit", [("tribal_warrior_outfit_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0,
520 , weight(14)|abundance(100)|head_armor(0)|body_armor(30)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
["nomad_robe", "Nomad Robe", [("nomad_robe_a",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs |itp_civilian,0,
610 , weight(15)|abundance(100)|head_armor(0)|body_armor(32)|leg_armor(10)|difficulty(0) ,imodbits_cloth ],
#["heraldric_armor", "Heraldric Armor", [("tourn_armor_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 442 , weight(17)|abundance(100)|head_armor(0)|body_armor(35)|leg_armor(8)|difficulty(7) ,imodbits_armor ],
["studded_leather_coat", "Studded Leather Coat", [("std_lthr_coat",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
690 , weight(14)|abundance(100)|head_armor(0)|body_armor(34)|leg_armor(10)|difficulty(7) ,imodbits_armor ],
["byrnie", "Byrnie", [("byrnie_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
795 , weight(17)|abundance(100)|head_armor(0)|body_armor(39)|leg_armor(6)|difficulty(7) ,imodbits_armor ],
#["blackwhite_surcoat", "Black and White Surcoat", [("surcoat_blackwhite",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 348 , weight(16)|abundance(100)|head_armor(0)|body_armor(33)|leg_armor(8)|difficulty(7) ,imodbits_armor ],
#["green_surcoat", "Green Surcoat", [("surcoat_green",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 348 , weight(16)|abundance(100)|head_armor(0)|body_armor(33)|leg_armor(8)|difficulty(7) ,imodbits_armor ],
#["blue_surcoat", "Blue Surcoat", [("surcoat_blue",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 350 , weight(16)|abundance(100)|head_armor(0)|body_armor(33)|leg_armor(8)|difficulty(7) ,imodbits_armor ],
#["red_surcoat", "Red Surcoat", [("surcoat_red",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 350 , weight(16)|abundance(100)|head_armor(0)|body_armor(33)|leg_armor(8)|difficulty(7) ,imodbits_armor ],
["haubergeon", "Haubergeon", [("haubergeon_a",0),("haubergeon_b",imodbits_good)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
863 , weight(18)|abundance(100)|head_armor(0)|body_armor(41)|leg_armor(6)|difficulty(6) ,imodbits_armor ],
["mail_shirt", "Mail Shirt", [("mail_shirt",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
920 , weight(19)|abundance(100)|head_armor(0)|body_armor(37)|leg_armor(12)|difficulty(7) ,imodbits_armor ],
["mail_hauberk", "Mail Hauberk", [("hauberk_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
1190 , weight(19)|abundance(100)|head_armor(0)|body_armor(40)|leg_armor(12)|difficulty(7) ,imodbits_armor ],
["lamellar_vest", "Lamellar Vest", [("nmd_warrior_a",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0,
1370 , weight(18)|abundance(100)|head_armor(0)|body_armor(46)|leg_armor(8)|difficulty(7) ,imodbits_cloth ],
["mail_with_surcoat", "Mail with Surcoat", [("mail_long_surcoat",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
1544 , weight(22)|abundance(100)|head_armor(0)|body_armor(42)|leg_armor(14)|difficulty(7) ,imodbits_armor ],
["surcoat_over_mail", "Surcoat over Mail", [("surcoat_over_mail",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
1720 , weight(22)|abundance(100)|head_armor(0)|body_armor(43)|leg_armor(14)|difficulty(7) ,imodbits_armor ],
#["lamellar_cuirass", "Lamellar Cuirass", [("lamellar_armor",0)], itp_type_body_armor |itp_covers_legs,0, 1020 , weight(25)|abundance(100)|head_armor(0)|body_armor(43)|leg_armor(15)|difficulty(9) ,imodbits_armor ],
["brigandine_a", "Brigandine", [("brigandine_a",0)], itp_merchandise| itp_type_body_armor|itp_covers_legs,0,
1830 , weight(19)|abundance(100)|head_armor(0)|body_armor(46)|leg_armor(12)|difficulty(0) ,imodbits_armor ],
["lamellar_armor", "Lamellar Armor", [("lamellar_armor_b",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
2410 , weight(25)|abundance(100)|head_armor(0)|body_armor(48)|leg_armor(13)|difficulty(0) ,imodbits_armor ],
["banded_armor", "Banded Armor", [("reinf_jerkin",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
2710 , weight(23)|abundance(100)|head_armor(0)|body_armor(49)|leg_armor(14)|difficulty(8) ,imodbits_armor ],
["cuir_bouilli", "Cuir Bouilli", [("hard_lthr_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
3100 , weight(24)|abundance(100)|head_armor(0)|body_armor(50)|leg_armor(15)|difficulty(8) ,imodbits_armor ],
["coat_of_plates", "Coat of Plates", [("coat_of_plates",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
3828 , weight(25)|abundance(100)|head_armor(0)|body_armor(52)|leg_armor(16)|difficulty(8) ,imodbits_armor ],
["plate_armor", "Plate Armor", [("plate_armor",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
6553 , weight(27)|abundance(100)|head_armor(0)|body_armor(55)|leg_armor(17)|difficulty(9) ,imodbits_plate ],
["black_armor", "Black Armor", [("black_armor",0)], itp_type_body_armor |itp_covers_legs ,0,
9496 , weight(28)|abundance(100)|head_armor(0)|body_armor(57)|leg_armor(18)|difficulty(10) ,imodbits_plate ],
["heraldic_mail_with_surcoat", "Heraldic Mail with Surcoat", [("heraldic_armor_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
3454 , weight(22)|abundance(100)|head_armor(0)|body_armor(49)|leg_armor(17)|difficulty(7) ,imodbits_armor,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_armor_a", ":agent_no", ":troop_no")])]],
##["heraldic_mail_with_tunic", "Heraldic_Mail", [("heraldic_armor_b",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
## 3520 , weight(22)|abundance(100)|head_armor(0)|body_armor(50)|leg_armor(16)|difficulty(7) ,imodbits_armor,
## [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_armor_b", ":agent_no", ":troop_no")])]],
##["heraldic_mail_with_tunic_b", "Heraldic_Mail", [("heraldic_armor_c",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
## 3610 , weight(22)|abundance(100)|head_armor(0)|body_armor(50)|leg_armor(16)|difficulty(7) ,imodbits_armor,
## [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_armor_c", ":agent_no", ":troop_no")])]],
["heraldic_mail_with_tabard", "Heraldic_Mail_with_Tabard", [("heraldic_armor_d",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0,
3654 , weight(21)|abundance(100)|head_armor(0)|body_armor(51)|leg_armor(15)|difficulty(7) ,imodbits_armor,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_armor_d", ":agent_no", ":troop_no")])]],
["turret_hat_ruby", "Turret Hat", [("turret_hat_r",0)], itp_type_head_armor |itp_civilian|itp_fit_to_head ,0, 70 , weight(0.5)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["turret_hat_blue", "Turret Hat", [("turret_hat_b",0)], itp_type_head_armor |itp_civilian|itp_fit_to_head ,0, 80 , weight(0.5)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["turret_hat_green", "Barbette", [("turret_hat_g",0)],itp_merchandise|itp_type_head_armor|itp_civilian|itp_fit_to_head,0,70, weight(0.5)|abundance(100)|head_armor(6)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth],
["head_wrappings","head_wrapping",[("head_wrapping",0)],itp_type_head_armor|itp_fit_to_head,0,16, weight(0.25)|head_armor(3),imodbit_tattered | imodbit_ragged | imodbit_sturdy | imodbit_thick],
["court_hat", "Turret Hat", [("court_hat",0)], itp_type_head_armor |itp_civilian|itp_fit_to_head ,0, 80 , weight(0.5)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["wimple_a", "Wimple", [("wimple_a",0)],itp_merchandise|itp_type_head_armor|itp_civilian|itp_fit_to_head,0,10, weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth],
["wimple_with_veil", "Wimple with Veil", [("wimple_b",0)],itp_merchandise|itp_type_head_armor|itp_civilian|itp_fit_to_head,0,10, weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth],
["straw_hat", "Straw Hat", [("straw_hat",0)],itp_merchandise|itp_type_head_armor|itp_civilian,0,9, weight(1)|abundance(100)|head_armor(2)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth],
["common_hood", "Hood", [("hood_a",0),("hood_b",0),("hood_c",0),("hood_d",0)],itp_merchandise|itp_type_head_armor|itp_civilian,0,9, weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth],
["headcloth", "Headcloth", [("headcloth",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 1 , weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["woolen_hood", "Woolen Hood", [("woolen_hood",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 4 , weight(1)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["fur_hat", "Fur Hat", [("hat_fur_a",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 4 , weight(0.5)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["nomad_cap", "Nomad Cap", [("helmet_fur_a",0),("helmet_fur_a",imodbits_good)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 6 , weight(0.75)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["steppe_cap", "Steppe Cap", [("helmet_fur_b",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 14 , weight(1)|abundance(100)|head_armor(12)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["padded_coif", "Padded Coif", [("padded_coif",0)], itp_merchandise| itp_type_head_armor ,0, 6 , weight(1)|abundance(100)|head_armor(11)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["woolen_cap", "Woolen Cap", [("woolen_cap",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 2 , weight(1)|abundance(100)|head_armor(6)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["felt_hat", "Felt Hat", [("felt_hat_a",0),("felt_hat_b",imodbits_good)], itp_merchandise| itp_type_head_armor |itp_civilian,0, 4 , weight(1)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["leather_cap", "Leather Cap", [("leather_cap",0)], itp_merchandise| itp_type_head_armor|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["arming_cap", "Arming Cap", [("linen_arming_cap",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["female_hood", "Lady's Hood", [("woolen_hood",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 9 , weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["leather_steppe_cap_a", "Leather Steppe Cap", [("nomad_cap_a",0)], itp_merchandise|itp_type_head_armor ,0, 24 , weight(1)|abundance(100)|head_armor(12)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["leather_steppe_cap_b", "Leather Steppe Cap", [("leather_steppe_cap_a",0)], itp_merchandise|itp_type_head_armor ,0, 36 , weight(1)|abundance(100)|head_armor(14)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["leather_steppe_cap_c", "Leather Steppe Cap", [("leather_steppe_cap_b",0)], itp_merchandise|itp_type_head_armor ,0, 51 , weight(1)|abundance(100)|head_armor(16)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["leather_warrior_cap", "Leather Warrior Cap", [("skull_cap_new_b",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 14 , weight(1)|abundance(100)|head_armor(18)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["skullcap", "Skullcap", [("skull_cap_new_a",0)], itp_merchandise| itp_type_head_armor ,0, 60 , weight(1.0)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_plate ],
["mail_coif", "Mail Coif", [("mail_coif",0)], itp_merchandise| itp_type_head_armor ,0, 71 , weight(1.25)|abundance(100)|head_armor(22)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_armor ],
["footman_helmet", "Footman's_Helmet", [("skull_cap_new",0)], itp_merchandise| itp_type_head_armor ,0, 95 , weight(1.5)|abundance(100)|head_armor(24)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_plate ],
["nasal_helmet", "Nasal Helmet", [("nasal_helmet_b",0)], itp_merchandise| itp_type_head_armor ,0, 121 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["norman_helmet", "Helmet with Cap", [("norman_helmet_a",0)], itp_merchandise| itp_type_head_armor|itp_fit_to_head ,0, 147 , weight(1.25)|abundance(100)|head_armor(28)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["segmented_helmet", "Segmented Helmet", [("segmented_helm_new",0)], itp_merchandise| itp_type_head_armor ,0, 174 , weight(1.25)|abundance(100)|head_armor(31)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["kettle_hat", "Kettle Hat", [("kettle_hat_new",0)], itp_merchandise| itp_type_head_armor,0, 193 , weight(1.5)|abundance(100)|head_armor(33)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["helmet_with_neckguard", "Helmet with Neckguard", [("neckguard_helm_new",0)], itp_merchandise| itp_type_head_armor ,0, 233 , weight(1.75)|abundance(100)|head_armor(35)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["spiked_helmet", "Spiked Helmet", [("spiked_helmet_new",0)], itp_merchandise| itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(38)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["nordic_helmet", "Nordic Helmet", [("helmet_w_eyeguard_new",0)], itp_merchandise| itp_type_head_armor ,0, 340 , weight(2)|abundance(100)|head_armor(40)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["flat_topped_helmet", "Flat Topped Helmet", [("flattop_helmet_new",0)], itp_merchandise| itp_type_head_armor ,0, 411 , weight(2)|abundance(100)|head_armor(42)|body_armor(0)|leg_armor(0)|difficulty(8) ,imodbits_plate ],
#TODO:
#["skullcap_b", "Skullcap_b", [("skull_cap_new_b",0)], itp_merchandise| itp_type_head_armor ,0, 71 , weight(1.5)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_plate ],
["bascinet", "Bascinet", [("bascinet_avt_new",0),("bascinet_avt_new1",imodbit_crude|imodbit_rusty),("bascinet_avt_new2",imodbits_good)], itp_merchandise|itp_type_head_armor ,0, 479 , weight(2.25)|abundance(100)|head_armor(45)|body_armor(0)|leg_armor(0)|difficulty(8) ,imodbits_plate ],
["guard_helmet", "Guard Helmet", [("reinf_helmet_new",0)], itp_merchandise| itp_type_head_armor ,0, 555 , weight(2.5)|abundance(100)|head_armor(47)|body_armor(0)|leg_armor(0)|difficulty(9) ,imodbits_plate ],
["black_helmet", "Black Helmet", [("black_helm",0)], itp_type_head_armor ,0, 638 , weight(2.75)|abundance(100)|head_armor(50)|body_armor(0)|leg_armor(0)|difficulty(9) ,imodbits_plate ],
["great_helmet", "Great Helmet", [("great_helm_a",0)], itp_merchandise| itp_type_head_armor|itp_covers_head,0, 980 , weight(2.75)|abundance(100)|head_armor(53)|body_armor(0)|leg_armor(0)|difficulty(10) ,imodbits_plate ],
["winged_great_helmet", "Winged Great Helmet", [("maciejowski_helmet_new",0)], itp_merchandise|itp_type_head_armor|itp_covers_head,0, 1240 , weight(2.75)|abundance(100)|head_armor(55)|body_armor(0)|leg_armor(0)|difficulty(10) ,imodbits_plate ],
#WEAPONS
["wooden_stick", "Wooden Stick", [("wooden_stick",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry|itp_wooden_attack, itc_scimitar, 4 , weight(2.5)|difficulty(0)|spd_rtng(99) | weapon_length(90)|swing_damage(13 , blunt) | thrust_damage(0 , pierce),imodbits_none ],
["cudgel", "Cudgel", [("club",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry|itp_wooden_attack, itc_scimitar, 4 , weight(2.5)|difficulty(0)|spd_rtng(99) | weapon_length(90)|swing_damage(13 , blunt) | thrust_damage(0 , pierce),imodbits_none ],
["hammer", "Hammer", [("iron_hammer",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar, 7 , weight(2)|difficulty(0)|spd_rtng(100) | weapon_length(55)|swing_damage(14 , blunt) | thrust_damage(0 , pierce),imodbits_mace ],
["club", "Club", [("club",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry|itp_wooden_attack, itc_scimitar, 11 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(15 , blunt) | thrust_damage(0 , pierce),imodbits_none ],
["winged_mace", "Winged Mace", [("winged_mace",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 122 , weight(3.5)|difficulty(0)|spd_rtng(99) | weapon_length(80)|swing_damage(21 , blunt) | thrust_damage(0 , pierce),imodbits_mace ],
["spiked_mace", "Spiked Mace", [("spiked_mace",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 180 , weight(3.5)|difficulty(0)|spd_rtng(95) | weapon_length(90)|swing_damage(22 , blunt) | thrust_damage(0 , pierce),imodbits_pick ],
["military_hammer", "Military Hammer", [("iron_hammer",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 317 , weight(4)|difficulty(0)|spd_rtng(92) | weapon_length(90)|swing_damage(25 , blunt) | thrust_damage(0 , pierce),imodbits_mace ],
["maul", "Maul", [("maul_b",0)], itp_type_two_handed_wpn|itp_merchandise| itp_primary|itp_two_handed|itp_wooden_parry|itp_wooden_attack, itc_nodachi|itcf_carry_spear, 97 , weight(6)|difficulty(11)|spd_rtng(84) | weapon_length(79)|swing_damage(33 , blunt) | thrust_damage(0 , pierce),imodbits_mace ],
["sledgehammer", "Sledgehammer", [("maul_c",0)], itp_type_two_handed_wpn|itp_merchandise|itp_primary|itp_two_handed|itp_wooden_parry|itp_wooden_attack, itc_nodachi|itcf_carry_spear, 101 , weight(7)|difficulty(12)|spd_rtng(82) | weapon_length(82)|swing_damage(35 , blunt) | thrust_damage(0 , pierce),imodbits_mace ],
["warhammer", "Warhammer", [("maul_d",0)], itp_type_two_handed_wpn|itp_merchandise|itp_primary|itp_two_handed|itp_wooden_parry|itp_wooden_attack, itc_nodachi|itcf_carry_spear, 309 , weight(9)|difficulty(14)|spd_rtng(85) | weapon_length(75)|swing_damage(38 , blunt) | thrust_damage(0 , pierce),imodbits_mace ],
["pickaxe", "Pickaxe", [("rusty_pick",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 27 , weight(3)|difficulty(0)|spd_rtng(96) | weapon_length(80)|swing_damage(19 , pierce) | thrust_damage(0 , pierce),imodbits_pick ],
["spiked_club", "Spiked Club", [("spiked_club",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 83 , weight(3)|difficulty(0)|spd_rtng(97) | weapon_length(97)|swing_damage(21 , pierce) | thrust_damage(0 , pierce),imodbits_mace ],
["fighting_pick", "Fighting Pick", [("rusty_pick",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 108 , weight(3.5)|difficulty(0)|spd_rtng(94) | weapon_length(90)|swing_damage(25 , pierce) | thrust_damage(0 , pierce),imodbits_pick ],
["military_pick", "Military Pick", [("steel_pick",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 142 , weight(4)|difficulty(0)|spd_rtng(90) | weapon_length(90)|swing_damage(27 , pierce) | thrust_damage(0 , pierce),imodbits_pick ],
["morningstar", "Morningstar", [("mace_morningstar",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 205 , weight(5.5)|difficulty(13)|spd_rtng(75) | weapon_length(98)|swing_damage(29 , pierce) | thrust_damage(0 , pierce),imodbits_mace ],
["sickle", "Sickle", [("sickle",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry|itp_wooden_parry, itc_cleaver, 1 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(40)|swing_damage(20 , cut) | thrust_damage(0 , pierce),imodbits_none ],
["cleaver", "Cleaver", [("cleaver",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry|itp_wooden_parry, itc_cleaver, 3 , weight(1.5)|difficulty(0)|spd_rtng(103) | weapon_length(30)|swing_damage(24 , cut) | thrust_damage(0 , pierce),imodbits_none ],
["knife", "Knife", [("peasant_knife",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry, itc_dagger|itcf_carry_dagger_front_left, 4 , weight(0.5)|difficulty(0)|spd_rtng(110) | weapon_length(40)|swing_damage(21 , cut) | thrust_damage(13 , pierce),imodbits_sword ],
["butchering_knife", "Butchering Knife", [("khyber_knife",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry, itc_dagger|itcf_carry_dagger_front_right, 13 , weight(0.75)|difficulty(0)|spd_rtng(108) | weapon_length(60)|swing_damage(24 , cut) | thrust_damage(17 , pierce),imodbits_sword ],
["dagger", "Dagger", [("dagger",0),("scab_dagger",ixmesh_carry),("dagger_b",imodbits_good),("dagger_b_scabbard",ixmesh_carry|imodbits_good)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry, itc_dagger|itcf_carry_dagger_front_left|itcf_show_holster_when_drawn, 17 , weight(0.75)|difficulty(0)|spd_rtng(112) | weapon_length(47)|swing_damage(22 , cut) | thrust_damage(19 , pierce),imodbits_sword_high ],
#["nordic_sword", "Nordic Sword", [("viking_sword",0),("scab_vikingsw", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 142 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(98)|swing_damage(27 , cut) | thrust_damage(19 , pierce),imodbits_sword ],
#["arming_sword", "Arming Sword", [("b_long_sword",0),("scab_longsw_b", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 156 , weight(1.5)|difficulty(0)|spd_rtng(101) | weapon_length(100)|swing_damage(25 , cut) | thrust_damage(22 , pierce),imodbits_sword ],
#["sword", "Sword", [("long_sword",0),("scab_longsw_a", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 148 , weight(1.5)|difficulty(0)|spd_rtng(100) | weapon_length(102)|swing_damage(26 , cut) | thrust_damage(23 , pierce),imodbits_sword ],
["falchion", "Falchion", [("falchion",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip, 105 , weight(2.5)|difficulty(8)|spd_rtng(96) | weapon_length(73)|swing_damage(30 , cut) | thrust_damage(0 , pierce),imodbits_sword ],
#["broadsword", "Broadsword", [("broadsword",0),("scab_broadsword", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 122 , weight(2.5)|difficulty(8)|spd_rtng(91) | weapon_length(101)|swing_damage(27 , cut) | thrust_damage(0 , pierce),imodbits_sword ],
["scimitar", "Scimitar", [("scimeter",0),("scab_scimeter", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 108 , weight(1.5)|difficulty(0)|spd_rtng(105) | weapon_length(97)|swing_damage(29 , cut) | thrust_damage(0 , pierce),imodbits_sword_high ],
#["nomad_sabre", "Nomad Sabre", [("shashqa",0),("scab_shashqa", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 115 , weight(1.75)|difficulty(0)|spd_rtng(101) | weapon_length(100)|swing_damage(27 , cut) | thrust_damage(0 , pierce),imodbits_sword ],
#["bastard_sword", "Bastard Sword", [("bastard_sword",0),("scab_bastardsw", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_primary, itc_bastardsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 279 , weight(2.25)|difficulty(9)|spd_rtng(102) | weapon_length(120)|swing_damage(33 , cut) | thrust_damage(27 , pierce),imodbits_sword ],
["great_sword", "Great Sword", [("b_bastard_sword",0),("scab_bastardsw_b", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back|itcf_show_holster_when_drawn,
423 , weight(2.75)|difficulty(10)|spd_rtng(95) | weapon_length(125)|swing_damage(39 , cut) | thrust_damage(31 , pierce),imodbits_sword_high ],
["sword_of_war", "Sword of War", [("b_bastard_sword",0),("scab_bastardsw_b", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back|itcf_show_holster_when_drawn,
524 , weight(3)|difficulty(11)|spd_rtng(93) | weapon_length(130)|swing_damage(40 , cut) | thrust_damage(31 , pierce),imodbits_sword_high ],
["hatchet", "Hatchet", [("hatchet",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 3 , weight(2)|difficulty(0)|spd_rtng(97) | weapon_length(60)|swing_damage(23 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["hand_axe", "Hand Axe", [("hatchet",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 24 , weight(2)|difficulty(7)|spd_rtng(95) | weapon_length(75)|swing_damage(27 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["fighting_axe", "Fighting Axe", [("fighting_ax",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 77 , weight(2.5)|difficulty(9)|spd_rtng(92) | weapon_length(90)|swing_damage(31 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["axe", "Axe", [("iron_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 65 , weight(4)|difficulty(8)|spd_rtng(91) | weapon_length(108)|swing_damage(32 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["voulge", "Voulge", [("voulge",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 129 , weight(4.5)|difficulty(8)|spd_rtng(87) | weapon_length(119)|swing_damage(35 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["battle_axe", "Battle Axe", [("battle_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 240 , weight(5)|difficulty(9)|spd_rtng(88) | weapon_length(108)|swing_damage(41 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["war_axe", "War Axe", [("war_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 264 , weight(5)|difficulty(10)|spd_rtng(86) | weapon_length(110)|swing_damage(43 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
#["double_axe", "Double Axe", [("dblhead_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 359 , weight(6.5)|difficulty(12)|spd_rtng(85) | weapon_length(95)|swing_damage(43 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
#["great_axe", "Great Axe", [("great_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 415 , weight(7)|difficulty(13)|spd_rtng(82) | weapon_length(120)|swing_damage(45 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["sword_two_handed_b", "Two Handed Sword", [("sword_two_handed_b",0)], itp_type_two_handed_wpn|itp_merchandise|itp_always_loot| itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back,
670 , weight(2.75)|difficulty(10)|spd_rtng(93) | weapon_length(110)|swing_damage(40 , cut) | thrust_damage(27 , pierce),imodbits_sword_high ],
["sword_two_handed_a", "Great Sword", [("sword_two_handed_a",0)], itp_type_two_handed_wpn|itp_merchandise|itp_always_loot|itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back,
1123 , weight(2.75)|difficulty(10)|spd_rtng(89) | weapon_length(120)|swing_damage(42 , cut) | thrust_damage(28 , pierce),imodbits_sword_high ],
["bastard_sword_a", "Bastard Sword", [("bastard_sword_a",0),("bastard_sword_a_scabbard", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_primary, itc_bastardsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
294 , weight(2.25)|difficulty(9)|spd_rtng(98) | weapon_length(101)|swing_damage(37 , cut) | thrust_damage(26 , pierce),imodbits_sword_high ],
["bastard_sword_b", "Heavy Bastard Sword", [("bastard_sword_b",0),("bastard_sword_b_scabbard", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_primary, itc_bastardsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
526 , weight(2.25)|difficulty(9)|spd_rtng(96) | weapon_length(105)|swing_damage(37 , cut) | thrust_damage(28 , pierce),imodbits_sword_high ],
["one_handed_war_axe_a", "One Handed War Axe", [("one_handed_war_axe_a",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
87 , weight(1.5)|difficulty(9)|spd_rtng(100) | weapon_length(60)|swing_damage(32 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["one_handed_war_axe_b", "One Handed War Axe", [("one_handed_war_axe_b",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
137 , weight(1.5)|difficulty(9)|spd_rtng(98) | weapon_length(61)|swing_damage(34 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["one_handed_battle_axe_a", "One Handed Battle Axe", [("one_handed_battle_axe_a",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
102 , weight(1.5)|difficulty(9)|spd_rtng(97) | weapon_length(69)|swing_damage(34 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["one_handed_battle_axe_b", "One Handed Battle Axe", [("one_handed_battle_axe_b",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
171 , weight(1.75)|difficulty(9)|spd_rtng(96) | weapon_length(70)|swing_damage(36 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["one_handed_battle_axe_c", "One Handed Battle Axe", [("one_handed_battle_axe_c",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
294 , weight(2.0)|difficulty(9)|spd_rtng(95) | weapon_length(72)|swing_damage(38 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["two_handed_axe", "Two_Handed_Axe", [("two_handed_battle_axe_a",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back,
110 , weight(4.5)|difficulty(10)|spd_rtng(90) | weapon_length(90)|swing_damage(40 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["two_handed_battle_axe_2", "Two_Handed_War_Axe", [("two_handed_battle_axe_b",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back,
202 , weight(4.5)|difficulty(10)|spd_rtng(92) | weapon_length(92)|swing_damage(47 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["two_handed_battle_axe_3", "Voulge", [("two_handed_battle_axe_c",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back,
258 , weight(4.5)|difficulty(10)|spd_rtng(87) | weapon_length(100)|swing_damage(48 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["bardiche", "Bardiche", [("two_handed_battle_axe_d",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back,
311 , weight(4.5)|difficulty(10)|spd_rtng(87) | weapon_length(102)|swing_damage(50 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["great_axe", "Great_Axe", [("two_handed_battle_axe_e",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back,
446 , weight(4.5)|difficulty(10)|spd_rtng(90) | weapon_length(96)|swing_damage(51 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["great_bardiche", "Great_Bardiche", [("two_handed_battle_axe_f",0)], itp_type_two_handed_wpn|itp_always_loot|itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back,
617 , weight(4.5)|difficulty(10)|spd_rtng(90) | weapon_length(116)|swing_damage(47 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["shortened_military_scythe", "Shortened Military Scythe", [("two_handed_battle_scythe_a",0)], itp_type_two_handed_wpn|itp_merchandise|itp_always_loot| itp_two_handed|itp_primary, itc_nodachi|itcf_carry_sword_back,
264 , weight(3.0)|difficulty(10)|spd_rtng(90) | weapon_length(112)|swing_damage(44 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["sword_medieval_a", "Sword", [("sword_medieval_a",0),("sword_medieval_a_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
163 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(27 , cut) | thrust_damage(22 , pierce),imodbits_sword_high ],
#["sword_medieval_a_long", "Sword", [("sword_medieval_a_long",0),("sword_medieval_a_long_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 156 , weight(1.5)|difficulty(0)|spd_rtng(97) | weapon_length(105)|swing_damage(25 , cut) | thrust_damage(22 , pierce),imodbits_sword ],
["sword_medieval_b", "Sword", [("sword_medieval_b",0),("sword_medieval_b_scabbard", ixmesh_carry),("sword_rusty_a",imodbit_rusty),("sword_rusty_a_scabbard", ixmesh_carry|imodbit_rusty)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
243 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(28 , cut) | thrust_damage(23 , pierce),imodbits_sword_high ],
["sword_medieval_b_small", "Short Sword", [("sword_medieval_b_small",0),("sword_medieval_b_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
152 , weight(1.5)|difficulty(0)|spd_rtng(102) | weapon_length(85)|swing_damage(26, cut) | thrust_damage(24, pierce),imodbits_sword_high ],
["sword_medieval_c", "Arming Sword", [("sword_medieval_c",0),("sword_medieval_c_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
410 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(29 , cut) | thrust_damage(24 , pierce),imodbits_sword_high ],
["sword_medieval_c_small", "Short Arming Sword", [("sword_medieval_c_small",0),("sword_medieval_c_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
243 , weight(1.5)|difficulty(0)|spd_rtng(103) | weapon_length(86)|swing_damage(26, cut) | thrust_damage(24 , pierce),imodbits_sword_high ],
#["sword_medieval_d", "sword_medieval_d", [("sword_medieval_d",0),("sword_medieval_d_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
# 131 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(24 , cut) | thrust_damage(21 , pierce),imodbits_sword ],
#["sword_medieval_d_long", "sword_medieval_d_long", [("sword_medieval_d_long",0),("sword_medieval_d_long_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
# 156 , weight(1.5)|difficulty(0)|spd_rtng(97) | weapon_length(105)|swing_damage(25 , cut) | thrust_damage(22 , pierce),imodbits_sword ],
#["sword_medieval_e", "sword_medieval_e", [("sword_medieval_e",0),("sword_medieval_e_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
# 131 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(24 , cut) | thrust_damage(21 , pierce),imodbits_sword ],
["sword_viking_1", "Nordic Sword", [("sword_viking_c",0),("sword_viking_c_scabbard ", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
147 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(94)|swing_damage(28 , cut) | thrust_damage(20 , pierce),imodbits_sword_high ] ,
["sword_viking_2", "Nordic Sword", [("sword8",0),("sword_viking_b_scabbard", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise|itp_primary|itp_attach_left_hand, itc_bastardsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
276 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(29 , cut) | thrust_damage(21 , pierce),imodbits_sword_high ],
["sword_viking_2_small", "Nordic Short Sword", [("sword_viking_b_small",0),("sword_viking_b_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
162 , weight(1.25)|difficulty(0)|spd_rtng(103) | weapon_length(85)|swing_damage(28 , cut) | thrust_damage(21 , pierce),imodbits_sword_high ],
["sword_viking_3", "Nordic Sword", [("sword_viking_a",0),("sword_viking_a_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
394 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(30 , cut) | thrust_damage(21 , pierce),imodbits_sword_high ],
#["sword_viking_a_long", "sword_viking_a_long", [("sword_viking_a_long",0),("sword_viking_a_long_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
# 142 , weight(1.5)|difficulty(0)|spd_rtng(97) | weapon_length(105)|swing_damage(27 , cut) | thrust_damage(19 , pierce),imodbits_sword ],
["sword_viking_3_small", "Nordic Sword", [("sword_viking_a_small",0),("sword_viking_a_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
280 , weight(1.25)|difficulty(0)|spd_rtng(103) | weapon_length(86)|swing_damage(29 , cut) | thrust_damage(21 , pierce),imodbits_sword_high ],
#["sword_viking_c_long", "sword_viking_c_long", [("sword_viking_c_long",0),("sword_viking_c_long_scabbard ", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
# 142 , weight(1.5)|difficulty(0)|spd_rtng(95) | weapon_length(105)|swing_damage(27 , cut) | thrust_damage(19 , pierce),imodbits_sword ] ,
["sword_khergit_1", "Nomad Sabre", [("khergit_sword_b",0),("khergit_sword_b_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
105 , weight(1.25)|difficulty(0)|spd_rtng(100) | weapon_length(97)|swing_damage(29 , cut),imodbits_sword_high ],
["sword_khergit_2", "Sabre", [("khergit_sword_c",0),("khergit_sword_c_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
191 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(97)|swing_damage(30 , cut),imodbits_sword_high ],
["sword_khergit_3", "Sabre", [("khergit_sword_a",0),("khergit_sword_a_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
294 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(98)|swing_damage(31 , cut),imodbits_sword_high ],
["sword_khergit_4", "Heavy Sabre", [("khergit_sword_d",0),("khergit_sword_d_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
384 , weight(1.75)|difficulty(0)|spd_rtng(96) | weapon_length(96)|swing_damage(33 , cut),imodbits_sword_high ],
["mace_1", "spiked_club", [("mace_d",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
45 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(62)|swing_damage(19 , pierce) | thrust_damage(0 , pierce),imodbits_mace ],
["mace_2", "Knobbed_Mace", [("mace_a",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
98 , weight(2.5)|difficulty(0)|spd_rtng(98) | weapon_length(60)|swing_damage(21 , blunt) | thrust_damage(0 , pierce),imodbits_mace ],
["mace_3", "Spiked Mace", [("mace_c",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
152 , weight(2.5)|difficulty(0)|spd_rtng(98) | weapon_length(62)|swing_damage(23 , blunt) | thrust_damage(0 , pierce),imodbits_mace ],
["mace_4", "Winged_Mace", [("mace_b",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
212 , weight(2.5)|difficulty(0)|spd_rtng(98) | weapon_length(60)|swing_damage(24 , blunt) | thrust_damage(0 , pierce),imodbits_mace ],
["club_with_spike_head", "Club_with_Spike", [("mace_e",0)], itp_type_two_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_bastardsword|itcf_carry_axe_back,
72 , weight(3.5)|difficulty(9)|spd_rtng(103) | weapon_length(80)|swing_damage(26 , blunt) | thrust_damage(25 , pierce),imodbits_mace ],
["scythe", "Scythe", [("scythe",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear, 43 , weight(3)|difficulty(0)|spd_rtng(79) | weapon_length(182)|swing_damage(19 , cut) | thrust_damage(14 , pierce),imodbits_polearm ],
["pitch_fork", "Pitch Fork", [("pitch_fork",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 19 , weight(3.5)|difficulty(0)|spd_rtng(83) | weapon_length(154)|swing_damage(0 , blunt) | thrust_damage(18 , pierce),imodbits_polearm ],
["military_fork", "Military Fork", [("military_fork",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 153 , weight(4.5)|difficulty(0)|spd_rtng(88) | weapon_length(135)|swing_damage(0 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ],
["battle_fork", "Battle Fork", [("battle_fork",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 282 , weight(4.5)|difficulty(0)|spd_rtng(87) | weapon_length(142)|swing_damage(0 , blunt) | thrust_damage(24 , pierce),imodbits_polearm ],
["boar_spear", "Boar Spear", [("spear",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear|itcf_carry_spear, 76 , weight(4)|difficulty(0)|spd_rtng(81) | weapon_length(157)|swing_damage(0 , cut) | thrust_damage(23 , pierce),imodbits_polearm ],
#["spear", "Spear", [("spear",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear, 173 , weight(4.5)|difficulty(0)|spd_rtng(80) | weapon_length(158)|swing_damage(17 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ],
["jousting_lance", "Jousting Lance", [("joust_of_peace",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_greatlance, 158 , weight(5)|difficulty(0)|spd_rtng(61) | weapon_length(218)|swing_damage(0 , cut) | thrust_damage(17 , blunt),imodbits_polearm ],
#["lance", "Lance", [("pike",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 196 , weight(5)|difficulty(0)|spd_rtng(72) | weapon_length(170)|swing_damage(0 , cut) | thrust_damage(20 , pierce),imodbits_polearm ],
#["great_lance", "Great Lance", [("heavy_lance",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_greatlance, 237 , weight(5)|difficulty(0)|spd_rtng(55) | weapon_length(215)|swing_damage(0 , cut) | thrust_damage(21 , pierce),imodbits_polearm ],
["double_sided_lance", "Double Sided Lance", [("lance_dblhead",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff, 261 , weight(5.5)|difficulty(0)|spd_rtng(80) | weapon_length(130)|swing_damage(0 , cut) | thrust_damage(27 , pierce),imodbits_polearm ],
#["pike", "Pike", [("pike",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_spear,
# 212 , weight(6)|difficulty(0)|spd_rtng(77) | weapon_length(167)|swing_damage(0 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ],
["glaive", "Glaive", [("glaive",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_staff|itcf_carry_spear,
352 , weight(4.5)|difficulty(0)|spd_rtng(83) | weapon_length(157)|swing_damage(38 , cut) | thrust_damage(21 , pierce),imodbits_polearm ],
["poleaxe", "Poleaxe", [("pole_ax",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_staff,
384 , weight(6.5)|difficulty(0)|spd_rtng(77) | weapon_length(180)|swing_damage(37 , cut) | thrust_damage(21 , pierce),imodbits_polearm ],
["polehammer", "Polehammer", [("pole_hammer",0)], itp_type_polearm| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_staff,
169 , weight(7)|difficulty(14)|spd_rtng(73) | weapon_length(130)|swing_damage(29 , blunt) | thrust_damage(25 , blunt),imodbits_polearm ],
["staff", "Staff", [("wooden_staff",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack, itc_staff|itcf_carry_sword_back,
36 , weight(1.5)|difficulty(0)|spd_rtng(100) | weapon_length(130)|swing_damage(18 , blunt) | thrust_damage(19 , blunt),imodbits_polearm ],
["quarter_staff", "Quarter Staff", [("quarter_staff",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack, itc_staff|itcf_carry_sword_back,
60 , weight(2)|difficulty(0)|spd_rtng(104) | weapon_length(140)|swing_damage(20 , blunt) | thrust_damage(20 , blunt),imodbits_polearm ],
["iron_staff", "Iron Staff", [("iron_staff",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield, itc_staff|itcf_carry_sword_back,
202 , weight(2)|difficulty(0)|spd_rtng(97) | weapon_length(140)|swing_damage(25 , blunt) | thrust_damage(26 , blunt),imodbits_polearm ],
["shortened_spear", "Shortened_Spear", [("spear_g_1-9m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear,
53 , weight(2.0)|difficulty(0)|spd_rtng(102) | weapon_length(120)|swing_damage(19 , blunt) | thrust_damage(25 , pierce),imodbits_polearm ],
["spear", "Spear", [("spear_h_2-15m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear,
75 , weight(2.25)|difficulty(0)|spd_rtng(98) | weapon_length(135)|swing_damage(20 , blunt) | thrust_damage(26 , pierce),imodbits_polearm ],
["war_spear", "War_Spear", [("spear_i_2-3m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear,
90 , weight(2.5)|difficulty(0)|spd_rtng(96) | weapon_length(150)|swing_damage(20 , blunt) | thrust_damage(27 , pierce),imodbits_polearm ],
#TODO:["shortened_spear", "shortened_spear", [("spear_e_2-1m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear,
# 65 , weight(2.0)|difficulty(0)|spd_rtng(98) | weapon_length(110)|swing_damage(17 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ],
#TODO:["spear_2-4m", "spear", [("spear_e_2-25m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear,
# 67 , weight(2.0)|difficulty(0)|spd_rtng(95) | weapon_length(125)|swing_damage(17 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ],
["spear_e_2-5m", "Military Scythe", [("spear_e_2-5m",0),("spear_c_2-5m",imodbits_bad)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear,
145 , weight(2.5)|difficulty(10)|spd_rtng(93) | weapon_length(155)|swing_damage(36 , cut) | thrust_damage(25 , pierce),imodbits_polearm ],
["light_lance", "Light Lance", [("spear_b_2-75m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear,
89 , weight(2.5)|difficulty(0)|spd_rtng(90) | weapon_length(175)|swing_damage(16 , blunt) | thrust_damage(27 , pierce),imodbits_polearm ],
["lance", "Lance", [("spear_d_2-8m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear,
110 , weight(2.5)|difficulty(0)|spd_rtng(88) | weapon_length(180)|swing_damage(16 , blunt) | thrust_damage(26 , pierce),imodbits_polearm ],
["heavy_lance", "Heavy Lance", [("spear_f_2-9m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear,
130 , weight(2.75)|difficulty(10)|spd_rtng(85) | weapon_length(190)|swing_damage(16 , blunt) | thrust_damage(26 , pierce),imodbits_polearm ],
["pike", "Pike", [("spear_a_3m",0)], itp_type_polearm|itp_merchandise| itp_cant_use_on_horseback|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear,
125 , weight(3.0)|difficulty(0)|spd_rtng(81) | weapon_length(245)|swing_damage(16 , blunt) | thrust_damage(26 , pierce),imodbits_polearm ],
##["spear_e_3-25m", "Spear_3-25m", [("spear_e_3-25m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear,
## 150 , weight(4.5)|difficulty(0)|spd_rtng(81) | weapon_length(225)|swing_damage(19 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ],
["ashwood_pike", "Ashwood Pike", [("pike",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_cutting_spear,
205 , weight(3.5)|difficulty(11)|spd_rtng(90) | weapon_length(170)|swing_damage(19 , blunt) | thrust_damage(29, pierce),imodbits_polearm ],
["awlpike", "Awlpike", [("pike",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear,
378 , weight(3.5)|difficulty(12)|spd_rtng(92) | weapon_length(160)|swing_damage(30 , cut) | thrust_damage(31 , pierce),imodbits_polearm ],
# SHIELDS
["wooden_shield", "Wooden Shield", [("shield_round_a",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(50),imodbits_shield ],
##["wooden_shield", "Wooden Shield", [("shield_round_a",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(50),imodbits_shield,
#["round_shield", "Round Shield", [("shield_round_c",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 64 , weight(2)|hit_points(400)|body_armor(1)|spd_rtng(100)|weapon_length(50),imodbits_shield ],
["nordic_shield", "Nordic Shield", [("shield_round_b",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 95 , weight(2)|hit_points(440)|body_armor(1)|spd_rtng(100)|weapon_length(50),imodbits_shield ],
#["kite_shield", "Kite Shield", [("shield_kite_a",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
#["kite_shield_", "Kite Shield", [("shield_kite_b",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
#["large_shield", "Large Shield", [("shield_kite_c",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 165 , weight(2.5)|hit_points(520)|body_armor(1)|spd_rtng(80)|weapon_length(92),imodbits_shield ],
#["battle_shield", "Battle Shield", [("shield_kite_d",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 196 , weight(3)|hit_points(560)|body_armor(1)|spd_rtng(78)|weapon_length(94),imodbits_shield ],
["fur_covered_shield", "Fur Covered Shield", [("shield_kite_m",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 227 , weight(3.5)|hit_points(600)|body_armor(1)|spd_rtng(76)|weapon_length(81),imodbits_shield ],
#["heraldric_shield", "Heraldric Shield", [("shield_heraldic",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 301 , weight(3.5)|hit_points(640)|body_armor(1)|spd_rtng(83)|weapon_length(65),imodbits_shield ],
#["heater_shield", "Heater Shield", [("shield_heater_a",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 477 , weight(3.5)|hit_points(710)|body_armor(4)|spd_rtng(80)|weapon_length(60),imodbits_shield ],
["steel_shield", "Steel Shield", [("shield_dragon",0)], itp_merchandise|itp_type_shield, itcf_carry_round_shield, 697 , weight(4)|hit_points(700)|body_armor(17)|spd_rtng(61)|weapon_length(40),imodbits_shield ],
#["nomad_shield", "Nomad Shield", [("shield_wood_b",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 12 , weight(2)|hit_points(260)|body_armor(6)|spd_rtng(110)|weapon_length(30),imodbits_shield ],
["plate_covered_round_shield", "Plate_Covered_Round_Shield", [("shield_round_e",0)], 0, itcf_carry_round_shield, 140 , weight(4)|hit_points(330)|body_armor(16)|spd_rtng(90)|weapon_length(40),imodbits_shield ],
["leather_covered_round_shield", "Leather_Covered_Round_Shield", [("shield_round_d",0)], itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 80 , weight(2.5)|hit_points(310)|body_armor(8)|spd_rtng(96)|weapon_length(40),imodbits_shield ],
["hide_covered_round_shield", "Hide_Covered_Round_Shield", [("shield_round_f",0)], itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 40 , weight(2)|hit_points(260)|body_armor(3)|spd_rtng(100)|weapon_length(40),imodbits_shield ],
["shield_heater_c", "Heater Shield", [("shield_heater_c",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 277 , weight(3.5)|hit_points(410)|body_armor(2)|spd_rtng(80)|weapon_length(50),imodbits_shield ],
#["shield_heater_d", "Heater Shield", [("shield_heater_d",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 477 , weight(3.5)|hit_points(710)|body_armor(4)|spd_rtng(80)|weapon_length(60),imodbits_shield ],
#["shield_kite_g", "Kite Shield g", [("shield_kite_g",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
#["shield_kite_h", "Kite Shield h", [("shield_kite_h",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
#["shield_kite_i", "Kite Shield i ", [("shield_kite_i",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
#["shield_kite_k", "Kite Shield k", [("shield_kite_k",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
["norman_shield_1", "Kite Shield", [("norman_shield_1",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
["norman_shield_2", "Kite Shield", [("norman_shield_2",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
["norman_shield_3", "Kite Shield", [("norman_shield_3",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
["norman_shield_4", "Kite Shield", [("norman_shield_4",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
["norman_shield_5", "Kite Shield", [("norman_shield_5",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
["norman_shield_6", "Kite Shield", [("norman_shield_6",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
["norman_shield_7", "Kite Shield", [("norman_shield_7",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
["norman_shield_8", "Kite Shield", [("norman_shield_8",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ],
["tab_shield_round_a", "Old Round Shield", [("tableau_shield_round_5",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 26 , weight(2.5)|hit_points(350)|body_armor(0)|spd_rtng(93)|weapon_length(50),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_5", ":agent_no", ":troop_no")])]],
["tab_shield_round_b", "Plain Round Shield", [("tableau_shield_round_3",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 65 , weight(3)|hit_points(460)|body_armor(2)|spd_rtng(90)|weapon_length(50),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_3", ":agent_no", ":troop_no")])]],
["tab_shield_round_c", "Round_Shield", [("tableau_shield_round_2",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 105 , weight(3.5)|hit_points(540)|body_armor(4)|spd_rtng(87)|weapon_length(50),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner","tableau_round_shield_2", ":agent_no", ":troop_no")])]],
["tab_shield_round_d", "Heavy Round_Shield", [("tableau_shield_round_1",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 210 , weight(4)|hit_points(600)|body_armor(6)|spd_rtng(84)|weapon_length(50),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_1", ":agent_no", ":troop_no")])]],
["tab_shield_round_e", "Huscarl's Round_Shield", [("tableau_shield_round_4",0)], itp_merchandise|itp_type_shield, itcf_carry_round_shield, 430 , weight(4.5)|hit_points(690)|body_armor(8)|spd_rtng(81)|weapon_length(50),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_4", ":agent_no", ":troop_no")])]],
["tab_shield_kite_a", "Old Kite Shield", [("tableau_shield_kite_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 33 , weight(2)|hit_points(285)|body_armor(0)|spd_rtng(96)|weapon_length(60),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_1", ":agent_no", ":troop_no")])]],
["tab_shield_kite_b", "Plain Kite Shield", [("tableau_shield_kite_3" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 70 , weight(2.5)|hit_points(365)|body_armor(2)|spd_rtng(93)|weapon_length(60),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_3", ":agent_no", ":troop_no")])]],
["tab_shield_kite_c", "Kite Shield", [("tableau_shield_kite_2" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 156 , weight(3)|hit_points(435)|body_armor(5)|spd_rtng(90)|weapon_length(60),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_2", ":agent_no", ":troop_no")])]],
["tab_shield_kite_d", "Heavy Kite Shield", [("tableau_shield_kite_2" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 320 , weight(3.5)|hit_points(515)|body_armor(8)|spd_rtng(87)|weapon_length(60),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_2", ":agent_no", ":troop_no")])]],
["tab_shield_kite_cav_a", "Horseman's Kite Shield", [("tableau_shield_kite_4" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 205 , weight(2)|hit_points(310)|body_armor(10)|spd_rtng(103)|weapon_length(40),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_4", ":agent_no", ":troop_no")])]],
["tab_shield_kite_cav_b", "Knightly Kite Shield", [("tableau_shield_kite_4" ,0)], itp_merchandise|itp_type_shield, itcf_carry_kite_shield, 360 , weight(2.5)|hit_points(370)|body_armor(16)|spd_rtng(100)|weapon_length(40),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_4", ":agent_no", ":troop_no")])]],
["tab_shield_heater_a", "Old Heater Shield", [("tableau_shield_heater_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 36 , weight(2)|hit_points(280)|body_armor(1)|spd_rtng(96)|weapon_length(60),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_1", ":agent_no", ":troop_no")])]],
["tab_shield_heater_b", "Plain Heater Shield", [("tableau_shield_heater_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 74 , weight(2.5)|hit_points(360)|body_armor(3)|spd_rtng(93)|weapon_length(60),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_1", ":agent_no", ":troop_no")])]],
["tab_shield_heater_c", "Heater Shield", [("tableau_shield_heater_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 160 , weight(3)|hit_points(430)|body_armor(6)|spd_rtng(90)|weapon_length(60),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_1", ":agent_no", ":troop_no")])]],
["tab_shield_heater_d", "Heavy Heater Shield", [("tableau_shield_heater_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 332 , weight(3.5)|hit_points(510)|body_armor(9)|spd_rtng(87)|weapon_length(60),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_1", ":agent_no", ":troop_no")])]],
["tab_shield_heater_cav_a", "Horseman's Heater Shield", [("tableau_shield_heater_2" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 229 , weight(2)|hit_points(300)|body_armor(12)|spd_rtng(103)|weapon_length(40),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_2", ":agent_no", ":troop_no")])]],
["tab_shield_heater_cav_b", "Knightly Heater Shield", [("tableau_shield_heater_2" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 390 , weight(2.5)|hit_points(360)|body_armor(18)|spd_rtng(100)|weapon_length(40),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_2", ":agent_no", ":troop_no")])]],
["tab_shield_pavise_a", "Old Board Shield", [("tableau_shield_pavise_2" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield, 60 , weight(3.5)|hit_points(510)|body_armor(0)|spd_rtng(89)|weapon_length(84),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_2", ":agent_no", ":troop_no")])]],
["tab_shield_pavise_b", "Plain Board Shield", [("tableau_shield_pavise_2" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield, 114 , weight(4)|hit_points(640)|body_armor(1)|spd_rtng(85)|weapon_length(84),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_2", ":agent_no", ":troop_no")])]],
["tab_shield_pavise_c", "Board Shield", [("tableau_shield_pavise_1" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield, 210 , weight(4.5)|hit_points(760)|body_armor(2)|spd_rtng(81)|weapon_length(84),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_1", ":agent_no", ":troop_no")])]],
["tab_shield_pavise_d", "Heavy Board Shield", [("tableau_shield_pavise_1" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield, 370 , weight(5)|hit_points(980)|body_armor(3)|spd_rtng(78)|weapon_length(84),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_1", ":agent_no", ":troop_no")])]],
["tab_shield_small_round_a", "Plain Cavalry Shield", [("tableau_shield_small_round_3",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 96 , weight(2)|hit_points(310)|body_armor(3)|spd_rtng(105)|weapon_length(40),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_small_round_shield_3", ":agent_no", ":troop_no")])]],
["tab_shield_small_round_b", "Round Cavalry Shield", [("tableau_shield_small_round_1",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 195 , weight(2.5)|hit_points(370)|body_armor(9)|spd_rtng(103)|weapon_length(40),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_small_round_shield_1", ":agent_no", ":troop_no")])]],
["tab_shield_small_round_c", "Elite Cavalry Shield", [("tableau_shield_small_round_2",0)], itp_merchandise|itp_type_shield, itcf_carry_round_shield, 370 , weight(3)|hit_points(420)|body_armor(14)|spd_rtng(100)|weapon_length(40),imodbits_shield,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_small_round_shield_2", ":agent_no", ":troop_no")])]],
#RANGED
["jarid", "Jarid", [("jarid_new",0),("jarid_quiver", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary|itp_bonus_against_shield ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 209 , weight(4)|difficulty(2)|spd_rtng(89) | shoot_speed(27) | thrust_damage(33 , pierce)|max_ammo(7)|weapon_length(65),imodbits_thrown ],
["javelin", "Javelin", [("javelin",0),("javelins_quiver", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary|itp_bonus_against_shield ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 75 , weight(5)|difficulty(1)|spd_rtng(91) | shoot_speed(28) | thrust_damage(28 , pierce)|max_ammo(7)|weapon_length(75),imodbits_thrown ],
["stones", "Stones", [("throwing_stone",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_stone, 1 , weight(4)|difficulty(0)|spd_rtng(97) | shoot_speed(30) | thrust_damage(11 , blunt)|max_ammo(18)|weapon_length(8),imodbit_large_bag ],
["throwing_knives", "Throwing Knives", [("throwing_knife",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_knife, 76 , weight(3.5)|difficulty(0)|spd_rtng(121) | shoot_speed(25) | thrust_damage(19 , cut)|max_ammo(15)|weapon_length(0),imodbits_thrown ],
["throwing_daggers", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_knife, 193 , weight(3.5)|difficulty(0)|spd_rtng(110) | shoot_speed(24) | thrust_damage(25 , cut)|max_ammo(14)|weapon_length(0),imodbits_thrown ],
["throwing_axes", "Throwing Axes", [("francisca",0)], itp_type_thrown |itp_merchandise|itp_primary|itp_bonus_against_shield,itcf_throw_axe,241, weight(5)|difficulty(1)|spd_rtng(99) | shoot_speed(20) | thrust_damage(38,cut)|max_ammo(7)|weapon_length(53),imodbits_thrown ],
["hunting_bow", "Hunting Bow", [("hunting_bow",0),("hunting_bow_carry",ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed,itcf_shoot_bow|itcf_carry_bow_back, 17 , weight(1)|difficulty(0)|spd_rtng(100) | shoot_speed(48) | thrust_damage(15 , pierce),imodbits_bow ],
["short_bow", "Short Bow", [("short_bow",0),("short_bow_carry",ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bow_back, 58 , weight(1)|difficulty(1)|spd_rtng(98) | shoot_speed(52) | thrust_damage(18 , pierce ),imodbits_bow ],
["nomad_bow", "Nomad Bow", [("nomad_bow",0),("nomad_bow_case", ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bowcase_left|itcf_show_holster_when_drawn, 164 , weight(1.25)|difficulty(2)|spd_rtng(96) | shoot_speed(53) | thrust_damage(20 , pierce),imodbits_bow ],
["long_bow", "Long Bow", [("long_bow",0),("long_bow_carry",ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bow_back, 145 , weight(1.75)|difficulty(3)|spd_rtng(82) | shoot_speed(54) | thrust_damage(22 , pierce),imodbits_bow ],
["khergit_bow", "Khergit Bow", [("khergit_bow",0),("khergit_bow_case", ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed,itcf_shoot_bow|itcf_carry_bowcase_left|itcf_show_holster_when_drawn, 269 , weight(1.25)|difficulty(3)|spd_rtng(95) | shoot_speed(56) | thrust_damage(21 ,pierce),imodbits_bow ],
["strong_bow", "Strong Bow", [("strong_bow",0),("strong_bow_case", ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bowcase_left|itcf_show_holster_when_drawn, 437 , weight(1.25)|difficulty(3)|spd_rtng(94) | shoot_speed(57) | thrust_damage(23 ,pierce),imodbit_cracked | imodbit_bent | imodbit_masterwork ],
["war_bow", "War Bow", [("war_bow",0),("war_bow_carry",ixmesh_carry)],itp_type_bow|itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bow_back, 728 , weight(1.5)|difficulty(4)|spd_rtng(93) | shoot_speed(58) | thrust_damage(25 ,pierce),imodbits_bow ],
["hunting_crossbow", "Hunting Crossbow", [("crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 22 , weight(2.25)|difficulty(0)|spd_rtng(47) | shoot_speed(50) | thrust_damage(28 , pierce)|max_ammo(1),imodbits_crossbow ],
["light_crossbow", "Light Crossbow", [("light_crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 67 , weight(2.5)|difficulty(8)|spd_rtng(45) | shoot_speed(59) | thrust_damage(34 , pierce)|max_ammo(1),imodbits_crossbow ],
["crossbow", "Crossbow", [("crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_use_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 182 , weight(3)|difficulty(8)|spd_rtng(43) | shoot_speed(68) | thrust_damage(38,pierce)|max_ammo(1),imodbits_crossbow ],
["heavy_crossbow", "Heavy Crossbow", [("heavy_crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_use_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 349 , weight(3.5)|difficulty(9)|spd_rtng(41) | shoot_speed(72) | thrust_damage(46 ,pierce)|max_ammo(1),imodbits_crossbow ],
["sniper_crossbow", "Siege Crossbow", [("heavy_crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_use_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 683 , weight(3.75)|difficulty(10)|spd_rtng(37) | shoot_speed(74) | thrust_damage(49 ,pierce)|max_ammo(1),imodbits_crossbow ],
["flintlock_pistol", "Flintlock Pistol", [("flintlock_pistol",0)], itp_type_pistol |itp_merchandise|itp_primary ,itcf_shoot_pistol|itcf_reload_pistol, 230 , weight(1.5)|difficulty(0)|spd_rtng(38) | shoot_speed(160) | thrust_damage(41 ,pierce)|max_ammo(1)|accuracy(65),imodbits_none,
[(ti_on_weapon_attack, [(play_sound,"snd_pistol_shot"),(position_move_x, pos1,27),(position_move_y, pos1,36),(particle_system_burst, "psys_pistol_smoke", pos1, 15)])]],
["torch", "Torch", [("club",0)], itp_type_bow|itp_primary, itc_scimitar, 11 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(11 , blunt) | thrust_damage(0 , pierce),imodbits_none,
[(ti_on_init_item, [(set_position_delta,0,60,0),(particle_system_add_new, "psys_torch_fire"),(particle_system_add_new, "psys_torch_smoke"),(set_current_color,150, 130, 70),(add_point_light, 10, 30),
])]],
##["short_sword", "Short Sword",
## [("sword_norman",0),("sword_norman_scabbard", ixmesh_carry),("sword_norman_rusty",imodbit_rusty),("sword_norman_rusty_scabbard", ixmesh_carry|imodbit_rusty)],
## itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 183 , weight(1.25)|difficulty(0)|spd_rtng(103) | weapon_length(75)|swing_damage(25 , cut) | thrust_damage(19 , pierce),imodbits_sword ],
["strange_armor", "Strange Armor", [("samurai_armor",0)], itp_type_body_armor |itp_covers_legs ,0, 1259 , weight(18)|abundance(100)|head_armor(0)|body_armor(38)|leg_armor(19)|difficulty(7) ,imodbits_armor ],
["strange_boots", "Strange Boots", [("samurai_boots",0)], itp_type_foot_armor | itp_attach_armature,0, 465 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(21)|difficulty(0) ,imodbits_cloth ],
["strange_helmet", "Strange Helmet", [("samurai_helmet",0)], itp_type_head_armor ,0, 824 , weight(2)|abundance(100)|head_armor(44)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["strange_sword", "Strange Sword", [("katana",0),("katana_scabbard",ixmesh_carry)], itp_type_two_handed_wpn| itp_primary, itc_bastardsword|itcf_carry_katana|itcf_show_holster_when_drawn, 679 , weight(2.0)|difficulty(9)|spd_rtng(108) | weapon_length(95)|swing_damage(32 , cut) | thrust_damage(18 , pierce),imodbits_sword ],
["strange_great_sword", "Strange Great Sword", [("no_dachi",0),("no_dachi_scabbard",ixmesh_carry)], itp_type_two_handed_wpn|itp_two_handed|itp_primary, itc_nodachi|itcf_carry_sword_back|itcf_show_holster_when_drawn, 920 , weight(3.5)|difficulty(11)|spd_rtng(92) | weapon_length(125)|swing_damage(38 , cut) | thrust_damage(0 , pierce),imodbits_axe ],
["strange_short_sword", "Strange Short Sword", [("wakizashi",0),("wakizashi_scabbard",ixmesh_carry)], itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_wakizashi|itcf_show_holster_when_drawn, 321 , weight(1.25)|difficulty(0)|spd_rtng(108) | weapon_length(65)|swing_damage(25 , cut) | thrust_damage(19 , pierce),imodbits_sword ],
["court_dress", "Court Dress", [("court_dress",0)], itp_type_body_armor|itp_covers_legs|itp_civilian ,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(4)|difficulty(0) ,imodbits_cloth ],
["rich_outfit", "Rich Outfit", [("merchant_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian ,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(4)|difficulty(0) ,imodbits_cloth ],
["khergit_guard_armor", "Khergit Guard Armor", [("lamellar_armor_a",0)], itp_type_body_armor|itp_covers_legs ,0, 348 , weight(14)|abundance(100)|head_armor(0)|body_armor(34)|leg_armor(8)|difficulty(0) ,imodbits_armor ],
#["leather_steppe_cap_c", "Leather Steppe Cap", [("leather_steppe_cap_c",0)], itp_type_head_armor ,0, 51 , weight(2)|abundance(100)|head_armor(18)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["felt_steppe_cap", "Felt Steppe Cap", [("felt_steppe_cap",0)], itp_type_head_armor ,0, 237 , weight(2)|abundance(100)|head_armor(16)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["khergit_war_helmet", "Khergit War Helmet", [("khergit_war_helmet",0)], itp_type_head_armor ,0, 322 , weight(2)|abundance(100)|head_armor(31)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["khergit_helmet", "Khergit Helmet", [("khergit_guard_helmet",0)], itp_type_head_armor ,0, 361 , weight(2)|abundance(100)|head_armor(33)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
#["khergit_sword", "Khergit Sword", [("khergit_sword",0),("khergit_sword_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 183 , weight(1.25)|difficulty(0)|spd_rtng(100) | weapon_length(97)|swing_damage(23 , cut) | thrust_damage(14 , pierce),imodbits_sword ],
["khergit_guard_boots", "Khergit Guard Boots", [("lamellar_boots_a",0)], itp_type_foot_armor | itp_attach_armature,0, 254 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(20)|difficulty(0) ,imodbits_cloth ],
["khergit_guard_helmet", "Khergit Guard Helmet", [("lamellar_helmet_a",0)], itp_type_head_armor ,0, 433 , weight(2)|abundance(100)|head_armor(36)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["khergit_cavalry_helmet", "Khergit Cavalry Helmet", [("lamellar_helmet_b",0)], itp_type_head_armor ,0, 433 , weight(2)|abundance(100)|head_armor(36)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["black_hood", "Black Hood", [("hood_black",0)], itp_type_head_armor|itp_merchandise ,0, 193 , weight(2)|abundance(100)|head_armor(18)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["light_leather", "Light Leather", [("light_leather",0)], itp_type_body_armor|itp_covers_legs|itp_merchandise ,0, 352 , weight(5)|abundance(100)|head_armor(0)|body_armor(26)|leg_armor(7)|difficulty(0) ,imodbits_armor ],
["light_leather_boots", "Light Leather Boots", [("light_leather_boots",0)], itp_type_foot_armor |itp_merchandise| itp_attach_armature,0, 91 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(15)|difficulty(0) ,imodbits_cloth ],
["mail_and_plate", "Mail and Plate", [("mail_and_plate",0)], itp_type_body_armor|itp_covers_legs ,0, 593 , weight(16)|abundance(100)|head_armor(0)|body_armor(34)|leg_armor(12)|difficulty(0) ,imodbits_armor ],
["light_mail_and_plate", "Light Mail and Plate", [("light_mail_and_plate",0)], itp_type_body_armor|itp_covers_legs ,0, 532 , weight(10)|abundance(100)|head_armor(0)|body_armor(32)|leg_armor(12)|difficulty(0) ,imodbits_armor ],
["byzantion_helmet_a", "Byzantion Helmet", [("byzantion_helmet_a",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["magyar_helmet_a", "Magyar Helmet", [("magyar_helmet_a",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["rus_helmet_a", "Rus Helmet", [("rus_helmet_a",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["sipahi_helmet_a", "Sipahi Helmet", [("sipahi_helmet_a",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["shahi", "Shahi", [("shahi",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["rabati", "Rabati", [("rabati",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
]
| Python |
import string
import types
from module_info import *
from module_mission_templates import *
from process_common import *
from process_operations import *
mission_template_name_pos = 0
mission_template_flags_pos = 1
mission_template_types_pos = 2
mission_template_desc_pos = 3
mission_template_groups_pos =4
mission_template_triggers_pos = 5
def save_triggers(file,template_name,triggers,variable_list,variable_uses,tag_uses,quick_strings):
file.write("%d\n"%len(triggers))
for i in xrange(len(triggers)):
trigger = triggers[i]
file.write("%f %f %f "%(trigger[trigger_check_pos],trigger[trigger_delay_pos],trigger[trigger_rearm_pos]))
save_statement_block(file, 0, 1, trigger[trigger_conditions_pos] , variable_list,variable_uses,tag_uses,quick_strings)
save_statement_block(file, 0, 1, trigger[trigger_consequences_pos], variable_list,variable_uses,tag_uses,quick_strings)
file.write("\n")
file.write("\n")
def save_mission_template_group(file,entry):
if (len(entry[5]) > 8):
print "ERROR: Too many item_overrides!"
error()
file.write("%d %d %d %d %d %d "%(entry[0],entry[1],entry[2],entry[3],entry[4], len(entry[5])))
for item_override in entry[5]:
add_tag_use(tag_uses,tag_item,item_override)
file.write("%d "%(item_override))
file.write("\n")
def save_mission_templates(variables,variable_uses,tag_uses,quick_strings):
file = open(export_dir + "mission_templates.txt","w")
file.write("missionsfile version 1\n")
file.write(" %d\n"%(len(mission_templates)))
for mission_template in mission_templates:
file.write("mst_%s %s %d "%(convert_to_identifier(mission_template[mission_template_name_pos]),convert_to_identifier(mission_template[mission_template_name_pos]),mission_template[mission_template_flags_pos]))
file.write(" %d\n"%(mission_template[mission_template_types_pos]))
file.write("%s \n"%(string.replace(mission_template[mission_template_desc_pos]," ","_")))
file.write("\n%d "%len(mission_template[mission_template_groups_pos]))
for group in mission_template[mission_template_groups_pos]:
save_mission_template_group(file,group)
save_triggers(file,convert_to_identifier(mission_template[mission_template_name_pos]), mission_template[mission_template_triggers_pos],variables,variable_uses,tag_uses,quick_strings)
file.write("\n")
file.close()
def save_python_header():
file = open("./ID_mission_templates.py","w")
for i_mission_template in xrange(len(mission_templates)):
file.write("mst_%s = %d\n"%(mission_templates[i_mission_template][0],i_mission_template))
file.close()
print "Exporting mission_template data..."
save_python_header()
variable_uses = []
variables = load_variables(export_dir, variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_mission_templates(variables,variable_uses,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir,tag_uses)
save_quick_strings(export_dir,quick_strings)
#print "Finished."
"""
(
"defense_1",mtf_battle_mode,stand_fast,
"You wait, your weapons ready, your senses alert. Some of your companions start to sing an old song, trying to forget their fear. You smile and let your thoughts wander away for a second. Then the lookout's cry shatters the melancholy: 'Enemies! They are coming'",
[
(2,mtef_leader_only,0,group(1),1),
(2,mtef_no_leader,0,group(1),3),
(0,mtef_no_leader,0,group(1),0),
(4,mtef_enemy_party|mtef_reverse_order,0,group(2)|aif_start_alarmed,5)],
[],
[
(ti_val(0), ti_val(0), ti_once, [[mission_cookie_eq,0,0],[store_mission_timer_a,1],[ge,reg(1),10],[store_enemy_count,2],[lt,reg(2),3]], [[add_reinforcements_to_entry,3,3],[reset_mission_timer_a],[increment_mission_cookie,0]]),
(ti_val(0), ti_val(0), ti_once, [[mission_cookie_eq,0,1],[store_mission_timer_a,1],[ge,reg(1),10],[store_enemy_count,2],[lt,reg(2),3]], [[add_reinforcements_to_entry,3,3],[reset_mission_timer_a],[increment_mission_cookie,0]]),
(ti_val(0), ti_val(0), ti_once, [[mission_cookie_eq,5,0],[store_mission_timer_b,1],[ge,reg(1),10],[store_friend_count,2],[lt,reg(2),3]], [[add_reinforcements_to_entry,2,2],[reset_mission_timer_b],[increment_mission_cookie,5]]),
(ti_val(0), ti_val(0), ti_once, [[mission_cookie_eq,5,1],[store_mission_timer_b,1],[ge,reg(1),10],[store_friend_count,2],[lt,reg(2),3]], [[add_reinforcements_to_entry,2,2],[reset_mission_timer_b],[increment_mission_cookie,5]]),
(ti_val(0), ti_val(0), ti_once, [[all_enemies_defeated,2]], [[set_mission_result,1] ,[finish_mission,1]]),
(ti_val(0), ti_val(0), ti_once, [[main_hero_fallen]], [[set_mission_result,-1],[finish_mission,1]]),
],
),
(
"chase_1",mtf_battle_mode,chase,
"You close up on the enemy thinking that this will be an easy victory. But as you come within shooting range, enemy fighters stop fleeing and turn to meet you. Perhaps they are experienced enough to know that they can't outrun you. Or perhaps their warrior pride triumphed over their fear. Whatever it is, these men now seem to be willing to put up a fight and your job will not be easy",
[(0,mtef_leader_only,0,group(1),1),(0,mtef_regulars_only,0,group(1),1),(1,mtef_regulars_only|mtef_enemy_party,0,aisb_hit_run,1),(2,mtef_regulars_only|mtef_enemy_party,0,0,2),(3,mtef_regulars_only|mtef_enemy_party,0,0,1),(4,mtef_regulars_only|mtef_enemy_party,0,group(2),2)],
[],
[
(ti_val(0), ti_val(0), ti_once, [[all_enemies_defeated,2]], [[set_mission_result,1] ,[finish_mission,1]]),
(ti_val(0), ti_val(0), ti_once, [[main_hero_fallen]], [[set_mission_result,-1],[finish_mission,1]]),
],
),
(
"slip_siege_fight_1",mtf_battle_mode,retreat_fight,
"You lead your retreating party through a back road which, oddly enough, seems to be completely unguarded.\
You decide to proceed with extreme caution. Very soon, you spot a movement in the bushes ahead.\
Not taking any chances, you send an arrow into the bushes. The arrow sinks behind leaves and immediately produces\
a sharp cry followed by some heavy cursing. Within seconds, a score of armored warriors rush out of hiding places.",
[(2,mtef_leader_only,0,group(1),1),(2,mtef_no_leader,0,group(1)|aif_start_alarmed,3),(3,mtef_enemy_party|mtef_reverse_order,0,aif_start_alarmed,6)],
# [(0,mtef_leader_only,0,group(1),1),(0,mtef_regulars_only,0,group(1),2|mtnf_const|mtnf_rand),(3,mtef_regulars_only|mtef_enemy_party,0,aif_start_alarmed,2|mtnf_const),(4,mtef_regulars_only|mtef_enemy_party,0,aif_start_alarmed,2|mtnf_const|mtnf_rand)],
[],
[
(ti_val(0), ti_val(0), ti_once, [[all_enemies_defeated,3]], [[set_mission_result,1] ,[finish_mission,1]]),
(ti_val(0), ti_val(0), ti_once, [[main_hero_fallen]], [[set_mission_result,-1],[finish_mission,1]]),
],
),
"""
| Python |
from module_info import *
import os
print "Initializing..."
try:
os.remove(export_dir + 'tag_uses.txt')
except:
a = []
try:
os.remove(export_dir + 'quick_strings.txt')
except:
a = []
| Python |
rt_water = 0
rt_mountain = 1
rt_steppe = 2
rt_plain = 3
rt_snow = 4
rt_desert = 5
rt_bridge = 7
rt_river = 8
rt_mountain_forest = 9
rt_steppe_forest = 10
rt_forest = 11
rt_snow_forest = 12
rt_desert_forest = 13
| Python |
import string
import types
from module_info import *
from module_tableau_materials import *
from process_common import *
from process_operations import *
def save_tableau_materials(variable_list,variable_uses,tag_uses,quick_strings):
ofile = open(export_dir + "tableau_materials.txt","w")
ofile.write("%d\n"%(len(tableaus)))
for tableau in tableaus:
ofile.write("tab_%s %d %s %d %d %d %d %d %d"%(tableau[0], tableau[1], tableau[2], tableau[3], tableau[4], tableau[5], tableau[6], tableau[7], tableau[8]))
save_statement_block(ofile, 0, 1, tableau[9], variable_list, variable_uses, tag_uses, quick_strings)
ofile.write("\n")
ofile.close()
def save_python_header():
ofile = open("./ID_tableau_materials.py","w")
for i_tableau in xrange(len(tableaus)):
ofile.write("tableau_%s = %d\n"%(tableaus[i_tableau][0],i_tableau))
ofile.close()
print "Exporting tableau materials data..."
save_python_header()
variable_uses = []
variables = load_variables(export_dir, variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_tableau_materials(variables,variable_uses,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir, tag_uses)
save_quick_strings(export_dir,quick_strings)
| Python |
tableau_game_character_sheet = 0
tableau_game_inventory_window = 1
tableau_game_profile_window = 2
tableau_game_party_window = 3
tableau_game_troop_label_banner = 4
tableau_round_shield_1 = 5
tableau_round_shield_2 = 6
tableau_round_shield_3 = 7
tableau_round_shield_4 = 8
tableau_round_shield_5 = 9
tableau_small_round_shield_1 = 10
tableau_small_round_shield_2 = 11
tableau_small_round_shield_3 = 12
tableau_kite_shield_1 = 13
tableau_kite_shield_2 = 14
tableau_kite_shield_3 = 15
tableau_kite_shield_4 = 16
tableau_heater_shield_1 = 17
tableau_heater_shield_2 = 18
tableau_pavise_shield_1 = 19
tableau_pavise_shield_2 = 20
tableau_heraldic_armor_a = 21
tableau_heraldic_armor_b = 22
tableau_heraldic_armor_c = 23
tableau_heraldic_armor_d = 24
tableau_troop_note_alpha_mask = 25
tableau_troop_note_color = 26
tableau_troop_character_alpha_mask = 27
tableau_troop_character_color = 28
tableau_troop_inventory_alpha_mask = 29
tableau_troop_inventory_color = 30
tableau_troop_profile_alpha_mask = 31
tableau_troop_profile_color = 32
tableau_troop_party_alpha_mask = 33
tableau_troop_party_color = 34
tableau_troop_note_mesh = 35
tableau_center_note_mesh = 36
tableau_faction_note_mesh_for_menu = 37
tableau_faction_note_mesh = 38
tableau_faction_note_mesh_banner = 39
tableau_2_factions_mesh = 40
tableau_color_picker = 41
tableau_custom_banner_square_no_mesh = 42
tableau_custom_banner_default = 43
tableau_custom_banner_tall = 44
tableau_custom_banner_square = 45
tableau_custom_banner_short = 46
tableau_background_selection = 47
tableau_positioning_selection = 48
tableau_retired_troop_alpha_mask = 49
tableau_retired_troop_color = 50
tableau_retirement_troop = 51
| Python |
reserved_variables = []
| Python |
import string
from process_common import *
from module_info import *
from module_skins import *
import string
# WARNING: The following should be the same as the number in face_generator.h
num_voice_types = 2
#####################
def replace_spaces(s0):
return string.replace(s0," ","_")
def write_face_tex(ofile,tex_set):
ofile.write(" %d "%len(tex_set))
for tex in tex_set:
color = tex[1]
hair_mats = tex[2]
hair_colors = []
if len(tex) > 3:
hair_colors = tex[3]
ofile.write(" %s %d %d %d "%(tex[0],color, len(hair_mats), len(hair_colors)))
for hair_mat in hair_mats:
ofile.write(" %s "%(replace_spaces(hair_mat)))
for hair_color in hair_colors:
ofile.write(" %d "%(hair_color))
ofile.write("\n")
def write_textures(ofile,tex_set):
ofile.write(" %d "%len(tex_set))
for tex in tex_set:
ofile.write(" %s "%tex)
ofile.write("\n")
def write_voices(ofile, voices):
ofile.write(" %d "%(len(voices)))
for voice_rec in voices:
ofile.write(" %d %s "%(voice_rec[0],voice_rec[1]))
ofile.write("\n")
def export_skins(skins):
ofile = open(export_dir + "skins.txt","w")
ofile.write("skins_file version 1\n")
if len(skins) > 16:
skins = skins[0:15]
ofile.write("%d\n"%len(skins))
for skin in skins:
skin_name = skin[0]
skin_flags = skin[1]
body_name = skin[2]
calf_name = skin[3]
hand_name = skin[4]
head_mesh = skin[5]
face_keys = skin[6]
hair_meshes = skin[7]
beard_meshes = skin[8]
hair_textures = skin[9]
beard_textures = skin[10]
face_textures = skin[11]
voices = skin[12]
skeleton_name = skin[13]
scale = skin[14]
blood_particles_1 = 0
blood_particles_2 = 0
constraints = []
if len(skin) > 15:
blood_particles_1 = skin[15]
if len(skin) > 16:
blood_particles_2 = skin[16]
if len(skin) > 17:
constraints = skin[17]
ofile.write("%s %d\n %s %s %s\n"%(skin_name, skin_flags, body_name, calf_name, hand_name))
ofile.write(" %s %d "%(head_mesh,len(face_keys)))
for face_key in face_keys:
ofile.write("skinkey_%s %d %d %f %f %s "%(convert_to_identifier(face_key[4]), face_key[0],face_key[1],face_key[2],face_key[3],replace_spaces(face_key[4])))
ofile.write("\n%d\n"%len(hair_meshes))
for mesh_name in hair_meshes:
ofile.write(" %s "%mesh_name)
ofile.write("\n %d\n"%len(beard_meshes))
for bmn in beard_meshes:
ofile.write(" %s\n"%bmn)
ofile.write("\n")
write_textures(ofile,hair_textures)
write_textures(ofile,beard_textures)
write_face_tex(ofile,face_textures)
write_voices(ofile, voices)
ofile.write(" %s %f "%(skeleton_name, scale))
ofile.write("\n%d %d\n"%(blood_particles_1, blood_particles_2))
ofile.write("%d\n"%(len(constraints)))
for constraint in constraints:
ofile.write("\n%f %d %d "%(constraint[0], constraint[1], (len(constraint) - 2)))
for i_pair in xrange(len(constraint)):
if i_pair > 1:
ofile.write(" %f %d"%(constraint[i_pair][0], constraint[i_pair][1]))
ofile.write("\n")
ofile.close()
print "Exporting skins..."
export_skins(skins)
| Python |
import string
from module_info import *
from module_scripts import *
from process_common import *
from process_operations import *
def save_scripts(variable_list,variable_uses,scripts,tag_uses,quick_strings):
file = open(export_dir + "scripts.txt","w")
file.write("scriptsfile version 1\n")
file.write("%d\n"%len(scripts))
temp_list = []
list_type = type(temp_list)
for i_script in xrange(len(scripts)):
func = scripts[i_script]
if (type(func[1]) == list_type):
file.write("%s -1\n"%(convert_to_identifier(func[0])))
save_statement_block(file,convert_to_identifier(func[0]), 0,func[1], variable_list,variable_uses,tag_uses,quick_strings)
else:
file.write("%s %f\n"%(convert_to_identifier(func[0]), func[1]))
save_statement_block(file,convert_to_identifier(func[0]), 0,func[2], variable_list,variable_uses,tag_uses,quick_strings)
file.write("\n")
file.close()
def save_python_header():
file = open("./ID_scripts.py","w")
for i_script in xrange(len(scripts)):
file.write("script_%s = %d\n"%(convert_to_identifier(scripts[i_script][0]),i_script))
file.write("\n\n")
file.close()
print "Exporting scripts..."
save_python_header()
variable_uses = []
variables = load_variables(export_dir, variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_scripts(variables,variable_uses,scripts,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir, tag_uses)
save_quick_strings(export_dir,quick_strings)
| Python |
spr_invalid_object = 0
spr_inventory = 1
spr_empty = 2
spr_chest_a = 3
spr_container_small_chest = 4
spr_container_chest_b = 5
spr_container_chest_c = 6
spr_player_chest = 7
spr_locked_player_chest = 8
spr_light_sun = 9
spr_light = 10
spr_light_red = 11
spr_light_night = 12
spr_torch = 13
spr_torch_night = 14
spr_barrier_20m = 15
spr_barrier_16m = 16
spr_barrier_8m = 17
spr_barrier_4m = 18
spr_barrier_2m = 19
spr_exit_4m = 20
spr_exit_8m = 21
spr_exit_16m = 22
spr_ai_limiter_2m = 23
spr_ai_limiter_4m = 24
spr_ai_limiter_8m = 25
spr_ai_limiter_16m = 26
spr_Shield = 27
spr_shelves = 28
spr_table_tavern = 29
spr_table_castle_a = 30
spr_chair_castle_a = 31
spr_pillow_a = 32
spr_pillow_b = 33
spr_pillow_c = 34
spr_interior_castle_g_square_keep_b = 35
spr_carpet_with_pillows_a = 36
spr_carpet_with_pillows_b = 37
spr_table_round_a = 38
spr_table_round_b = 39
spr_fireplace_b = 40
spr_fireplace_c = 41
spr_sofa_a = 42
spr_sofa_b = 43
spr_ewer_a = 44
spr_end_table_a = 45
spr_fake_houses_steppe_a = 46
spr_fake_houses_steppe_b = 47
spr_fake_houses_steppe_c = 48
spr_boat_destroy = 49
spr_destroy_house_a = 50
spr_destroy_house_b = 51
spr_destroy_house_c = 52
spr_destroy_heap = 53
spr_destroy_castle_a = 54
spr_destroy_castle_b = 55
spr_destroy_castle_c = 56
spr_destroy_castle_d = 57
spr_destroy_windmill = 58
spr_destroy_tree_a = 59
spr_destroy_tree_b = 60
spr_destroy_bridge_a = 61
spr_destroy_bridge_b = 62
spr_catapult = 63
spr_catapult_destructible = 64
spr_broom = 65
spr_garlic = 66
spr_garlic_b = 67
spr_destroy_a = 68
spr_destroy_b = 69
spr_bridge_wooden = 70
spr_bridge_wooden_snowy = 71
spr_grave_a = 72
spr_village_house_e = 73
spr_village_house_f = 74
spr_village_house_g = 75
spr_village_house_h = 76
spr_village_house_i = 77
spr_village_house_j = 78
spr_village_wall_a = 79
spr_village_wall_b = 80
spr_village_snowy_house_a = 81
spr_village_snowy_house_b = 82
spr_village_snowy_house_c = 83
spr_village_snowy_house_d = 84
spr_village_snowy_house_e = 85
spr_village_snowy_house_f = 86
spr_town_house_steppe_a = 87
spr_town_house_steppe_b = 88
spr_town_house_steppe_c = 89
spr_town_house_steppe_d = 90
spr_town_house_steppe_e = 91
spr_town_house_steppe_f = 92
spr_town_house_steppe_g = 93
spr_town_house_steppe_h = 94
spr_town_house_steppe_i = 95
spr_carpet_a = 96
spr_carpet_b = 97
spr_carpet_c = 98
spr_carpet_d = 99
spr_carpet_e = 100
spr_carpet_f = 101
spr_awning_a = 102
spr_awning_b = 103
spr_awning_c = 104
spr_awning_long = 105
spr_awning_long_b = 106
spr_awning_d = 107
spr_ship = 108
spr_ship_b = 109
spr_ship_c = 110
spr_ship_d = 111
spr_snowy_barrel_a = 112
spr_snowy_fence = 113
spr_snowy_wood_heap = 114
spr_village_snowy_stable_a = 115
spr_village_straw_house_a = 116
spr_village_stable_a = 117
spr_village_shed_a = 118
spr_village_shed_b = 119
spr_dungeon_door_cell_a = 120
spr_dungeon_door_cell_b = 121
spr_dungeon_door_entry_a = 122
spr_dungeon_door_entry_b = 123
spr_dungeon_door_entry_c = 124
spr_dungeon_door_direction_a = 125
spr_dungeon_door_direction_b = 126
spr_dungeon_door_stairs_a = 127
spr_dungeon_door_stairs_b = 128
spr_dungeon_bed_a = 129
spr_dungeon_bed_b = 130
spr_torture_tool_a = 131
spr_torture_tool_b = 132
spr_torture_tool_c = 133
spr_skeleton_head = 134
spr_skeleton_bone = 135
spr_skeleton_a = 136
spr_dungeon_stairs_a = 137
spr_dungeon_stairs_b = 138
spr_dungeon_torture_room_a = 139
spr_dungeon_entry_a = 140
spr_dungeon_entry_b = 141
spr_dungeon_entry_c = 142
spr_dungeon_cell_a = 143
spr_dungeon_cell_b = 144
spr_dungeon_cell_c = 145
spr_dungeon_corridor_a = 146
spr_dungeon_corridor_b = 147
spr_dungeon_corridor_c = 148
spr_dungeon_corridor_d = 149
spr_dungeon_direction_a = 150
spr_dungeon_direction_b = 151
spr_dungeon_room_a = 152
spr_dungeon_tower_stairs_a = 153
spr_dungeon_tower_cell_a = 154
spr_tunnel_a = 155
spr_tunnel_salt = 156
spr_salt_a = 157
spr_door_destructible = 158
spr_tutorial_door_a = 159
spr_tutorial_door_b = 160
spr_tutorial_flag_yellow = 161
spr_tutorial_flag_red = 162
spr_tutorial_flag_blue = 163
spr_interior_prison_a = 164
spr_interior_prison_b = 165
spr_interior_prison_cell_a = 166
spr_interior_prison_d = 167
spr_arena_archery_target_a = 168
spr_archery_butt_a = 169
spr_archery_target_with_hit_a = 170
spr_dummy_a = 171
spr_band_a = 172
spr_arena_sign = 173
spr_castle_h_battlement_a = 174
spr_castle_h_battlement_b = 175
spr_castle_h_battlement_c = 176
spr_castle_h_battlement_a2 = 177
spr_castle_h_battlement_b2 = 178
spr_castle_h_corner_a = 179
spr_castle_h_corner_c = 180
spr_castle_h_stairs_a = 181
spr_castle_h_stairs_b = 182
spr_castle_h_gatehouse_a = 183
spr_castle_h_keep_a = 184
spr_castle_h_keep_b = 185
spr_castle_h_house_a = 186
spr_castle_h_house_b = 187
spr_castle_h_house_c = 188
spr_castle_h_battlement_barrier = 189
spr_full_keep_b = 190
spr_castle_f_keep_a = 191
spr_castle_f_battlement_a = 192
spr_castle_f_battlement_a_destroyed = 193
spr_castle_f_battlement_b = 194
spr_castle_f_battlement_c = 195
spr_castle_f_battlement_d = 196
spr_castle_f_battlement_e = 197
spr_castle_f_sally_port_elevation = 198
spr_castle_f_battlement_corner_a = 199
spr_castle_f_battlement_corner_b = 200
spr_castle_f_battlement_corner_c = 201
spr_castle_f_door_a = 202
spr_castle_f_doors_top_a = 203
spr_castle_f_sally_door_a = 204
spr_castle_f_stairs_a = 205
spr_castle_f_tower_a = 206
spr_castle_f_wall_stairs_a = 207
spr_castle_f_wall_stairs_b = 208
spr_castle_f_wall_way_a = 209
spr_castle_f_wall_way_b = 210
spr_castle_f_gatehouse_a = 211
spr_castle_g_battlement_a = 212
spr_castle_g_battlement_a1 = 213
spr_castle_g_battlement_c = 214
spr_castle_g_corner_a = 215
spr_castle_g_corner_c = 216
spr_castle_g_tower_a = 217
spr_castle_g_gate_house = 218
spr_castle_g_gate_house_door_a = 219
spr_castle_g_gate_house_door_b = 220
spr_castle_g_square_keep_a = 221
spr_castle_i_battlement_a = 222
spr_castle_i_battlement_a1 = 223
spr_castle_i_battlement_c = 224
spr_castle_i_corner_a = 225
spr_castle_i_corner_c = 226
spr_castle_i_tower_a = 227
spr_castle_i_gate_house = 228
spr_castle_i_gate_house_door_a = 229
spr_castle_i_gate_house_door_b = 230
spr_castle_i_square_keep_a = 231
spr_mosque_a = 232
spr_stone_minaret_a = 233
spr_stone_house_a = 234
spr_stone_house_b = 235
spr_stone_house_c = 236
spr_stone_house_d = 237
spr_stone_house_e = 238
spr_stone_house_f = 239
spr_banner_pole = 240
spr_custom_banner_01 = 241
spr_custom_banner_02 = 242
spr_banner_a = 243
spr_banner_b = 244
spr_banner_c = 245
spr_banner_d = 246
spr_banner_e = 247
spr_banner_f = 248
spr_banner_g = 249
spr_banner_h = 250
spr_banner_i = 251
spr_banner_j = 252
spr_banner_k = 253
spr_banner_l = 254
spr_banner_m = 255
spr_banner_n = 256
spr_banner_o = 257
spr_banner_p = 258
spr_banner_q = 259
spr_banner_r = 260
spr_banner_s = 261
spr_banner_t = 262
spr_banner_u = 263
spr_banner_ba = 264
spr_banner_bb = 265
spr_banner_bc = 266
spr_banner_bd = 267
spr_banner_be = 268
spr_banner_bf = 269
spr_banner_bg = 270
spr_banner_bh = 271
spr_banner_bi = 272
spr_banner_bj = 273
spr_banner_bk = 274
spr_banner_bl = 275
spr_banner_bm = 276
spr_banner_bn = 277
spr_banner_bo = 278
spr_banner_bp = 279
spr_banner_bq = 280
spr_banner_br = 281
spr_banner_bs = 282
spr_banner_bt = 283
spr_banner_bu = 284
spr_banner_ca = 285
spr_banner_cb = 286
spr_banner_cc = 287
spr_banner_cd = 288
spr_banner_ce = 289
spr_banner_cf = 290
spr_banner_cg = 291
spr_banner_ch = 292
spr_banner_ci = 293
spr_banner_cj = 294
spr_banner_ck = 295
spr_banner_cl = 296
spr_banner_cm = 297
spr_banner_cn = 298
spr_banner_co = 299
spr_banner_cp = 300
spr_banner_cq = 301
spr_banner_cr = 302
spr_banner_cs = 303
spr_banner_ct = 304
spr_banner_cu = 305
spr_banner_da = 306
spr_banner_db = 307
spr_banner_dc = 308
spr_banner_dd = 309
spr_banner_de = 310
spr_banner_df = 311
spr_banner_dg = 312
spr_banner_dh = 313
spr_banner_di = 314
spr_banner_dj = 315
spr_banner_dk = 316
spr_banner_dl = 317
spr_banner_dm = 318
spr_banner_dn = 319
spr_banner_do = 320
spr_banner_dp = 321
spr_banner_dq = 322
spr_banner_dr = 323
spr_banner_ds = 324
spr_banner_dt = 325
spr_banner_du = 326
spr_banner_ea = 327
spr_banner_eb = 328
spr_banner_ec = 329
spr_banner_ed = 330
spr_banner_ee = 331
spr_banner_ef = 332
spr_banner_eg = 333
spr_banner_eh = 334
spr_banner_ei = 335
spr_banner_ej = 336
spr_banner_ek = 337
spr_banner_el = 338
spr_banner_em = 339
spr_banner_en = 340
spr_banner_eo = 341
spr_banner_ep = 342
spr_banner_eq = 343
spr_banner_er = 344
spr_banner_es = 345
spr_banner_et = 346
spr_banner_eu = 347
spr_banner_f01 = 348
spr_banner_f02 = 349
spr_banner_f03 = 350
spr_banner_f04 = 351
spr_banner_f05 = 352
spr_banner_f06 = 353
spr_banner_f07 = 354
spr_banner_f08 = 355
spr_banner_f09 = 356
spr_banner_f10 = 357
spr_banner_f11 = 358
spr_banner_f12 = 359
spr_banner_f13 = 360
spr_banner_f14 = 361
spr_banner_f15 = 362
spr_banner_f16 = 363
spr_banner_f17 = 364
spr_banner_f18 = 365
spr_banner_f19 = 366
spr_banner_f20 = 367
spr_banner_g01 = 368
spr_banner_g02 = 369
spr_banner_g03 = 370
spr_banner_g04 = 371
spr_banner_g05 = 372
spr_banner_g06 = 373
spr_banner_g07 = 374
spr_banner_g08 = 375
spr_banner_g09 = 376
spr_banner_g10 = 377
spr_banner_kingdom_a = 378
spr_banner_kingdom_b = 379
spr_banner_kingdom_c = 380
spr_banner_kingdom_d = 381
spr_banner_kingdom_e = 382
spr_banner_kingdom_f = 383
spr_banner_f21 = 384
spr_tavern_chair_a = 385
spr_tavern_chair_b = 386
spr_tavern_table_a = 387
spr_tavern_table_b = 388
spr_fireplace_a = 389
spr_barrel = 390
spr_bench_tavern = 391
spr_bench_tavern_b = 392
spr_bowl_wood = 393
spr_chandelier_table = 394
spr_chandelier_tavern = 395
spr_chest_gothic = 396
spr_chest_b = 397
spr_chest_c = 398
spr_counter_tavern = 399
spr_cup = 400
spr_dish_metal = 401
spr_gothic_chair = 402
spr_gothic_stool = 403
spr_grate = 404
spr_jug = 405
spr_potlamp = 406
spr_weapon_rack = 407
spr_weapon_rack_big = 408
spr_tavern_barrel = 409
spr_tavern_barrel_b = 410
spr_merchant_sign = 411
spr_tavern_sign = 412
spr_sack = 413
spr_skull_a = 414
spr_skull_b = 415
spr_skull_c = 416
spr_skull_d = 417
spr_skeleton_cow = 418
spr_cupboard_a = 419
spr_box_a = 420
spr_bucket_a = 421
spr_straw_a = 422
spr_straw_b = 423
spr_straw_c = 424
spr_cloth_a = 425
spr_cloth_b = 426
spr_mat_a = 427
spr_mat_b = 428
spr_mat_c = 429
spr_mat_d = 430
spr_wood_a = 431
spr_wood_b = 432
spr_wood_heap = 433
spr_wood_heap_b = 434
spr_water_well_a = 435
spr_net_a = 436
spr_net_b = 437
spr_meat_hook = 438
spr_cooking_pole = 439
spr_bowl_a = 440
spr_bucket_b = 441
spr_washtub_a = 442
spr_washtub_b = 443
spr_table_trunk_a = 444
spr_chair_trunk_a = 445
spr_chair_trunk_b = 446
spr_chair_trunk_c = 447
spr_table_trestle_long = 448
spr_table_trestle_small = 449
spr_chair_trestle = 450
spr_wheel = 451
spr_ladder = 452
spr_cart = 453
spr_village_stand = 454
spr_wooden_stand = 455
spr_table_small = 456
spr_table_small_b = 457
spr_small_timber_frame_house_a = 458
spr_timber_frame_house_b = 459
spr_timber_frame_house_c = 460
spr_timber_frame_extension_a = 461
spr_timber_frame_extension_b = 462
spr_stone_stairs_a = 463
spr_stone_stairs_b = 464
spr_railing_a = 465
spr_side_building_a = 466
spr_battlement_a = 467
spr_battlement_a_destroyed = 468
spr_round_tower_a = 469
spr_small_round_tower_a = 470
spr_small_round_tower_roof_a = 471
spr_square_keep_a = 472
spr_square_tower_roof_a = 473
spr_gate_house_a = 474
spr_gate_house_b = 475
spr_small_wall_a = 476
spr_small_wall_b = 477
spr_small_wall_c = 478
spr_small_wall_c_destroy = 479
spr_small_wall_d = 480
spr_small_wall_e = 481
spr_small_wall_f = 482
spr_small_wall_f2 = 483
spr_town_house_a = 484
spr_town_house_b = 485
spr_town_house_c = 486
spr_town_house_d = 487
spr_town_house_e = 488
spr_town_house_f = 489
spr_town_house_g = 490
spr_town_house_h = 491
spr_town_house_i = 492
spr_town_house_j = 493
spr_town_house_l = 494
spr_town_house_m = 495
spr_town_house_n = 496
spr_town_house_o = 497
spr_town_house_p = 498
spr_town_house_q = 499
spr_passage_house_a = 500
spr_passage_house_b = 501
spr_passage_house_c = 502
spr_passage_house_d = 503
spr_passage_house_c_door = 504
spr_house_extension_a = 505
spr_house_extension_b = 506
spr_house_extension_c = 507
spr_house_extension_d = 508
spr_house_extension_e = 509
spr_house_extension_f = 510
spr_house_extension_f2 = 511
spr_house_extension_g = 512
spr_house_extension_g2 = 513
spr_house_extension_h = 514
spr_house_extension_i = 515
spr_house_roof_door = 516
spr_door_extension_a = 517
spr_stairs_arch_a = 518
spr_town_house_r = 519
spr_town_house_s = 520
spr_town_house_t = 521
spr_town_house_u = 522
spr_town_house_v = 523
spr_town_house_w = 524
spr_town_house_y = 525
spr_town_house_z = 526
spr_town_house_za = 527
spr_windmill = 528
spr_windmill_fan_turning = 529
spr_windmill_fan = 530
spr_fake_house_a = 531
spr_fake_house_b = 532
spr_fake_house_c = 533
spr_fake_house_d = 534
spr_fake_house_e = 535
spr_fake_house_f = 536
spr_fake_house_snowy_a = 537
spr_fake_house_snowy_b = 538
spr_fake_house_snowy_c = 539
spr_fake_house_snowy_d = 540
spr_fake_house_far_a = 541
spr_fake_house_far_b = 542
spr_fake_house_far_c = 543
spr_fake_house_far_d = 544
spr_fake_house_far_e = 545
spr_fake_house_far_f = 546
spr_fake_house_far_snowycrude_a = 547
spr_fake_house_far_snowy_b = 548
spr_fake_house_far_snowy_c = 549
spr_fake_house_far_snowy_d = 550
spr_earth_wall_a = 551
spr_earth_wall_a2 = 552
spr_earth_wall_b = 553
spr_earth_wall_b2 = 554
spr_earth_stairs_a = 555
spr_earth_stairs_b = 556
spr_earth_tower_small_a = 557
spr_earth_gate_house_a = 558
spr_earth_gate_a = 559
spr_earth_square_keep_a = 560
spr_earth_house_a = 561
spr_earth_house_b = 562
spr_earth_house_c = 563
spr_earth_house_d = 564
spr_village_steppe_a = 565
spr_village_steppe_b = 566
spr_village_steppe_c = 567
spr_village_steppe_d = 568
spr_village_steppe_e = 569
spr_village_steppe_f = 570
spr_town_house_aa = 571
spr_snowy_house_a = 572
spr_snowy_house_b = 573
spr_snowy_house_c = 574
spr_snowy_house_d = 575
spr_snowy_house_e = 576
spr_snowy_house_f = 577
spr_snowy_house_g = 578
spr_snowy_house_h = 579
spr_snowy_house_i = 580
spr_snowy_wall_a = 581
spr_snowy_stand = 582
spr_snowy_heap_a = 583
spr_snowy_trunks_a = 584
spr_snowy_castle_tower_a = 585
spr_snowy_castle_battlement_a = 586
spr_snowy_castle_battlement_a_destroyed = 587
spr_snowy_castle_battlement_b = 588
spr_snowy_castle_battlement_corner_a = 589
spr_snowy_castle_battlement_corner_b = 590
spr_snowy_castle_battlement_corner_c = 591
spr_snowy_castle_battlement_stairs_a = 592
spr_snowy_castle_battlement_stairs_b = 593
spr_snowy_castle_gate_house_a = 594
spr_snowy_castle_round_tower_a = 595
spr_snowy_castle_square_keep_a = 596
spr_snowy_castle_stairs_a = 597
spr_square_keep_b = 598
spr_square_keep_c = 599
spr_square_keep_d = 600
spr_square_keep_e = 601
spr_square_keep_f = 602
spr_square_extension_a = 603
spr_square_stairs_a = 604
spr_castle_courtyard_house_a = 605
spr_castle_courtyard_house_b = 606
spr_castle_courtyard_house_c = 607
spr_castle_courtyard_a = 608
spr_gatehouse_b = 609
spr_castle_gaillard = 610
spr_castle_e_battlement_a = 611
spr_castle_e_battlement_c = 612
spr_castle_e_battlement_a_destroyed = 613
spr_castle_e_sally_door_a = 614
spr_castle_e_corner = 615
spr_castle_e_corner_b = 616
spr_castle_e_corner_c = 617
spr_castle_e_stairs_a = 618
spr_castle_e_tower = 619
spr_castle_e_gate_house_a = 620
spr_castle_e_keep_a = 621
spr_stand_thatched = 622
spr_stand_cloth = 623
spr_castle_e_house_a = 624
spr_castle_e_house_b = 625
spr_arena_block_a = 626
spr_arena_block_b = 627
spr_arena_block_c = 628
spr_arena_block_d = 629
spr_arena_block_e = 630
spr_arena_block_f = 631
spr_arena_block_g = 632
spr_arena_block_h = 633
spr_arena_block_i = 634
spr_arena_block_j = 635
spr_arena_block_j_awning = 636
spr_arena_palisade_a = 637
spr_arena_wall_a = 638
spr_arena_wall_b = 639
spr_arena_barrier_a = 640
spr_arena_barrier_b = 641
spr_arena_barrier_c = 642
spr_arena_tower_a = 643
spr_arena_tower_b = 644
spr_arena_tower_c = 645
spr_arena_spectator_a = 646
spr_arena_spectator_b = 647
spr_arena_spectator_c = 648
spr_arena_spectator_sitting_a = 649
spr_arena_spectator_sitting_b = 650
spr_arena_spectator_sitting_c = 651
spr_courtyard_gate_a = 652
spr_courtyard_gate_b = 653
spr_courtyard_gate_c = 654
spr_courtyard_gate_snowy = 655
spr_castle_tower_a = 656
spr_castle_battlement_a = 657
spr_castle_battlement_b = 658
spr_castle_battlement_c = 659
spr_castle_battlement_a_destroyed = 660
spr_castle_battlement_b_destroyed = 661
spr_castle_battlement_corner_a = 662
spr_castle_battlement_corner_b = 663
spr_castle_battlement_corner_c = 664
spr_castle_battlement_stairs_a = 665
spr_castle_battlement_stairs_b = 666
spr_castle_gate_house_a = 667
spr_castle_round_tower_a = 668
spr_castle_square_keep_a = 669
spr_castle_stairs_a = 670
spr_castle_drawbridge_open = 671
spr_castle_drawbridge_closed = 672
spr_spike_group_a = 673
spr_spike_a = 674
spr_belfry_a = 675
spr_belfry_b = 676
spr_belfry_b_platform_a = 677
spr_belfry_old = 678
spr_belfry_platform_a = 679
spr_belfry_platform_b = 680
spr_belfry_platform_old = 681
spr_belfry_wheel = 682
spr_belfry_wheel_old = 683
spr_mangonel = 684
spr_trebuchet_old = 685
spr_trebuchet_new = 686
spr_trebuchet_destructible = 687
spr_stone_ball = 688
spr_village_house_a = 689
spr_village_house_b = 690
spr_village_house_c = 691
spr_village_house_d = 692
spr_farm_house_a = 693
spr_farm_house_b = 694
spr_farm_house_c = 695
spr_mountain_house_a = 696
spr_mountain_house_b = 697
spr_village_hut_a = 698
spr_crude_fence = 699
spr_crude_fence_small = 700
spr_crude_fence_small_b = 701
spr_ramp_12m = 702
spr_ramp_14m = 703
spr_siege_ladder_6m = 704
spr_siege_ladder_8m = 705
spr_siege_ladder_10m = 706
spr_siege_ladder_12m = 707
spr_siege_ladder_14m = 708
spr_siege_ladder_move_6m = 709
spr_siege_ladder_move_8m = 710
spr_siege_ladder_move_10m = 711
spr_siege_ladder_move_12m = 712
spr_siege_ladder_move_14m = 713
spr_portcullis = 714
spr_bed_a = 715
spr_bed_b = 716
spr_bed_c = 717
spr_bed_d = 718
spr_bed_e = 719
spr_bed_f = 720
spr_towngate_door_left = 721
spr_towngate_door_right = 722
spr_towngate_rectangle_door_left = 723
spr_towngate_rectangle_door_right = 724
spr_door_screen = 725
spr_door_a = 726
spr_door_b = 727
spr_door_c = 728
spr_door_d = 729
spr_tavern_door_a = 730
spr_tavern_door_b = 731
spr_door_e_left = 732
spr_door_e_right = 733
spr_door_f_left = 734
spr_door_f_right = 735
spr_door_h_left = 736
spr_door_h_right = 737
spr_draw_bridge_a = 738
spr_chain_1m = 739
spr_chain_2m = 740
spr_chain_5m = 741
spr_chain_10m = 742
spr_bridge_modular_a = 743
spr_bridge_modular_b = 744
spr_church_a = 745
spr_church_tower_a = 746
spr_stone_step_a = 747
spr_stone_step_b = 748
spr_stone_step_c = 749
spr_stone_heap = 750
spr_stone_heap_b = 751
spr_panel_door_a = 752
spr_panel_door_b = 753
spr_smoke_stain = 754
spr_brazier_with_fire = 755
spr_cooking_fire = 756
spr_cauldron_a = 757
spr_fry_pan_a = 758
spr_tripod_cauldron_a = 759
spr_tripod_cauldron_b = 760
spr_open_stable_a = 761
spr_open_stable_b = 762
spr_plate_a = 763
spr_plate_b = 764
spr_plate_c = 765
spr_lettuce = 766
spr_hanger = 767
spr_knife_eating = 768
spr_colander = 769
spr_ladle = 770
spr_spoon = 771
spr_skewer = 772
spr_grape_a = 773
spr_grape_b = 774
spr_apple_a = 775
spr_apple_b = 776
spr_maize_a = 777
spr_maize_b = 778
spr_cabbage = 779
spr_flax_bundle = 780
spr_olive_plane = 781
spr_grapes_plane = 782
spr_date_fruit_plane = 783
spr_bowl = 784
spr_bowl_small = 785
spr_dye_blue = 786
spr_dye_red = 787
spr_dye_yellow = 788
spr_basket = 789
spr_basket_big = 790
spr_basket_big_green = 791
spr_leatherwork_frame = 792
spr_cabbage_b = 793
spr_bean = 794
spr_basket_a = 795
spr_feeding_trough_a = 796
spr_marrow_a = 797
spr_marrow_b = 798
spr_squash_plant = 799
spr_gatehouse_new_a = 800
spr_gatehouse_new_b = 801
spr_gatehouse_new_snowy_a = 802
spr_winch = 803
spr_winch_b = 804
spr_drawbridge = 805
spr_gatehouse_door_left = 806
spr_gatehouse_door_right = 807
spr_cheese_a = 808
spr_cheese_b = 809
spr_cheese_slice_a = 810
spr_bread_a = 811
spr_bread_b = 812
spr_bread_slice_a = 813
spr_fish_a = 814
spr_fish_roasted_a = 815
spr_chicken_roasted = 816
spr_food_steam = 817
spr_city_smoke = 818
spr_city_fire_fly_night = 819
spr_city_fly_day = 820
spr_flue_smoke_tall = 821
spr_flue_smoke_short = 822
spr_moon_beam = 823
spr_fire_small = 824
spr_fire_big = 825
spr_battle_field_smoke = 826
spr_Village_fire_big = 827
spr_candle_a = 828
spr_candle_b = 829
spr_candle_c = 830
spr_lamp_a = 831
spr_lamp_b = 832
spr_hook_a = 833
spr_window_night = 834
spr_fried_pig = 835
spr_village_oven = 836
spr_dungeon_water_drops = 837
spr_shadow_circle_1 = 838
spr_shadow_circle_2 = 839
spr_shadow_square_1 = 840
spr_shadow_square_2 = 841
spr_wheelbarrow = 842
spr_gourd = 843
spr_gourd_spike = 844
spr_obstacle_fence_1 = 845
spr_obstacle_fallen_tree_a = 846
spr_obstacle_fallen_tree_b = 847
spr_siege_wall_a = 848
spr_siege_large_shield_a = 849
spr_granary_a = 850
spr_small_wall_connect_a = 851
spr_full_stable_a = 852
spr_full_stable_b = 853
spr_full_stable_c = 854
spr_full_stable_d = 855
spr_arabian_house_a = 856
spr_arabian_house_b = 857
spr_arabian_house_c = 858
spr_arabian_house_d = 859
spr_arabian_house_e = 860
spr_arabian_house_f = 861
spr_arabian_house_g = 862
spr_arabian_house_h = 863
spr_arabian_house_i = 864
spr_arabian_square_keep_a = 865
spr_arabian_passage_house_a = 866
spr_arabian_wall_a = 867
spr_arabian_wall_b = 868
spr_arabian_ground_a = 869
spr_arabian_parterre_a = 870
spr_well_shaft = 871
spr_horse_mill = 872
spr_horse_mill_collar = 873
spr_arabian_stable = 874
spr_arabian_tent = 875
spr_arabian_tent_b = 876
spr_desert_plant_a = 877
spr_arabian_castle_battlement_a = 878
spr_arabian_castle_battlement_b_destroyed = 879
spr_arabian_castle_battlement_c = 880
spr_arabian_castle_battlement_d = 881
spr_arabian_castle_corner_a = 882
spr_arabian_castle_stairs = 883
spr_arabian_castle_stairs_b = 884
spr_arabian_castle_stairs_c = 885
spr_arabian_castle_battlement_section_a = 886
spr_arabian_castle_gate_house_a = 887
spr_arabian_castle_house_a = 888
spr_arabian_castle_house_b = 889
spr_arabian_castle_keep_a = 890
spr_arabian_house_a2 = 891
spr_arabian_village_house_a = 892
spr_arabian_village_house_b = 893
spr_arabian_village_house_c = 894
spr_arabian_village_house_d = 895
spr_arabian_village_stable = 896
spr_arabian_village_hut = 897
spr_arabian_village_stairs = 898
spr_tree_a01 = 899
spr_stairs_a = 900
spr_headquarters_flag_red = 901
spr_headquarters_flag_blue = 902
spr_headquarters_flag_gray = 903
spr_headquarters_flag_red_code_only = 904
spr_headquarters_flag_blue_code_only = 905
spr_headquarters_flag_gray_code_only = 906
spr_headquarters_pole_code_only = 907
spr_headquarters_flag_swadian = 908
spr_headquarters_flag_vaegir = 909
spr_headquarters_flag_khergit = 910
spr_headquarters_flag_nord = 911
spr_headquarters_flag_rhodok = 912
spr_headquarters_flag_sarranid = 913
spr_glow_a = 914
spr_glow_b = 915
spr_arabian_castle_corner_b = 916
spr_dummy_a_undestructable = 917
spr_cave_entrance_1 = 918
spr_pointer_arrow = 919
spr_fireplace_d_interior = 920
spr_ship_sail_off = 921
spr_ship_sail_off_b = 922
spr_ship_c_sail_off = 923
spr_ramp_small_a = 924
spr_castle_g_battlement_b = 925
spr_box_a_dynamic = 926
spr_desert_field = 927
spr_water_river = 928
spr_viking_house_a = 929
spr_viking_house_b = 930
spr_viking_house_c = 931
spr_viking_house_d = 932
spr_viking_house_e = 933
spr_viking_stable_a = 934
spr_viking_keep = 935
spr_viking_house_c_destroy = 936
spr_viking_house_b_destroy = 937
spr_harbour_a = 938
spr_sea_foam_a = 939
spr_viking_keep_destroy = 940
spr_viking_keep_destroy_door = 941
spr_earth_tower_small_b = 942
spr_earth_gate_house_b = 943
spr_earth_tower_a = 944
spr_earth_stairs_c = 945
spr_earth_sally_gate_left = 946
spr_earth_sally_gate_right = 947
spr_barrier_box = 948
spr_barrier_capsule = 949
spr_barrier_cone = 950
spr_barrier_sphere = 951
spr_viking_keep_destroy_sally_door_right = 952
spr_viking_keep_destroy_sally_door_left = 953
spr_castle_f_door_b = 954
spr_ctf_flag_kingdom_1 = 955
spr_ctf_flag_kingdom_2 = 956
spr_ctf_flag_kingdom_3 = 957
spr_ctf_flag_kingdom_4 = 958
spr_ctf_flag_kingdom_5 = 959
spr_ctf_flag_kingdom_6 = 960
spr_ctf_flag_kingdom_7 = 961
spr_headquarters_flag_rebel = 962
spr_arabian_lighthouse_a = 963
spr_arabian_ramp_a = 964
spr_arabian_ramp_b = 965
spr_winery_interior = 966
spr_winery_barrel_shelf = 967
spr_winery_wall_shelf = 968
spr_winery_huge_barrel = 969
spr_winery_wine_press = 970
spr_winery_middle_barrel = 971
spr_winery_wine_cart_small_loaded = 972
spr_winery_wine_cart_small_empty = 973
spr_winery_wine_cart_empty = 974
spr_winery_wine_cart_loaded = 975
spr_weavery_interior = 976
spr_weavery_loom_a = 977
spr_weavery_spinning_wheel = 978
spr_mill_interior = 979
spr_mill_flour_sack = 980
spr_mill_flour_sack_desk_a = 981
spr_mill_flour_sack_desk_b = 982
spr_smithy_interior = 983
spr_smithy_grindstone_wheel = 984
spr_smithy_forge_bellows = 985
spr_smithy_forge = 986
spr_smithy_anvil = 987
spr_tannery_hide_a = 988
spr_tannery_hide_b = 989
spr_tannery_pools_a = 990
spr_tannery_pools_b = 991
spr_fountain = 992
spr_rhodok_houses_a = 993
spr_rhodok_houses_b = 994
spr_rhodok_houses_c = 995
spr_rhodok_houses_d = 996
spr_rhodok_houses_e = 997
spr_rhodok_house_passage_a = 998
spr_bridge_b = 999
spr_brewery_pool = 1000
spr_brewery_big_bucket = 1001
spr_brewery_interior = 1002
spr_brewery_bucket_platform_a = 1003
spr_brewery_bucket_platform_b = 1004
spr_weavery_dye_pool_r = 1005
spr_weavery_dye_pool_y = 1006
spr_weavery_dye_pool_b = 1007
spr_weavery_dye_pool_p = 1008
spr_weavery_dye_pool_g = 1009
spr_oil_press_interior = 1010
spr_city_swad_01 = 1011
spr_city_swad_02 = 1012
spr_city_swad_03 = 1013
spr_city_swad_04 = 1014
spr_city_swad_passage_01 = 1015
spr_city_swad_05 = 1016
spr_arena_block_j_a = 1017
spr_arena_underway_a = 1018
spr_arena_circle_a = 1019
spr_rope_bridge_15m = 1020
spr_tree_house_a = 1021
spr_tree_house_guard_a = 1022
spr_tree_house_guard_b = 1023
spr_tree_shelter_a = 1024
spr_yellow_fall_leafs_a = 1025
| Python |
qst_deliver_message = 0
qst_deliver_message_to_enemy_lord = 1
qst_raise_troops = 2
qst_escort_lady = 3
qst_deal_with_bandits_at_lords_village = 4
qst_collect_taxes = 5
qst_hunt_down_fugitive = 6
qst_kill_local_merchant = 7
qst_bring_back_runaway_serfs = 8
qst_follow_spy = 9
qst_capture_enemy_hero = 10
qst_lend_companion = 11
qst_collect_debt = 12
qst_incriminate_loyal_commander = 13
qst_meet_spy_in_enemy_town = 14
qst_capture_prisoners = 15
qst_lend_surgeon = 16
qst_follow_army = 17
qst_report_to_army = 18
qst_deliver_cattle_to_army = 19
qst_join_siege_with_army = 20
qst_screen_army = 21
qst_scout_waypoints = 22
qst_rescue_lord_by_replace = 23
qst_deliver_message_to_prisoner_lord = 24
qst_duel_for_lady = 25
qst_duel_courtship_rival = 26
qst_duel_avenge_insult = 27
qst_move_cattle_herd = 28
qst_escort_merchant_caravan = 29
qst_deliver_wine = 30
qst_troublesome_bandits = 31
qst_kidnapped_girl = 32
qst_persuade_lords_to_make_peace = 33
qst_deal_with_looters = 34
qst_deal_with_night_bandits = 35
qst_deliver_grain = 36
qst_deliver_cattle = 37
qst_train_peasants_against_bandits = 38
qst_eliminate_bandits_infesting_village = 39
qst_visit_lady = 40
qst_formal_marriage_proposal = 41
qst_obtain_liege_blessing = 42
qst_wed_betrothed = 43
qst_wed_betrothed_female = 44
qst_join_faction = 45
qst_rebel_against_kingdom = 46
qst_consult_with_minister = 47
qst_organize_feast = 48
qst_resolve_dispute = 49
qst_offer_gift = 50
qst_denounce_lord = 51
qst_intrigue_against_lord = 52
qst_track_down_bandits = 53
qst_track_down_provocateurs = 54
qst_retaliate_for_border_incident = 55
qst_raid_caravan_to_start_war = 56
qst_cause_provocation = 57
qst_rescue_prisoner = 58
qst_destroy_bandit_lair = 59
qst_blank_quest_2 = 60
qst_blank_quest_3 = 61
qst_blank_quest_4 = 62
qst_blank_quest_5 = 63
qst_blank_quest_6 = 64
qst_blank_quest_7 = 65
qst_blank_quest_8 = 66
qst_blank_quest_9 = 67
qst_blank_quest_10 = 68
qst_blank_quest_11 = 69
qst_blank_quest_12 = 70
qst_blank_quest_13 = 71
qst_blank_quest_14 = 72
qst_blank_quest_15 = 73
qst_blank_quest_16 = 74
qst_blank_quest_17 = 75
qst_blank_quest_18 = 76
qst_blank_quest_19 = 77
qst_blank_quest_20 = 78
qst_blank_quest_21 = 79
qst_blank_quest_22 = 80
qst_blank_quest_23 = 81
qst_blank_quest_24 = 82
qst_blank_quest_25 = 83
qst_blank_quest_26 = 84
qst_blank_quest_27 = 85
qst_collect_men = 86
qst_learn_where_merchant_brother_is = 87
qst_save_relative_of_merchant = 88
qst_save_town_from_bandits = 89
qst_quests_end = 90
qsttag_deliver_message = 504403158265495552
qsttag_deliver_message_to_enemy_lord = 504403158265495553
qsttag_raise_troops = 504403158265495554
qsttag_escort_lady = 504403158265495555
qsttag_deal_with_bandits_at_lords_village = 504403158265495556
qsttag_collect_taxes = 504403158265495557
qsttag_hunt_down_fugitive = 504403158265495558
qsttag_kill_local_merchant = 504403158265495559
qsttag_bring_back_runaway_serfs = 504403158265495560
qsttag_follow_spy = 504403158265495561
qsttag_capture_enemy_hero = 504403158265495562
qsttag_lend_companion = 504403158265495563
qsttag_collect_debt = 504403158265495564
qsttag_incriminate_loyal_commander = 504403158265495565
qsttag_meet_spy_in_enemy_town = 504403158265495566
qsttag_capture_prisoners = 504403158265495567
qsttag_lend_surgeon = 504403158265495568
qsttag_follow_army = 504403158265495569
qsttag_report_to_army = 504403158265495570
qsttag_deliver_cattle_to_army = 504403158265495571
qsttag_join_siege_with_army = 504403158265495572
qsttag_screen_army = 504403158265495573
qsttag_scout_waypoints = 504403158265495574
qsttag_rescue_lord_by_replace = 504403158265495575
qsttag_deliver_message_to_prisoner_lord = 504403158265495576
qsttag_duel_for_lady = 504403158265495577
qsttag_duel_courtship_rival = 504403158265495578
qsttag_duel_avenge_insult = 504403158265495579
qsttag_move_cattle_herd = 504403158265495580
qsttag_escort_merchant_caravan = 504403158265495581
qsttag_deliver_wine = 504403158265495582
qsttag_troublesome_bandits = 504403158265495583
qsttag_kidnapped_girl = 504403158265495584
qsttag_persuade_lords_to_make_peace = 504403158265495585
qsttag_deal_with_looters = 504403158265495586
qsttag_deal_with_night_bandits = 504403158265495587
qsttag_deliver_grain = 504403158265495588
qsttag_deliver_cattle = 504403158265495589
qsttag_train_peasants_against_bandits = 504403158265495590
qsttag_eliminate_bandits_infesting_village = 504403158265495591
qsttag_visit_lady = 504403158265495592
qsttag_formal_marriage_proposal = 504403158265495593
qsttag_obtain_liege_blessing = 504403158265495594
qsttag_wed_betrothed = 504403158265495595
qsttag_wed_betrothed_female = 504403158265495596
qsttag_join_faction = 504403158265495597
qsttag_rebel_against_kingdom = 504403158265495598
qsttag_consult_with_minister = 504403158265495599
qsttag_organize_feast = 504403158265495600
qsttag_resolve_dispute = 504403158265495601
qsttag_offer_gift = 504403158265495602
qsttag_denounce_lord = 504403158265495603
qsttag_intrigue_against_lord = 504403158265495604
qsttag_track_down_bandits = 504403158265495605
qsttag_track_down_provocateurs = 504403158265495606
qsttag_retaliate_for_border_incident = 504403158265495607
qsttag_raid_caravan_to_start_war = 504403158265495608
qsttag_cause_provocation = 504403158265495609
qsttag_rescue_prisoner = 504403158265495610
qsttag_destroy_bandit_lair = 504403158265495611
qsttag_blank_quest_2 = 504403158265495612
qsttag_blank_quest_3 = 504403158265495613
qsttag_blank_quest_4 = 504403158265495614
qsttag_blank_quest_5 = 504403158265495615
qsttag_blank_quest_6 = 504403158265495616
qsttag_blank_quest_7 = 504403158265495617
qsttag_blank_quest_8 = 504403158265495618
qsttag_blank_quest_9 = 504403158265495619
qsttag_blank_quest_10 = 504403158265495620
qsttag_blank_quest_11 = 504403158265495621
qsttag_blank_quest_12 = 504403158265495622
qsttag_blank_quest_13 = 504403158265495623
qsttag_blank_quest_14 = 504403158265495624
qsttag_blank_quest_15 = 504403158265495625
qsttag_blank_quest_16 = 504403158265495626
qsttag_blank_quest_17 = 504403158265495627
qsttag_blank_quest_18 = 504403158265495628
qsttag_blank_quest_19 = 504403158265495629
qsttag_blank_quest_20 = 504403158265495630
qsttag_blank_quest_21 = 504403158265495631
qsttag_blank_quest_22 = 504403158265495632
qsttag_blank_quest_23 = 504403158265495633
qsttag_blank_quest_24 = 504403158265495634
qsttag_blank_quest_25 = 504403158265495635
qsttag_blank_quest_26 = 504403158265495636
qsttag_blank_quest_27 = 504403158265495637
qsttag_collect_men = 504403158265495638
qsttag_learn_where_merchant_brother_is = 504403158265495639
qsttag_save_relative_of_merchant = 504403158265495640
qsttag_save_town_from_bandits = 504403158265495641
qsttag_quests_end = 504403158265495642
| Python |
from header_common import *
from header_operations import *
from header_mission_templates import *
from header_animations import *
from header_sounds import *
from header_music import *
from header_items import *
from module_constants import *
####################################################################################################################
# Each mission-template is a tuple that contains the following fields:
# 1) Mission-template id (string): used for referencing mission-templates in other files.
# The prefix mt_ is automatically added before each mission-template id
#
# 2) Mission-template flags (int): See header_mission-templates.py for a list of available flags
# 3) Mission-type(int): Which mission types this mission template matches.
# For mission-types to be used with the default party-meeting system,
# this should be 'charge' or 'charge_with_ally' otherwise must be -1.
#
# 4) Mission description text (string).
# 5) List of spawn records (list): Each spawn record is a tuple that contains the following fields:
# 5.1) entry-no: Troops spawned from this spawn record will use this entry
# 5.2) spawn flags.
# 5.3) alter flags. which equipment will be overriden
# 5.4) ai flags.
# 5.5) Number of troops to spawn.
# 5.6) list of equipment to add to troops spawned from here (maximum 8).
# 6) List of triggers (list).
# See module_triggers.py for infomation about triggers.
#
# Please note that mission templates is work in progress and can be changed in the future versions.
#
####################################################################################################################
pilgrim_disguise = [itm_pilgrim_hood,itm_pilgrim_disguise,itm_practice_staff, itm_throwing_daggers]
af_castle_lord = af_override_horse | af_override_weapons| af_require_civilian
multiplayer_server_check_belfry_movement = (
0, 0, 0, [],
[
(multiplayer_is_server),
(set_fixed_point_multiplier, 100),
(try_for_range, ":belfry_kind", 0, 2),
(try_begin),
(eq, ":belfry_kind", 0),
(assign, ":belfry_body_scene_prop", "spr_belfry_a"),
(else_try),
(assign, ":belfry_body_scene_prop", "spr_belfry_b"),
(try_end),
(scene_prop_get_num_instances, ":num_belfries", ":belfry_body_scene_prop"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", ":belfry_body_scene_prop", ":belfry_no"),
(prop_instance_get_position, pos1, ":belfry_scene_prop_id"), #pos1 holds position of current belfry
(prop_instance_get_starting_position, pos11, ":belfry_scene_prop_id"),
(store_add, ":belfry_first_entry_point_id", 11, ":belfry_no"), #belfry entry points are 110..119 and 120..129 and 130..139
(try_begin),
(eq, ":belfry_kind", 1),
(scene_prop_get_num_instances, ":number_of_belfry_a", "spr_belfry_a"),
(val_add, ":belfry_first_entry_point_id", ":number_of_belfry_a"),
(try_end),
(val_mul, ":belfry_first_entry_point_id", 10),
(store_add, ":belfry_last_entry_point_id", ":belfry_first_entry_point_id", 10),
(try_for_range, ":entry_point_id", ":belfry_first_entry_point_id", ":belfry_last_entry_point_id"),
(entry_point_is_auto_generated, ":entry_point_id"),
(assign, ":belfry_last_entry_point_id", ":entry_point_id"),
(try_end),
(assign, ":belfry_last_entry_point_id_plus_one", ":belfry_last_entry_point_id"),
(val_sub, ":belfry_last_entry_point_id", 1),
(assign, reg0, ":belfry_last_entry_point_id"),
(neg|entry_point_is_auto_generated, ":belfry_last_entry_point_id"),
(try_begin),
(get_sq_distance_between_positions, ":dist_between_belfry_and_its_destination", pos1, pos11),
(ge, ":dist_between_belfry_and_its_destination", 4), #0.2 * 0.2 * 100 = 4 (if distance between belfry and its destination already less than 20cm no need to move it anymore)
(assign, ":max_dist_between_entry_point_and_belfry_destination", -1), #should be lower than 0 to allow belfry to go last entry point
(assign, ":belfry_next_entry_point_id", -1),
(try_for_range, ":entry_point_id", ":belfry_first_entry_point_id", ":belfry_last_entry_point_id_plus_one"),
(entry_point_get_position, pos4, ":entry_point_id"),
(get_sq_distance_between_positions, ":dist_between_entry_point_and_belfry_destination", pos11, pos4),
(lt, ":dist_between_entry_point_and_belfry_destination", ":dist_between_belfry_and_its_destination"),
(gt, ":dist_between_entry_point_and_belfry_destination", ":max_dist_between_entry_point_and_belfry_destination"),
(assign, ":max_dist_between_entry_point_and_belfry_destination", ":dist_between_entry_point_and_belfry_destination"),
(assign, ":belfry_next_entry_point_id", ":entry_point_id"),
(try_end),
(try_begin),
(ge, ":belfry_next_entry_point_id", 0),
(entry_point_get_position, pos5, ":belfry_next_entry_point_id"), #pos5 holds belfry next entry point target during its path
(else_try),
(copy_position, pos5, pos11),
(try_end),
(get_distance_between_positions, ":belfry_next_entry_point_distance", pos1, pos5),
#collecting scene prop ids of belfry parts
(try_begin),
(eq, ":belfry_kind", 0),
#belfry platform_a
(scene_prop_get_instance, ":belfry_platform_a_scene_prop_id", "spr_belfry_platform_a", ":belfry_no"),
#belfry platform_b
(scene_prop_get_instance, ":belfry_platform_b_scene_prop_id", "spr_belfry_platform_b", ":belfry_no"),
(else_try),
#belfry platform_a
(scene_prop_get_instance, ":belfry_platform_a_scene_prop_id", "spr_belfry_b_platform_a", ":belfry_no"),
(try_end),
#belfry wheel_1
(store_mul, ":wheel_no", ":belfry_no", 3),
(try_begin),
(eq, ":belfry_body_scene_prop", "spr_belfry_b"),
(scene_prop_get_num_instances, ":number_of_belfry_a", "spr_belfry_a"),
(store_mul, ":number_of_belfry_a_wheels", ":number_of_belfry_a", 3),
(val_add, ":wheel_no", ":number_of_belfry_a_wheels"),
(try_end),
(scene_prop_get_instance, ":belfry_wheel_1_scene_prop_id", "spr_belfry_wheel", ":wheel_no"),
#belfry wheel_2
(val_add, ":wheel_no", 1),
(scene_prop_get_instance, ":belfry_wheel_2_scene_prop_id", "spr_belfry_wheel", ":wheel_no"),
#belfry wheel_3
(val_add, ":wheel_no", 1),
(scene_prop_get_instance, ":belfry_wheel_3_scene_prop_id", "spr_belfry_wheel", ":wheel_no"),
(init_position, pos17),
(position_move_y, pos17, -225),
(position_transform_position_to_parent, pos18, pos1, pos17),
(position_move_y, pos17, -225),
(position_transform_position_to_parent, pos19, pos1, pos17),
(assign, ":number_of_agents_around_belfry", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_agent_id, ":agent_id", ":player_no"),
(ge, ":agent_id", 0),
(agent_get_team, ":agent_team", ":agent_id"),
(eq, ":agent_team", 1), #only team2 players allowed to move belfry (team which spawns outside the castle (team1 = 0, team2 = 1))
(agent_get_horse, ":agent_horse_id", ":agent_id"),
(eq, ":agent_horse_id", -1),
(agent_get_position, pos2, ":agent_id"),
(get_sq_distance_between_positions_in_meters, ":dist_between_agent_and_belfry", pos18, pos2),
(lt, ":dist_between_agent_and_belfry", multi_distance_sq_to_use_belfry), #must be at most 10m * 10m = 100m away from the player
(neg|scene_prop_has_agent_on_it, ":belfry_scene_prop_id", ":agent_id"),
(neg|scene_prop_has_agent_on_it, ":belfry_platform_a_scene_prop_id", ":agent_id"),
(this_or_next|eq, ":belfry_kind", 1), #there is this_or_next here because belfry_b has no platform_b
(neg|scene_prop_has_agent_on_it, ":belfry_platform_b_scene_prop_id", ":agent_id"),
(neg|scene_prop_has_agent_on_it, ":belfry_wheel_1_scene_prop_id", ":agent_id"),#can be removed to make faster
(neg|scene_prop_has_agent_on_it, ":belfry_wheel_2_scene_prop_id", ":agent_id"),#can be removed to make faster
(neg|scene_prop_has_agent_on_it, ":belfry_wheel_3_scene_prop_id", ":agent_id"),#can be removed to make faster
(neg|position_is_behind_position, pos2, pos19),
(position_is_behind_position, pos2, pos1),
(val_add, ":number_of_agents_around_belfry", 1),
(try_end),
(val_min, ":number_of_agents_around_belfry", 16),
(try_begin),
(scene_prop_get_slot, ":pre_number_of_agents_around_belfry", ":belfry_scene_prop_id", scene_prop_number_of_agents_pushing),
(scene_prop_get_slot, ":next_entry_point_id", ":belfry_scene_prop_id", scene_prop_next_entry_point_id),
(this_or_next|neq, ":pre_number_of_agents_around_belfry", ":number_of_agents_around_belfry"),
(neq, ":next_entry_point_id", ":belfry_next_entry_point_id"),
(try_begin),
(eq, ":next_entry_point_id", ":belfry_next_entry_point_id"), #if we are still targetting same entry point subtract
(prop_instance_is_animating, ":is_animating", ":belfry_scene_prop_id"),
(eq, ":is_animating", 1),
(store_mul, ":sqrt_number_of_agents_around_belfry", "$g_last_number_of_agents_around_belfry", 100),
(store_sqrt, ":sqrt_number_of_agents_around_belfry", ":sqrt_number_of_agents_around_belfry"),
(val_min, ":sqrt_number_of_agents_around_belfry", 300),
(assign, ":distance", ":belfry_next_entry_point_distance"),
(val_mul, ":distance", ":sqrt_number_of_agents_around_belfry"),
(val_div, ":distance", 100), #100 is because of fixed_point_multiplier
(val_mul, ":distance", 4), #multiplying with 4 to make belfry pushing process slower,
#with 16 agents belfry will go with 4 / 4 = 1 speed (max), with 1 agent belfry will go with 1 / 4 = 0.25 speed (min)
(try_end),
(try_begin),
(ge, ":belfry_next_entry_point_id", 0),
#up down rotation of belfry's next entry point
(init_position, pos9),
(position_set_y, pos9, -500), #go 5.0 meters back
(position_set_x, pos9, -300), #go 3.0 meters left
(position_transform_position_to_parent, pos10, pos5, pos9),
(position_get_distance_to_terrain, ":height_to_terrain_1", pos10), #learn distance between 5 meters back of entry point(pos10) and ground level at left part of belfry
(init_position, pos9),
(position_set_y, pos9, -500), #go 5.0 meters back
(position_set_x, pos9, 300), #go 3.0 meters right
(position_transform_position_to_parent, pos10, pos5, pos9),
(position_get_distance_to_terrain, ":height_to_terrain_2", pos10), #learn distance between 5 meters back of entry point(pos10) and ground level at right part of belfry
(store_add, ":height_to_terrain", ":height_to_terrain_1", ":height_to_terrain_2"),
(val_mul, ":height_to_terrain", 100), #because of fixed point multiplier
(store_div, ":rotate_angle_of_next_entry_point", ":height_to_terrain", 24), #if there is 1 meters of distance (100cm) then next target position will rotate by 2 degrees. #ac sonra
(init_position, pos20),
(position_rotate_x_floating, pos20, ":rotate_angle_of_next_entry_point"),
(position_transform_position_to_parent, pos23, pos5, pos20),
#right left rotation of belfry's next entry point
(init_position, pos9),
(position_set_x, pos9, -300), #go 3.0 meters left
(position_transform_position_to_parent, pos10, pos5, pos9), #applying 3.0 meters in -x to position of next entry point target, final result is in pos10
(position_get_distance_to_terrain, ":height_to_terrain_at_left", pos10), #learn distance between 3.0 meters left of entry point(pos10) and ground level
(init_position, pos9),
(position_set_x, pos9, 300), #go 3.0 meters left
(position_transform_position_to_parent, pos10, pos5, pos9), #applying 3.0 meters in x to position of next entry point target, final result is in pos10
(position_get_distance_to_terrain, ":height_to_terrain_at_right", pos10), #learn distance between 3.0 meters right of entry point(pos10) and ground level
(store_sub, ":height_to_terrain_1", ":height_to_terrain_at_left", ":height_to_terrain_at_right"),
(init_position, pos9),
(position_set_x, pos9, -300), #go 3.0 meters left
(position_set_y, pos9, -500), #go 5.0 meters forward
(position_transform_position_to_parent, pos10, pos5, pos9), #applying 3.0 meters in -x to position of next entry point target, final result is in pos10
(position_get_distance_to_terrain, ":height_to_terrain_at_left", pos10), #learn distance between 3.0 meters left of entry point(pos10) and ground level
(init_position, pos9),
(position_set_x, pos9, 300), #go 3.0 meters left
(position_set_y, pos9, -500), #go 5.0 meters forward
(position_transform_position_to_parent, pos10, pos5, pos9), #applying 3.0 meters in x to position of next entry point target, final result is in pos10
(position_get_distance_to_terrain, ":height_to_terrain_at_right", pos10), #learn distance between 3.0 meters right of entry point(pos10) and ground level
(store_sub, ":height_to_terrain_2", ":height_to_terrain_at_left", ":height_to_terrain_at_right"),
(store_add, ":height_to_terrain", ":height_to_terrain_1", ":height_to_terrain_2"),
(val_mul, ":height_to_terrain", 100), #100 is because of fixed_point_multiplier
(store_div, ":rotate_angle_of_next_entry_point", ":height_to_terrain", 24), #if there is 1 meters of distance (100cm) then next target position will rotate by 25 degrees.
(val_mul, ":rotate_angle_of_next_entry_point", -1),
(init_position, pos20),
(position_rotate_y_floating, pos20, ":rotate_angle_of_next_entry_point"),
(position_transform_position_to_parent, pos22, pos23, pos20),
(else_try),
(copy_position, pos22, pos5),
(try_end),
(try_begin),
(ge, ":number_of_agents_around_belfry", 1), #if there is any agents pushing belfry
(store_mul, ":sqrt_number_of_agents_around_belfry", ":number_of_agents_around_belfry", 100),
(store_sqrt, ":sqrt_number_of_agents_around_belfry", ":sqrt_number_of_agents_around_belfry"),
(val_min, ":sqrt_number_of_agents_around_belfry", 300),
(val_mul, ":belfry_next_entry_point_distance", 100), #100 is because of fixed_point_multiplier
(val_mul, ":belfry_next_entry_point_distance", 3), #multiplying with 3 to make belfry pushing process slower,
#with 9 agents belfry will go with 3 / 3 = 1 speed (max), with 1 agent belfry will go with 1 / 3 = 0.33 speed (min)
(val_div, ":belfry_next_entry_point_distance", ":sqrt_number_of_agents_around_belfry"),
#calculating destination coordinates of belfry parts
#belfry platform_a
(prop_instance_get_position, pos6, ":belfry_platform_a_scene_prop_id"),
(position_transform_position_to_local, pos7, pos1, pos6),
(position_transform_position_to_parent, pos8, pos22, pos7),
(prop_instance_animate_to_position, ":belfry_platform_a_scene_prop_id", pos8, ":belfry_next_entry_point_distance"),
#belfry platform_b
(try_begin),
(eq, ":belfry_kind", 0),
(prop_instance_get_position, pos6, ":belfry_platform_b_scene_prop_id"),
(position_transform_position_to_local, pos7, pos1, pos6),
(position_transform_position_to_parent, pos8, pos22, pos7),
(prop_instance_animate_to_position, ":belfry_platform_b_scene_prop_id", pos8, ":belfry_next_entry_point_distance"),
(try_end),
#wheel rotation
(store_mul, ":belfry_wheel_rotation", ":belfry_next_entry_point_distance", -25),
#(val_add, "$g_belfry_wheel_rotation", ":belfry_wheel_rotation"),
(assign, "$g_last_number_of_agents_around_belfry", ":number_of_agents_around_belfry"),
#belfry wheel_1
#(prop_instance_get_starting_position, pos13, ":belfry_wheel_1_scene_prop_id"),
(prop_instance_get_position, pos13, ":belfry_wheel_1_scene_prop_id"),
(prop_instance_get_position, pos20, ":belfry_scene_prop_id"),
(position_transform_position_to_local, pos7, pos20, pos13),
(position_transform_position_to_parent, pos21, pos22, pos7),
(prop_instance_rotate_to_position, ":belfry_wheel_1_scene_prop_id", pos21, ":belfry_next_entry_point_distance", ":belfry_wheel_rotation"),
#belfry wheel_2
#(prop_instance_get_starting_position, pos13, ":belfry_wheel_2_scene_prop_id"),
(prop_instance_get_position, pos13, ":belfry_wheel_2_scene_prop_id"),
(prop_instance_get_position, pos20, ":belfry_scene_prop_id"),
(position_transform_position_to_local, pos7, pos20, pos13),
(position_transform_position_to_parent, pos21, pos22, pos7),
(prop_instance_rotate_to_position, ":belfry_wheel_2_scene_prop_id", pos21, ":belfry_next_entry_point_distance", ":belfry_wheel_rotation"),
#belfry wheel_3
(prop_instance_get_position, pos13, ":belfry_wheel_3_scene_prop_id"),
(prop_instance_get_position, pos20, ":belfry_scene_prop_id"),
(position_transform_position_to_local, pos7, pos20, pos13),
(position_transform_position_to_parent, pos21, pos22, pos7),
(prop_instance_rotate_to_position, ":belfry_wheel_3_scene_prop_id", pos21, ":belfry_next_entry_point_distance", ":belfry_wheel_rotation"),
#belfry main body
(prop_instance_animate_to_position, ":belfry_scene_prop_id", pos22, ":belfry_next_entry_point_distance"),
(else_try),
(prop_instance_is_animating, ":is_animating", ":belfry_scene_prop_id"),
(eq, ":is_animating", 1),
#belfry platform_a
(prop_instance_stop_animating, ":belfry_platform_a_scene_prop_id"),
#belfry platform_b
(try_begin),
(eq, ":belfry_kind", 0),
(prop_instance_stop_animating, ":belfry_platform_b_scene_prop_id"),
(try_end),
#belfry wheel_1
(prop_instance_stop_animating, ":belfry_wheel_1_scene_prop_id"),
#belfry wheel_2
(prop_instance_stop_animating, ":belfry_wheel_2_scene_prop_id"),
#belfry wheel_3
(prop_instance_stop_animating, ":belfry_wheel_3_scene_prop_id"),
#belfry main body
(prop_instance_stop_animating, ":belfry_scene_prop_id"),
(try_end),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_number_of_agents_pushing, ":number_of_agents_around_belfry"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_next_entry_point_id, ":belfry_next_entry_point_id"),
(try_end),
(else_try),
(le, ":dist_between_belfry_and_its_destination", 4),
(scene_prop_slot_eq, ":belfry_scene_prop_id", scene_prop_belfry_platform_moved, 0),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_belfry_platform_moved, 1),
(try_begin),
(eq, ":belfry_kind", 0),
(scene_prop_get_instance, ":belfry_platform_a_scene_prop_id", "spr_belfry_platform_a", ":belfry_no"),
(else_try),
(scene_prop_get_instance, ":belfry_platform_a_scene_prop_id", "spr_belfry_b_platform_a", ":belfry_no"),
(try_end),
(prop_instance_get_starting_position, pos0, ":belfry_platform_a_scene_prop_id"),
(prop_instance_animate_to_position, ":belfry_platform_a_scene_prop_id", pos0, 400),
(try_end),
(try_end),
(try_end),
])
multiplayer_server_spawn_bots = (
0, 0, 0, [],
[
(multiplayer_is_server),
(eq, "$g_multiplayer_ready_for_spawning_agent", 1),
(store_add, ":total_req", "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_required_team_2"),
(try_begin),
(gt, ":total_req", 0),
(try_begin),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(team_get_score, ":team_1_score", 0),
(team_get_score, ":team_2_score", 1),
(store_add, ":current_round", ":team_1_score", ":team_2_score"),
(eq, ":current_round", 0),
(store_mission_timer_a, ":round_time"),
(val_sub, ":round_time", "$g_round_start_time"),
(lt, ":round_time", 20),
(assign, ":rounded_game_first_round_time_limit_past", 0),
(else_try),
(assign, ":rounded_game_first_round_time_limit_past", 1),
(try_end),
(eq, ":rounded_game_first_round_time_limit_past", 1),
(store_random_in_range, ":random_req", 0, ":total_req"),
(val_sub, ":random_req", "$g_multiplayer_num_bots_required_team_1"),
(try_begin),
(lt, ":random_req", 0),
#add to team 1
(assign, ":selected_team", 0),
(else_try),
#add to team 2
(assign, ":selected_team", 1),
(try_end),
(try_begin),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(store_mission_timer_a, ":round_time"),
(val_sub, ":round_time", "$g_round_start_time"),
(try_begin),
(le, ":round_time", 20),
(assign, ":look_only_actives", 0),
(else_try),
(assign, ":look_only_actives", 1),
(try_end),
(else_try),
(assign, ":look_only_actives", 1),
(try_end),
(call_script, "script_multiplayer_find_bot_troop_and_group_for_spawn", ":selected_team", ":look_only_actives"),
(assign, ":selected_troop", reg0),
(assign, ":selected_group", reg1),
(team_get_faction, ":team_faction", ":selected_team"),
(assign, ":num_ai_troops", 0),
(try_for_range, ":cur_ai_troop", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
(store_troop_faction, ":ai_troop_faction", ":cur_ai_troop"),
(eq, ":ai_troop_faction", ":team_faction"),
(val_add, ":num_ai_troops", 1),
(try_end),
(assign, ":number_of_active_players_wanted_bot", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_team_no, ":player_team_no", ":player_no"),
(eq, ":selected_team", ":player_team_no"),
(assign, ":ai_wanted", 0),
(store_add, ":end_cond", slot_player_bot_type_1_wanted, ":num_ai_troops"),
(try_for_range, ":bot_type_wanted_slot", slot_player_bot_type_1_wanted, ":end_cond"),
(player_slot_ge, ":player_no", ":bot_type_wanted_slot", 1),
(assign, ":ai_wanted", 1),
(assign, ":end_cond", 0),
(try_end),
(ge, ":ai_wanted", 1),
(val_add, ":number_of_active_players_wanted_bot", 1),
(try_end),
(try_begin),
(this_or_next|ge, ":selected_group", 0),
(eq, ":number_of_active_players_wanted_bot", 0),
(troop_get_inventory_slot, ":has_item", ":selected_troop", ek_horse),
(try_begin),
(ge, ":has_item", 0),
(assign, ":is_horseman", 1),
(else_try),
(assign, ":is_horseman", 0),
(try_end),
(try_begin),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(store_mission_timer_a, ":round_time"),
(val_sub, ":round_time", "$g_round_start_time"),
(try_begin),
(lt, ":round_time", 20), #at start of game spawn at base entry point
(try_begin),
(eq, ":selected_team", 0),
(call_script, "script_multiplayer_find_spawn_point", ":selected_team", 1, ":is_horseman"),
(else_try),
(assign, reg0, multi_initial_spawn_point_team_2),
(try_end),
(else_try),
(call_script, "script_multiplayer_find_spawn_point", ":selected_team", 0, ":is_horseman"),
(try_end),
(else_try),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(try_begin),
(eq, ":selected_team", 0),
(assign, reg0, 0),
(else_try),
(assign, reg0, 32),
(try_end),
(else_try),
(call_script, "script_multiplayer_find_spawn_point", ":selected_team", 0, ":is_horseman"),
(try_end),
(store_current_scene, ":cur_scene"),
(modify_visitors_at_site, ":cur_scene"),
(add_visitors_to_current_scene, reg0, ":selected_troop", 1, ":selected_team", ":selected_group"),
(assign, "$g_multiplayer_ready_for_spawning_agent", 0),
(try_begin),
(eq, ":selected_team", 0),
(val_sub, "$g_multiplayer_num_bots_required_team_1", 1),
(else_try),
(eq, ":selected_team", 1),
(val_sub, "$g_multiplayer_num_bots_required_team_2", 1),
(try_end),
(try_end),
(try_end),
])
multiplayer_server_manage_bots = (
3, 0, 0, [],
[
(multiplayer_is_server),
(try_for_agents, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_group, ":agent_group", ":cur_agent"),
(try_begin),
(neg|player_is_active, ":agent_group"),
(call_script, "script_multiplayer_change_leader_of_bot", ":cur_agent"),
(else_try),
(player_get_team_no, ":leader_team_no", ":agent_group"),
(agent_get_team, ":agent_team", ":cur_agent"),
(neq, ":leader_team_no", ":agent_team"),
(call_script, "script_multiplayer_change_leader_of_bot", ":cur_agent"),
(try_end),
(try_end),
])
multiplayer_server_check_polls = (
1, 5, 0,
[
(multiplayer_is_server),
(eq, "$g_multiplayer_poll_running", 1),
(eq, "$g_multiplayer_poll_ended", 0),
(store_mission_timer_a, ":mission_timer"),
(store_add, ":total_votes", "$g_multiplayer_poll_no_count", "$g_multiplayer_poll_yes_count"),
(this_or_next|eq, ":total_votes", "$g_multiplayer_poll_num_sent"),
(gt, ":mission_timer", "$g_multiplayer_poll_end_time"),
(call_script, "script_cf_multiplayer_evaluate_poll"),
],
[
(assign, "$g_multiplayer_poll_running", 0),
(try_begin),
(this_or_next|eq, "$g_multiplayer_poll_to_show", 0), #change map
(eq, "$g_multiplayer_poll_to_show", 3), #change map with factions
(call_script, "script_game_multiplayer_get_game_type_mission_template", "$g_multiplayer_game_type"),
(start_multiplayer_mission, reg0, "$g_multiplayer_poll_value_to_show", 1),
(call_script, "script_game_set_multiplayer_mission_end"),
(try_end),
])
multiplayer_server_check_end_map = (
1, 0, 0, [],
[
(multiplayer_is_server),
#checking for restarting the map
(assign, ":end_map", 0),
(try_begin),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(try_begin),
(eq, "$g_round_ended", 1),
(store_mission_timer_a, ":seconds_past_till_round_ended"),
(val_sub, ":seconds_past_till_round_ended", "$g_round_finish_time"),
(store_sub, ":multiplayer_respawn_period_minus_one", "$g_multiplayer_respawn_period", 1),
(ge, ":seconds_past_till_round_ended", ":multiplayer_respawn_period_minus_one"),
(store_mission_timer_a, ":mission_timer"),
(try_begin),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(assign, ":reduce_amount", 90),
(else_try),
(assign, ":reduce_amount", 120),
(try_end),
(store_mul, ":game_max_seconds", "$g_multiplayer_game_max_minutes", 60),
(store_sub, ":game_max_seconds_min_n_seconds", ":game_max_seconds", ":reduce_amount"), #when round ends if there are 60 seconds to map change time then change map without completing exact map time.
(gt, ":mission_timer", ":game_max_seconds_min_n_seconds"),
(assign, ":end_map", 1),
(try_end),
(eq, ":end_map", 1),
(else_try),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_battle), #battle mod has different end map condition by time
(neq, "$g_multiplayer_game_type", multiplayer_game_type_destroy), #fight and destroy mod has different end map condition by time
(neq, "$g_multiplayer_game_type", multiplayer_game_type_siege), #siege mod has different end map condition by time
(neq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters), #in headquarters mod game cannot limited by time, only can be limited by score.
(store_mission_timer_a, ":mission_timer"),
(store_mul, ":game_max_seconds", "$g_multiplayer_game_max_minutes", 60),
(gt, ":mission_timer", ":game_max_seconds"),
(assign, ":end_map", 1),
(else_try),
#assuming only 2 teams in scene
(team_get_score, ":team_1_score", 0),
(team_get_score, ":team_2_score", 1),
(try_begin),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters), #for not-headquarters mods
(try_begin),
(this_or_next|ge, ":team_1_score", "$g_multiplayer_game_max_points"),
(ge, ":team_2_score", "$g_multiplayer_game_max_points"),
(assign, ":end_map", 1),
(try_end),
(else_try),
(assign, ":at_least_one_player_is_at_game", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_agent_id, ":agent_id", ":player_no"),
(ge, ":agent_id", 0),
(neg|agent_is_non_player, ":agent_id"),
(assign, ":at_least_one_player_is_at_game", 1),
(assign, ":num_players", 0),
(try_end),
(eq, ":at_least_one_player_is_at_game", 1),
(this_or_next|le, ":team_1_score", 0), #in headquarters game ends only if one team has 0 score.
(le, ":team_2_score", 0),
(assign, ":end_map", 1),
(try_end),
(try_end),
(try_begin),
(eq, ":end_map", 1),
(call_script, "script_game_multiplayer_get_game_type_mission_template", "$g_multiplayer_game_type"),
(start_multiplayer_mission, reg0, "$g_multiplayer_selected_map", 0),
(call_script, "script_game_set_multiplayer_mission_end"),
(try_end),
])
multiplayer_once_at_the_first_frame = (
0, 0, ti_once, [], [
(start_presentation, "prsnt_multiplayer_welcome_message"),
])
multiplayer_battle_window_opened = (
ti_battle_window_opened, 0, 0, [], [
(start_presentation, "prsnt_multiplayer_team_score_display"),
])
common_battle_mission_start = (
ti_before_mission_start, 0, 0, [],
[
(team_set_relation, 0, 2, 1),
(team_set_relation, 1, 3, 1),
(call_script, "script_change_banners_and_chest"),
])
common_battle_tab_press = (
ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_battle_won", 1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),
(else_try),
(call_script, "script_cf_check_enemies_nearby"),
(question_box,"str_do_you_want_to_retreat"),
(else_try),
(display_message,"str_can_not_retreat"),
(try_end),
])
common_battle_init_banner = (
ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(call_script, "script_troop_agent_set_banner", "tableau_game_troop_label_banner", ":agent_no", ":troop_no"),
])
common_arena_fight_tab_press = (
ti_tab_pressed, 0, 0, [],
[
(question_box,"str_give_up_fight"),
])
common_custom_battle_tab_press = (
ti_tab_pressed, 0, 0, [],
[
(try_begin),
(neq, "$g_battle_result", 0),
(call_script, "script_custom_battle_end"),
(finish_mission),
(else_try),
(question_box,"str_give_up_fight"),
(try_end),
])
custom_battle_check_victory_condition = (
1, 60, ti_once,
[
(store_mission_timer_a,reg(1)),
(ge,reg(1),10),
(all_enemies_defeated, 2),
(neg|main_hero_fallen, 0),
(set_mission_result,1),
(display_message,"str_msg_battle_won"),
(assign, "$g_battle_won",1),
(assign, "$g_battle_result", 1),
],
[
(call_script, "script_custom_battle_end"),
(finish_mission, 1),
])
custom_battle_check_defeat_condition = (
1, 4, ti_once,
[
(main_hero_fallen),
(assign,"$g_battle_result",-1),
],
[
(call_script, "script_custom_battle_end"),
(finish_mission),
])
common_battle_victory_display = (
10, 0, 0, [],
[
(eq,"$g_battle_won",1),
(display_message,"str_msg_battle_won"),
])
common_siege_question_answered = (
ti_question_answered, 0, 0, [],
[
(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$pin_player_fallen", 0),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":agent_team", ":player_agent"),
(try_begin),
(neq, "$attacker_team", ":agent_team"),
(neq, "$attacker_team_2", ":agent_team"),
(str_store_string, s5, "str_siege_continues"),
(call_script, "script_simulate_retreat", 8, 15, 0),
(else_try),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 5, 20, 0),
(try_end),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),
])
common_custom_battle_question_answered = (
ti_question_answered, 0, 0, [],
[
(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$g_battle_result", -1),
(call_script, "script_custom_battle_end"),
(finish_mission),
])
common_custom_siege_init = (
0, 0, ti_once, [],
[
(assign, "$g_battle_result", 0),
(call_script, "script_music_set_situation_with_culture", mtf_sit_siege),
])
common_siege_init = (
0, 0, ti_once, [],
[
(assign,"$g_battle_won",0),
(assign,"$defender_reinforcement_stage",0),
(assign,"$attacker_reinforcement_stage",0),
(call_script, "script_music_set_situation_with_culture", mtf_sit_siege),
])
common_music_situation_update = (
30, 0, 0, [],
[
(call_script, "script_combat_music_set_situation_with_culture"),
])
common_siege_ai_trigger_init = (
0, 0, ti_once,
[
(assign, "$defender_team", 0),
(assign, "$attacker_team", 1),
(assign, "$defender_team_2", 2),
(assign, "$attacker_team_2", 3),
], [])
common_siege_ai_trigger_init_2 = (
0, 0, ti_once,
[
(set_show_messages, 0),
(entry_point_get_position, pos10, 10),
(try_for_range, ":cur_group", 0, grc_everyone),
(neq, ":cur_group", grc_archers),
(team_give_order, "$defender_team", ":cur_group", mordr_hold),
(team_give_order, "$defender_team", ":cur_group", mordr_stand_closer),
(team_give_order, "$defender_team", ":cur_group", mordr_stand_closer),
(team_give_order, "$defender_team_2", ":cur_group", mordr_hold),
(team_give_order, "$defender_team_2", ":cur_group", mordr_stand_closer),
(team_give_order, "$defender_team_2", ":cur_group", mordr_stand_closer),
(try_end),
(team_give_order, "$defender_team", grc_archers, mordr_stand_ground),
(team_set_order_position, "$defender_team", grc_everyone, pos10),
(team_give_order, "$defender_team_2", grc_archers, mordr_stand_ground),
(team_set_order_position, "$defender_team_2", grc_everyone, pos10),
(set_show_messages, 1),
], [])
common_siege_ai_trigger_init_after_2_secs = (
0, 2, ti_once, [],
[
(try_for_agents, ":agent_no"),
(agent_set_slot, ":agent_no", slot_agent_is_not_reinforcement, 1),
(try_end),
])
common_siege_defender_reinforcement_check = (
3, 0, 5, [],
[(lt, "$defender_reinforcement_stage", 7),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",10),
(store_normalized_team_count,":num_defenders",0),
(lt,":num_defenders",8),
(add_reinforcements_to_entry,4, 7),
(val_add,"$defender_reinforcement_stage",1),
(try_begin),
(gt, ":mission_time", 300), #5 minutes, don't let small armies charge
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(neq, ":player_team", "$defender_team"), #player should be the attacker
(neq, ":player_team", "$defender_team_2"), #player should be the attacker
(ge, "$defender_reinforcement_stage", 2),
(set_show_messages, 0),
(team_give_order, "$defender_team", grc_infantry, mordr_charge), #AI desperate charge:infantry!!!
(team_give_order, "$defender_team_2", grc_infantry, mordr_charge), #AI desperate charge:infantry!!!
(team_give_order, "$defender_team", grc_cavalry, mordr_charge), #AI desperate charge:cavalry!!!
(team_give_order, "$defender_team_2", grc_cavalry, mordr_charge), #AI desperate charge:cavalry!!!
(set_show_messages, 1),
(ge, "$defender_reinforcement_stage", 4),
(set_show_messages, 0),
(team_give_order, "$defender_team", grc_everyone, mordr_charge), #AI desperate charge: everyone!!!
(team_give_order, "$defender_team_2", grc_everyone, mordr_charge), #AI desperate charge: everyone!!!
(set_show_messages, 1),
(try_end),
])
common_siege_defender_reinforcement_archer_reposition = (
2, 0, 0,
[
(gt, "$defender_reinforcement_stage", 0),
],
[
(call_script, "script_siege_move_archers_to_archer_positions"),
])
common_siege_attacker_reinforcement_check = (
1, 0, 5,
[
(lt,"$attacker_reinforcement_stage",5),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",10),
(store_normalized_team_count,":num_attackers",1),
(lt,":num_attackers",6)
],
[
(add_reinforcements_to_entry, 1, 8),
(val_add,"$attacker_reinforcement_stage", 1),
])
common_siege_attacker_do_not_stall = (
5, 0, 0, [],
[ #Make sure attackers do not stall on the ladders...
(try_for_agents, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_get_team, ":agent_team", ":agent_no"),
(this_or_next|eq, ":agent_team", "$attacker_team"),
(eq, ":agent_team", "$attacker_team_2"),
(agent_ai_set_always_attack_in_melee, ":agent_no", 1),
(try_end),
])
common_battle_check_friendly_kills = (
2, 0, 0, [],
[
(call_script, "script_check_friendly_kills"),
])
common_battle_check_victory_condition = (
1, 60, ti_once,
[
(store_mission_timer_a,reg(1)),
(ge,reg(1),10),
(all_enemies_defeated, 5),
(neg|main_hero_fallen, 0),
(set_mission_result,1),
(display_message,"str_msg_battle_won"),
(assign,"$g_battle_won",1),
(assign, "$g_battle_result", 1),
(call_script, "script_play_victorious_sound"),
],
[
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission, 1),
])
common_battle_victory_display = (
10, 0, 0, [],
[
(eq,"$g_battle_won",1),
(display_message,"str_msg_battle_won"),
])
common_siege_refill_ammo = (
120, 0, 0, [],
[#refill ammo of defenders every two minutes.
(get_player_agent_no, ":player_agent"),
(try_for_agents,":cur_agent"),
(neq, ":cur_agent", ":player_agent"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
## (agent_is_defender, ":cur_agent"),
(agent_get_team, ":agent_team", ":cur_agent"),
(this_or_next|eq, ":agent_team", "$defender_team"),
(eq, ":agent_team", "$defender_team_2"),
(agent_refill_ammo, ":cur_agent"),
(try_end),
])
common_siege_check_defeat_condition = (
1, 4, ti_once,
[
(main_hero_fallen)
],
[
(assign, "$pin_player_fallen", 1),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":agent_team", ":player_agent"),
(try_begin),
(neq, "$attacker_team", ":agent_team"),
(neq, "$attacker_team_2", ":agent_team"),
(str_store_string, s5, "str_siege_continues"),
(call_script, "script_simulate_retreat", 8, 15, 0),
(else_try),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 5, 20, 0),
(try_end),
(assign, "$g_battle_result", -1),
(set_mission_result,-1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),
])
common_battle_order_panel = (
0, 0, 0, [],
[
(game_key_clicked, gk_view_orders),
(neg|is_presentation_active, "prsnt_battle"),
(start_presentation, "prsnt_battle"),
])
common_battle_order_panel_tick = (
0.1, 0, 0, [],
[
(is_presentation_active, "prsnt_battle"),
(call_script, "script_update_order_panel_statistics_and_map"),
])
common_battle_inventory = (
ti_inventory_key_pressed, 0, 0, [],
[
(display_message,"str_use_baggage_for_inventory"),
])
common_inventory_not_available = (
ti_inventory_key_pressed, 0, 0,
[
(display_message, "str_cant_use_inventory_now"),
], [])
common_siege_init_ai_and_belfry = (
0, 0, ti_once,
[
(call_script, "script_siege_init_ai_and_belfry"),
], [])
common_siege_move_belfry = (
0, 0, ti_once,
[
(call_script, "script_cf_siege_move_belfry"),
], [])
common_siege_rotate_belfry = (
0, 2, ti_once,
[
(call_script, "script_cf_siege_rotate_belfry_platform"),
],
[
(assign, "$belfry_positioned", 3),
])
common_siege_assign_men_to_belfry = (
0, 0, ti_once,
[
(call_script, "script_cf_siege_assign_men_to_belfry"),
], [])
tournament_triggers = [
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest"),
(assign, "$g_arena_training_num_agents_spawned", 0)]),
(ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_arena")], []),
(ti_tab_pressed, 0, 0, [],
[(try_begin),
(eq, "$g_mt_mode", abm_visit),
(set_trigger_result, 1),
(else_try),
(question_box,"str_give_up_fight"),
(try_end),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(try_begin),
(eq, "$g_mt_mode", abm_tournament),
(call_script, "script_end_tournament_fight", 0),
(else_try),
(eq, "$g_mt_mode", abm_training),
(get_player_agent_no, ":player_agent"),
(agent_get_kill_count, "$g_arena_training_kills", ":player_agent", 1),#use this for conversation
(try_end),
(finish_mission,0),
]),
(1, 0, ti_once, [], [
(eq, "$g_mt_mode", abm_visit),
(call_script, "script_music_set_situation_with_culture", mtf_sit_travel),
(store_current_scene, reg(1)),
(scene_set_slot, reg(1), slot_scene_visited, 1),
(mission_enable_talk),
(get_player_agent_no, ":player_agent"),
(assign, ":team_set", 0),
(try_for_agents, ":agent_no"),
(neq, ":agent_no", ":player_agent"),
(agent_get_troop_id, ":troop_id", ":agent_no"),
(is_between, ":troop_id", regular_troops_begin, regular_troops_end),
(eq, ":team_set", 0),
(agent_set_team, ":agent_no", 1),
(assign, ":team_set", 1),
(try_end),
]),
##
## (0, 0, 0, [],
## [
## #refresh hit points for arena visit trainers
## (eq, "$g_mt_mode", abm_visit),
## (get_player_agent_no, ":player_agent"),
## (try_for_agents, ":agent_no"),
## (neq, ":agent_no", ":player_agent"),
## (agent_get_troop_id, ":troop_id", ":agent_no"),
## (is_between, ":troop_id", regular_troops_begin, regular_troops_end),
## (agent_set_hit_points, ":agent_no", 100),
## (try_end),
## ]),
## (1, 4, ti_once, [(eq, "$g_mt_mode", abm_fight),
## (this_or_next|main_hero_fallen),
## (num_active_teams_le,1)],
## [
## (try_begin),
## (num_active_teams_le,1),
## (neg|main_hero_fallen),
## (assign,"$arena_fight_won",1),
## #Fight won, decrease odds
## (assign, ":player_odds_sub", 0),
## (try_begin),
## (ge,"$arena_bet_amount",1),
## (store_div, ":player_odds_sub", "$arena_win_amount", 2),
## (try_end),
## (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
## (val_add, ":player_odds_sub", 5),
## (val_sub, ":player_odds", ":player_odds_sub"),
## (val_max, ":player_odds", 250),
## (party_set_slot, "$g_encountered_party", slot_town_player_odds, ":player_odds"),
## (else_try),
## #Fight lost, increase odds
## (assign, ":player_odds_add", 0),
## (try_begin),
## (ge,"$arena_bet_amount",1),
## (store_div, ":player_odds_add", "$arena_win_amount", 2),
## (try_end),
## (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
## (val_add, ":player_odds_add", 5),
## (val_add, ":player_odds", ":player_odds_add"),
## (val_min, ":player_odds", 4000),
## (party_set_slot, "$g_encountered_party", slot_town_player_odds, ":player_odds"),
## (try_end),
## (store_remaining_team_no,"$arena_winner_team"),
## (assign, "$g_mt_mode", abm_visit),
## (party_get_slot, ":arena_mission_template", "$current_town", slot_town_arena_template),
## (set_jump_mission, ":arena_mission_template"),
## (party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
## (modify_visitors_at_site, ":arena_scene"),
## (reset_visitors),
## (set_visitor, 35, "trp_veteran_fighter"),
## (set_visitor, 36, "trp_hired_blade"),
## (set_jump_entry, 50),
## (jump_to_scene, ":arena_scene"),
## ]),
(0, 0, ti_once, [],
[
(eq, "$g_mt_mode", abm_tournament),
(play_sound, "snd_arena_ambiance", sf_looping),
(call_script, "script_music_set_situation_with_culture", mtf_sit_arena),
]),
(1, 4, ti_once, [(eq, "$g_mt_mode", abm_tournament),
(this_or_next|main_hero_fallen),
(num_active_teams_le, 1)],
[
(try_begin),
(neg|main_hero_fallen),
(call_script, "script_end_tournament_fight", 1),
(call_script, "script_play_victorious_sound"),
(finish_mission),
(else_try),
(call_script, "script_end_tournament_fight", 0),
(finish_mission),
(try_end),
]),
(ti_battle_window_opened, 0, 0, [], [(eq, "$g_mt_mode", abm_training),(start_presentation, "prsnt_arena_training")]),
(0, 0, ti_once, [], [(eq, "$g_mt_mode", abm_training),
(assign, "$g_arena_training_max_opponents", 40),
(assign, "$g_arena_training_num_agents_spawned", 0),
(assign, "$g_arena_training_kills", 0),
(assign, "$g_arena_training_won", 0),
(call_script, "script_music_set_situation_with_culture", mtf_sit_arena),
]),
(1, 4, ti_once, [(eq, "$g_mt_mode", abm_training),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 3),
(assign, ":win_cond", 0),
(try_begin),
(ge, "$g_arena_training_num_agents_spawned", "$g_arena_training_max_opponents"),#spawn at most 40 agents
(num_active_teams_le, 1),
(assign, ":win_cond", 1),
(try_end),
(this_or_next|eq, ":win_cond", 1),
(main_hero_fallen)],
[
(get_player_agent_no, ":player_agent"),
(agent_get_kill_count, "$g_arena_training_kills", ":player_agent", 1),#use this for conversation
(assign, "$g_arena_training_won", 0),
(try_begin),
(neg|main_hero_fallen),
(assign, "$g_arena_training_won", 1),#use this for conversation
(try_end),
(assign, "$g_mt_mode", abm_visit),
(set_jump_mission, "mt_arena_melee_fight"),
(party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
(modify_visitors_at_site, ":arena_scene"),
(reset_visitors),
(set_visitor, 35, "trp_veteran_fighter"),
(set_visitor, 36, "trp_hired_blade"),
(set_jump_entry, 50),
(jump_to_scene, ":arena_scene"),
]),
(0.2, 0, 0,
[
(eq, "$g_mt_mode", abm_training),
(assign, ":num_active_fighters", 0),
(try_for_agents, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_get_team, ":team_no", ":agent_no"),
(is_between, ":team_no", 0 ,7),
(val_add, ":num_active_fighters", 1),
(try_end),
(lt, ":num_active_fighters", 7),
(neg|main_hero_fallen),
(store_mission_timer_a, ":cur_time"),
(this_or_next|ge, ":cur_time", "$g_arena_training_next_spawn_time"),
(this_or_next|lt, "$g_arena_training_num_agents_spawned", 6),
(num_active_teams_le, 1),
(lt, "$g_arena_training_num_agents_spawned", "$g_arena_training_max_opponents"),
],
[
(assign, ":added_troop", "$g_arena_training_num_agents_spawned"),
(store_div, ":added_troop", "$g_arena_training_num_agents_spawned", 6),
(assign, ":added_troop_sequence", "$g_arena_training_num_agents_spawned"),
(val_mod, ":added_troop_sequence", 6),
(val_add, ":added_troop", ":added_troop_sequence"),
(val_min, ":added_troop", 9),
(val_add, ":added_troop", "trp_arena_training_fighter_1"),
(assign, ":end_cond", 10000),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos5, ":player_agent"),
(try_for_range, ":unused", 0, ":end_cond"),
(store_random_in_range, ":random_entry_point", 32, 40),
(neq, ":random_entry_point", "$g_player_entry_point"), # make sure we don't overwrite player
(entry_point_get_position, pos1, ":random_entry_point"),
(get_distance_between_positions, ":dist", pos5, pos1),
(gt, ":dist", 1200), #must be at least 12 meters away from the player
(assign, ":end_cond", 0),
(try_end),
(add_visitors_to_current_scene, ":random_entry_point", ":added_troop", 1),
(store_add, ":new_spawned_count", "$g_arena_training_num_agents_spawned", 1),
(store_mission_timer_a, ":cur_time"),
(store_add, "$g_arena_training_next_spawn_time", ":cur_time", 14),
(store_div, ":time_reduction", ":new_spawned_count", 3),
(val_sub, "$g_arena_training_next_spawn_time", ":time_reduction"),
]),
(0, 0, 0,
[
(eq, "$g_mt_mode", abm_training)
],
[
(assign, ":max_teams", 6),
(val_max, ":max_teams", 1),
(get_player_agent_no, ":player_agent"),
(try_for_agents, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_slot_eq, ":agent_no", slot_agent_arena_team_set, 0),
(agent_get_team, ":team_no", ":agent_no"),
(is_between, ":team_no", 0 ,7),
(try_begin),
(eq, ":agent_no", ":player_agent"),
(agent_set_team, ":agent_no", 6), #player is always team 6.
(else_try),
(store_random_in_range, ":selected_team", 0, ":max_teams"),
# find strongest team
(try_for_range, ":t", 0, 6),
(troop_set_slot, "trp_temp_array_a", ":t", 0),
(try_end),
(try_for_agents, ":other_agent_no"),
(agent_is_human, ":other_agent_no"),
(agent_is_alive, ":other_agent_no"),
(neq, ":agent_no", ":player_agent"),
(agent_slot_eq, ":other_agent_no", slot_agent_arena_team_set, 1),
(agent_get_team, ":other_agent_team", ":other_agent_no"),
(troop_get_slot, ":count", "trp_temp_array_a", ":other_agent_team"),
(val_add, ":count", 1),
(troop_set_slot, "trp_temp_array_a", ":other_agent_team", ":count"),
(try_end),
(assign, ":strongest_team", 0),
(troop_get_slot, ":strongest_team_count", "trp_temp_array_a", 0),
(try_for_range, ":t", 1, 6),
(troop_slot_ge, "trp_temp_array_a", ":t", ":strongest_team_count"),
(troop_get_slot, ":strongest_team_count", "trp_temp_array_a", ":t"),
(assign, ":strongest_team", ":t"),
(try_end),
(store_random_in_range, ":rand", 5, 100),
(try_begin),
(lt, ":rand", "$g_arena_training_num_agents_spawned"),
(assign, ":selected_team", ":strongest_team"),
(try_end),
(agent_set_team, ":agent_no", ":selected_team"),
(try_end),
(agent_set_slot, ":agent_no", slot_agent_arena_team_set, 1),
(try_begin),
(neq, ":agent_no", ":player_agent"),
(val_add, "$g_arena_training_num_agents_spawned", 1),
(try_end),
(try_end),
]),
]
mission_templates = [
(
"town_default",0,-1,
"Default town visit",
[(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(1,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(4,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(5,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(6,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(7,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(8,mtef_scene_source,af_override_horse,0,1,[]),
(9,mtef_scene_source,af_override_horse,0,1,[]),
(10,mtef_scene_source,af_override_horse,0,1,[]),
(11,mtef_scene_source,af_override_horse,0,1,[]),
(12,mtef_scene_source,af_override_horse,0,1,[]),
(13,mtef_scene_source,0,0,1,[]),
(14,mtef_scene_source,0,0,1,[]),
(15,mtef_scene_source,0,0,1,[]),
(16,mtef_visitor_source,af_override_horse,0,1,[]),
(17,mtef_visitor_source,af_override_horse,0,1,[]),
(18,mtef_visitor_source,af_override_horse,0,1,[]),
(19,mtef_visitor_source,af_override_horse,0,1,[]),
(20,mtef_visitor_source,af_override_horse,0,1,[]),
(21,mtef_visitor_source,af_override_horse,0,1,[]),
(22,mtef_visitor_source,af_override_horse,0,1,[]),
(23,mtef_visitor_source,af_override_horse,0,1,[]),
(24,mtef_visitor_source,af_override_horse,0,1,[]),
(25,mtef_visitor_source,af_override_horse,0,1,[]),
(26,mtef_visitor_source,af_override_horse,0,1,[]),
(27,mtef_visitor_source,af_override_horse,0,1,[]),
(28,mtef_visitor_source,af_override_horse,0,1,[]),
(29,mtef_visitor_source,af_override_horse,0,1,[]),
(30,mtef_visitor_source,af_override_horse,0,1,[]),
(31,mtef_visitor_source,af_override_horse,0,1,[]),
],
[
(1, 0, ti_once, [],
[
(store_current_scene, ":cur_scene"),
(scene_set_slot, ":cur_scene", slot_scene_visited, 1),
(try_begin),
(eq, "$sneaked_into_town", 1),
(call_script, "script_music_set_situation_with_culture", mtf_sit_town_infiltrate),
(else_try),
(eq, "$talk_context", tc_tavern_talk),
(call_script, "script_music_set_situation_with_culture", mtf_sit_tavern),
(else_try),
(call_script, "script_music_set_situation_with_culture", mtf_sit_town),
(try_end),
]),
(ti_before_mission_start, 0, 0, [],
[
(call_script, "script_change_banners_and_chest"),
(call_script, "script_initialize_tavern_variables"),
]),
(ti_inventory_key_pressed, 0, 0,
[
(set_trigger_result,1)
], []),
#tavern - belligerent drunk leaving/fading out
(1, 0, 0,
[
(gt, "$g_belligerent_drunk_leaving", 0),
(entry_point_get_position, pos0, 0),
(agent_get_position, pos1, "$g_belligerent_drunk_leaving"),
(get_distance_between_positions, ":dist", pos0, pos1),
(le, ":dist", 150),
],
[
(agent_fade_out, "$g_belligerent_drunk_leaving"),
(assign, "$g_belligerent_drunk_leaving", 0),
]),
(ti_tab_pressed, 0, 0,
[
(try_begin),
(eq, "$g_main_attacker_agent", 0),
(set_trigger_result, 1),
(try_end),
], []),
#tavern brawl triggers - drunk
(2, 0, 0,
[
(neg|conversation_screen_is_active),
(eq, "$talk_context", tc_tavern_talk),
(neg|troop_slot_eq, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),
(troop_slot_eq, "trp_belligerent_drunk", slot_troop_cur_center, "$g_encountered_party"),
(eq, "$drunks_dont_pick_fights", 0),
],
[
(try_begin),
(eq, "$g_start_belligerent_drunk_fight", 0),
(assign, "$g_start_belligerent_drunk_fight", 1),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "trp_belligerent_drunk"),
(assign, "$g_belligerent_drunk", ":cur_agent"),
(try_end),
(else_try),
(eq, "$g_start_belligerent_drunk_fight", 1),
(agent_is_active, "$g_belligerent_drunk"),
(agent_is_alive, "$g_belligerent_drunk"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(agent_get_position, pos1, "$g_belligerent_drunk"),
(get_distance_between_positions, ":dist", pos0, pos1),
(position_get_z, ":pos0_z", pos0),
(position_get_z, ":pos1_z", pos1),
(store_sub, ":z_difference", ":pos1_z", ":pos0_z"),
(try_begin),
(le, ":z_difference", 0),
(val_mul, ":z_difference", -1),
(try_end),
(store_mul, ":z_difference_mul_3", ":z_difference", 3),
(val_add, ":dist", ":z_difference_mul_3"),
(store_random_in_range, ":random_value", 0, 200),
(store_add, ":400_plus_random_200", 400, ":random_value"),
(le, ":dist", ":400_plus_random_200"),
(call_script, "script_activate_tavern_attackers"),
(start_mission_conversation, "trp_belligerent_drunk"),
(assign, "$g_start_belligerent_drunk_fight", 2),
(try_end),
]),
#tavern brawl triggers - assassin
(2, 0, 0, [
(neg|conversation_screen_is_active),
(eq, "$talk_context", tc_tavern_talk),
(troop_slot_eq, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),
],
[
(try_begin),
(eq, "$g_start_hired_assassin_fight", 0),
(assign, "$g_start_hired_assassin_fight", 1),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "trp_hired_assassin"),
(assign, "$g_hired_assassin", ":cur_agent"),
(try_end),
(else_try),
(eq, "$g_start_hired_assassin_fight", 1),
(agent_is_active, "$g_hired_assassin"),
(agent_is_alive, "$g_hired_assassin"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(agent_get_position, pos1, "$g_hired_assassin"),
(get_distance_between_positions, ":dist", pos0, pos1),
(position_get_z, ":pos0_z", pos0),
(position_get_z, ":pos1_z", pos1),
(store_sub, ":z_difference", ":pos1_z", ":pos0_z"),
(try_begin),
(le, ":z_difference", 0),
(val_mul, ":z_difference", -1),
(try_end),
(store_mul, ":z_difference_mul_3", ":z_difference", 3),
(val_add, ":dist", ":z_difference_mul_3"),
(store_random_in_range, ":random_value", 0, 200),
(store_add, ":400_plus_random_200", 400, ":random_value"),
(le, ":dist", ":400_plus_random_200"),
(call_script, "script_activate_tavern_attackers"),
(assign, "$g_start_hired_assassin_fight", 2),
(try_end),
]),
#Aftermath talks
(3, 0, ti_once,
[
(neg|conversation_screen_is_active),
(eq, "$talk_context", tc_tavern_talk),
(gt, "$g_main_attacker_agent", 0),
(this_or_next|neg|agent_is_alive, "$g_main_attacker_agent"),
(agent_is_wounded, "$g_main_attacker_agent"),
],
[
(mission_enable_talk),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_position, pos4, ":agent"),
(agent_set_scripted_destination, ":agent", pos4),
(try_end),
(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
(start_mission_conversation, ":tavernkeeper"),
]),
#Aftermath talks
(3, 0, ti_once,
[
(neg|conversation_screen_is_active),
(eq, "$talk_context", tc_tavern_talk),
(gt, "$g_main_attacker_agent", 0),
(main_hero_fallen),
],
[
(jump_to_menu, "mnu_lost_tavern_duel"),
(finish_mission,0)
]),
#No shooting in the tavern
(1, 0, 0,
[
(neg|conversation_screen_is_active),
(eq, "$talk_context", tc_tavern_talk),
(gt, "$g_main_attacker_agent", 0),
(get_player_agent_no, ":player_agent"),
(agent_is_alive, ":player_agent"),
(agent_get_wielded_item, ":wielded_item", ":player_agent", 0),
(is_between, ":wielded_item", "itm_darts", "itm_torch"),
(neq, ":wielded_item", "itm_javelin_melee"),
(neq, ":wielded_item", "itm_throwing_spear_melee"),
(neq, ":wielded_item", "itm_jarid_melee"),
(neq, ":wielded_item", "itm_light_throwing_axes_melee"),
(neq, ":wielded_item", "itm_throwing_axes_melee"),
(neq, ":wielded_item", "itm_heavy_throwing_axes_melee"),
],
[
(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
(start_mission_conversation, ":tavernkeeper"),
]),
#Check for weapon in hand of attacker, also, everyone gets out of the way
(1, 0, 0,
[
(gt, "$g_main_attacker_agent", 0),
],
[
(agent_get_wielded_item, ":wielded_item", "$g_main_attacker_agent", 0),
(val_max, "$g_attacker_drawn_weapon", ":wielded_item"),
(call_script, "script_neutral_behavior_in_fight"),
]),
],
),
# This template is used in party encounters and such.
#
(
"conversation_encounter",0,-1,
"Conversation_encounter",
[( 0,mtef_visitor_source,af_override_fullhelm,0,1,[]),( 1,mtef_visitor_source,af_override_fullhelm,0,1,[]),
( 2,mtef_visitor_source,af_override_fullhelm,0,1,[]),( 3,mtef_visitor_source,af_override_fullhelm,0,1,[]),( 4,mtef_visitor_source,af_override_fullhelm,0,1,[]),( 5,mtef_visitor_source,af_override_fullhelm,0,1,[]),( 6,mtef_visitor_source,af_override_fullhelm,0,1,[]),
( 7,mtef_visitor_source,af_override_fullhelm,0,1,[]),( 8,mtef_visitor_source,af_override_fullhelm,0,1,[]),( 9,mtef_visitor_source,af_override_fullhelm,0,1,[]),(10,mtef_visitor_source,af_override_fullhelm,0,1,[]),(11,mtef_visitor_source,af_override_fullhelm,0,1,[]),
#prisoners now...
(12,mtef_visitor_source,af_override_fullhelm,0,1,[]),(13,mtef_visitor_source,af_override_fullhelm,0,1,[]),(14,mtef_visitor_source,af_override_fullhelm,0,1,[]),(15,mtef_visitor_source,af_override_fullhelm,0,1,[]),(16,mtef_visitor_source,af_override_fullhelm,0,1,[]),
#Other party
(17,mtef_visitor_source,af_override_fullhelm,0,1,[]),(18,mtef_visitor_source,af_override_fullhelm,0,1,[]),(19,mtef_visitor_source,af_override_fullhelm,0,1,[]),(20,mtef_visitor_source,af_override_fullhelm,0,1,[]),(21,mtef_visitor_source,af_override_fullhelm,0,1,[]),
(22,mtef_visitor_source,af_override_fullhelm,0,1,[]),(23,mtef_visitor_source,af_override_fullhelm,0,1,[]),(24,mtef_visitor_source,af_override_fullhelm,0,1,[]),(25,mtef_visitor_source,af_override_fullhelm,0,1,[]),(26,mtef_visitor_source,af_override_fullhelm,0,1,[]),
(27,mtef_visitor_source,af_override_fullhelm,0,1,[]),(28,mtef_visitor_source,af_override_fullhelm,0,1,[]),(29,mtef_visitor_source,af_override_fullhelm,0,1,[]),(30,mtef_visitor_source,af_override_fullhelm,0,1,[]),(31,mtef_visitor_source,af_override_fullhelm,0,1,[]),
],
[],
),
#----------------------------------------------------------------
#mission templates before this point are hardwired into the game.
#-----------------------------------------------------------------
(
"town_center",0,-1,
"Default town visit",
[(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(1,mtef_scene_source|mtef_team_0,0,0,1,[]),
(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(4,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(5,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(6,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(7,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(8,mtef_visitor_source,af_override_horse,0,1,[]),
(9,mtef_visitor_source,af_override_horse,0,1,[]),(10,mtef_visitor_source,af_override_horse,0,1,[]),(11,mtef_visitor_source,af_override_horse,0,1,[]),(12,mtef_visitor_source,af_override_horse,0,1,[]),(13,mtef_visitor_source,0,0,1,[]),(14,mtef_scene_source,0,0,1,[]),(15,mtef_scene_source,0,0,1,[]),
(16,mtef_visitor_source,af_override_horse,0,1,[]),(17,mtef_visitor_source,af_override_horse,0,1,[]),(18,mtef_visitor_source,af_override_horse,0,1,[]),(19,mtef_visitor_source,af_override_horse,0,1,[]),(20,mtef_visitor_source,af_override_horse,0,1,[]),(21,mtef_visitor_source,af_override_horse,0,1,[]),(22,mtef_visitor_source,af_override_horse,0,1,[]),
(23,mtef_visitor_source,af_override_horse,0,1,[]), #guard
(24,mtef_visitor_source,af_override_horse,0,1,[]), #guard
(25,mtef_visitor_source,af_override_horse,0,1,[]), #guard
(26,mtef_visitor_source,af_override_horse,0,1,[]), #guard
(27,mtef_visitor_source,af_override_horse,0,1,[]), #guard
(28,mtef_visitor_source,af_override_horse,0,1,[]), #guard
(29,mtef_visitor_source,af_override_horse,0,1,[]),
(30,mtef_visitor_source,af_override_horse,0,1,[]),
(31,mtef_visitor_source,af_override_horse,0,1,[]),
(32,mtef_visitor_source,af_override_horse,0,1,[]),
(33,mtef_visitor_source,af_override_horse,0,1,[]),
(34,mtef_visitor_source,af_override_horse,0,1,[]),
(35,mtef_visitor_source,af_override_horse,0,1,[]),
(36,mtef_visitor_source,af_override_horse,0,1,[]), #town walker point
(37,mtef_visitor_source,af_override_horse,0,1,[]), #town walker point
(38,mtef_visitor_source,af_override_horse,0,1,[]),
(39,mtef_visitor_source,af_override_horse,0,1,[]),
(40,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]), #in towns, can be used for guard reinforcements
(41,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]), #in towns, can be used for guard reinforcements
(42,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]), #in towns, can be used for guard reinforcements
(43,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]), #in towns, can be used for guard reinforcements
(44,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
],
[
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_init_town_agent", ":agent_no"),
(try_begin),
(this_or_next|eq, "$talk_context", tc_escape),
(eq, "$talk_context", tc_prison_break),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(troop_slot_eq, ":troop_no", slot_troop_will_join_prison_break, 1),
(agent_set_team, ":agent_no", 0),
(agent_ai_set_aggressiveness, ":agent_no", 5),
(troop_set_slot, ":troop_no", slot_troop_will_join_prison_break, 0),
(try_begin),
(troop_slot_eq, ":troop_no", slot_troop_mission_participation, mp_prison_break_stand_back),
(agent_get_position, pos1, ":agent_no"),
(agent_set_scripted_destination, ":agent_no", pos1),
(try_end),
(try_end),
]),
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_main_attacker_agent", 0),
]),
(1, 0, ti_once,
[],
[
(try_begin),
(eq, "$g_mt_mode", tcm_default),
(store_current_scene, ":cur_scene"),
(scene_set_slot, ":cur_scene", slot_scene_visited, 1),
(try_end),
(call_script, "script_init_town_walker_agents"),
(try_begin),
(eq, "$sneaked_into_town", 1),
(call_script, "script_music_set_situation_with_culture", mtf_sit_town_infiltrate),
(else_try),
(call_script, "script_music_set_situation_with_culture", mtf_sit_town),
(try_end),
]),
(ti_before_mission_start, 0, 0,
[],
[
(call_script, "script_change_banners_and_chest")
]),
(ti_inventory_key_pressed, 0, 0,
[
(try_begin),
(eq, "$g_mt_mode", tcm_default),
(set_trigger_result,1),
(else_try),
(eq, "$g_mt_mode", tcm_disguised),
(display_message,"str_cant_use_inventory_disguised"),
(else_try),
(display_message, "str_cant_use_inventory_now"),
(try_end),
],
[]),
(ti_tab_pressed, 0, 0,
[
(try_begin),
(this_or_next|eq, "$talk_context", tc_escape),
(eq, "$talk_context", tc_prison_break),
(display_message, "str_cannot_leave_now"),
(else_try),
(this_or_next|eq, "$g_mt_mode", tcm_default),
(eq, "$g_mt_mode", tcm_disguised),
(mission_enable_talk),
(set_trigger_result,1),
(else_try),
(display_message, "str_cannot_leave_now"),
(try_end),
],
[]),
(ti_on_leave_area, 0, 0,
[
(try_begin),
(eq, "$g_defending_against_siege", 0),
(assign,"$g_leave_town",1),
(try_end),
],
[
(try_begin),
(eq, "$talk_context", tc_escape),
(call_script, "script_deduct_casualties_from_garrison"),
(jump_to_menu,"mnu_sneak_into_town_caught_dispersed_guards"),
(try_end),
(mission_enable_talk),
]),
(0, 0, ti_once,
[],
[
(party_slot_eq, "$current_town", slot_party_type, spt_town),
(call_script, "script_town_init_doors", 0),
(try_begin),
(eq, "$town_nighttime", 0),
(play_sound, "snd_town_ambiance", sf_looping),
(try_end),
]),
(3, 0, 0,
[
(call_script, "script_tick_town_walkers")
],
[]),
(2, 0, 0,
[
(call_script, "script_center_ambiance_sounds")
],
[]),
#JAILBREAK TRIGGERS
#Civilians get out of the way
(1, 0, 0,
[
(this_or_next|eq, "$talk_context", tc_prison_break),
(eq, "$talk_context", tc_escape),
],
[
#(agent_get_team, ":prisoner_agent", 0),
(call_script, "script_neutral_behavior_in_fight"),
(mission_disable_talk),
]),
#The game begins with the town alerted
(1, 0, ti_once,
[
#If I set this to 1, 0, ti_once, then the prisoner spawns twice
(eq, "$talk_context", tc_escape),
],
[
(get_player_agent_no, ":player_agent"),
(assign, reg6, ":player_agent"),
(call_script, "script_activate_town_guard"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos4, ":player_agent"),
(try_for_range, ":prisoner", active_npcs_begin, kingdom_ladies_end),
(troop_slot_ge, ":prisoner", slot_troop_mission_participation, mp_prison_break_fight),
(str_store_troop_name, s4, ":prisoner"),
(display_message, "str_s4_joins_prison_break"),
(store_current_scene, ":cur_scene"), #this might be a better option?
(modify_visitors_at_site, ":cur_scene"),
#<entry_no>,<troop_id>,<number_of_troops>, <team_no>, <group_no>),
#team no and group no are used in multiplayer mode only. default team in entry is used in single player mode
(store_current_scene, ":cur_scene"),
(modify_visitors_at_site, ":cur_scene"),
(add_visitors_to_current_scene, 24, ":prisoner", 1, 0, 0),
(troop_set_slot, ":prisoner", slot_troop_will_join_prison_break, 1),
(try_end),
]),
(3, 0, 0,
[
(main_hero_fallen, 0),
],
[
(try_begin),
(this_or_next|eq, "$talk_context", tc_prison_break),
(eq, "$talk_context", tc_escape),
(call_script, "script_deduct_casualties_from_garrison"),
(jump_to_menu,"mnu_captivity_start_castle_defeat"),
(assign, ":end_cond", kingdom_ladies_end),
(try_for_range, ":prisoner", active_npcs_begin, ":end_cond"),
(troop_set_slot, ":prisoner", slot_troop_mission_participation, 0), #new
(try_end),
(mission_enable_talk),
(finish_mission, 0),
(else_try),
(set_trigger_result,1),
(try_end),
]),
(3, 0, 0,
[
(eq, "$talk_context", tc_escape),
(neg|main_hero_fallen,0),
(store_mission_timer_a, ":time"),
(ge, ":time", 10),
(all_enemies_defeated), #1 is default enemy team for in-town battles
],
[
(call_script, "script_deduct_casualties_from_garrison"),
(try_for_agents, ":agent"),
(agent_get_troop_id, ":troop", ":agent"),
(troop_slot_ge, ":troop", slot_troop_mission_participation, mp_prison_break_fight),
(try_begin),
(agent_is_alive, ":agent"),
(troop_set_slot, ":troop", slot_troop_mission_participation, mp_prison_break_escaped),
(else_try),
(troop_set_slot, ":troop", slot_troop_mission_participation, mp_prison_break_caught),
(try_end),
(try_end),
(jump_to_menu,"mnu_sneak_into_town_caught_ran_away"),
(mission_enable_talk),
(finish_mission,0)
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
#(store_trigger_param_3, ":is_wounded"),
(agent_get_troop_id, ":dead_agent_troop_no", ":dead_agent_no"),
(agent_get_troop_id, ":killer_agent_troop_no", ":killer_agent_no"),
(try_begin),
(this_or_next|eq, ":dead_agent_troop_no", "trp_swadian_prison_guard"),
(this_or_next|eq, ":dead_agent_troop_no", "trp_vaegir_prison_guard"),
(this_or_next|eq, ":dead_agent_troop_no", "trp_khergit_prison_guard"),
(this_or_next|eq, ":dead_agent_troop_no", "trp_nord_prison_guard"),
(this_or_next|eq, ":dead_agent_troop_no", "trp_rhodok_prison_guard"),
(eq, ":dead_agent_troop_no", "trp_sarranid_prison_guard"),
(eq, ":killer_agent_troop_no", "trp_player"),
(display_message, "@You got keys of dungeon."),
(try_end),
]),
]),
(
"village_center",0,-1,
"village center",
[(0,mtef_scene_source|mtef_team_0,0,0,1,[]),
(1,mtef_scene_source|mtef_team_0,0,0,1,[]),
(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(4,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(5,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(6,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(7,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(8,mtef_visitor_source,af_override_horse,0,1,[]),
(9,mtef_visitor_source,af_override_horse,0,1,[]),(10,mtef_visitor_source,af_override_horse,0,1,[]),(11,mtef_visitor_source,af_override_horse,0,1,[]),(12,mtef_visitor_source,af_override_horse,0,1,[]),(13,mtef_visitor_source,0,0,1,[]),(14,mtef_visitor_source,0,0,1,[]),(15,mtef_visitor_source,0,0,1,[]),
(16,mtef_visitor_source,af_override_horse,0,1,[]),(17,mtef_visitor_source,af_override_horse,0,1,[]),(18,mtef_visitor_source,af_override_horse,0,1,[]),(19,mtef_visitor_source,af_override_horse,0,1,[]),(20,mtef_visitor_source,af_override_horse,0,1,[]),(21,mtef_visitor_source,af_override_horse,0,1,[]),(22,mtef_visitor_source,af_override_horse,0,1,[]),(23,mtef_visitor_source,af_override_horse,0,1,[]),
(24,mtef_visitor_source,af_override_horse,0,1,[]),(25,mtef_visitor_source,af_override_horse,0,1,[]),(26,mtef_visitor_source,af_override_horse,0,1,[]),(27,mtef_visitor_source,af_override_horse,0,1,[]),(28,mtef_visitor_source,af_override_horse,0,1,[]),(29,mtef_visitor_source,af_override_horse,0,1,[]),(30,mtef_visitor_source,af_override_horse,0,1,[]),(31,mtef_visitor_source,af_override_horse,0,1,[]),
(32,mtef_visitor_source,af_override_horse,0,1,[]),(33,mtef_visitor_source,af_override_horse,0,1,[]),(34,mtef_visitor_source,af_override_horse,0,1,[]),(35,mtef_visitor_source,af_override_horse,0,1,[]),(36,mtef_visitor_source,af_override_horse,0,1,[]),(37,mtef_visitor_source,af_override_horse,0,1,[]),(38,mtef_visitor_source,af_override_horse,0,1,[]),(39,mtef_visitor_source,af_override_horse,0,1,[]),
(40,mtef_visitor_source,af_override_horse,0,1,[]),(41,mtef_visitor_source,af_override_horse,0,1,[]),(42,mtef_visitor_source,af_override_horse,0,1,[]),(43,mtef_visitor_source,af_override_horse,0,1,[]),(44,mtef_visitor_source,af_override_horse,0,1,[]),(45,mtef_visitor_source,af_override_horse,0,1,[]),(46,mtef_visitor_source,af_override_horse,0,1,[]),(47,mtef_visitor_source,af_override_horse,0,1,[]),
],
[
(1, 0, ti_once, [], [
(store_current_scene, ":cur_scene"),
(scene_set_slot, ":cur_scene", slot_scene_visited, 1),
(call_script, "script_init_town_walker_agents"),
(call_script, "script_music_set_situation_with_culture", mtf_sit_travel),
]),
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),
(ti_inventory_key_pressed, 0, 0, [(set_trigger_result,1)], []),
(ti_tab_pressed, 0, 0, [(try_begin),
(check_quest_active, "qst_hunt_down_fugitive"),
(neg|check_quest_succeeded, "qst_hunt_down_fugitive"),
(neg|check_quest_failed, "qst_hunt_down_fugitive"),
(quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_current_state, 1),
(try_begin),
(call_script, "script_cf_troop_agent_is_alive", "trp_fugitive"),
(call_script, "script_fail_quest", "qst_hunt_down_fugitive"),
(else_try),
(call_script, "script_succeed_quest", "qst_hunt_down_fugitive"),
(try_end),
(try_end),
(set_trigger_result,1)], []),
(ti_on_leave_area, 0, 0, [
(try_begin),
(assign,"$g_leave_town",1),
(try_end),
], []),
(3, 0, 0, [(call_script, "script_tick_town_walkers")], []),
(2, 0, 0, [(call_script, "script_center_ambiance_sounds")], []),
(1, 0, ti_once, [(check_quest_active, "qst_hunt_down_fugitive"),
(neg|check_quest_succeeded, "qst_hunt_down_fugitive"),
(neg|check_quest_failed, "qst_hunt_down_fugitive"),
(quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_current_state, 1),
(assign, ":not_alive", 0),
(try_begin),
(call_script, "script_cf_troop_agent_is_alive", "trp_fugitive"),
(else_try),
(assign, ":not_alive", 1),
(try_end),
(this_or_next|main_hero_fallen),
(eq, ":not_alive", 1),
],
[(try_begin),
(main_hero_fallen),
(jump_to_menu, "mnu_village_hunt_down_fugitive_defeated"),
(call_script, "script_fail_quest", "qst_hunt_down_fugitive"),
(finish_mission, 4),
(else_try),
(call_script, "script_change_player_relation_with_center", "$current_town", -2),
(call_script, "script_succeed_quest", "qst_hunt_down_fugitive"),
(try_end),
]),
],
),
(
"bandits_at_night",0,-1,
"Default town visit",
[(0,mtef_scene_source|mtef_team_0, af_override_horse, aif_start_alarmed, 1, pilgrim_disguise),
(1,mtef_scene_source|mtef_team_0,0,0,1,[]),
(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(4,mtef_visitor_source|mtef_team_0, af_override_horse, aif_start_alarmed, 1, []),
(5,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(6,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(7,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(8,mtef_scene_source,af_override_horse,0,1,[]),
(9,mtef_visitor_source,af_override_horse,0,1,[]),(10,mtef_visitor_source,af_override_horse,0,1,[]),(11,mtef_visitor_source,af_override_horse,aif_start_alarmed,1,[]),(12,mtef_visitor_source,af_override_horse,0,1,[]),(13,mtef_scene_source,0,0,1,[]),(14,mtef_scene_source,0,0,1,[]),(15,mtef_scene_source,0,0,1,[]),
(16,mtef_visitor_source,af_override_horse,0,1,[]),(17,mtef_visitor_source,af_override_horse,0,1,[]),(18,mtef_visitor_source,af_override_horse,0,1,[]),(19,mtef_visitor_source,af_override_horse,0,1,[]),(20,mtef_visitor_source,af_override_horse,0,1,[]),(21,mtef_visitor_source,af_override_horse,0,1,[]),(22,mtef_visitor_source,af_override_horse,0,1,[]),(23,mtef_visitor_source,af_override_horse,0,1,[]),
(24,mtef_visitor_source,af_override_horse,0,1,[]),(25,mtef_visitor_source,af_override_horse,0,1,[]),(26,mtef_visitor_source,af_override_horse,0,1,[]),(27,mtef_visitor_source,af_override_horse,aif_start_alarmed,1,[]),(28,mtef_visitor_source,af_override_horse,aif_start_alarmed,1,[]),(29,mtef_visitor_source,af_override_horse,0,1,[]),(30,mtef_visitor_source,af_override_horse,0,1,[]),(31,mtef_visitor_source,af_override_horse,0,1,[]),
(32,mtef_visitor_source,af_override_horse,0,1,[]),(33,mtef_visitor_source,af_override_horse,0,1,[]),(34,mtef_visitor_source,af_override_horse,0,1,[]),(35,mtef_visitor_source,af_override_horse,0,1,[]),(36,mtef_visitor_source,af_override_horse,0,1,[]),(37,mtef_visitor_source,af_override_horse,0,1,[]),(38,mtef_visitor_source,af_override_horse,0,1,[]),(39,mtef_visitor_source,af_override_horse,0,1,[]),
(40,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),(41,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),(42,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),(43,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),(45,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),(46,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),(47,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
],
[
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(neq, ":troop_no", "trp_player"),
(agent_set_team, ":agent_no", 1),
]),
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),
common_inventory_not_available,
(ti_tab_pressed, 0, 0,
[
(display_message, "str_cannot_leave_now"),
], []),
(ti_on_leave_area, 0, 0,
[
(try_begin),
(eq, "$g_defending_against_siege", 0),
(assign,"$g_leave_town",1),
(try_end),
], []),
(0, 0, ti_once, [],
[
(call_script, "script_music_set_situation_with_culture", mtf_sit_ambushed),
(set_party_battle_mode),
(party_slot_eq, "$current_town", slot_party_type, spt_town),
(call_script, "script_town_init_doors", 0),
]),
(1, 4, ti_once,
[
(store_mission_timer_a,":cur_time"),
(ge, ":cur_time", 5),
(this_or_next|main_hero_fallen),
(num_active_teams_le,1)
],
[
(try_begin),
(main_hero_fallen),
(jump_to_menu, "mnu_town_bandits_failed"),
(else_try),
(jump_to_menu, "mnu_town_bandits_succeeded"),
(try_end),
(finish_mission),
]),
],
),
(
"village_training", mtf_arena_fight, -1,
"village_training",
[(2,mtef_visitor_source|mtef_team_0,af_override_everything,aif_start_alarmed,1,[itm_practice_staff, itm_practice_boots]),
(4,mtef_visitor_source|mtef_team_1,af_override_everything,aif_start_alarmed,1,[itm_practice_staff, itm_practice_boots]),
],
[
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_train_peasants_against_bandits_training_succeeded", 0),
(call_script, "script_change_banners_and_chest"),
]),
common_arena_fight_tab_press,
(ti_question_answered, 0, 0, [],
[
(store_trigger_param_1,":answer"),
(eq,":answer",0),
(finish_mission),
]),
common_inventory_not_available,
(1, 4, ti_once,
[
(this_or_next|main_hero_fallen),
(num_active_teams_le, 1)
],
[
(try_begin),
(neg|main_hero_fallen),
(assign, "$g_train_peasants_against_bandits_training_succeeded", 1),
(try_end),
(finish_mission),
]),
],
),
(
"visit_town_castle",0,-1,
"You enter the halls of the lord.",
[(0,mtef_scene_source|mtef_team_0,af_override_horse|af_override_weapons|af_override_head,0,1,[]),
(1,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(4,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]), #for doors
(5,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(6,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(7,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(8,mtef_visitor_source,af_override_horse,0,1,[]),
(9,mtef_visitor_source,af_override_horse,0,1,[]),
(10,mtef_scene_source,af_override_horse,0,1,[]),
(11,mtef_scene_source,af_override_horse,0,1,[]),
(12,mtef_visitor_source,af_override_horse,0,1,[]),
(13,mtef_visitor_source,0,0,1,[]),
(14,mtef_visitor_source,0,0,1,[]),
(15,mtef_visitor_source,0,0,1,[]),
(16,mtef_visitor_source,af_castle_lord,0,1,[]),
(17,mtef_visitor_source,af_castle_lord,0,1,[]),
(18,mtef_visitor_source,af_castle_lord,0,1,[]),
(19,mtef_visitor_source,af_castle_lord,0,1,[]),
(20,mtef_visitor_source,af_castle_lord,0,1,[]),
(21,mtef_visitor_source,af_castle_lord,0,1,[]),
(22,mtef_visitor_source,af_castle_lord,0,1,[]),
(23,mtef_visitor_source,af_castle_lord,0,1,[]),
(24,mtef_visitor_source,af_castle_lord,0,1,[]),
(25,mtef_visitor_source,af_castle_lord,0,1,[]),
(26,mtef_visitor_source,af_castle_lord,0,1,[]),
(27,mtef_visitor_source,af_castle_lord,0,1,[]),
(28,mtef_visitor_source,af_castle_lord,0,1,[]),
(29,mtef_visitor_source,af_castle_lord,0,1,[]),
(30,mtef_visitor_source,af_castle_lord,0,1,[]),
(31,mtef_visitor_source,af_castle_lord,0,1,[])
],
[
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_init_town_agent", ":agent_no"),
]),
(ti_before_mission_start, 0, 0, [],
[
(call_script, "script_change_banners_and_chest"),
]),
(ti_inventory_key_pressed, 0, 0,
[
(set_trigger_result,1)
], []),
#adjust for prison break
(ti_tab_pressed, 0, 0,
[
(neq, "$talk_context", tc_prison_break),
(set_trigger_result,1)
], []),
(ti_on_leave_area, 0, 0,
[
(eq, "$talk_context", tc_prison_break),
],
[
(display_message, "str_leaving_area_during_prison_break"),
(set_jump_mission, "mt_sneak_caught_fight"),
]),
(0, 0, ti_once, [], [
#(set_fog_distance, 150, 0xFF736252)
(try_begin),
(eq, "$talk_context", tc_court_talk),
(try_begin),
(store_faction_of_party, ":center_faction", "$current_town"),
(faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, ":center_faction", slot_faction_ai_object, "$current_town"),
(call_script, "script_music_set_situation_with_culture", mtf_sit_feast),
#(call_script, "script_music_set_situation_with_culture", mtf_sit_lords_hall),
(try_end),
(else_try),
(call_script, "script_music_set_situation_with_culture", 0), #prison
(try_end),
]),
],
),
(
"back_alley_kill_local_merchant",mtf_battle_mode,-1,
"You enter the back alley",
[
(0,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
],
[
common_inventory_not_available,
(ti_tab_pressed, 0, 0, [(display_message,"str_cannot_leave_now")], []),
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),
(0, 0, ti_once, [],
[
(call_script, "script_music_set_situation_with_culture", mtf_sit_ambushed),
]),
(0, 0, ti_once, [
(store_mission_timer_a,":cur_time"),
(ge,":cur_time",1),
(assign, ":merchant_hp", 0),
(assign, ":player_hp", 0),
(assign, ":merchant_hp", 0),
(assign, ":merchant_agent", -1),
(assign, ":player_agent", -1),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":troop_id", ":agent_no"),
(try_begin),
(eq, ":troop_id", "trp_local_merchant"),
(store_agent_hit_points, ":merchant_hp", ":agent_no"),
(assign, ":merchant_agent", ":agent_no"),
(else_try),
(eq, ":troop_id", "trp_player"),
(store_agent_hit_points, ":player_hp",":agent_no"),
(assign, ":player_agent", ":agent_no"),
(try_end),
(try_end),
(ge, ":player_agent", 0),
(ge, ":merchant_agent", 0),
(agent_is_alive, ":player_agent"),
(agent_is_alive, ":merchant_agent"),
(is_between, ":merchant_hp", 1, 30),
(gt, ":player_hp", 50),
(start_mission_conversation, "trp_local_merchant"),
], []),
(1, 4, ti_once, [(assign, ":not_alive", 0),
(try_begin),
(call_script, "script_cf_troop_agent_is_alive", "trp_local_merchant"),
(else_try),
(assign, ":not_alive", 1),
(try_end),
(this_or_next|main_hero_fallen),
(eq, ":not_alive", 1)],
[
(try_begin),
(main_hero_fallen),
(call_script, "script_fail_quest", "qst_kill_local_merchant"),
(else_try),
(call_script, "script_change_player_relation_with_center", "$current_town", -4),
(call_script, "script_succeed_quest", "qst_kill_local_merchant"),
(try_end),
(finish_mission),
]),
],
),
(
"back_alley_revolt",mtf_battle_mode,charge,
"You lead your men to battle.",
[(0,mtef_team_0|mtef_use_exact_number,af_override_horse|af_override_weapons|af_override_head,aif_start_alarmed,4,[itm_quarter_staff]),
(3,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
],
[
common_inventory_not_available,
common_battle_init_banner,
(ti_tab_pressed, 0, 0, [],
[(question_box,"str_do_you_want_to_retreat"),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(jump_to_menu, "mnu_collect_taxes_failed"),
(finish_mission),]),
(ti_tab_pressed, 0, 0, [(display_message,"str_cannot_leave_now")], []),
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),
(0, 0, ti_once, [],
[
(call_script, "script_music_set_situation_with_culture", mtf_sit_fight),
]),
(1, 4, ti_once, [(this_or_next|main_hero_fallen),(num_active_teams_le,1)],
[
(try_begin),
(main_hero_fallen),
(jump_to_menu, "mnu_collect_taxes_failed"),
(else_try),
(jump_to_menu, "mnu_collect_taxes_rebels_killed"),
(try_end),
(finish_mission),
]),
],
),
(
"lead_charge",mtf_battle_mode,charge,
"You lead your men to battle.",
[
(1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
(0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
],
[
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_agent_reassign_team", ":agent_no"),
(assign, ":initial_courage_score", 5000),
(agent_get_troop_id, ":troop_id", ":agent_no"),
(store_character_level, ":troop_level", ":troop_id"),
(val_mul, ":troop_level", 35),
(val_add, ":initial_courage_score", ":troop_level"), #average : 20 * 35 = 700
(store_random_in_range, ":randomized_addition_courage", 0, 3000), #average : 1500
(val_add, ":initial_courage_score", ":randomized_addition_courage"),
(agent_get_party_id, ":agent_party", ":agent_no"),
(party_get_morale, ":cur_morale", ":agent_party"),
(store_sub, ":morale_effect_on_courage", ":cur_morale", 70),
(val_mul, ":morale_effect_on_courage", 30), #this can effect morale with -2100..900
(val_add, ":initial_courage_score", ":morale_effect_on_courage"),
#average = 5000 + 700 + 1500 = 7200; min : 5700, max : 8700
#morale effect = min : -2100(party morale is 0), average : 0(party morale is 70), max : 900(party morale is 100)
#min starting : 3600, max starting : 9600, average starting : 7200
(agent_set_slot, ":agent_no", slot_agent_courage_score, ":initial_courage_score"),
]),
common_battle_init_banner,
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(store_trigger_param_3, ":is_wounded"),
(try_begin),
(ge, ":dead_agent_no", 0),
(neg|agent_is_ally, ":dead_agent_no"),
(agent_is_human, ":dead_agent_no"),
(agent_get_troop_id, ":dead_agent_troop_id", ":dead_agent_no"),
## (str_store_troop_name, s6, ":dead_agent_troop_id"),
## (assign, reg0, ":dead_agent_no"),
## (assign, reg1, ":killer_agent_no"),
## (assign, reg2, ":is_wounded"),
## (agent_get_team, reg3, ":dead_agent_no"),
#(display_message, "@{!}dead agent no : {reg0} ; killer agent no : {reg1} ; is_wounded : {reg2} ; dead agent team : {reg3} ; {s6} is added"),
(party_add_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
(eq, ":is_wounded", 1),
(party_wound_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1),
(try_end),
(call_script, "script_apply_death_effect_on_courage_scores", ":dead_agent_no", ":killer_agent_no"),
]),
common_battle_tab_press,
(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, 1),
(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),
(call_script, "script_place_player_banner_near_inventory_bms"),
(party_clear, "p_routed_enemies"),
(assign, "$g_latest_order_1", 1),
(assign, "$g_latest_order_2", 1),
(assign, "$g_latest_order_3", 1),
(assign, "$g_latest_order_4", 1),
]),
(0, 0, ti_once, [], [(assign,"$g_battle_won",0),
(assign,"$defender_reinforcement_stage",0),
(assign,"$attacker_reinforcement_stage",0),
(call_script, "script_place_player_banner_near_inventory"),
(call_script, "script_combat_music_set_situation_with_culture"),
(assign, "$g_defender_reinforcement_limit", 2),
]),
common_music_situation_update,
common_battle_check_friendly_kills,
(1, 0, 5, [
#new (25.11.09) starts (sdsd = TODO : make a similar code to also helping ally encounters)
#count all total (not dead) enemy soldiers (in battle area + not currently placed in battle area)
(call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
(assign, ":total_enemy_soldiers", reg0),
#decrease number of agents already in battle area to find all number of reinforcement enemies
(assign, ":enemy_soldiers_in_battle_area", 0),
(try_for_agents,":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_get_party_id, ":agent_party", ":cur_agent"),
(try_begin),
(neq, ":agent_party", "p_main_party"),
(neg|agent_is_ally, ":cur_agent"),
(val_add, ":enemy_soldiers_in_battle_area", 1),
(try_end),
(try_end),
(store_sub, ":total_enemy_reinforcements", ":total_enemy_soldiers", ":enemy_soldiers_in_battle_area"),
(try_begin),
(lt, ":total_enemy_reinforcements", 15),
(ge, "$defender_reinforcement_stage", 2),
(eq, "$defender_reinforcement_limit_increased", 0),
(val_add, "$g_defender_reinforcement_limit", 1),
(assign, "$defender_reinforcement_limit_increased", 1),
(try_end),
#new (25.11.09) ends
(lt,"$defender_reinforcement_stage","$g_defender_reinforcement_limit"),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",10),
(store_normalized_team_count,":num_defenders", 0),
(lt,":num_defenders",6)],
[(add_reinforcements_to_entry,0,7),(assign, "$defender_reinforcement_limit_increased", 0),(val_add,"$defender_reinforcement_stage",1)]),
(1, 0, 5, [(lt,"$attacker_reinforcement_stage",2),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",10),
(store_normalized_team_count,":num_attackers", 1),
(lt,":num_attackers",6)],
[(add_reinforcements_to_entry,3,7),(val_add,"$attacker_reinforcement_stage",1)]),
common_battle_check_victory_condition,
common_battle_victory_display,
(1, 4, ti_once, [(main_hero_fallen)],
[
(assign, "$pin_player_fallen", 1),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 10, 20, 1),
(assign, "$g_battle_result", -1),
(set_mission_result,-1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0)]),
common_battle_inventory,
#AI Triggers
(0, 0, ti_once, [
(store_mission_timer_a,":mission_time"),(ge,":mission_time",2),
],
[(call_script, "script_select_battle_tactic"),
(call_script, "script_battle_tactic_init"),
#(call_script, "script_battle_calculate_initial_powers"), #deciding run away method changed and that line is erased
]),
(3, 0, 0, [
(call_script, "script_apply_effect_of_other_people_on_courage_scores"),
], []), #calculating and applying effect of people on others courage scores
(3, 0, 0, [
(try_for_agents, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_is_alive, ":agent_no"),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",3),
(call_script, "script_decide_run_away_or_not", ":agent_no", ":mission_time"),
(try_end),
], []), #controlling courage score and if needed deciding to run away for each agent
(5, 0, 0, [
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",3),
(call_script, "script_battle_tactic_apply"),
], []), #applying battle tactic
common_battle_order_panel,
common_battle_order_panel_tick,
],
),
(
"village_attack_bandits",mtf_battle_mode,charge,
"You lead your men to battle.",
[
(3,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(1,mtef_team_0|mtef_use_exact_number,0,aif_start_alarmed, 7,[]),
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
],
[
common_battle_tab_press,
common_battle_init_banner,
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$pin_player_fallen", 0),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 10, 20, 1),
(assign, "$g_battle_result", -1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),]),
(0, 0, ti_once, [], [(assign, "$g_battle_won", 0),
(assign, "$defender_reinforcement_stage", 0),
(assign, "$attacker_reinforcement_stage", 0),
(try_begin),
(eq, "$g_mt_mode", vba_after_training),
(add_reinforcements_to_entry, 1, 6),
(else_try),
(add_reinforcements_to_entry, 1, 29),
(try_end),
(call_script, "script_combat_music_set_situation_with_culture"),
]),
common_music_situation_update,
common_battle_check_friendly_kills,
common_battle_check_victory_condition,
common_battle_victory_display,
(1, 4, ti_once, [(main_hero_fallen)],
[
(assign, "$pin_player_fallen", 1),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 10, 20, 1),
(assign, "$g_battle_result", -1),
(set_mission_result, -1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission, 0)]),
common_battle_inventory,
common_battle_order_panel,
common_battle_order_panel_tick,
],
),
(
"village_raid",mtf_battle_mode,charge,
"You lead your men to battle.",
[
(3,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,12,[]),
(3,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
(1,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
(1,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
],
[
common_battle_tab_press,
common_battle_init_banner,
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$pin_player_fallen", 0),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 10, 20, 1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),]),
(0, 0, ti_once, [], [(assign,"$g_battle_won",0),
(assign,"$defender_reinforcement_stage",0),
(assign,"$attacker_reinforcement_stage",0),
(call_script, "script_combat_music_set_situation_with_culture"),
]),
common_music_situation_update,
common_battle_check_friendly_kills,
(1, 0, 5, [(lt,"$defender_reinforcement_stage",2),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",10),
(store_normalized_team_count,":num_defenders", 0),
(lt,":num_defenders",6)],
[(add_reinforcements_to_entry,0,6),(val_add,"$defender_reinforcement_stage",1)]),
(1, 0, 5, [(lt,"$attacker_reinforcement_stage",2),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",10),
(store_normalized_team_count,":num_attackers", 1),
(lt,":num_attackers",6)],
[(add_reinforcements_to_entry,3,6),(val_add,"$attacker_reinforcement_stage",1)]),
(1, 60, ti_once,
[
(store_mission_timer_a,reg(1)),
(ge,reg(1),10),
(all_enemies_defeated, 5),
(neg|main_hero_fallen, 0),
(set_mission_result,1),
(display_message,"str_msg_battle_won"),
(assign,"$g_battle_won",1),
(assign, "$g_battle_result", 1),
(try_begin),
(eq, "$g_village_raid_evil", 0),
(call_script, "script_play_victorious_sound"),
(else_try),
(play_track, "track_victorious_evil", 1),
(try_end),
],
[
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission, 1),
]),
common_battle_victory_display,
(1, 4, ti_once, [(main_hero_fallen)],
[
(assign, "$pin_player_fallen", 1),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 10, 20, 1),
(assign, "$g_battle_result", -1),
(set_mission_result,-1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0)]),
common_battle_inventory,
common_battle_order_panel,
common_battle_order_panel_tick,
## #AI Tiggers
## (0, 0, ti_once, [
## (store_mission_timer_a,reg(1)),(ge,reg(1),4),
## (call_script, "script_select_battle_tactic"),
## (call_script, "script_battle_tactic_init"),
## ], []),
## (1, 0, 0, [
## (store_mission_timer_a,reg(1)),(ge,reg(1),4),
## (call_script, "script_battle_tactic_apply"),
## ], []),
],
),
## (
## "charge_with_allies",mtf_battle_mode,charge_with_ally,
## "Taking a handful of fighters with you, you set off to patrol the area.",
## [
## (1,mtef_defenders,0,0|aif_start_alarmed,8,[]),
## (0,mtef_defenders,0,0|aif_start_alarmed,0,[]),
## (4,mtef_attackers,0,aif_start_alarmed,8,[]),
## (4,mtef_attackers,0,aif_start_alarmed,0,[]),
## ],
## [
## (ti_tab_pressed, 0, 0, [],
## [
## (try_begin),
## (eq, "$battle_won", 1),
## (finish_mission,0),
## (else_try),
## (call_script, "script_cf_check_enemies_nearby"),
## (question_box,"str_do_you_want_to_retreat"),
## (else_try),
## (display_message,"str_can_not_retreat"),
## (try_end),
## ]),
## (ti_question_answered, 0, 0, [],
## [(store_trigger_param_1,":answer"),
## (eq,":answer",0),
## (assign, "$pin_player_fallen", 0),
## (str_store_string, s5, "str_retreat"),
## (call_script, "script_simulate_retreat", 10, 30),
## (finish_mission,0),]),
##
## (0, 0, ti_once, [], [(assign,"$battle_won",0),(assign,"$defender_reinforcement_stage",0),(assign,"$attacker_reinforcement_stage",0)]),
## (1, 0, 5, [(lt,"$defender_reinforcement_stage",2),(store_mission_timer_a,reg(1)),(ge,reg(1),10),(store_defender_count,reg(2)),(lt,reg(2),3)],
## [(add_reinforcements_to_entry,0,4),(val_add,"$defender_reinforcement_stage",1)]),
## (1, 0, 5, [(lt,"$attacker_reinforcement_stage",2),(store_mission_timer_a,reg(1)),(ge,reg(1),10),(store_attacker_count,reg(2)),(lt,reg(2),3)],
## [(add_reinforcements_to_entry,3,4),(val_add,"$attacker_reinforcement_stage",1)]),
## (1, 60, ti_once, [(store_mission_timer_a,reg(1)),
## (ge,reg(1),10),(all_enemies_defeated,2),
## (neg|main_hero_fallen,0),
## (set_mission_result,1),
## (assign, "$g_battle_result", 1),
## (display_message,"str_msg_battle_won"),
## (assign,"$battle_won",1)],
## [(finish_mission,1)]),
## (10, 0, 0, [], [(eq,"$battle_won",1),(display_message,"str_msg_battle_won")]),
##
## (1, 4, ti_once, [(main_hero_fallen)],
## [
## (assign, "$pin_player_fallen", 1),
## (str_store_string, s5, "str_retreat"),
## (call_script, "script_simulate_retreat", 20, 30),
## (assign, "$g_battle_result", -1),
## (set_mission_result,-1),(finish_mission,0)]),
## (ti_inventory_key_pressed, 0, 0, [(display_message,"str_use_baggage_for_inventory")], []),
## ],
## ),
## (
## "charge_with_allies_old",mtf_battle_mode,charge_with_ally,
## "Taking a handful of fighters with you, you set off to patrol the area.",
## [(1,mtef_leader_only,0,0,1,[]),
## (1,mtef_no_leader,0,0|aif_start_alarmed,2,[]),
## (1,mtef_reverse_order|mtef_ally_party,0,0|aif_start_alarmed,3,[]),
## (0,mtef_no_leader,0,0|aif_start_alarmed,0,[]),
## (0,mtef_reverse_order|mtef_ally_party,0,0|aif_start_alarmed,0,[]),
## (3,mtef_reverse_order|mtef_enemy_party,0,aif_start_alarmed,6,[]),
## (4,mtef_reverse_order|mtef_enemy_party,0,aif_start_alarmed,0,[])],
## [
## (ti_tab_pressed, 0, 0, [],
## [
## (try_begin),
## (eq, "$battle_won", 1),
## (finish_mission,0),
## (else_try),
## (call_script, "script_cf_check_enemies_nearby"),
## (question_box,"str_do_you_want_to_retreat"),
## (else_try),
## (display_message,"str_can_not_retreat"),
## (try_end),
## ]),
## (ti_question_answered, 0, 0, [],
## [(store_trigger_param_1,":answer"),(eq,":answer",0),(finish_mission,0),]),
##
## (0, 0, ti_once, [], [(assign,"$battle_won",0),(assign,"$enemy_reinforcement_stage",0),(assign,"$friend_reinforcement_stage",0),(assign,"$ally_reinforcement_stage",0)]),
##
## (1, 0, 5, [(lt,"$enemy_reinforcement_stage",2),(store_mission_timer_a,reg(1)),(ge,reg(1),10),(store_enemy_count,reg(2)),(lt,reg(2),3)],
## [(add_reinforcements_to_entry,6,3),(val_add,"$enemy_reinforcement_stage",1)]),
## (1, 0, 5, [(lt,"$friend_reinforcement_stage",2),(store_mission_timer_a,reg(1)),(ge,reg(1),10),(store_friend_count,reg(2)),(lt,reg(2),2)],
## [(add_reinforcements_to_entry,3,1),(val_add,"$friend_reinforcement_stage",1)]),
## (1, 0, 5, [(lt,"$ally_reinforcement_stage",2),(store_mission_timer_a,reg(1)),(ge,reg(1),10),(store_ally_count,reg(2)), (lt,reg(2),2)],
## [(add_reinforcements_to_entry,4,2),(val_add,"$ally_reinforcement_stage",1)]),
## (1, 60, ti_once, [(store_mission_timer_a,reg(1)),
## (ge,reg(1),10),
## (all_enemies_defeated,2),
## (neg|main_hero_fallen,0),
## (set_mission_result,1),
## (assign, "$g_battle_result", 1),
## (display_message,"str_msg_battle_won"),
## (assign,"$battle_won",1),
## ],
## [(finish_mission,1)]),
## (10, 0, 0, [], [(eq,"$battle_won",1),(display_message,"str_msg_battle_won")]),
## (1, 4, ti_once, [(main_hero_fallen,0)],
## [(set_mission_result,-1),(finish_mission,1)]),
## (ti_inventory_key_pressed, 0, 0, [(display_message,"str_use_baggage_for_inventory")], []),
## ],
## ),
## (
## "lead_charge_old",mtf_battle_mode,charge,
## "You lead your men to battle.",
## [
## (1,mtef_leader_only,0,0,1,[]),
## (1,mtef_no_leader,0,0|aif_start_alarmed,5,[]),
## (0,mtef_no_leader,0,0|aif_start_alarmed,0,[]),
## (3,mtef_enemy_party|mtef_reverse_order,0,aif_start_alarmed,6,[]),
## (4,mtef_enemy_party|mtef_reverse_order,0,aif_start_alarmed,0,[]),
## ],
## [
## (ti_tab_pressed, 0, 0, [],
## [
## (try_begin),
## (eq, "$battle_won", 1),
## (finish_mission,0),
## (else_try),
## (call_script, "script_cf_check_enemies_nearby"),
## (question_box,"str_do_you_want_to_retreat"),
## (else_try),
## (display_message,"str_can_not_retreat"),
## (try_end),
## ]),
## (ti_question_answered, 0, 0, [],
## [(store_trigger_param_1,":answer"),(eq,":answer",0),(finish_mission,0),]),
##
## (0, 0, ti_once, [], [(assign,"$battle_won",0),(assign,"$enemy_reinforcement_stage",0),(assign,"$friend_reinforcement_stage",0)]),
## (1, 0, 5, [(lt,"$enemy_reinforcement_stage",2),(store_mission_timer_a,reg(1)),(ge,reg(1),10),(store_enemy_count,reg(2)),(lt,reg(2),3)],
## [(add_reinforcements_to_entry,4,3),(val_add,"$enemy_reinforcement_stage",1)]),
## (1, 0, 5, [(lt,"$friend_reinforcement_stage",2),(store_mission_timer_a,reg(1)),(ge,reg(1),10),(store_friend_count,reg(2)),(lt,reg(2),3)],
## [(add_reinforcements_to_entry,2,3),(val_add,"$friend_reinforcement_stage",1)]),
## (1, 60, ti_once, [(store_mission_timer_a,reg(1)),
## (ge,reg(1),10),(all_enemies_defeated,2),
## (neg|main_hero_fallen,0),
## (set_mission_result,1),
## (assign, "$g_battle_result", 1),
## (display_message,"str_msg_battle_won"),
## (assign,"$battle_won",1)],
## [(finish_mission,1)]),
## (10, 0, 0, [], [(eq,"$battle_won",1),(display_message,"str_msg_battle_won")]),
## (1, 4, ti_once, [(main_hero_fallen)],
## [
## (assign, "$g_battle_result", -1),
## (set_mission_result,-1),(finish_mission,1)]),
## (ti_inventory_key_pressed, 0, 0, [(display_message,"str_use_baggage_for_inventory")], []),
## ],
## ),
(
"besiege_inner_battle_castle",mtf_battle_mode,-1,
"You attack the walls of the castle...",
[
(0, mtef_attackers|mtef_use_exact_number|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(6, mtef_attackers|mtef_use_exact_number|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(7, mtef_attackers|mtef_use_exact_number|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(16, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(17, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(18, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(19, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(20, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
],
[
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),
common_battle_tab_press,
common_battle_init_banner,
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$pin_player_fallen", 0),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 5, 20, 0),
(assign, "$g_battle_result", -1),
(set_mission_result,-1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),
]),
(0, 0, ti_once, [], [(assign,"$g_battle_won",0),
(call_script, "script_music_set_situation_with_culture", mtf_sit_ambushed),
]),
#AI Tiggers
(0, 0, ti_once, [
(assign, "$defender_team", 0),
(assign, "$attacker_team", 1),
(assign, "$defender_team_2", 2),
(assign, "$attacker_team_2", 3),
], []),
common_battle_check_friendly_kills,
common_battle_check_victory_condition,
common_battle_victory_display,
(1, 4, ti_once, [(main_hero_fallen)],
[
(assign, "$pin_player_fallen", 1),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 5, 20, 0),
(assign, "$g_battle_result", -1),
(set_mission_result,-1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0)
]),
common_battle_order_panel,
common_battle_order_panel_tick,
common_battle_inventory,
],
),
(
"besiege_inner_battle_town_center",mtf_battle_mode,-1,
"You attack the walls of the castle...",
[
(0, mtef_attackers|mtef_use_exact_number|mtef_team_1,af_override_horse,aif_start_alarmed,4,[]),
(2, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(23, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(24, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(25, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(26, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(27, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(28, mtef_defenders|mtef_use_exact_number|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
],
[
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),
common_battle_tab_press,
common_battle_init_banner,
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$pin_player_fallen", 0),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 5, 20, 0),
(assign, "$g_battle_result", -1),
(set_mission_result,-1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),
]),
(0, 0, ti_once, [], [(assign,"$g_battle_won",0),
(call_script, "script_music_set_situation_with_culture", mtf_sit_ambushed),
]),
#AI Tiggers
(0, 0, ti_once, [
(assign, "$defender_team", 0),
(assign, "$attacker_team", 1),
(assign, "$defender_team_2", 2),
(assign, "$attacker_team_2", 3),
], []),
common_battle_check_friendly_kills,
common_battle_check_victory_condition,
common_battle_victory_display,
(1, 4, ti_once, [(main_hero_fallen)],
[
(assign, "$pin_player_fallen", 1),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 5, 20, 0),
(assign, "$g_battle_result", -1),
(set_mission_result,-1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0)
]),
common_battle_order_panel,
common_battle_order_panel_tick,
common_battle_inventory,
],
),
(
"castle_attack_walls_defenders_sally",mtf_battle_mode,-1,
"You attack the walls of the castle...",
[
(0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,12,[]),
(0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,0,[]),
(3,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,12,[]),
(3,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,0,[]),
],
[
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_agent_reassign_team", ":agent_no"),
]),
(ti_before_mission_start, 0, 0, [],
[
(team_set_relation, 0, 2, 1),
(team_set_relation, 1, 3, 1),
(call_script, "script_change_banners_and_chest"),
(call_script, "script_remove_siege_objects"),
]),
common_battle_tab_press,
common_battle_init_banner,
(ti_on_agent_killed_or_wounded, 0, 0, [], #new
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(store_trigger_param_3, ":is_wounded"),
(try_begin),
(ge, ":dead_agent_no", 0),
(neg|agent_is_ally, ":dead_agent_no"),
(agent_is_human, ":dead_agent_no"),
(agent_get_troop_id, ":dead_agent_troop_id", ":dead_agent_no"),
(str_store_troop_name, s6, ":dead_agent_troop_id"),
(assign, reg0, ":dead_agent_no"),
(assign, reg1, ":killer_agent_no"),
(assign, reg2, ":is_wounded"),
(agent_get_team, reg3, ":dead_agent_no"),
#(display_message, "@{!}dead agent no : {reg0} ; killer agent no : {reg1} ; is_wounded : {reg2} ; dead agent team : {reg3} ; {s6} is added"),
(party_add_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
(eq, ":is_wounded", 1),
(party_wound_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1),
(try_end),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$pin_player_fallen", 0),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 5, 20, 0),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),]),
(0, 0, ti_once, [], [(assign,"$g_battle_won",0),
(call_script, "script_combat_music_set_situation_with_culture"),
]),
common_music_situation_update,
common_battle_check_friendly_kills,
(1, 60, ti_once, [(store_mission_timer_a, reg(1)),
(ge, reg(1), 10),
(all_enemies_defeated, 2),
(neg|main_hero_fallen,0),
(set_mission_result,1),
(display_message,"str_msg_battle_won"),
(assign, "$g_battle_won", 1),
(assign, "$g_battle_result", 1),
(assign, "$g_siege_sallied_out_once", 1),
(assign, "$g_siege_method", 1), #reset siege timer
(call_script, "script_play_victorious_sound"),
],
[(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,1)]),
common_battle_victory_display,
(1, 4, ti_once, [(main_hero_fallen)],
[
(assign, "$pin_player_fallen", 1),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 5, 20, 0),
(assign, "$g_battle_result", -1),
(set_mission_result, -1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0)]),
common_battle_order_panel,
common_battle_order_panel_tick,
common_battle_inventory,
],
),
(
"castle_attack_walls_belfry",mtf_battle_mode,-1,
"You attack the walls of the castle...",
[
(0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,12,[]),
(0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,0,[]),
(10,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,0,[]),
(11,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,7,[]),
(15,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,0,[]),
(40,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(41,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(42,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(43,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(44,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(45,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(46,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(47,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
],
[
common_battle_mission_start,
common_battle_tab_press,
common_battle_init_banner,
common_siege_question_answered,
common_siege_init,
common_music_situation_update,
common_siege_ai_trigger_init,
common_siege_ai_trigger_init_2,
(0, 0, ti_once,
[
(set_show_messages, 0),
(team_give_order, "$attacker_team", grc_everyone, mordr_spread_out),
(team_give_order, "$attacker_team", grc_everyone, mordr_spread_out),
(team_give_order, "$attacker_team", grc_everyone, mordr_spread_out),
(set_show_messages, 1),
], []),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(store_trigger_param_3, ":is_wounded"),
(try_begin),
(ge, ":dead_agent_no", 0),
(neg|agent_is_ally, ":dead_agent_no"),
(agent_is_human, ":dead_agent_no"),
(agent_get_troop_id, ":dead_agent_troop_id", ":dead_agent_no"),
(str_store_troop_name, s6, ":dead_agent_troop_id"),
(assign, reg0, ":dead_agent_no"),
(assign, reg1, ":killer_agent_no"),
(assign, reg2, ":is_wounded"),
(agent_get_team, reg3, ":dead_agent_no"),
#(display_message, "@{!}dead agent no : {reg0} ; killer agent no : {reg1} ; is_wounded : {reg2} ; dead agent team : {reg3} ; {s6} is added"),
(party_add_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
(eq, ":is_wounded", 1),
(party_wound_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1),
(try_end),
]),
common_siege_ai_trigger_init_after_2_secs,
common_siege_defender_reinforcement_check,
common_siege_defender_reinforcement_archer_reposition,
common_siege_attacker_reinforcement_check,
common_siege_attacker_do_not_stall,
common_battle_check_friendly_kills,
common_battle_check_victory_condition,
common_battle_victory_display,
common_siege_refill_ammo,
common_siege_check_defeat_condition,
common_battle_order_panel,
common_battle_order_panel_tick,
common_inventory_not_available,
common_siege_init_ai_and_belfry,
common_siege_move_belfry,
common_siege_rotate_belfry,
common_siege_assign_men_to_belfry,
],
),
(
"castle_attack_walls_ladder",mtf_battle_mode,-1,
"You attack the walls of the castle...",
[
(0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,12,[]),
(0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,0,[]),
(10,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,0,[]),
(11,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,7,[]),
(15,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,0,[]),
(40,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(41,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(42,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(43,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(44,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(45,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
(46,mtef_defenders|mtef_team_0|mtef_archers_first,af_override_horse,aif_start_alarmed,1,[]),
],
[
common_battle_mission_start,
common_battle_tab_press,
common_battle_init_banner,
common_siege_question_answered,
common_siege_init,
common_music_situation_update,
common_siege_ai_trigger_init,
common_siege_ai_trigger_init_2,
common_siege_ai_trigger_init_after_2_secs,
common_siege_defender_reinforcement_check,
common_siege_defender_reinforcement_archer_reposition,
common_siege_attacker_reinforcement_check,
common_siege_attacker_do_not_stall,
common_battle_check_friendly_kills,
common_battle_check_victory_condition,
common_battle_victory_display,
common_siege_refill_ammo,
common_siege_check_defeat_condition,
common_battle_order_panel,
common_battle_order_panel_tick,
common_inventory_not_available,
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(store_trigger_param_3, ":is_wounded"),
(try_begin),
(ge, ":dead_agent_no", 0),
(neg|agent_is_ally, ":dead_agent_no"),
(agent_is_human, ":dead_agent_no"),
(agent_get_troop_id, ":dead_agent_troop_id", ":dead_agent_no"),
(str_store_troop_name, s6, ":dead_agent_troop_id"),
(assign, reg0, ":dead_agent_no"),
(assign, reg1, ":killer_agent_no"),
(assign, reg2, ":is_wounded"),
(agent_get_team, reg3, ":dead_agent_no"),
#(display_message, "@{!}dead agent no : {reg0} ; killer agent no : {reg1} ; is_wounded : {reg2} ; dead agent team : {reg3} ; {s6} is added"),
(party_add_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
(eq, ":is_wounded", 1),
(party_wound_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1),
(try_end),
]),
## (15, 0, 0,
## [
## (get_player_agent_no, ":player_agent"),
## (agent_get_team, ":agent_team", ":player_agent"),
## (neq, "$attacker_team", ":agent_team"),
## (assign, ":non_ranged", 0),
## (assign, ":ranged", 0),
## (assign, ":ranged_pos_x", 0),
## (assign, ":ranged_pos_y", 0),
## (set_fixed_point_multiplier, 100),
## (try_for_agents, ":agent_no"),
## (eq, ":non_ranged", 0),
## (agent_is_human, ":agent_no"),
## (agent_is_alive, ":agent_no"),
## (neg|agent_is_defender, ":agent_no"),
## (agent_get_class, ":agent_class", ":agent_no"),
## (try_begin),
## (neq, ":agent_class", grc_archers),
## (val_add, ":non_ranged", 1),
## (else_try),
## (val_add, ":ranged", 1),
## (agent_get_position, pos0, ":agent_no"),
## (position_get_x, ":pos_x", pos0),
## (position_get_y, ":pos_y", pos0),
## (val_add, ":ranged_pos_x", ":pos_x"),
## (val_add, ":ranged_pos_y", ":pos_y"),
## (try_end),
## (try_end),
## (try_begin),
## (eq, ":non_ranged", 0),
## (gt, ":ranged", 0),
## (val_div, ":ranged_pos_x", ":ranged"),
## (val_div, ":ranged_pos_y", ":ranged"),
## (entry_point_get_position, pos0, 10),
## (init_position, pos1),
## (position_set_x, pos1, ":ranged_pos_x"),
## (position_set_y, pos1, ":ranged_pos_y"),
## (position_get_z, ":pos_z", pos0),
## (position_set_z, pos1, ":pos_z"),
## (get_distance_between_positions, ":dist", pos0, pos1),
## (gt, ":dist", 1000), #average position of archers is more than 10 meters far from entry point 10
## (team_give_order, "$attacker_team", grc_archers, mordr_hold),
## (team_set_order_position, "$attacker_team", grc_archers, pos0),
## (else_try),
## (team_give_order, "$attacker_team", grc_everyone, mordr_charge),
## (try_end),
## ],
## []),
],
),
(
"castle_visit",0,-1,
"Castle visit",
[(0,mtef_scene_source|mtef_team_0,af_override_horse|af_override_weapons|af_override_head,0,1,pilgrim_disguise),
(1,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(4,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise), #for doors
(5,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(6,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(7,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
(8,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(9,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(10,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(11,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(12,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(13,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(14,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(15,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(16,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(17,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(18,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(19,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(20,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(21,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(22,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(23,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(24,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(25,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(26,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(27,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(28,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(29,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(30,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(31,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(32,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(33,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(34,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(35,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(36,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(37,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(38,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),(39,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
# Party members
(40,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(41,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(42,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(43,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(44,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(45,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(46,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
],
[
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_init_town_agent", ":agent_no"),
(get_player_agent_no, ":player_agent"),
(try_begin),
(neq, ":player_agent", ":agent_no"),
(agent_set_team, ":agent_no", 7),
(try_end),
(try_begin),
(this_or_next|eq, "$talk_context", tc_escape),
(eq, "$talk_context", tc_prison_break),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(troop_get_slot, ":will_join_prison_break", ":troop_no", slot_troop_will_join_prison_break),
(eq, ":will_join_prison_break", 1),
(agent_set_team, ":agent_no", 0),
(agent_ai_set_aggressiveness, ":agent_no", 5),
(troop_set_slot, ":troop_no", slot_troop_will_join_prison_break, 0),
(try_begin),
(troop_slot_eq, ":troop_no", slot_troop_mission_participation, mp_prison_break_stand_back),
(agent_get_position, pos1, ":agent_no"),
(agent_set_scripted_destination, ":agent_no", pos1),
(try_end),
(try_end),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
#(store_trigger_param_3, ":is_wounded"),
(agent_get_troop_id, ":dead_agent_troop_no", ":dead_agent_no"),
(agent_get_troop_id, ":killer_agent_troop_no", ":killer_agent_no"),
(try_begin),
(this_or_next|eq, ":dead_agent_troop_no", "trp_swadian_prison_guard"),
(this_or_next|eq, ":dead_agent_troop_no", "trp_vaegir_prison_guard"),
(this_or_next|eq, ":dead_agent_troop_no", "trp_khergit_prison_guard"),
(this_or_next|eq, ":dead_agent_troop_no", "trp_nord_prison_guard"),
(this_or_next|eq, ":dead_agent_troop_no", "trp_rhodok_prison_guard"),
(eq, ":dead_agent_troop_no", "trp_sarranid_prison_guard"),
(eq, ":killer_agent_troop_no", "trp_player"),
(display_message, "@You got keys of dungeon."),
(try_end),
]),
#JAILBREAK TRIGGERS
#Civilians get out of the way
(1, 0, 0,
[
(this_or_next|eq, "$talk_context", tc_prison_break),
(eq, "$talk_context", tc_escape),
],
[
#(agent_get_team, ":prisoner_agent", 0),
(call_script, "script_neutral_behavior_in_fight"),
(mission_disable_talk),
]),
#The game begins with the town alerted
(1, 0, ti_once,
[
#If I set this to 1, 0, ti_once, then the prisoner spawns twice
(eq, "$talk_context", tc_escape),
],
[
(get_player_agent_no, ":player_agent"),
(assign, reg6, ":player_agent"),
(call_script, "script_activate_town_guard"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos4, ":player_agent"),
(try_for_range, ":prisoner", active_npcs_begin, kingdom_ladies_end),
(troop_slot_ge, ":prisoner", slot_troop_mission_participation, 1),
(str_store_troop_name, s4, ":prisoner"),
(display_message, "str_s4_joins_prison_break"),
(store_current_scene, ":cur_scene"), #this might be a better option?
(modify_visitors_at_site, ":cur_scene"),
#<entry_no>,<troop_id>,<number_of_troops>, <team_no>, <group_no>),
#team no and group no are used in multiplayer mode only. default team in entry is used in single player mode
(store_current_scene, ":cur_scene"),
(modify_visitors_at_site, ":cur_scene"),
(assign, ":nearest_entry_no", 24),
(add_visitors_to_current_scene, ":nearest_entry_no", ":prisoner", 1, 0, 0),
(troop_set_slot, ":prisoner", slot_troop_will_join_prison_break, 1),
(try_end),
]),
(ti_tab_pressed, 0, 0,
[
(try_begin),
(this_or_next|eq, "$talk_context", tc_escape),
(eq, "$talk_context", tc_prison_break),
(display_message, "str_cannot_leave_now"),
(else_try),
(this_or_next|eq, "$g_mt_mode", tcm_default),
(eq, "$g_mt_mode", tcm_disguised),
(set_trigger_result, 1),
(mission_enable_talk),
(else_try),
(display_message, "str_cannot_leave_now"),
(try_end),
],
[]),
(ti_before_mission_start, 0, 0, [],
[
(call_script, "script_change_banners_and_chest"),
(call_script, "script_remove_siege_objects"),
]),
(3, 0, 0,
[
(main_hero_fallen, 0),
],
[
(try_begin),
(this_or_next|eq, "$talk_context", tc_prison_break),
(eq, "$talk_context", tc_escape),
(call_script, "script_deduct_casualties_from_garrison"),
(jump_to_menu,"mnu_captivity_start_castle_defeat"),
(assign, ":end_cond", kingdom_ladies_end),
(try_for_range, ":prisoner", active_npcs_begin, ":end_cond"),
(troop_set_slot, ":prisoner", slot_troop_mission_participation, 0), #new
(try_end),
(mission_enable_talk),
(finish_mission, 0),
(else_try),
(mission_enable_talk),
(finish_mission, 0),
(set_trigger_result, 1),
(try_end),
]),
(3, 0, 0,
[
(eq, "$talk_context", tc_escape),
(neg|main_hero_fallen,0),
(store_mission_timer_a, ":time"),
(ge, ":time", 10),
(all_enemies_defeated), #1 is default enemy team for in-town battles
],
[
(call_script, "script_deduct_casualties_from_garrison"),
(try_for_agents, ":agent"),
(agent_get_troop_id, ":troop", ":agent"),
(troop_slot_ge, ":troop", slot_troop_mission_participation, mp_prison_break_fight),
(try_begin),
(agent_is_alive, ":agent"),
(troop_set_slot, ":troop", slot_troop_mission_participation, mp_prison_break_escaped),
(else_try),
(troop_set_slot, ":troop", slot_troop_mission_participation, mp_prison_break_caught),
(try_end),
(try_end),
(jump_to_menu, "mnu_sneak_into_town_caught_ran_away"),
(mission_enable_talk),
(finish_mission, 0),
]),
],
),
(
"training_ground_trainer_talk", 0, -1,
"Training.",
[
(0,mtef_scene_source|mtef_team_0,af_override_horse|af_override_weapons,0,1,[]),
(1,mtef_scene_source|mtef_team_0,af_override_horse|af_override_weapons,0,1,[]),
(2,mtef_scene_source|mtef_team_0,af_override_horse|af_override_weapons,0,1,[]),
(3,mtef_scene_source|mtef_team_0,af_override_horse|af_override_weapons,0,1,[]),
(4,mtef_scene_source|mtef_team_0,af_override_horse|af_override_weapons,0,1,[]),
(5,mtef_scene_source|mtef_team_0,af_override_horse|af_override_weapons,0,1,[]),
(6,mtef_scene_source|mtef_team_0,0,0,1,[]),
],
[
(ti_before_mission_start, 0, 0, [],
[
(call_script, "script_change_banners_and_chest"),
]),
(ti_inventory_key_pressed, 0, 0,
[
(set_trigger_result,1),
], []),
(ti_tab_pressed, 0, 0,
[
(set_trigger_result,1),
], []),
(0.0, 1.0, 2.0,
[(lt, "$trainer_help_message", 2),
],
[(try_begin),
(eq, "$trainer_help_message", 0),
# (tutorial_box, "str_trainer_help_1", "@Tutorial"),
(else_try),
# (tutorial_box, "str_trainer_help_2", "@Tutorial"),
(try_end),
(val_add, "$trainer_help_message", 1),
]),
],
),
(
"training_ground_trainer_training",mtf_arena_fight,-1,
"You will fight a match in the arena.",
[
(16, mtef_visitor_source|mtef_team_0,af_override_everything,aif_start_alarmed,1,[itm_practice_shield,itm_practice_sword,itm_practice_boots]),
(17, mtef_visitor_source|mtef_team_1,af_override_everything,aif_start_alarmed,1,[itm_practice_staff,itm_practice_boots]),
(18, mtef_visitor_source|mtef_team_2,af_override_everything,aif_start_alarmed,1,[itm_practice_staff,itm_practice_boots]),
(19, mtef_visitor_source|mtef_team_3,af_override_everything,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_practice_boots]),
(20, mtef_visitor_source,0,0,1,[]),
],
[
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),
common_arena_fight_tab_press,
(ti_question_answered, 0, 0, [],
[
(store_trigger_param_1, ":answer"),
(eq, ":answer", 0),
(set_jump_mission, "mt_training_ground_trainer_talk"),
(modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
(reset_visitors),
(set_jump_entry, 5),
(jump_to_scene, "$g_training_ground_melee_training_scene"),
]),
(1, 3, ti_once, [(main_hero_fallen,0)],
[
(set_jump_mission, "mt_training_ground_trainer_talk"),
(modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
(reset_visitors),
(set_jump_entry, 5),
(jump_to_scene, "$g_training_ground_melee_training_scene"),
]),
(1, 3, ti_once,
[
(store_mission_timer_a, reg1),
(ge, reg1, 1),
(num_active_teams_le, 1),
(neg|main_hero_fallen),
(assign, "$training_fight_won", 1),
],
[
(set_jump_mission, "mt_training_ground_trainer_talk"),
(modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
(reset_visitors),
(set_jump_entry, 5),
(jump_to_scene, "$g_training_ground_melee_training_scene"),
]),
(ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_arena")], []),
],
),
(
"training_ground_training", mtf_arena_fight, -1,
"Training.",
[
(0,mtef_visitor_source|mtef_team_0,af_override_everything,aif_start_alarmed,1,[itm_practice_staff]),
(1,mtef_visitor_source|mtef_team_1,af_override_everything,aif_start_alarmed,1,[itm_practice_staff]),
(2,mtef_visitor_source|mtef_team_1,af_override_everything,aif_start_alarmed,1,[itm_practice_staff]),
(3,mtef_visitor_source|mtef_team_1,af_override_everything,aif_start_alarmed,1,[itm_practice_staff]),
(4,mtef_visitor_source|mtef_team_1,af_override_everything,aif_start_alarmed,1,[itm_practice_staff]),
(8,mtef_visitor_source,af_override_weapons|af_override_horse|af_override_head,0,1,[]),
(9,mtef_visitor_source,af_override_weapons|af_override_horse|af_override_head,0,1,[]),
(10,mtef_visitor_source,af_override_weapons|af_override_horse|af_override_head,0,1,[]),
(11,mtef_visitor_source,af_override_weapons|af_override_horse|af_override_head,0,1,[]),
(12,mtef_visitor_source,af_override_weapons|af_override_horse|af_override_head,0,1,[]),
(13,mtef_visitor_source,af_override_weapons|af_override_horse|af_override_head,0,1,[]),
(14,mtef_visitor_source,af_override_weapons|af_override_horse|af_override_head,0,1,[]),
(15,mtef_visitor_source,af_override_weapons|af_override_horse|af_override_head,0,1,[]),
],
[
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_last_destroyed_gourds", 0),
(call_script, "script_change_banners_and_chest")]),
common_arena_fight_tab_press,
(ti_question_answered, 0, 0, [],
[
(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$g_training_ground_training_success_ratio", 0),
(jump_to_menu, "mnu_training_ground_training_result"),
(finish_mission),
]),
common_inventory_not_available,
(0, 0, ti_once,
[
(try_begin),
(eq, "$g_mt_mode", ctm_ranged),
(set_fixed_point_multiplier, 100),
(entry_point_get_position, pos1, 0),
(init_position, pos2),
(position_set_y, pos2, "$g_training_ground_ranged_distance"),
(position_transform_position_to_parent, pos3, pos1, pos2),
(copy_position, pos1, pos3),
(assign, ":end_cond", 10),
(assign, ":shift_value", 0),
(try_for_range, ":cur_i", 0, ":end_cond"),
(store_sub, ":cur_instance", ":cur_i", ":shift_value"),
(scene_prop_get_instance, ":target_object", "spr_gourd", ":cur_instance"),
(copy_position, pos2, pos1),
(init_position, pos0),
(store_random_in_range, ":random_no", 0, 360),
(position_rotate_z, pos2, ":random_no"),
(store_random_in_range, ":random_no", 50, 600),
(position_move_x, pos2, ":random_no"),
(store_random_in_range, ":random_no", 0, 360),
(position_transform_position_to_local, pos3, pos1, pos2),
(position_rotate_z, pos0, ":random_no"),
(position_transform_position_to_parent, pos4, pos0, pos3),
(position_transform_position_to_parent, pos2, pos1, pos4),
(position_set_z_to_ground_level, pos2),
(position_move_z, pos2, 150),
(assign, ":valid", 1),
(try_for_range, ":cur_instance_2", 0, 10),
(eq, ":valid", 1),
(neq, ":cur_instance", ":cur_instance_2"),
(scene_prop_get_instance, ":target_object_2", "spr_gourd", ":cur_instance_2"),
(prop_instance_get_position, pos3, ":target_object_2"),
(get_distance_between_positions, ":dist", pos2, pos3),
(lt, ":dist", 100),
(assign, ":valid", 0),
(try_end),
(try_begin),
(eq, ":valid", 0),
(val_add, ":end_cond", 1),
(val_add, ":shift_value", 1),
(else_try),
(prop_instance_set_position, ":target_object", pos2),
(prop_instance_animate_to_position, ":target_object", pos2, 1),
(scene_prop_get_instance, ":target_object_2", "spr_gourd_spike", ":cur_instance"),
(position_move_z, pos2, -150), #moving back to ground level
(prop_instance_set_position, ":target_object_2", pos2),
(prop_instance_animate_to_position, ":target_object_2", pos2, 1),
(try_end),
(try_end),
(else_try),
(eq, "$g_mt_mode", ctm_mounted),
(assign, ":num_gourds", 0),
#First, placing gourds on the spikes
(try_for_range, ":cur_i", 0, 100),
(scene_prop_get_instance, ":target_object", "spr_gourd", ":cur_i"),
(scene_prop_get_instance, ":target_object_2", "spr_gourd_spike", ":cur_i"),
(ge, ":target_object", 0),
(ge, ":target_object_2", 0),
(val_add, ":num_gourds", 1),
(prop_instance_get_position, pos0, ":target_object_2"),
(position_move_z, pos0, 150),
(prop_instance_set_position, ":target_object", pos0),
(prop_instance_animate_to_position, ":target_object", pos0, 1),
(try_end),
(store_sub, ":end_cond", ":num_gourds", "$g_training_ground_training_num_gourds_to_destroy"),
#Second, removing gourds and their spikes randomly
(try_for_range, ":cur_i", 0, ":end_cond"),
(store_random_in_range, ":random_instance", 0, ":num_gourds"),
(scene_prop_get_instance, ":target_object", "spr_gourd", ":random_instance"),
(prop_instance_get_position, pos0, ":target_object"),
(position_get_z, ":pos_z", pos0),
(try_begin),
(lt, ":pos_z", -50000),
# (val_add, ":end_cond", 1), #removed already, try again
(else_try),
(position_set_z, pos0, -100000),
(prop_instance_set_position, ":target_object", pos0),
(prop_instance_animate_to_position, ":target_object", pos0, 1),
(scene_prop_get_instance, ":target_object_2", "spr_gourd_spike", ":random_instance"),
(prop_instance_set_position, ":target_object_2", pos0),
(prop_instance_animate_to_position, ":target_object_2", pos0, 1),
(try_end),
(try_end),
(try_end),
],
[]),
(1, 3, ti_once,
[
(eq, "$g_mt_mode", ctm_melee),
(this_or_next|main_hero_fallen),
(num_active_teams_le, 1)
],
[
(try_begin),
(neg|main_hero_fallen),
(assign, "$g_training_ground_training_success_ratio", 100),
(else_try),
(assign, ":alive_enemies", 0),
(try_for_agents, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_get_team, ":team_no", ":agent_no"),
(eq, ":team_no", 1),
(val_add, ":alive_enemies", 1),
(try_end),
(store_sub, ":dead_enemies", "$g_training_ground_training_num_enemies", ":alive_enemies"),
(store_mul, "$g_training_ground_training_success_ratio", ":dead_enemies", 100),
(val_div, "$g_training_ground_training_success_ratio", "$g_training_ground_training_num_enemies"),
(try_end),
(jump_to_menu, "mnu_training_ground_training_result"),
(finish_mission),
]),
(1, 3, ti_once,
[
(eq, "$g_mt_mode", ctm_ranged),
(get_player_agent_no, ":player_agent"),
(agent_get_ammo, ":ammo", ":player_agent"),
(store_mission_timer_a, ":cur_seconds"),
(this_or_next|main_hero_fallen),
(this_or_next|eq, ":ammo", 0),
(gt, ":cur_seconds", 116),
],
[
(store_mul, "$g_training_ground_training_success_ratio", "$scene_num_total_gourds_destroyed", 10),
(jump_to_menu, "mnu_training_ground_training_result"),
(finish_mission),
]),
(1, 3, ti_once,
[
(eq, "$g_mt_mode", ctm_mounted),
(get_player_agent_no, ":player_agent"),
(agent_get_horse, ":player_horse", ":player_agent"),
(store_mission_timer_a, ":cur_seconds"),
(this_or_next|lt, ":player_horse", 0),
(this_or_next|main_hero_fallen),
(this_or_next|ge, "$scene_num_total_gourds_destroyed", "$g_training_ground_training_num_gourds_to_destroy"),
(gt, ":cur_seconds", 120),
],
[
(store_mul, "$g_training_ground_training_success_ratio", "$scene_num_total_gourds_destroyed", 100),
(val_div, "$g_training_ground_training_success_ratio", "$g_training_ground_training_num_gourds_to_destroy"),
(jump_to_menu, "mnu_training_ground_training_result"),
(finish_mission),
]),
(0, 0, 0,
[
(gt, "$g_last_destroyed_gourds", 0),
(try_begin),
(eq, "$g_mt_mode", ctm_ranged),
(entry_point_get_position, pos1, 0),
(position_move_y, pos1, 100, 0),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos2, ":player_agent"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_add, "$scene_num_total_gourds_destroyed", "$g_last_destroyed_gourds"),
(else_try),
(display_message, "@You must stay behind the line on the ground! Point is not counted."),
(try_end),
(else_try),
(val_add, "$scene_num_total_gourds_destroyed", "$g_last_destroyed_gourds"),
(try_end),
(assign, "$g_last_destroyed_gourds", 0),
],
[]),
],
),
(
"sneak_caught_fight",mtf_battle_mode,-1,
"You must fight your way out!",
[
(0,mtef_scene_source|mtef_team_0,af_override_all,aif_start_alarmed,1,pilgrim_disguise),
(1,mtef_scene_source|mtef_team_0,af_override_all,aif_start_alarmed,1,pilgrim_disguise),
(2,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(34,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(35,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(36,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(42,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(43,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(48,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(49,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(50,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(51,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(52,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(53,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(54,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(55,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(56,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(57,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(58,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(59,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(60,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(61,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(62,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(63,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(64,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
# (0,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,pilgrim_disguise),
# (25,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
# (26,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
# (27,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
# (28,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
# (29,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
# (30,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
# (31,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
# (32,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
],
[
(ti_before_mission_start, 0, 0, [],
[
(call_script, "script_change_banners_and_chest"),
]),
(ti_after_mission_start, 0, 0, [],
[
(assign, ":num_guards", 5),
(try_begin),
(party_get_slot, ":last_nearby_fire_time", "$current_town", slot_town_last_nearby_fire_time),
(store_current_hours, ":cur_time"),
(store_add, ":fire_finish_time", ":last_nearby_fire_time", 4),
(is_between, ":cur_time", ":fire_finish_time", ":last_nearby_fire_time"),
(assign, ":num_guards", 2),
(else_try),
(this_or_next|eq, "$talk_context", tc_escape),
(eq, "$talk_context", tc_prison_break),
(assign, ":num_guards", 4),
(try_end),
(try_begin),
(this_or_next|eq, "$talk_context", tc_escape),
(eq, "$talk_context", tc_prison_break),
(entry_point_get_position, pos0, 7),
(else_try),
(party_slot_eq, "$current_town", slot_party_type, spt_town),
(entry_point_get_position, pos0, 0),
(else_try),
(entry_point_get_position, pos0, 1),
(try_end),
(assign, ":last_nearest_entry_distance", -1),
(assign, ":last_nearest_entry_point", -1),
(try_for_range, ":guard_no", 0, ":num_guards"),
(assign, ":smallest_dist", 100000),
(try_for_range, ":guard_entry_point", 2, 64),
(neq, ":last_nearest_entry_point", ":guard_entry_point"),
(entry_point_get_position, pos1, ":guard_entry_point"),
(get_distance_between_positions, ":dist", pos0, pos1),
(lt, ":dist", ":smallest_dist"),
(gt, ":dist", ":last_nearest_entry_distance"),
(assign, ":smallest_dist", ":dist"),
(assign, ":nearest_entry_point", ":guard_entry_point"),
(try_end),
(store_faction_of_party, ":town_faction","$current_town"),
(try_begin),
(this_or_next|eq, ":guard_no", 0),
(eq, ":guard_no", 2),
(faction_get_slot, ":troop_of_guard", ":town_faction", slot_faction_tier_2_troop),
(else_try),
(faction_get_slot, ":troop_of_guard", ":town_faction", slot_faction_tier_2_troop),
(try_end),
(assign, ":last_nearest_entry_point", ":nearest_entry_point"),
(assign, ":last_nearest_entry_distance", ":smallest_dist"),
(add_visitors_to_current_scene, ":nearest_entry_point", ":troop_of_guard", 1, 0),
(try_end),
]),
(ti_tab_pressed, 0, 0, [],
[(question_box,"str_do_you_wish_to_surrender")]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),(eq,":answer",0),(jump_to_menu,"mnu_captivity_start_castle_defeat"),(finish_mission,0),]),
(1, 0, ti_once, [],
[
(play_sound,"snd_sneak_town_halt"),
(call_script, "script_music_set_situation_with_culture", mtf_sit_fight),
]),
(0, 3, 0,
[
(main_hero_fallen,0),
],
[
(jump_to_menu,"mnu_captivity_start_castle_defeat"),
(finish_mission,0),
]),
(1, 0, 0, [],
[
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(try_for_agents, ":agent_no"),
(neq, ":agent_no", ":player_agent"),
(agent_is_alive, ":agent_no"),
(agent_get_team, ":agent_team", ":agent_no"),
(eq, ":agent_team", 1),
(agent_get_position, pos1, ":agent_no"),
(get_distance_between_positions, ":dist", pos0, pos1),
(try_begin),
(le, ":dist", 800),
(agent_clear_scripted_mode, ":agent_no"),
(else_try),
(agent_set_scripted_destination, ":agent_no", pos0, 0),
(try_end),
(try_end),
]),
(5, 1, ti_once,
[
(num_active_teams_le,1),
(neg|main_hero_fallen),
(store_mission_timer_a,":cur_time"),
(ge, ":cur_time", 5),
],
[
(assign,"$auto_menu",-1),
(jump_to_menu,"mnu_sneak_into_town_caught_dispersed_guards"),
(finish_mission,1),
]),
(ti_on_leave_area, 0, ti_once, [],
[(assign,"$auto_menu",-1),(jump_to_menu,"mnu_sneak_into_town_caught_ran_away"),(finish_mission,0)]),
(ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_arena")], []),
],
),
(
"ai_training",0,-1,
"You start training.",
[
# (0,0,af_override_horse,aif_start_alarmed,1,[]),
(0,0,0,aif_start_alarmed,30,[]),
# (1,mtef_no_leader,0,0|aif_start_alarmed,5,[]),
# (0,mtef_no_leader,0,0|aif_start_alarmed,0,[]),
# (3,mtef_enemy_party|mtef_reverse_order,0,aif_start_alarmed,6,[]),
# (4,mtef_enemy_party|mtef_reverse_order,0,aif_start_alarmed,0,[]),
],
[
# (ti_before_mission_start, 0, 0, [], [(set_rain, 1,100), (set_fog_distance, 10)]),
(ti_tab_pressed, 0, 0, [],
[(finish_mission,0)]),
common_battle_order_panel,
common_battle_order_panel_tick,
## (0, 0, ti_once,
## [
## (key_clicked, key_numpad_7),
## (mission_cam_set_mode,1),
## (get_player_agent_no, ":player_agent"),
## (mission_cam_set_target_agent, ":player_agent", 1),
## (mission_cam_set_animation, "anim_test_cam"),], []),
],
),
(
"camera_test",0,-1,
"camera Test.",
[
# (0,mtef_attackers,0,aif_start_alarmed,5,[]),
],
[
(1, 0, 0, [(mission_cam_set_mode,1),
(entry_point_get_position, pos3, 3),
(mission_cam_set_position, pos3)], []),
# (ti_before_mission_start, 0, 0, [], [(set_rain, 1,100)]),
(ti_tab_pressed, 0, 0, [],
[(finish_mission,0)]),
],
),
(
"arena_melee_fight",mtf_arena_fight,-1,
"You enter a melee fight in the arena.",
[
(0,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_red, itm_red_tourney_helmet]),
(1,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword, itm_arena_tunic_red]),
(2,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_practice_horse,itm_arena_tunic_red, itm_red_tourney_helmet]),
(3,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_red, itm_red_tourney_helmet]),
(4,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows, itm_practice_dagger, itm_arena_tunic_red]),
(5,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_practice_sword,itm_practice_shield,itm_arena_tunic_red]),
(6,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_practice_horse,itm_arena_tunic_red]),
(7,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_red, itm_red_tourney_helmet]),
(8,mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_dagger, itm_arena_tunic_blue]),
(9,mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_blue,itm_blue_tourney_helmet]),
(10,mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_arena_tunic_blue]),
(11,mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_practice_sword,itm_practice_shield,itm_arena_tunic_blue, itm_blue_tourney_helmet]),
(12,mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_blue]),
(13,mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_blue,itm_blue_tourney_helmet]),
(14,mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_arena_tunic_blue]),
(15,mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_practice_sword,itm_practice_shield,itm_arena_tunic_blue]),
(16,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_green, itm_green_tourney_helmet]),
(17,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_arena_tunic_green, itm_green_tourney_helmet]),
(18,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_practice_horse,itm_arena_tunic_green, itm_green_tourney_helmet]),
(19,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_green, itm_green_tourney_helmet]),
(20,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_dagger, itm_arena_tunic_green, itm_green_tourney_helmet]),
(21,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_practice_sword,itm_practice_shield,itm_arena_tunic_green]),
(22,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_practice_horse,itm_arena_tunic_green]),
(23,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_green, itm_green_tourney_helmet]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(25,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(26,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(27,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(28,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_dagger, itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(29,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_sword,itm_practice_shield,itm_arena_tunic_yellow]),
(30,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_practice_horse,itm_arena_tunic_yellow]),
(31,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
#32
(32, mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword]),
(33,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_practice_staff]),
(34,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_sword, itm_practice_shield]),
(35,mtef_visitor_source|mtef_team_4,af_override_all,aif_start_alarmed,1,[itm_practice_staff]),
(36, mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows, itm_practice_dagger]),
(37,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_practice_sword, itm_practice_shield]),
(38,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword]),
(39,mtef_visitor_source|mtef_team_4,af_override_all,aif_start_alarmed,1,[itm_practice_staff]),
#40-49 not used yet
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_dagger, itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_sword,itm_practice_shield,itm_arena_tunic_yellow]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_heavy_practice_sword,itm_practice_horse,itm_arena_tunic_yellow]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_lance,itm_practice_shield,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(24,mtef_visitor_source|mtef_team_3,af_override_all,aif_start_alarmed,1,[itm_practice_bow,itm_practice_arrows,itm_practice_horse,itm_arena_tunic_yellow, itm_gold_tourney_helmet]),
(50, mtef_scene_source,af_override_horse|af_override_weapons|af_override_head,0,1,[]),
(51, mtef_visitor_source,af_override_horse|af_override_weapons|af_override_head,0,1,[]),
(52, mtef_scene_source,af_override_horse,0,1,[]),
#not used yet:
(53, mtef_scene_source,af_override_horse,0,1,[]),(54, mtef_scene_source,af_override_horse,0,1,[]),(55, mtef_scene_source,af_override_horse,0,1,[]),
#used for torunament master scene
(56, mtef_visitor_source|mtef_team_0, af_override_all, aif_start_alarmed, 1, [itm_practice_sword, itm_practice_shield, itm_padded_cloth, itm_segmented_helmet]),
(57, mtef_visitor_source|mtef_team_0, af_override_all, aif_start_alarmed, 1, [itm_practice_sword, itm_practice_shield, itm_padded_cloth, itm_segmented_helmet]),
],
tournament_triggers
),
(
"arena_challenge_fight",mtf_arena_fight|mtf_commit_casualties,-1,
"You enter a melee fight in the arena.",
[
(56, mtef_visitor_source|mtef_team_0, 0, aif_start_alarmed, 1, []),
(58, mtef_visitor_source|mtef_team_2, 0, aif_start_alarmed, 1, []),
],
[
common_inventory_not_available,
(ti_tab_pressed, 0, 0, [(display_message, "str_cannot_leave_now")], []),
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),
(0, 0, ti_once, [],
[
(call_script, "script_music_set_situation_with_culture", mtf_sit_arena),
]),
#NOTE -- THIS IS A VESTIGIAL SCRIPT. FOR LORD DUELS, USE THE NEXT SCRIPT DOWN
(1, 4, ti_once, [
(this_or_next|main_hero_fallen),
(num_active_teams_le,1)],
[
(try_begin),
(main_hero_fallen),
(check_quest_active, "qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_fail_quest", "qst_duel_for_lady"),
(else_try),
(check_quest_active, "qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_succeed_quest", "qst_duel_for_lady"),
(else_try),
(main_hero_fallen),
(check_quest_active, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_fail_quest", "qst_duel_courtship_rival"),
(else_try),
(check_quest_active, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_succeed_quest", "qst_duel_courtship_rival"),
(else_try),
(main_hero_fallen),
(check_quest_active, "qst_duel_avenge_insult"),
(quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_fail_quest", "qst_duel_avenge_insult"),
(else_try),
(check_quest_active, "qst_duel_avenge_insult"),
(quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_succeed_quest", "qst_duel_avenge_insult"),
(else_try),
(main_hero_fallen),
(check_quest_active, "qst_denounce_lord"),
(quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_fail_quest", "qst_denounce_lord"),
(else_try),
(check_quest_active, "qst_denounce_lord"),
(quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_succeed_quest", "qst_denounce_lord"),
(else_try),
(quest_get_slot, ":target_troop", "qst_denounce_lord", slot_quest_target_troop),
(str_store_troop_name, s4, ":target_troop"),
(try_end),
(finish_mission),
]),
],
),
(
"duel_with_lord",mtf_arena_fight|mtf_commit_casualties,-1,
"You enter a melee fight in the arena.",
[
(0, mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_sword_medieval_a,itm_arena_tunic_blue]),
(16, mtef_visitor_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[itm_sword_medieval_a,itm_arena_tunic_blue]),
],
[
common_inventory_not_available,
(ti_tab_pressed, 0, 0, [(display_message, "str_cannot_leave_now")], []),
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),
(0, 0, ti_once, [],
[
(call_script, "script_music_set_situation_with_culture", mtf_sit_arena),
]),
(1, 4, ti_once, [
(this_or_next|main_hero_fallen),
(num_active_teams_le,1)],
[
(try_begin),
(main_hero_fallen),
(check_quest_active, "qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_fail_quest", "qst_duel_for_lady"),
(else_try),
(check_quest_active, "qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_succeed_quest", "qst_duel_for_lady"),
(else_try),
(main_hero_fallen),
(check_quest_active, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_fail_quest", "qst_duel_courtship_rival"),
(else_try),
(check_quest_active, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_succeed_quest", "qst_duel_courtship_rival"),
(else_try),
(main_hero_fallen),
(check_quest_active, "qst_duel_avenge_insult"),
(quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_fail_quest", "qst_duel_avenge_insult"),
(else_try),
(check_quest_active, "qst_duel_avenge_insult"),
(quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_succeed_quest", "qst_duel_avenge_insult"),
(else_try),
(main_hero_fallen),
(check_quest_active, "qst_denounce_lord"),
(quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_fail_quest", "qst_denounce_lord"),
(else_try),
(check_quest_active, "qst_denounce_lord"),
(quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_duel_troop"),
(call_script, "script_succeed_quest", "qst_denounce_lord"),
(else_try),
(quest_get_slot, ":target_troop", "qst_denounce_lord", slot_quest_target_troop),
(str_store_troop_name, s4, ":target_troop"),
(try_end),
(finish_mission),
]),
],
),
## (
## "tutorial",0,-1,
## "You enter the training ground.",
## [
## (1,mtef_leader_only,af_override_horse,0,1,[]), #af_override_weapons
## (2,mtef_scene_source,af_override_horse,0,1,[]), #af_override_weapons
## ],
## [
## (ti_tab_pressed, 0, 0, [],
## [(question_box,"str_do_you_wish_to_leave_tutorial")]),
## (ti_question_answered, 0, 0, [],
## [(store_trigger_param_1,":answer"),
## (eq,":answer",0),
## (finish_mission,0),
## (leave_encounter),
## (change_screen_return),
## (troop_remove_item, "trp_player", "itm_tutorial_sword"),
## (troop_remove_item, "trp_player", "itm_tutorial_axe"),
## (troop_remove_item, "trp_player", "itm_tutorial_spear"),
## (troop_remove_item, "trp_player", "itm_tutorial_club"),
## (troop_remove_item, "trp_player", "itm_tutorial_battle_axe"),
## (troop_remove_item, "trp_player", "itm_tutorial_arrows"),
## (troop_remove_item, "trp_player", "itm_tutorial_bolts"),
## (troop_remove_item, "trp_player", "itm_tutorial_short_bow"),
## (troop_remove_item, "trp_player", "itm_tutorial_crossbow"),
## (troop_remove_item, "trp_player", "itm_tutorial_throwing_daggers"),
##
## (check_quest_active, "qst_destroy_dummies"),
## (cancel_quest,"qst_destroy_dummies"),
## ]),
### (ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_tutorial")], []),
## (ti_inventory_key_pressed, 0, 0, [(set_trigger_result,1)], []),
##
##
## (0, 0, ti_once, [],
## [
## (assign, "$tutorial_enter_melee", 0),
## (assign, "$tutorial_enter_ranged", 0),
## (assign, "$tutorial_enter_mounted", 0),
## (assign, "$tutorial_camp_stage", 0),
## (assign, "$tutorial_quest_taken", 0),
## (assign, "$tutorial_quest_succeeded", 0),
## (assign, "$tutorial_num_total_dummies_destroyed", 0),
## (assign, "$tutorial_melee_chest", 0),
## (assign, "$tutorial_ranged_chest", 0),
## (assign, "$tutorial_award_taken", 0),
##
##
## (entry_point_get_position,2,2),#Trainer
## (entry_point_get_position,16,16),#Horse
## (set_spawn_position, 16),
## (spawn_horse, "itm_tutorial_saddle_horse"),
##
## (troop_remove_item, "trp_tutorial_chest_1", "itm_tutorial_sword"),
## (troop_remove_item, "trp_tutorial_chest_1", "itm_tutorial_axe"),
## (troop_remove_item, "trp_tutorial_chest_1", "itm_tutorial_spear"),
## (troop_remove_item, "trp_tutorial_chest_1", "itm_tutorial_club"),
## (troop_remove_item, "trp_tutorial_chest_1", "itm_tutorial_battle_axe"),
## (troop_remove_item, "trp_tutorial_chest_2", "itm_tutorial_arrows"),
## (troop_remove_item, "trp_tutorial_chest_2", "itm_tutorial_bolts"),
## (troop_remove_item, "trp_tutorial_chest_2", "itm_tutorial_short_bow"),
## (troop_remove_item, "trp_tutorial_chest_2", "itm_tutorial_crossbow"),
## (troop_remove_item, "trp_tutorial_chest_2", "itm_tutorial_throwing_daggers"),
## (troop_add_item, "trp_tutorial_chest_1", "itm_tutorial_sword"),
## (troop_add_item, "trp_tutorial_chest_1", "itm_tutorial_axe"),
## (troop_add_item, "trp_tutorial_chest_1", "itm_tutorial_spear"),
## (troop_add_item, "trp_tutorial_chest_1", "itm_tutorial_club"),
## (troop_add_item, "trp_tutorial_chest_1", "itm_tutorial_battle_axe"),
## (troop_add_item, "trp_tutorial_chest_2", "itm_tutorial_arrows"),
## (troop_add_item, "trp_tutorial_chest_2", "itm_tutorial_bolts"),
## (troop_add_item, "trp_tutorial_chest_2", "itm_tutorial_short_bow"),
## (troop_add_item, "trp_tutorial_chest_2", "itm_tutorial_crossbow"),
## (troop_add_item, "trp_tutorial_chest_2", "itm_tutorial_throwing_daggers"),
## ]
## ),
##
## (1, 0, ti_once, [(store_character_level, ":player_level", "trp_player"),
## (le, ":player_level", 1),
## (get_player_agent_no, ":player_agent"),
## (ge, ":player_agent", 0),
## (agent_get_position, pos1, ":player_agent"),
## (entry_point_get_position,3,3),
## (get_distance_between_positions, ":distance_to_area", 1, 3),
## (lt, ":distance_to_area", 500),
## (eq, "$tutorial_enter_melee", 0),],
## [(tutorial_box,"str_tutorial_enter_melee", "str_tutorial"), (val_add,"$tutorial_enter_melee", 1)]),
## (1, 0, ti_once, [(store_character_level, ":player_level", "trp_player"),
## (le, ":player_level", 1),
## (get_player_agent_no, ":player_agent"),
## (ge, ":player_agent", 0),
## (neg|conversation_screen_is_active),
## (agent_get_position, pos1, ":player_agent"),
## (entry_point_get_position,4,4),
## (get_distance_between_positions, ":distance_to_area", 1, 4),
## (lt, ":distance_to_area", 500),
## (eq, "$tutorial_enter_ranged", 0),],
## [(tutorial_box,"str_tutorial_enter_ranged", "str_tutorial"), (val_add,"$tutorial_enter_ranged", 1)]),
## (1, 0, ti_once, [(store_character_level, ":player_level", "trp_player"),
## (le, ":player_level", 1),
## (get_player_agent_no, ":player_agent"),
## (ge, ":player_agent", 0),
## (neg|conversation_screen_is_active),
## (agent_get_position, pos1, ":player_agent"),
## (entry_point_get_position,5,5),
## (get_distance_between_positions, ":distance_to_area", 1, 5),
## (lt, ":distance_to_area", 500),
## (eq, "$tutorial_enter_mounted", 0),],
## [(tutorial_box,"str_tutorial_enter_mounted", "str_tutorial"), (val_add,"$tutorial_enter_mounted", 1)]),
##
##
## (2, 0, ti_once, [(store_character_level, ":player_level", "trp_player"),
## (le, ":player_level", 1),
## (get_player_agent_no, ":player_agent"),
## (ge, ":player_agent", 0),
## (neg|conversation_screen_is_active),
## (agent_get_position, pos1, ":player_agent"),
## (entry_point_get_position,6,6),
## (get_distance_between_positions, ":distance_to_area", 1, 6),
## (lt, ":distance_to_area", 300),
## (eq, "$tutorial_melee_chest", 0),],
## [(tutorial_box,"str_tutorial_melee_chest", "str_tutorial"), (val_add,"$tutorial_melee_chest", 1)]),
## (2, 0, ti_once, [(store_character_level, ":player_level", "trp_player"),
## (le, ":player_level", 1),
## (get_player_agent_no, ":player_agent"),
## (ge, ":player_agent", 0),
## (agent_get_position, pos1, ":player_agent"),
## (entry_point_get_position,7,7),
## (get_distance_between_positions, ":distance_to_area", 1, 7),
## (lt, ":distance_to_area", 300),
## (eq, "$tutorial_ranged_chest", 0),],
## [(tutorial_box,"str_tutorial_ranged_chest", "str_tutorial"), (val_add,"$tutorial_ranged_chest", 1)]),
##
## (2, 0, ti_once, [(store_character_level, ":player_level", "trp_player"),
## (le, ":player_level", 1),
## (eq, "$tutorial_item_equipped", 0),
## (try_begin),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_sword"),
## (assign, "$tutorial_item_equipped", 1),
## (else_try),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_axe"),
## (assign, "$tutorial_item_equipped", 1),
## (else_try),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_spear"),
## (assign, "$tutorial_item_equipped", 1),
## (else_try),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_club"),
## (assign, "$tutorial_item_equipped", 1),
## (else_try),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_battle_axe"),
## (assign, "$tutorial_item_equipped", 1),
## (else_try),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_arrows"),
## (assign, "$tutorial_item_equipped", 1),
## (else_try),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_bolts"),
## (assign, "$tutorial_item_equipped", 1),
## (else_try),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_short_bow"),
## (assign, "$tutorial_item_equipped", 1),
## (else_try),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_crossbow"),
## (assign, "$tutorial_item_equipped", 1),
## (else_try),
## (troop_has_item_equipped, "trp_player", "itm_tutorial_throwing_daggers"),
## (assign, "$tutorial_item_equipped", 1),
## (try_end),
## (eq, "$tutorial_item_equipped", 1),],
## [(tutorial_box,"str_tutorial_item_equipped", "str_tutorial")]),
##
##
##
##
### (2, 0, ti_once, [(get_player_agent_no, ":player_agent"),
### (agent_get_position, pos1, ":player_agent"),
### (entry_point_get_position,21,21),
### (get_distance_between_positions, ":distance_to_area", 1, 21),
### (lt, ":distance_to_area", 200),
### (eq, "$tutorial_group_of_weapons", 0),],
### [(tutorial_box,"str_tutorial_group_of_weapons", "str_tutorial"), (val_add,"$tutorial_group_of_weapons", 1)]),
##
##
##
## (1, 5, ti_once, [(eq,"$tutorial_camp_stage",0),
## (neg|conversation_screen_is_active),
## (eq,"$tutorial_quest_award_taken",0),
## (store_character_level, ":player_level", "trp_player"),
## (le, ":player_level", 1),
## (tutorial_box,"str_tutorial_camp1","str_tutorial"),],
## [(val_add,"$tutorial_camp_stage",1)]),
## (1, 3, ti_once, [(eq,"$tutorial_camp_stage",1),
## (neg|conversation_screen_is_active),
## (tutorial_box,"str_tutorial_camp2","str_tutorial"),],
## [(val_add,"$tutorial_camp_stage",1)]),
## (1, 3, ti_once, [(eq,"$tutorial_camp_stage",2),
## (neg|conversation_screen_is_active),
## (tutorial_box,"str_tutorial_camp3","str_tutorial"),],
## [(val_add,"$tutorial_camp_stage",1)]),
## (1, 3, ti_once, [(eq,"$tutorial_camp_stage",3),(eq, "$tutorial_award_taken", 0),
## (neg|conversation_screen_is_active),
## (tutorial_box,"str_tutorial_camp4","str_tutorial"),],
## [(val_add,"$tutorial_camp_stage",2)]),
##
##
## (1, 3, ti_once, [(eq,"$tutorial_camp_stage",5),
## (neg|conversation_screen_is_active),
## (eq,"$tutorial_quest_taken",1),
## (tutorial_box,"str_tutorial_camp6","str_tutorial"),],
## [(val_add,"$tutorial_camp_stage",1)]),
##
## (1, 3, ti_once, [(eq,"$tutorial_camp_stage",6),
## (neg|conversation_screen_is_active),
## (ge,"$tutorial_num_total_dummies_destroyed",10),
## (tutorial_box,"str_tutorial_camp7","str_tutorial"),],
## [(val_add,"$tutorial_camp_stage",1), (assign,"$tutorial_quest_succeeded",1),]),
##
## (1, 3, ti_once, [(eq,"$tutorial_camp_stage",7),
## (neg|conversation_screen_is_active),
## (eq,"$tutorial_quest_award_taken",1),
## (tutorial_box,"str_tutorial_camp8","str_tutorial"),
## (troop_add_proficiency_points, "trp_player", 10),
## (assign, "$tutorial_last_proficiency_sum", 0),
## (try_for_range, ":cur_attribute", 0, num_weapon_proficiencies),
## (store_proficiency_level, ":cur_attribute_point", "trp_player", ":cur_attribute"),
## (val_add, "$tutorial_last_proficiency_sum", ":cur_attribute_point"),
## (try_end),],
## [(val_add,"$tutorial_camp_stage",1),]),
##
## (1, 3, ti_once, [(eq,"$tutorial_camp_stage",8),
## (neg|conversation_screen_is_active),
## (assign, ":new_proficiency_sum", 0),
## (try_for_range, ":cur_attribute", 0, num_weapon_proficiencies),
## (store_proficiency_level, ":cur_attribute_point", "trp_player", ":cur_attribute"),
## (val_add, ":new_proficiency_sum", ":cur_attribute_point"),
## (try_end),
## (assign, reg(48), ":new_proficiency_sum"),
## (assign, reg(49), "$tutorial_last_proficiency_sum"),
## (lt,"$tutorial_last_proficiency_sum",":new_proficiency_sum"),
## (tutorial_box,"str_tutorial_camp9","str_tutorial"),],
## [(val_add,"$tutorial_camp_stage",1)]),
##
## (2, 0, 0, [(check_quest_active,"qst_destroy_dummies"),
## (le, "$tutorial_num_total_dummies_destroyed", 10),],
## [
## (assign, ":progress", "$tutorial_num_total_dummies_destroyed"),
## (val_mul, ":progress", 10),
## (set_quest_progression,"qst_destroy_dummies",":progress"),
## ]
## ),
##
## ],
## ),
(
"wedding",0,-1,
"Wedding",
[
(0,mtef_visitor_source,af_override_everything,0,1,[itm_tabard, itm_ankle_boots]),
(1,mtef_visitor_source,af_override_everything,0,1,[itm_bride_dress, itm_bride_crown, itm_bride_shoes]),
(2,mtef_visitor_source,af_castle_lord,0,1,[]),
(3,mtef_visitor_source,af_override_everything,0,1,[itm_courtly_outfit, itm_blue_hose]),
(4,mtef_visitor_source,af_castle_lord,0,1,[]),
(5,mtef_visitor_source,af_castle_lord,0,1,[]),
(6,mtef_visitor_source,af_castle_lord,0,1,[]),
(7,mtef_visitor_source,af_castle_lord,0,1,[]),
(8,mtef_visitor_source,af_castle_lord,0,1,[]),
(9,mtef_visitor_source,af_castle_lord,0,1,[]),
(10,mtef_visitor_source,af_castle_lord,0,1,[]),
(11,mtef_visitor_source,af_castle_lord,0,1,[]),
(12,mtef_visitor_source,af_castle_lord,0,1,[]),
(13,mtef_visitor_source,af_castle_lord,0,1,[]),
(14,mtef_visitor_source,af_castle_lord,0,1,[]),
(15,mtef_visitor_source,af_castle_lord,0,1,[]),
(16,mtef_visitor_source,af_castle_lord,0,1,[]),
(17,mtef_visitor_source,af_castle_lord,0,1,[]),
(18,mtef_visitor_source,af_castle_lord,0,1,[]),
(19,mtef_visitor_source,af_castle_lord,0,1,[]),
(20,mtef_visitor_source,af_castle_lord,0,1,[]),
(21,mtef_visitor_source,af_castle_lord,0,1,[]),
(22,mtef_visitor_source,af_castle_lord,0,1,[]),
(23,mtef_visitor_source,af_castle_lord,0,1,[]),
(24,mtef_visitor_source,af_castle_lord,0,1,[]),
(25,mtef_visitor_source,af_castle_lord,0,1,[]),
(26,mtef_visitor_source,af_castle_lord,0,1,[]),
(27,mtef_visitor_source,af_castle_lord,0,1,[]),
(28,mtef_visitor_source,af_castle_lord,0,1,[]),
(29,mtef_visitor_source,af_castle_lord,0,1,[]),
(30,mtef_visitor_source,af_castle_lord,0,1,[]),
(31,mtef_visitor_source,af_castle_lord,0,1,[]),
],
[
(ti_tab_pressed, 0, 0, [],
[
(show_object_details_overlay, 1),
(finish_mission,0),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(show_object_details_overlay, 1),
(finish_mission,0),
]),
(ti_after_mission_start, 0, 0, [],
[
(assign, "$g_wedding_state", 0),
(play_track, "track_wedding", 2),
(show_object_details_overlay, 0),
]),
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(troop_get_type, ":gender", ":troop_no"),
(set_fixed_point_multiplier, 100),
(try_begin),
(eq, ":troop_no", "$g_wedding_bishop_troop"),
(else_try),
(eq, ":troop_no", "$g_wedding_bride_troop"),
(agent_set_no_dynamics, ":agent_no", 1),
(init_position, pos1),
(position_set_z, pos1, -1000),
(agent_set_position, ":agent_no", pos1),
(else_try),
(eq, ":troop_no", "$g_wedding_brides_dad_troop"),
(agent_set_no_dynamics, ":agent_no", 1),
(init_position, pos1),
(position_set_z, pos1, -1000),
(agent_set_position, ":agent_no", pos1),
(else_try),
(eq, ":troop_no", "$g_wedding_groom_troop"),
(agent_set_no_dynamics, ":agent_no", 1),
(init_position, pos1),
(position_move_x, pos1, 175),
(position_move_z, pos1, 10),
(position_rotate_z, pos1, 180),
(agent_set_position, ":agent_no", pos1),
(agent_set_animation, ":agent_no", "anim_wedding_groom_wait"),
(else_try),
(try_begin),
(eq, ":gender", 0), #male
(store_random_in_range, ":random_no", 0, 3),
(try_begin),
(eq, ":random_no", 0),
(agent_set_slot, ":agent_no", slot_agent_cur_animation, "anim_wedding_guest_notr"),
(agent_set_animation, ":agent_no", "anim_wedding_guest_notr"),
(else_try),
(agent_set_slot, ":agent_no", slot_agent_cur_animation, "anim_wedding_guest"),
(agent_set_animation, ":agent_no", "anim_wedding_guest"),
(try_end),
(else_try), #female
(agent_set_slot, ":agent_no", slot_agent_cur_animation, "anim_wedding_guest_woman"),
(agent_set_animation, ":agent_no", "anim_wedding_guest_woman"),
(try_end),
(store_random_in_range, ":progress", 0, 100),
(agent_set_animation_progress, ":agent_no", ":progress"),
(try_end),
]),
(0, 0, 0,
[
(store_mission_timer_a, ":cur_time"),
(set_fixed_point_multiplier, 100),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(try_begin),
(eq, ":troop_no", "$g_wedding_groom_troop"),
(else_try),
(eq, ":troop_no", "$g_wedding_bride_troop"),
(else_try),
(eq, ":troop_no", "$g_wedding_brides_dad_troop"),
(else_try),
(eq, ":troop_no", "$g_wedding_bishop_troop"),
(else_try),
(agent_get_slot, ":cur_animation", ":agent_no", slot_agent_cur_animation),
(agent_set_animation, ":agent_no", ":cur_animation"),
(try_end),
(try_end),
(try_begin),
(eq, "$g_wedding_state", 0),
(mission_cam_set_mode, 1, 0, 0),
(init_position, pos1),
(position_rotate_z, pos1, 180),
(position_rotate_x, pos1, 5),
(position_set_x, pos1, -500),
(position_set_y, pos1, 1000),
(position_set_z, pos1, 600),
(mission_cam_set_position, pos1),
(init_position, pos1),
(position_rotate_z, pos1, 180),
(position_rotate_x, pos1, -15),
(position_set_x, pos1, -500),
(position_set_y, pos1, 1000),
(position_set_z, pos1, 600),
(mission_cam_animate_to_position, pos1, 4000, 0),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 1),
(ge, ":cur_time", 4),
(init_position, pos1),
(position_rotate_z, pos1, 90),
(position_rotate_x, pos1, -10),
(position_set_x, pos1, -580),
(position_set_y, pos1, 700),
(position_set_z, pos1, 200),
(mission_cam_set_position, pos1),
(init_position, pos1),
(position_rotate_z, pos1, 150),
(position_rotate_x, pos1, -10),
(position_set_x, pos1, -580),
(position_set_y, pos1, 100),
(position_set_z, pos1, 200),
(mission_cam_animate_to_position, pos1, 6000, 1),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 2),
(ge, ":cur_time", 9),
(mission_cam_animate_to_screen_color, 0xFF000000, 1000),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 3),
(ge, ":cur_time", 10),
(init_position, pos1),
(position_move_x, pos1, 175),
(position_move_z, pos1, 10),
(position_rotate_z, pos1, 180),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":agent_troop", ":agent_no"),
(try_begin),
(eq, ":agent_troop", "$g_wedding_bride_troop"),
(agent_set_position, ":agent_no", pos1),
(agent_set_animation, ":agent_no", "anim_wedding_bride_stairs"),
(else_try),
(eq, ":agent_troop", "$g_wedding_brides_dad_troop"),
(agent_set_position, ":agent_no", pos1),
(agent_set_animation, ":agent_no", "anim_wedding_dad_stairs"),
(try_end),
(try_end),
(init_position, pos1),
(position_rotate_z, pos1, -90),
(position_set_x, pos1, 300),
(position_set_y, pos1, 950),
(position_set_z, pos1, 420),
(mission_cam_set_position, pos1),
(position_set_x, pos1, 175),
(position_set_y, pos1, 950),
(position_set_z, pos1, 320),
(mission_cam_animate_to_position, pos1, 4000, 0),
(mission_cam_animate_to_screen_color, 0x00000000, 500),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 4),
(ge, ":cur_time", 14),
(init_position, pos1),
(position_rotate_z, pos1, -60),
(position_rotate_x, pos1, 10),
(position_set_x, pos1, -400),
(position_set_y, pos1, 200),
(position_set_z, pos1, 115),
(mission_cam_set_position, pos1),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 5),
(ge, ":cur_time", 20),
(init_position, pos1),
(position_move_x, pos1, 175),
(position_move_z, pos1, 10),
(position_rotate_z, pos1, 180),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":agent_troop", ":agent_no"),
(try_begin),
(eq, ":agent_troop", "$g_wedding_bride_troop"),
(agent_set_position, ":agent_no", pos1),
(agent_set_animation, ":agent_no", "anim_wedding_bride_walk"),
(else_try),
(eq, ":agent_troop", "$g_wedding_brides_dad_troop"),
(agent_set_position, ":agent_no", pos1),
(agent_set_animation, ":agent_no", "anim_wedding_dad_walk"),
(try_end),
(try_end),
(init_position, pos1),
(position_rotate_z, pos1, -140),
(position_rotate_x, pos1, -15),
(position_set_x, pos1, -625),
(position_set_y, pos1, -530),
(position_set_z, pos1, 180),
(mission_cam_set_position, pos1),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 6),
(ge, ":cur_time", 22),
(init_position, pos1),
(position_rotate_z, pos1, 45),
(position_rotate_x, pos1, -10),
(position_set_x, pos1, -260),
(position_set_y, pos1, 120),
(position_set_z, pos1, 275),
(mission_cam_set_position, pos1),
(position_rotate_z, pos1, 10),
(mission_cam_animate_to_position, pos1, 2000, 0),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 7),
(ge, ":cur_time", 24),
(init_position, pos1),
(position_move_x, pos1, 175),
(position_move_z, pos1, 10),
(position_rotate_z, pos1, 180),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":agent_troop", ":agent_no"),
(try_begin),
(eq, ":agent_troop", "$g_wedding_bride_troop"),
(agent_set_position, ":agent_no", pos1),
(agent_set_animation, ":agent_no", "anim_wedding_bride_last"),
(else_try),
(eq, ":agent_troop", "$g_wedding_brides_dad_troop"),
(agent_set_position, ":agent_no", pos1),
(agent_set_animation, ":agent_no", "anim_wedding_dad_last"),
(else_try),
(eq, ":agent_troop", "$g_wedding_groom_troop"),
(agent_set_position, ":agent_no", pos1),
(agent_set_animation, ":agent_no", "anim_wedding_groom_last"),
(try_end),
(try_end),
(init_position, pos1),
(position_rotate_z, pos1, -45),
(position_rotate_x, pos1, -10),
(position_set_x, pos1, -900),
(position_set_y, pos1, -850),
(position_set_z, pos1, 230),
(mission_cam_set_position, pos1),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 8),
(ge, ":cur_time", 31),
(init_position, pos1),
(position_set_x, pos1, -550),
(position_set_y, pos1, -625),
(position_set_z, pos1, 1500),
(particle_system_burst, "psys_wedding_rose", pos1, 750),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 9),
(ge, ":cur_time", 33),
(init_position, pos1),
(position_rotate_z, pos1, 180),
(position_set_x, pos1, -536),
(position_set_y, pos1, -415),
(position_set_z, pos1, 135),
(mission_cam_set_position, pos1),
(position_rotate_z, pos1, -8),
(position_set_z, pos1, 350),
(position_rotate_x, pos1, 35),
(mission_cam_animate_to_position_and_aperture, pos1, 10, 9000, 1),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 10),
(ge, ":cur_time", 41),
(mission_cam_set_screen_color, 0x00FFFFFF),
(mission_cam_animate_to_screen_color, 0xFFFFFFFF, 3000),
(val_add, "$g_wedding_state", 1),
(else_try),
(eq, "$g_wedding_state", 11),
(ge, ":cur_time", 48),
(show_object_details_overlay, 1),
(finish_mission,0),
(try_end),
], []),
],
),
(
"tutorial_training_ground",mtf_arena_fight,-1,
"You enter the training ground.",
[
(0,mtef_visitor_source|mtef_team_0,0,0,1,[]),
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_sword]),
(33,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_sword]),
(34,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_sword]),
(35,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_sword]),
(36,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_bow, itm_practice_arrows]),
(42,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_bow, itm_practice_arrows]),
(43,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(48,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(49,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(50,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(51,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(52,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(53,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(54,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(55,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(56,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(57,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(58,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(59,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(60,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(61,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_sword]),
(62,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_sword]),
(63,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_bow, itm_practice_arrows]),
(64,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_practice_bow, itm_practice_arrows]),
],
[
(ti_tab_pressed, 0, 0, [],
[(try_begin),
(lt, "$g_tutorial_training_ground_state", 20),
(question_box, "str_do_you_wish_to_leave_tutorial"),
(else_try),
(finish_mission,0),
(try_end),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(finish_mission,0),
]),
(ti_inventory_key_pressed, 0, 0, [(display_message, "str_cant_use_inventory_tutorial")], []),
(ti_battle_window_opened, 0, 0, [],
[
(start_presentation, "prsnt_tutorial_show_mouse_movement"),
]),
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(agent_ai_set_always_attack_in_melee, ":agent_no", 1),
(agent_set_no_death_knock_down_only, ":agent_no", 1),
(agent_set_invulnerable_shield, ":agent_no", 1),
(agent_get_position, pos1, ":agent_no"),
(agent_set_slot, ":agent_no", slot_agent_spawn_entry_point, -1),
(get_player_agent_no, ":player_agent"),
(try_begin),
(eq, ":agent_no", ":player_agent"),
(agent_set_team, ":agent_no", 7),
(try_end),
(try_for_range, ":cur_entry_point", 0, 64),
(entry_point_get_position, pos2, ":cur_entry_point"),
(get_sq_distance_between_positions, ":dist", pos1, pos2),
(lt, ":dist", 100), #10 cm
(agent_set_slot, ":agent_no", slot_agent_spawn_entry_point, ":cur_entry_point"),
(try_end),
(agent_get_troop_id, ":cur_agent_troop", ":agent_no"),
(try_begin),
(eq, ":cur_agent_troop", "trp_tutorial_archer_1"),
(agent_get_position, pos1, ":agent_no"),
(agent_set_scripted_destination, ":agent_no", pos1),
(scene_prop_get_num_instances, ":num_instances", "spr_archery_target_with_hit_a"),
(assign, ":shortest_dist", 10000000),
(assign, ":best_instance", -1),
(try_for_range, ":cur_instance", 0, ":num_instances"),
(scene_prop_get_instance, ":spr_instance", "spr_archery_target_with_hit_a", ":cur_instance"),
(prop_instance_get_position, pos2, ":spr_instance"),
(get_sq_distance_between_positions, ":cur_dist", pos1, pos2),
(lt, ":cur_dist", ":shortest_dist"),
(assign, ":shortest_dist", ":cur_dist"),
(assign, ":best_instance", ":spr_instance"),
(try_end),
(agent_set_slot, ":agent_no", slot_agent_target_prop_instance, ":best_instance"),
(else_try),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_rider_1"),
(eq, ":cur_agent_troop", "trp_tutorial_rider_2"),
(agent_set_slot, ":agent_no", slot_agent_target_entry_point, 48),
(agent_set_slot, ":agent_no", slot_agent_target_prop_instance, -1),
(entry_point_get_position, pos1, 48),
(agent_set_scripted_destination, ":agent_no", pos1),
(try_end),
]),
(ti_on_agent_knocked_down, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(store_trigger_param_2, ":enemy_agent_no"),
(agent_get_troop_id, ":agent_troop", ":agent_no"),
(agent_get_troop_id, ":enemy_agent_troop", ":enemy_agent_no"),
(try_begin),
(ge, "$g_tutorial_training_ground_melee_trainer_attack", 0),
#do nothing
(else_try),
(ge, "$g_tutorial_training_ground_melee_trainer_parry", 0),
(try_begin),
(eq, ":agent_troop", "trp_player"),
(eq, ":enemy_agent_troop", "$g_tutorial_training_ground_melee_trainer_parry"),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(agent_set_team, ":agent_no", 0),
(agent_set_team, ":enemy_agent_no", 7),
(tutorial_message, -1),
(assign, "$g_tutorial_mouse_dir", -1),
(assign, "$g_tutorial_mouse_click", -1),
(assign, "$g_tutorial_training_ground_conversation_state", 2), #player knocked down in parry
(play_sound, "snd_tutorial_fail"),
(start_mission_conversation, "$g_tutorial_training_ground_melee_trainer_parry"),
(assign, "$g_tutorial_training_ground_melee_trainer_parry", -1),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 1), #still in attack ready action
(agent_set_attack_action, ":agent_no", 0, 0), #release
(try_end),
(else_try),
(eq, ":enemy_agent_troop", "trp_player"),
(eq, ":agent_troop", "$g_tutorial_training_ground_melee_trainer_parry"),
(agent_set_team, ":agent_no", 7),
(agent_set_team, ":enemy_agent_no", 0),
(tutorial_message, -1),
(assign, "$g_tutorial_mouse_dir", -1),
(assign, "$g_tutorial_mouse_click", -1),
(assign, "$g_tutorial_training_ground_conversation_state", 3), #trainer knocked down in parry
(play_sound, "snd_tutorial_fail"),
(start_mission_conversation, "$g_tutorial_training_ground_melee_trainer_parry"),
(assign, "$g_tutorial_training_ground_melee_trainer_parry", -1),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 1), #still in attack ready action
(agent_set_attack_action, ":agent_no", 0, 0), #release
(try_end),
(try_end),
(else_try),
(ge, "$g_tutorial_training_ground_melee_trainer_chamber", 0),
(try_begin),
(eq, ":agent_troop", "trp_player"),
(eq, ":enemy_agent_troop", "$g_tutorial_training_ground_melee_trainer_chamber"),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(agent_set_team, ":agent_no", 0),
(agent_set_team, ":enemy_agent_no", 7),
(tutorial_message, -1),
(assign, "$g_tutorial_mouse_dir", -1),
(assign, "$g_tutorial_mouse_click", -1),
(assign, "$g_tutorial_training_ground_conversation_state", 7), #player knocked down in chamber
(play_sound, "snd_tutorial_fail"),
(start_mission_conversation, "$g_tutorial_training_ground_melee_trainer_chamber"),
(assign, "$g_tutorial_training_ground_melee_trainer_chamber", -1),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 1), #still in attack ready action
(agent_set_attack_action, ":agent_no", 0, 0), #release
(try_end),
(else_try),
(eq, ":enemy_agent_troop", "trp_player"),
(eq, ":agent_troop", "$g_tutorial_training_ground_melee_trainer_chamber"),
(agent_set_team, ":agent_no", 7),
(agent_set_team, ":enemy_agent_no", 0),
(tutorial_message, -1),
(assign, "$g_tutorial_mouse_dir", -1),
(assign, "$g_tutorial_mouse_click", -1),
(assign, "$g_tutorial_training_ground_conversation_state", 8), #trainer knocked down in chamber
(play_sound, "snd_tutorial_fail"),
(start_mission_conversation, "$g_tutorial_training_ground_melee_trainer_chamber"),
(assign, "$g_tutorial_training_ground_melee_trainer_chamber", -1),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 1), #still in attack ready action
(agent_set_attack_action, ":agent_no", 0, 0), #release
(try_end),
(try_end),
(else_try),
(ge, "$g_tutorial_training_ground_melee_trainer_combat", 0),
(try_begin),
(eq, ":agent_troop", "trp_player"),
(eq, ":enemy_agent_troop", "$g_tutorial_training_ground_melee_trainer_combat"),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(agent_set_team, ":agent_no", 0),
(agent_set_team, ":enemy_agent_no", 7),
(tutorial_message, -1),
(assign, "$g_tutorial_training_ground_conversation_state", 4), #player knocked down in combat
(play_sound, "snd_tutorial_fail"),
(start_mission_conversation, "$g_tutorial_training_ground_melee_trainer_combat"),
(assign, "$g_tutorial_training_ground_melee_trainer_combat", -1),
(else_try),
(eq, ":enemy_agent_troop", "trp_player"),
(eq, ":agent_troop", "$g_tutorial_training_ground_melee_trainer_combat"),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(agent_set_team, ":agent_no", 7),
(agent_set_team, ":enemy_agent_no", 0),
## (assign, "$g_tutorial_training_ground_melee_trainer_combat_completed", 1), #not used
(tutorial_message, -1),
(assign, "$g_tutorial_training_ground_conversation_state", 5), #trainer knocked down in combat
(play_sound, "snd_tutorial_2"),
(start_mission_conversation, "$g_tutorial_training_ground_melee_trainer_combat"),
(assign, "$g_tutorial_training_ground_melee_trainer_combat", -1),
(try_end),
(else_try),
(agent_is_human, ":agent_no"),
(assign, "$g_tutorial_training_ground_melee_last_winner", ":enemy_agent_no"),
(assign, "$g_tutorial_training_ground_melee_last_loser", ":agent_no"),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(agent_set_team, "$g_tutorial_training_ground_melee_cur_fighter_1", 7),
(agent_set_team, "$g_tutorial_training_ground_melee_cur_fighter_2", 7),
(agent_force_rethink, "$g_tutorial_training_ground_melee_cur_fighter_1"),
(agent_force_rethink, "$g_tutorial_training_ground_melee_cur_fighter_2"),
(try_end),
(agent_set_hit_points, ":agent_no", 100, 0),
(agent_set_hit_points, ":enemy_agent_no", 100, 0),
]),
(ti_before_mission_start, 0, 0, [],
[
(scene_set_day_time, 13),
(team_set_relation, 0, 1, 0),
(team_set_relation, 0, 2, 0),
(team_set_relation, 0, 3, 0),
(team_set_relation, 0, 7, 0),
(team_set_relation, 7, 1, 1),
(team_set_relation, 7, 2, 1),
(team_set_relation, 7, 3, 1),
(team_set_relation, 1, 2, -1),
(team_set_relation, 1, 3, 1),
(team_set_relation, 2, 3, 1),
(assign, "$g_position_to_use_for_replacing_scene_items", pos8),
(call_script, "script_replace_scene_items_with_spawn_items_before_ms"),
(assign, "$g_tutorial_training_ground_state", 0),
(assign, "$g_tutorial_training_ground_conversation_state", 0),
(assign, "$g_tutorial_training_ground_melee_paused", 0),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(assign, "$g_tutorial_training_ground_melee_next_action_time", 0),
(assign, "$g_tutorial_training_ground_melee_last_winner", -1),
(assign, "$g_tutorial_training_ground_melee_last_loser", -1),
(assign, "$g_tutorial_training_ground_melee_cur_fighter_1", -1),
(assign, "$g_tutorial_training_ground_melee_cur_fighter_2", -1),
(assign, "$g_tutorial_training_ground_melee_trainer_attack", -1),
(assign, "$g_tutorial_training_ground_melee_trainer_parry", -1),
(assign, "$g_tutorial_training_ground_melee_trainer_combat", -1),
(assign, "$g_tutorial_training_ground_melee_trainer_chamber", -1),
## (assign, "$g_tutorial_training_ground_melee_trainer_attack_completed", 0), #not used
## (assign, "$g_tutorial_training_ground_melee_trainer_parry_completed", 0), #not used
## (assign, "$g_tutorial_training_ground_melee_trainer_combat_completed", 0), #not used
## (assign, "$g_tutorial_training_ground_melee_trainer_chamber_completed", 0), #not used
(assign, "$g_tutorial_training_ground_melee_trainer_next_action_time", 0),
(assign, "$g_tutorial_training_ground_archer_trainer_state", 0),
(assign, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
(assign, "$g_tutorial_training_ground_horseman_trainer_state", 0),
(assign, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 0),
(assign, "$g_tutorial_training_ground_next_score_time", 0),
(assign, "$g_tutorial_mouse_dir", -1),
(assign, "$g_tutorial_mouse_click", -1),
(assign, "$g_pointer_arrow_height_adder", -1000),
]),
(0, 0, ti_once, [],
[
(tutorial_message_set_size, 17, 17),
(tutorial_message_set_position, 500, 650),
(tutorial_message_set_center_justify, 0),
(mission_enable_talk),
(call_script, "script_replace_scene_items_with_spawn_items_after_ms"),
(entry_point_get_position, pos1, 59),
(set_spawn_position, pos1),
(spawn_horse, "itm_practice_horse", 0),
(assign, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
(scene_spawned_item_get_instance, ":item_instance", "itm_practice_bow", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, -1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(scene_spawned_item_get_instance, ":item_instance", "itm_practice_bow_2", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, -1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(scene_spawned_item_get_instance, ":item_instance", "itm_practice_arrows", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, -1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(scene_spawned_item_get_instance, ":item_instance", "itm_practice_arrows_2", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, -1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(scene_spawned_item_get_instance, ":item_instance", "itm_practice_crossbow", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, -1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(scene_spawned_item_get_instance, ":item_instance", "itm_practice_bolts", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, -1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(scene_spawned_item_get_instance, ":item_instance", "itm_practice_javelin", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, -1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(scene_spawned_item_get_instance, ":item_instance", "itm_arena_lance", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, -1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
]),
(0, 1, ti_once, [],
[
(tutorial_message_set_background, 1),
(tutorial_message, "str_tutorial_training_ground_intro_message"),
]),
(0, 0, 0,
[
(store_mission_timer_a, ":cur_time"),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "trp_tutorial_archer_1"),
(try_begin),
(agent_get_wielded_item, ":cur_wielded_item", ":cur_agent", 0),
(neq, ":cur_wielded_item", "itm_practice_bow"),
(agent_set_wielded_item, ":cur_agent", "itm_practice_bow"),
(else_try),
(agent_get_slot, ":look_spr", ":cur_agent", slot_agent_target_prop_instance),
(prop_instance_get_position, pos1, ":look_spr"),
(position_move_z, pos1, 10),
(agent_set_look_target_position, ":cur_agent", pos1),
(try_begin),
(neg|agent_slot_ge, ":cur_agent", slot_agent_next_action_time, ":cur_time"),
(agent_set_attack_action, ":cur_agent", 0),
(store_random_in_range, ":next_action_time", 3, 13),
(val_add, ":next_action_time", ":cur_time"),
(agent_set_slot, ":cur_agent", slot_agent_next_action_time, ":next_action_time"),
(try_end),
(try_end),
(try_end),
], []),
(0, 0, 0,
[
(set_fixed_point_multiplier, 100),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_rider_1"),
(eq, ":cur_agent_troop", "trp_tutorial_rider_2"),
(agent_get_slot, ":target_entry_point", ":cur_agent", slot_agent_target_entry_point),
(entry_point_get_position, pos1, ":target_entry_point"),
(agent_get_position, pos2, ":cur_agent"),
(get_sq_distance_between_positions, ":cur_dist", pos1, pos2),
(try_begin),
(lt, ":cur_dist", 6400),
(val_add, ":target_entry_point", 1),
(try_begin),
(gt, ":target_entry_point", 57), #last entry point
(assign, ":target_entry_point", 48), #first entry point
(try_end),
(agent_set_slot, ":cur_agent", slot_agent_target_entry_point, ":target_entry_point"),
(entry_point_get_position, pos1, ":target_entry_point"),
(agent_set_scripted_destination, ":cur_agent", pos1),
(try_end),
(try_begin),
(eq, ":cur_agent_troop", "trp_tutorial_rider_2"),
(try_begin),
(agent_get_wielded_item, ":cur_wielded_item", ":cur_agent", 0),
(neq, ":cur_wielded_item", "itm_practice_bow"),
(agent_set_wielded_item, ":cur_agent", "itm_practice_bow"),
(else_try),
(scene_prop_get_num_instances, ":num_instances", "spr_archery_target_with_hit_a"),
(assign, ":shortest_dist", 10000000),
(assign, ":best_instance", -1),
(try_for_range, ":cur_instance", 0, ":num_instances"),
(scene_prop_get_instance, ":spr_instance", "spr_archery_target_with_hit_a", ":cur_instance"),
(neg|agent_slot_eq, ":cur_agent", slot_agent_target_prop_instance, ":spr_instance"),
(prop_instance_get_position, pos1, ":spr_instance"),
(position_is_behind_position, pos2, pos1), #target is facing towards us
(get_sq_distance_between_positions, ":cur_dist", pos1, pos2),
(lt, ":cur_dist", ":shortest_dist"),
(assign, ":shortest_dist", ":cur_dist"),
(assign, ":best_instance", ":spr_instance"),
(try_end),
(try_begin),
(lt, ":shortest_dist", 40000), #20 meters
(prop_instance_get_position, pos1, ":best_instance"),
(position_move_z, pos1, 10),
(init_position, pos3),
(position_set_x, pos3, -160), #1.6 meters
(position_transform_position_to_parent, pos4, pos1, pos3),
(copy_position, pos1, pos4),
(agent_set_look_target_position, ":cur_agent", pos1),
(lt, ":shortest_dist", 22500), #15 meters
(agent_set_slot, ":cur_agent", slot_agent_target_prop_instance, ":best_instance"),
(agent_set_attack_action, ":cur_agent", 0),
(else_try),
(agent_get_slot, ":last_instance", ":cur_agent", slot_agent_target_prop_instance),
(ge, ":last_instance", 0),
(prop_instance_get_position, pos1, ":last_instance"),
(get_sq_distance_between_positions, ":cur_dist", pos1, pos2),
(lt, ":cur_dist", 40000), #20 meters
(position_move_z, pos1, 10),
(init_position, pos3),
(position_set_x, pos3, -160), #1.6 meters
(position_transform_position_to_parent, pos4, pos1, pos3),
(copy_position, pos1, pos4),
(agent_set_look_target_position, ":cur_agent", pos1),
(try_end),
(try_end),
(else_try),
(eq, ":cur_agent_troop", "trp_tutorial_rider_1"),
(try_begin),
(agent_get_wielded_item, ":cur_wielded_item", ":cur_agent", 0),
(neq, ":cur_wielded_item", "itm_practice_sword"),
(agent_set_wielded_item, ":cur_agent", "itm_practice_sword"),
(else_try),
(scene_prop_get_num_instances, ":num_instances", "spr_dummy_a_undestructable"),
(assign, ":shortest_dist", 10000000),
(assign, ":best_instance", -1),
(try_for_range, ":cur_instance", 0, ":num_instances"),
(scene_prop_get_instance, ":spr_instance", "spr_dummy_a_undestructable", ":cur_instance"),
(neg|agent_slot_eq, ":cur_agent", slot_agent_target_prop_instance, ":spr_instance"),
(prop_instance_get_position, pos1, ":spr_instance"),
(get_sq_distance_between_positions, ":cur_dist", pos1, pos2),
(lt, ":cur_dist", ":shortest_dist"),
(assign, ":shortest_dist", ":cur_dist"),
(assign, ":best_instance", ":spr_instance"),
(try_end),
(try_begin),
(lt, ":shortest_dist", 10000), #10 meters
(prop_instance_get_position, pos1, ":best_instance"),
(position_transform_position_to_local, pos3, pos2, pos1),
(position_get_x, ":local_x", pos3),
(position_get_y, ":local_y", pos3),
(is_between, ":local_x", -200, 200),
(gt, ":local_y", -100),
(init_position, pos3),
(try_begin),
(lt, ":local_x", 0),
(position_move_x, pos3, -100),
(position_move_z, pos3, 100),
(else_try),
(position_move_x, pos3, 100),
(position_move_z, pos3, 150),
(try_end),
(position_transform_position_to_parent, pos4, pos2, pos3),
(agent_set_look_target_position, ":cur_agent", pos4),
(try_begin),
(lt, ":local_x", 0),
(agent_set_attack_action, ":cur_agent", 2, 1), #left
(else_try),
(agent_set_attack_action, ":cur_agent", 1, 1), #right
(try_end),
(this_or_next|lt, ":shortest_dist", 900), #3 meters
(lt, ":local_y", 100), #1 meter
(agent_set_attack_action, ":cur_agent", 0, 0), #release
(agent_set_slot, ":cur_agent", slot_agent_target_prop_instance, ":best_instance"),
(else_try),
(agent_get_slot, ":last_instance", ":cur_agent", slot_agent_target_prop_instance),
(ge, ":last_instance", 0),
(prop_instance_get_position, pos1, ":last_instance"),
(get_sq_distance_between_positions, ":cur_dist", pos1, pos2),
(lt, ":cur_dist", 10000), #10 meters
(position_transform_position_to_local, pos3, pos2, pos1),
(position_get_x, ":local_x", pos3),
(position_get_y, ":local_y", pos3),
(is_between, ":local_x", -200, 200),
(gt, ":local_y", -100),
(init_position, pos3),
(try_begin),
(lt, ":local_x", 0),
(position_move_x, pos3, -100),
(position_move_z, pos3, 100),
(else_try),
(position_move_x, pos3, 100),
(position_move_z, pos3, 150),
(try_end),
(position_transform_position_to_parent, pos4, pos2, pos3),
(agent_set_look_target_position, ":cur_agent", pos4),
(try_end),
(try_end),
(try_end),
(try_end),
], []),
(0, 0, 0,
[
(store_mission_timer_a, ":cur_time"),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "trp_tutorial_archer_1"),
(try_begin),
(agent_get_wielded_item, ":cur_wielded_item", ":cur_agent", 0),
(neq, ":cur_wielded_item", "itm_practice_bow"),
(agent_set_wielded_item, ":cur_agent", "itm_practice_bow"),
(else_try),
(agent_get_slot, ":look_spr", ":cur_agent", slot_agent_target_prop_instance),
(prop_instance_get_position, pos1, ":look_spr"),
(agent_set_look_target_position, ":cur_agent", pos1),
(try_begin),
(neg|agent_slot_ge, ":cur_agent", slot_agent_next_action_time, ":cur_time"),
(agent_set_attack_action, ":cur_agent", 0),
(store_random_in_range, ":next_action_time", 3, 13),
(val_add, ":next_action_time", ":cur_time"),
(agent_set_slot, ":cur_agent", slot_agent_next_action_time, ":next_action_time"),
(try_end),
(try_end),
(try_end),
], []),
(0, 0, 0,
[
(call_script, "script_iterate_pointer_arrow"),
], []),
(5, 0, 0,
[
(try_begin),
(store_mission_timer_a, ":cur_time"),
(ge, ":cur_time", 30),
(eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
(assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
(tutorial_message, -1),
(try_end),
(get_player_agent_no, ":player_agent"),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(neq, ":cur_agent", ":player_agent"),
(agent_refill_ammo, ":cur_agent"),
(try_end),
], []),
(0, 0, 0,
[
(get_player_agent_no, ":player_agent"),
(agent_get_wielded_item, ":wielded_weapon", ":player_agent", 0),
(assign, ":refill", 0),
(try_begin),
(eq, ":wielded_weapon", "itm_practice_bow"),
(agent_has_item_equipped, ":player_agent", "itm_practice_arrows"),
(agent_get_ammo, ":cur_ammo", ":player_agent", 1),
(eq, ":cur_ammo", 0),
(assign, ":refill", 1),
(else_try),
(eq, ":wielded_weapon", "itm_practice_bow_2"),
(agent_has_item_equipped, ":player_agent", "itm_practice_arrows_2"),
(agent_get_ammo, ":cur_ammo", ":player_agent", 1),
(eq, ":cur_ammo", 0),
(assign, ":refill", 1),
(else_try),
(eq, ":wielded_weapon", "itm_practice_crossbow"),
(agent_has_item_equipped, ":player_agent", "itm_practice_bolts"),
(agent_get_ammo, ":cur_ammo", ":player_agent", 1),
(eq, ":cur_ammo", 0),
(assign, ":refill", 1),
(else_try),
(eq, ":wielded_weapon", "itm_practice_javelin"),
(agent_get_ammo, ":cur_ammo", ":player_agent", 1),
(le, ":cur_ammo", 1),
(assign, ":refill", 1),
(try_end),
(eq, ":refill", 1),
(agent_refill_ammo, ":player_agent"),
(tutorial_box, "str_tutorial_training_ground_ammo_refill", "@Tutorial"),
], []),
(0, 0, 0,
[
(get_player_agent_no, ":player_agent"),
(neq, "$g_tutorial_training_ground_horseman_trainer_state", 0),
(mission_disable_talk),
(try_begin),
(eq, "$g_tutorial_training_ground_horseman_trainer_state", 1),
(assign, "$g_tutorial_training_ground_current_score", 0),
(val_add, "$g_tutorial_training_ground_horseman_trainer_state", 1),
(else_try),
(eq, "$g_tutorial_training_ground_horseman_trainer_state", 2),
(try_begin),
(try_begin),
(ge, "$g_tutorial_training_ground_horseman_trainer_item_1", 0),
(scene_spawned_item_get_instance, ":item_instance", "$g_tutorial_training_ground_horseman_trainer_item_1", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, 1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(scene_prop_get_instance, ":pointer_instance", "spr_pointer_arrow", 0),
(prop_instance_set_position, ":pointer_instance", pos0),
(assign, "$g_pointer_arrow_height_adder", 200),
(try_begin),
(ge, "$g_tutorial_training_ground_horseman_trainer_item_2", 0),
(scene_spawned_item_get_instance, ":item_instance", "$g_tutorial_training_ground_horseman_trainer_item_2", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, 1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(try_end),
(try_end),
(val_add, "$g_tutorial_training_ground_horseman_trainer_state", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_horseman_trainer_state", 3),
(try_begin),
(ge, "$g_tutorial_training_ground_horseman_trainer_item_1", 0),
(try_begin),
(str_store_item_name, s0, "$g_tutorial_training_ground_horseman_trainer_item_1"),
(tutorial_message, "str_tutorial_training_ground_horseman_text_1"),
(agent_has_item_equipped, ":player_agent", "$g_tutorial_training_ground_horseman_trainer_item_1"),
(val_add, "$g_tutorial_training_ground_horseman_trainer_state", 1),
(play_sound, "snd_tutorial_1"),
(try_end),
(else_try),
(val_add, "$g_tutorial_training_ground_horseman_trainer_state", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_horseman_trainer_state", 4),
(try_begin),
(ge, "$g_tutorial_training_ground_horseman_trainer_item_2", 0),
(try_begin),
(str_store_item_name, s0, "$g_tutorial_training_ground_horseman_trainer_item_2"),
(tutorial_message, "str_tutorial_training_ground_horseman_text_1"),
(agent_has_item_equipped, ":player_agent", "$g_tutorial_training_ground_horseman_trainer_item_2"),
(val_add, "$g_tutorial_training_ground_horseman_trainer_state", 1),
(play_sound, "snd_tutorial_1"),
(try_end),
(else_try),
(val_add, "$g_tutorial_training_ground_horseman_trainer_state", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_horseman_trainer_state", 5),
(try_begin),
(agent_get_horse, ":player_horse", ":player_agent"),
(lt, ":player_horse", 0),
(tutorial_message, "str_tutorial_training_ground_horseman_text_2"),
(try_begin),
(assign, ":horse_agent_to_mount", -1),
(try_for_agents, ":cur_agent"),
(agent_get_item_id, ":cur_agent_item", ":cur_agent"),
(eq, ":cur_agent_item", "itm_practice_horse"),
(assign, ":horse_agent_to_mount", ":cur_agent"),
(try_end),
(agent_get_position, pos0, ":horse_agent_to_mount"),
(scene_prop_get_instance, ":pointer_instance", "spr_pointer_arrow", 0),
(prop_instance_get_position, pos1, ":pointer_instance"),
(set_fixed_point_multiplier, 100),
(position_get_x, ":x1", pos0),
(position_get_x, ":x2", pos1),
(position_get_y, ":y1", pos0),
(position_get_y, ":y2", pos1),
(this_or_next|neq, ":x1", ":x2"),
(neq, ":y1", ":y2"),
(prop_instance_set_position, ":pointer_instance", pos0),
(assign, "$g_pointer_arrow_height_adder", 200),
(try_end),
(else_try),
(val_add, "$g_tutorial_training_ground_horseman_trainer_state", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_horseman_trainer_state", 6),
(try_begin),
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 0),
(tutorial_message, "str_tutorial_training_ground_horseman_text_3"),
(else_try),
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 1),
(assign, ":prop_to_search_for", "spr_dummy_a_undestructable"),
(tutorial_message, "str_tutorial_training_ground_horseman_text_4"),
(else_try),
(assign, ":prop_to_search_for", "spr_archery_target_with_hit_a"),
(tutorial_message, "str_tutorial_training_ground_horseman_text_5"),
(try_end),
(try_begin),
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 0),
(store_add, ":cur_entry_point", "$g_tutorial_training_ground_current_score", 48),
(entry_point_get_position, pos0, ":cur_entry_point"),
(init_position, pos2),
(position_move_y, pos2, -800),
(position_transform_position_to_parent, pos3, pos0, pos2),
(copy_position, pos0, pos3),
(agent_get_position, pos2, ":player_agent"),
(try_begin),
(get_distance_between_positions, ":cur_dist", pos0, pos2),
(lt, ":cur_dist", 500), #5 meters
(val_add, "$g_tutorial_training_ground_current_score", 1),
(ge, "$g_tutorial_training_ground_current_score", 10),
(assign, "$g_pointer_arrow_height_adder", -1000),
(tutorial_message, "str_tutorial_training_ground_horseman_text_6", 0, 10),
(assign, "$g_tutorial_training_ground_horseman_trainer_state", 0),
(val_add, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 1),
(play_sound, "snd_tutorial_2"),
(try_end),
(try_begin),
(scene_prop_get_instance, ":pointer_instance", "spr_pointer_arrow", 0),
(prop_instance_get_position, pos1, ":pointer_instance"),
(set_fixed_point_multiplier, 1),
(position_get_x, ":x1", pos0),
(position_get_x, ":x2", pos1),
(position_get_y, ":y1", pos0),
(position_get_y, ":y2", pos1),
(this_or_next|neq, ":x1", ":x2"),
(neq, ":y1", ":y2"),
(prop_instance_set_position, ":pointer_instance", pos0),
(assign, "$g_pointer_arrow_height_adder", 150),
(play_sound, "snd_tutorial_1"),
(try_end),
(else_try),
(scene_prop_get_num_instances, ":end_cond", ":prop_to_search_for"),
(try_begin),
(lt, "$g_tutorial_training_ground_current_score", 6),
(assign, ":next_prop_instance", -1),
(store_add, ":var_id_to_search_for", "$g_tutorial_training_ground_current_score", 1),
(try_for_range, ":cur_instance", 0, ":end_cond"),
(scene_prop_get_instance, ":prop_instance", ":prop_to_search_for", ":cur_instance"),
(prop_instance_get_variation_id_2, ":var_id_2", ":prop_instance"),
(eq, ":var_id_to_search_for", ":var_id_2"),
(assign, ":next_prop_instance", ":prop_instance"),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(prop_instance_get_position, pos0, ":next_prop_instance"),
(scene_prop_get_instance, ":pointer_instance", "spr_pointer_arrow", 0),
(prop_instance_get_position, pos1, ":pointer_instance"),
(set_fixed_point_multiplier, 1),
(position_get_x, ":x1", pos0),
(position_get_x, ":x2", pos1),
(position_get_y, ":y1", pos0),
(position_get_y, ":y2", pos1),
(this_or_next|neq, ":x1", ":x2"),
(neq, ":y1", ":y2"),
(prop_instance_set_position, ":pointer_instance", pos0),
(assign, "$g_pointer_arrow_height_adder", 200),
(play_sound, "snd_tutorial_1"),
(try_end),
(else_try),
(assign, "$g_pointer_arrow_height_adder", -1000),
(try_begin),
(ge, "$g_tutorial_training_ground_horseman_trainer_item_2", 0),
(agent_unequip_item, ":player_agent", "$g_tutorial_training_ground_horseman_trainer_item_2"),
(try_end),
(agent_unequip_item, ":player_agent", "$g_tutorial_training_ground_horseman_trainer_item_1"),
(tutorial_message, "str_tutorial_training_ground_horseman_text_6", 0, 10),
(assign, "$g_tutorial_training_ground_horseman_trainer_state", 0),
(val_add, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 1),
(play_sound, "snd_tutorial_2"),
(try_end),
(try_end),
(try_end),
], []),
(0, 0, 0,
[
(get_player_agent_no, ":player_agent"),
(neq, "$g_tutorial_training_ground_archer_trainer_state", 0),
(mission_disable_talk),
(try_begin),
(eq, "$g_tutorial_training_ground_archer_trainer_state", 1),
(try_begin),
(assign, "$g_last_destroyed_gourds", 0),
(assign, "$g_tutorial_training_ground_current_score", 0),
(scene_spawned_item_get_instance, ":item_instance", "$g_tutorial_training_ground_archer_trainer_item_1", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, 1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(scene_prop_get_instance, ":pointer_instance", "spr_pointer_arrow", 0),
(prop_instance_set_position, ":pointer_instance", pos0),
(assign, "$g_pointer_arrow_height_adder", 100),
(try_begin),
(ge, "$g_tutorial_training_ground_archer_trainer_item_2", 0),
(scene_spawned_item_get_instance, ":item_instance", "$g_tutorial_training_ground_archer_trainer_item_2", 0),
(prop_instance_get_position, pos0, ":item_instance"),
(position_move_z, pos0, 1000, 1),
(prop_instance_set_position, ":item_instance", pos0),
(try_end),
(val_add, "$g_tutorial_training_ground_archer_trainer_state", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_archer_trainer_state", 2),
(try_begin),
(str_store_item_name, s0, "$g_tutorial_training_ground_archer_trainer_item_1"),
(tutorial_message, "str_tutorial_training_ground_archer_text_1"),
(agent_has_item_equipped, ":player_agent", "$g_tutorial_training_ground_archer_trainer_item_1"),
(val_add, "$g_tutorial_training_ground_archer_trainer_state", 1),
(play_sound, "snd_tutorial_1"),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_archer_trainer_state", 3),
(try_begin),
(ge, "$g_tutorial_training_ground_archer_trainer_item_2", 0),
(try_begin),
(str_store_item_name, s0, "$g_tutorial_training_ground_archer_trainer_item_2"),
(tutorial_message, "str_tutorial_training_ground_archer_text_1"),
(agent_has_item_equipped, ":player_agent", "$g_tutorial_training_ground_archer_trainer_item_2"),
(val_add, "$g_tutorial_training_ground_archer_trainer_state", 1),
(play_sound, "snd_tutorial_1"),
(try_end),
(else_try),
(val_add, "$g_tutorial_training_ground_archer_trainer_state", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_archer_trainer_state", 4),
(try_begin),
(try_for_range, ":cur_instance", 0, 3),
(scene_prop_get_instance, ":gourd_instance", "spr_gourd", ":cur_instance"),
(prop_instance_refill_hit_points, ":gourd_instance"),
(entry_point_get_position, pos0, 45),
(init_position, pos1),
(store_sub, ":cur_rotation", ":cur_instance", 1),
(val_mul, ":cur_rotation", 5),
(position_rotate_z, pos1, ":cur_rotation"),
(try_begin),
(ge, "$g_tutorial_training_ground_archer_trainer_item_2", 0),
(position_move_y, pos1, 1300), #for bow and crossbow
(else_try),
(position_move_y, pos1, 800), #for javelin
(val_mul, ":cur_rotation", 2),
(try_end),
(position_transform_position_to_parent, pos2, pos0, pos1),
(position_set_z_to_ground_level, pos2),
(scene_prop_get_instance, ":spike_instance", "spr_gourd_spike", ":cur_instance"),
(prop_instance_set_position, ":spike_instance", pos2),
(position_move_z, pos2, 150, 1),
(prop_instance_set_position, ":gourd_instance", pos2),
(try_end),
(scene_prop_get_instance, ":pointer_instance", "spr_pointer_arrow", 0),
(scene_prop_get_instance, ":spike_instance", "spr_gourd_spike", 1),
(prop_instance_get_position, pos1, ":spike_instance"),
(prop_instance_set_position, ":pointer_instance", pos1),
(assign, "$g_pointer_arrow_height_adder", 200),
(tutorial_message, "str_tutorial_training_ground_archer_text_2"),
(val_add, "$g_tutorial_training_ground_archer_trainer_state", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_archer_trainer_state", 5),
(try_begin),
(try_begin),
(neq, "$g_tutorial_training_ground_current_score", "$g_last_destroyed_gourds"),
(assign, "$g_tutorial_training_ground_current_score", "$g_last_destroyed_gourds"),
(try_begin),
(lt, "$g_last_destroyed_gourds", 3),
(play_sound, "snd_tutorial_1"),
(else_try),
(play_sound, "snd_tutorial_2"),
(try_end),
(try_end),
(try_begin),
(eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
(eq, "$g_last_destroyed_gourds", 0),
(entry_point_get_position, pos0, 45),
(agent_get_position, pos1, ":player_agent"),
(neg|position_is_behind_position, pos1, pos0),
(tutorial_message, "str_tutorial_training_ground_archer_text_3"),
(else_try),
(eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
(eq, "$g_last_destroyed_gourds", 1),
(tutorial_message, "str_tutorial_training_ground_archer_text_4"),
(try_end),
(ge, "$g_last_destroyed_gourds", 3),
(assign, "$g_pointer_arrow_height_adder", -1000),
(val_add, "$g_tutorial_training_ground_archer_trainer_state", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_archer_trainer_state", 6),
(try_begin),
(try_begin),
(ge, "$g_tutorial_training_ground_archer_trainer_item_2", 0),
(agent_unequip_item, ":player_agent", "$g_tutorial_training_ground_archer_trainer_item_2"),
(try_end),
(agent_unequip_item, ":player_agent", "$g_tutorial_training_ground_archer_trainer_item_1"),
(tutorial_message, "str_tutorial_training_ground_archer_text_5", 0, 10),
(assign, "$g_tutorial_training_ground_archer_trainer_state", 0),
(val_add, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 1),
(try_end),
(try_end),
], []),
(0, 0, 0,
[
(get_player_agent_no, ":player_agent"),
(neq, "$g_tutorial_training_ground_melee_trainer_attack", -1),
(mission_disable_talk),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "$g_tutorial_training_ground_melee_trainer_attack"),
(assign, ":trainer_agent", ":cur_agent"),
(try_end),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_state", 0),
(try_begin),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(agent_set_team, ":cur_agent", 7),
(agent_get_slot, ":spawn_point", ":cur_agent", slot_agent_spawn_entry_point),
(entry_point_get_position, pos1, ":spawn_point"),
(agent_set_scripted_destination, ":cur_agent", pos1),
(agent_force_rethink, ":cur_agent"),
(try_end),
(agent_set_wielded_item, ":trainer_agent", "itm_practice_sword"), #TODO: change this
(store_random_in_range, "$g_tutorial_training_ground_melee_state", 1, 5), #random attack dir
(assign, "$g_tutorial_update_mouse_presentation", 1),
(assign, "$g_tutorial_training_ground_next_score_time", 0),
(try_end),
(else_try),
(gt, "$g_tutorial_training_ground_melee_state", 0),
(try_begin),
(agent_set_team, ":player_agent", 1),
(agent_set_team, ":trainer_agent", 2),
(agent_get_position, pos1, ":player_agent"),
(agent_set_scripted_destination_no_attack, ":trainer_agent", pos1),
(agent_get_attack_action, ":attack_action", ":player_agent"),
(try_begin),
(eq, ":attack_action", 2), #release
(agent_get_action_dir, ":action_dir_attacker", ":player_agent"),
(try_begin),
(eq, ":action_dir_attacker", 0), #down
(agent_set_defend_action, ":trainer_agent", 0, 1),
(else_try),
(eq, ":action_dir_attacker", 3), #up
(agent_set_defend_action, ":trainer_agent", 3, 1),
(else_try),
(eq, ":action_dir_attacker", 1), #right
(agent_set_defend_action, ":trainer_agent", 2, 1),
(else_try),
(eq, ":action_dir_attacker", 2), #left
(agent_set_defend_action, ":trainer_agent", 1, 1),
(try_end),
(try_end),
(try_begin),
(ge, "$g_tutorial_training_ground_current_score", 5),
(tutorial_message, -1),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(agent_set_team, ":player_agent", 0),
(agent_set_team, ":trainer_agent", 7),
(agent_set_hit_points, ":player_agent", 100, 0),
(agent_set_hit_points, ":trainer_agent", 100, 0),
## (assign, "$g_tutorial_training_ground_melee_trainer_attack_completed", 1), #not used
(assign, "$g_tutorial_training_ground_conversation_state", 9), #attack complete
(start_mission_conversation, "$g_tutorial_training_ground_melee_trainer_attack"),
(assign, "$g_tutorial_training_ground_melee_trainer_attack", -1),
(try_end),
(try_end),
(try_end),
(try_begin),
(agent_get_attack_action, ":attack_action", ":player_agent"),
(eq, ":attack_action", 2), #release
(agent_get_action_dir, ":action_dir_attacker", ":player_agent"),
(store_add, ":attack_state", ":action_dir_attacker", 1),
(agent_get_wielded_item, ":weapon_item", ":player_agent", 0),
(call_script, "script_cf_is_melee_weapon_for_tutorial", ":weapon_item"),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_next_score_time"),
(try_begin),
(eq, ":attack_state", "$g_tutorial_training_ground_melee_state"),
(val_add, "$g_tutorial_training_ground_current_score", 1),
(try_begin),
(ge, "$g_tutorial_training_ground_current_score", 5),
(assign, "$g_tutorial_training_ground_melee_state", 5),
(play_sound, "snd_tutorial_2"),
(else_try),
(play_sound, "snd_tutorial_1"),
(assign, ":end_cond", 100),
(try_for_range, ":unused", 0, ":end_cond"),
(store_random_in_range, ":random_no", 1, 5), #random attack dir
(neq, ":random_no", "$g_tutorial_training_ground_melee_state"),
(assign, "$g_tutorial_training_ground_melee_state", ":random_no"),
(assign, ":end_cond", 0), #break
(try_end),
(try_end),
(assign, "$g_tutorial_update_mouse_presentation", 1),
(else_try),
(val_add, "$g_tutorial_training_ground_current_score_2", 1),
(play_sound, "snd_tutorial_fail"),
(try_end),
(store_add, "$g_tutorial_training_ground_next_score_time", ":cur_time", 1),
(try_end),
(assign, reg0, "$g_tutorial_training_ground_current_score"),
(assign, reg1, "$g_tutorial_training_ground_current_score_2"),
(str_clear, s0),
(assign, "$g_tutorial_mouse_dir", -1),
(assign, "$g_tutorial_mouse_click", -1),
(try_begin),
(neq, "$g_tutorial_training_ground_melee_state", 5), #finished
(store_mission_timer_a, ":cur_time"),
(this_or_next|eq, "$g_tutorial_update_mouse_presentation", 0),
(gt, ":cur_time", "$g_tutorial_training_ground_next_score_time"),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_state", 1), #down
(str_store_string, s0, "str_tutorial_training_ground_attack_training_down"),
(else_try),
(eq, "$g_tutorial_training_ground_melee_state", 4), #up
(str_store_string, s0, "str_tutorial_training_ground_attack_training_up"),
(else_try),
(eq, "$g_tutorial_training_ground_melee_state", 2), #right
(str_store_string, s0, "str_tutorial_training_ground_attack_training_right"),
(else_try),
(eq, "$g_tutorial_training_ground_melee_state", 3), #left
(str_store_string, s0, "str_tutorial_training_ground_attack_training_left"),
(try_end),
(store_sub, "$g_tutorial_mouse_dir", "$g_tutorial_training_ground_melee_state", 1),
(assign, "$g_tutorial_mouse_click", 0),
(try_begin),
(eq, "$g_tutorial_update_mouse_presentation", 1),
(assign, "$g_tutorial_update_mouse_presentation", 0),
(start_presentation, "prsnt_tutorial_show_mouse_movement"),
(try_end),
(try_end),
(try_begin),
(agent_get_wielded_item, ":weapon_item", ":player_agent", 0),
(call_script, "script_cf_is_melee_weapon_for_tutorial", ":weapon_item"),
(tutorial_message, "str_tutorial_training_ground_attack_training"),
(else_try),
(tutorial_message, "str_tutorial_training_ground_warning_melee"),
(try_end),
], []),
(0, 0, 0,
[
(get_player_agent_no, ":player_agent"),
(neq, "$g_tutorial_training_ground_melee_trainer_parry", -1),
(mission_disable_talk),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "$g_tutorial_training_ground_melee_trainer_parry"),
(assign, ":trainer_agent", ":cur_agent"),
(try_end),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_state", 0),
(try_begin),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(agent_set_team, ":cur_agent", 7),
(agent_get_slot, ":spawn_point", ":cur_agent", slot_agent_spawn_entry_point),
(entry_point_get_position, pos1, ":spawn_point"),
(agent_set_scripted_destination, ":cur_agent", pos1),
(agent_force_rethink, ":cur_agent"),
(try_end),
(agent_set_wielded_item, ":trainer_agent", "itm_practice_sword"), #TODO: change this
(val_add, "$g_tutorial_training_ground_melee_state", 1),
(store_mission_timer_a, "$g_tutorial_training_ground_melee_next_action_time"),
(val_add, "$g_tutorial_training_ground_melee_next_action_time", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_state", 1),
(try_begin),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_melee_next_action_time"),
(agent_set_team, ":player_agent", 1),
(agent_set_team, ":trainer_agent", 2),
(agent_get_position, pos1, ":player_agent"),
(agent_set_scripted_destination_no_attack, ":trainer_agent", pos1),
(agent_get_position, pos2, ":trainer_agent"),
(get_sq_distance_between_positions, ":sq_dist", pos1, pos2),
(lt, ":sq_dist", 400), #2 meters
(try_begin),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
(try_begin),
(ge, "$g_tutorial_training_ground_current_score", 5),
(assign, "$g_tutorial_mouse_dir", -1),
(assign, "$g_tutorial_mouse_click", -1),
(tutorial_message, -1),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(agent_set_team, ":player_agent", 0),
(agent_set_team, ":trainer_agent", 7),
(agent_set_hit_points, ":player_agent", 100, 0),
(agent_set_hit_points, ":trainer_agent", 100, 0),
## (assign, "$g_tutorial_training_ground_melee_trainer_parry_completed", 1), #not used
(assign, "$g_tutorial_training_ground_conversation_state", 1), #parry complete
(start_mission_conversation, "$g_tutorial_training_ground_melee_trainer_parry"),
(assign, "$g_tutorial_training_ground_melee_trainer_parry", -1),
(else_try),
(store_random_in_range, ":random_no", 0, 4),
(agent_set_attack_action, ":trainer_agent", ":random_no", 1), #ready
(val_add, "$g_tutorial_training_ground_melee_trainer_action_state", 1),
(assign, "$g_tutorial_mouse_dir", ":random_no"),
(try_begin),
(is_between, ":random_no", 1, 3), #right or left
(store_sub, "$g_tutorial_mouse_dir", 3, ":random_no"), #revert sides
(try_end),
(assign, "$g_tutorial_mouse_click", 1),
(start_presentation, "prsnt_tutorial_show_mouse_movement"),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 1),
(agent_get_defend_action, ":defend_action", ":player_agent"),
(gt, ":defend_action", 0), #parrying or blocking
(agent_get_action_dir, ":action_dir_defender", ":player_agent"),
(agent_get_action_dir, ":action_dir_attacker", ":trainer_agent"),
(assign, ":actions_match", 0),
(try_begin),
(eq, ":action_dir_attacker", 0), #down
(eq, ":action_dir_defender", 0), #down
(assign, ":actions_match", 1),
(else_try),
(eq, ":action_dir_attacker", 3), #up
(eq, ":action_dir_defender", 3), #up
(assign, ":actions_match", 1),
(else_try),
(eq, ":action_dir_attacker", 1), #right
(eq, ":action_dir_defender", 2), #left
(assign, ":actions_match", 1),
(else_try),
(eq, ":action_dir_attacker", 2), #left
(eq, ":action_dir_defender", 1), #right
(assign, ":actions_match", 1),
(try_end),
(eq, ":actions_match", 1),
(assign, "$g_tutorial_mouse_dir", -1),
(assign, "$g_tutorial_mouse_click", -1),
(agent_set_attack_action, ":trainer_agent", 0, 0), #release
(val_add, "$g_tutorial_training_ground_melee_trainer_action_state", 1),
(store_mission_timer_a, "$g_tutorial_training_ground_melee_trainer_next_action_time"),
(val_add, "$g_tutorial_training_ground_melee_trainer_next_action_time", 2),
(else_try),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 2),
(try_begin),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_melee_trainer_next_action_time"),
(assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
(try_end),
(try_end),
(try_end),
(try_end),
(try_begin),
(agent_is_in_parried_animation, ":trainer_agent"),
(agent_get_wielded_item, ":shield_item", ":player_agent", 1),
(eq, ":shield_item", -1),
(agent_get_wielded_item, ":weapon_item", ":player_agent", 0),
(neq, ":weapon_item", "itm_practice_dagger"),
(call_script, "script_cf_is_melee_weapon_for_tutorial", ":weapon_item"),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_next_score_time"),
(val_add, "$g_tutorial_training_ground_current_score", 1),
(try_begin),
(lt, "$g_tutorial_training_ground_current_score", 5),
(play_sound, "snd_tutorial_1"),
(else_try),
(play_sound, "snd_tutorial_2"),
(try_end),
(store_add, "$g_tutorial_training_ground_next_score_time", ":cur_time", 1),
(try_end),
(assign, reg0, "$g_tutorial_training_ground_current_score"),
(try_begin),
(agent_get_wielded_item, ":shield_item", ":player_agent", 1),
(eq, ":shield_item", -1),
(agent_get_wielded_item, ":weapon_item", ":player_agent", 0),
(neq, ":weapon_item", "itm_practice_dagger"),
(call_script, "script_cf_is_melee_weapon_for_tutorial", ":weapon_item"),
(tutorial_message, "str_tutorial_training_ground_parry_training"),
(else_try),
(neq, ":shield_item", -1),
(tutorial_message, "str_tutorial_training_ground_warning_shield"),
(else_try),
(tutorial_message, "str_tutorial_training_ground_warning_melee_with_parry"),
(try_end),
], []),
(0, 0, 0,
[
(get_player_agent_no, ":player_agent"),
(neq, "$g_tutorial_training_ground_melee_trainer_chamber", -1),
(mission_disable_talk),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "$g_tutorial_training_ground_melee_trainer_chamber"),
(assign, ":trainer_agent", ":cur_agent"),
(try_end),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_state", 0),
(try_begin),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(agent_set_team, ":cur_agent", 7),
(agent_get_slot, ":spawn_point", ":cur_agent", slot_agent_spawn_entry_point),
(entry_point_get_position, pos1, ":spawn_point"),
(agent_set_scripted_destination, ":cur_agent", pos1),
(agent_force_rethink, ":cur_agent"),
(try_end),
## (entry_point_get_position, pos1, 30),
## (agent_set_scripted_destination_no_attack, ":trainer_agent", pos1, 1),
## (agent_get_position, pos2, ":trainer_agent"),
## (get_sq_distance_between_positions, ":sq_dist_1", pos1, pos2),
## (lt, ":sq_dist_1", 400), #2 meters
## (entry_point_get_position, pos1, 31),
## (agent_get_position, pos2, ":player_agent"),
## (get_sq_distance_between_positions, ":sq_dist_2", pos1, pos2),
## (lt, ":sq_dist_2", 400), #2 meters
(agent_set_wielded_item, ":trainer_agent", "itm_practice_sword"), #TODO: change this
(val_add, "$g_tutorial_training_ground_melee_state", 1),
(store_mission_timer_a, "$g_tutorial_training_ground_melee_next_action_time"),
(val_add, "$g_tutorial_training_ground_melee_next_action_time", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_state", 1),
(try_begin),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_melee_next_action_time"),
(agent_set_team, ":player_agent", 1),
(agent_set_team, ":trainer_agent", 2),
(agent_get_position, pos1, ":player_agent"),
(agent_set_scripted_destination_no_attack, ":trainer_agent", pos1),
(agent_get_position, pos2, ":trainer_agent"),
(get_sq_distance_between_positions, ":sq_dist", pos1, pos2),
(lt, ":sq_dist", 400), #2 meters
(try_begin),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
(try_begin),
(ge, "$g_tutorial_training_ground_current_score", 5),
(tutorial_message, -1),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(agent_set_team, ":player_agent", 0),
(agent_set_team, ":trainer_agent", 7),
(agent_set_hit_points, ":player_agent", 100, 0),
(agent_set_hit_points, ":trainer_agent", 100, 0),
## (assign, "$g_tutorial_training_ground_melee_trainer_chamber_completed", 1), #not used
(assign, "$g_tutorial_training_ground_conversation_state", 6), #chamber complete
(start_mission_conversation, "$g_tutorial_training_ground_melee_trainer_chamber"),
(assign, "$g_tutorial_training_ground_melee_trainer_chamber", -1),
(else_try),
(store_random_in_range, "$g_tutorial_training_ground_melee_trainer_attack_dir", 0, 4),
(agent_set_attack_action, ":trainer_agent", "$g_tutorial_training_ground_melee_trainer_attack_dir", 1), #ready
(val_add, "$g_tutorial_training_ground_melee_trainer_action_state", 1),
(store_mission_timer_a, "$g_tutorial_training_ground_melee_trainer_next_action_time"),
(val_add, "$g_tutorial_training_ground_melee_trainer_next_action_time", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 1),
(try_begin),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_melee_trainer_next_action_time"),
(agent_set_attack_action, ":trainer_agent", -1, 0), #cancel
(agent_set_defend_action, ":trainer_agent", 0, 1), #cancel
(val_add, "$g_tutorial_training_ground_melee_trainer_action_state", 1),
(store_mission_timer_a, "$g_tutorial_training_ground_melee_trainer_next_action_time"),
(val_add, "$g_tutorial_training_ground_melee_trainer_next_action_time", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 2),
(try_begin),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_melee_trainer_next_action_time"),
(agent_set_attack_action, ":trainer_agent", "$g_tutorial_training_ground_melee_trainer_attack_dir", 0),
(val_add, "$g_tutorial_training_ground_melee_trainer_action_state", 1),
(store_mission_timer_a, "$g_tutorial_training_ground_melee_trainer_next_action_time"),
(val_add, "$g_tutorial_training_ground_melee_trainer_next_action_time", 2),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_trainer_action_state", 3),
(try_begin),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_melee_trainer_next_action_time"),
(assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
(try_end),
(try_end),
(try_end),
(try_end),
(try_begin),
(agent_is_in_parried_animation, ":trainer_agent"),
(agent_get_attack_action, ":attack_action", ":player_agent"),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_next_score_time"),
#add first, because player might immediately start attacking after parry
(store_add, "$g_tutorial_training_ground_next_score_time", ":cur_time", 1),
(eq, ":attack_action", 1), #readying_attack
(val_add, "$g_tutorial_training_ground_current_score", 1),
(try_begin),
(lt, "$g_tutorial_training_ground_current_score", 5),
(play_sound, "snd_tutorial_1"),
(else_try),
(play_sound, "snd_tutorial_2"),
(try_end),
(try_end),
(assign, reg0, "$g_tutorial_training_ground_current_score"),
(tutorial_message, "str_tutorial_training_ground_chamber_training"),
], []),
(0, 0, 0,
[
(get_player_agent_no, ":player_agent"),
(neq, "$g_tutorial_training_ground_melee_trainer_combat", -1),
(mission_disable_talk),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "$g_tutorial_training_ground_melee_trainer_combat"),
(assign, ":trainer_agent", ":cur_agent"),
(try_end),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_state", 0),
(try_begin),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(agent_set_team, ":cur_agent", 7),
(agent_get_slot, ":spawn_point", ":cur_agent", slot_agent_spawn_entry_point),
(entry_point_get_position, pos1, ":spawn_point"),
(agent_set_scripted_destination, ":cur_agent", pos1),
(agent_force_rethink, ":cur_agent"),
(try_end),
## (entry_point_get_position, pos1, 30),
## (agent_set_scripted_destination, ":trainer_agent", pos1, 1),
## (agent_get_position, pos2, ":trainer_agent"),
## (get_sq_distance_between_positions, ":sq_dist_1", pos1, pos2),
## (lt, ":sq_dist_1", 400), #2 meters
## (entry_point_get_position, pos1, 31),
## (agent_get_position, pos2, ":player_agent"),
## (get_sq_distance_between_positions, ":sq_dist_2", pos1, pos2),
## (lt, ":sq_dist_2", 400), #2 meters
(agent_set_wielded_item, ":trainer_agent", "itm_practice_sword"), #TODO: change this
(val_add, "$g_tutorial_training_ground_melee_state", 1),
(store_mission_timer_a, "$g_tutorial_training_ground_melee_next_action_time"),
(val_add, "$g_tutorial_training_ground_melee_next_action_time", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_state", 1),
(try_begin),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_melee_next_action_time"),
(agent_set_team, ":player_agent", 1),
(agent_set_team, ":trainer_agent", 2),
(agent_clear_scripted_mode, ":trainer_agent"),
(agent_force_rethink, ":trainer_agent"),
(try_end),
(try_end),
], []),
(0, 0, 0,
[
(eq, "$g_tutorial_training_ground_melee_trainer_attack", -1),
(eq, "$g_tutorial_training_ground_melee_trainer_parry", -1),
(eq, "$g_tutorial_training_ground_melee_trainer_combat", -1),
(eq, "$g_tutorial_training_ground_melee_trainer_chamber", -1),
(eq, "$g_tutorial_training_ground_archer_trainer_state", 0),
(eq, "$g_tutorial_training_ground_horseman_trainer_state", 0),
(mission_enable_talk),
], []),
(0, 0, 0,
[
(eq, "$g_tutorial_training_ground_melee_trainer_attack", -1),
(eq, "$g_tutorial_training_ground_melee_trainer_parry", -1),
(eq, "$g_tutorial_training_ground_melee_trainer_combat", -1),
(eq, "$g_tutorial_training_ground_melee_trainer_chamber", -1),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(assign, ":shortest_dist", 10000000),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(agent_get_position, pos2, ":cur_agent"),
(get_sq_distance_between_positions, ":cur_dist", pos1, pos2),
(lt, ":cur_dist", ":shortest_dist"),
(assign, ":shortest_dist", ":cur_dist"),
(try_end),
(try_begin),
(le, ":shortest_dist", 1600), #4 meters
(assign, "$g_tutorial_training_ground_melee_paused", 1),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(agent_set_team, ":cur_agent", 7),
(agent_get_position, pos2, ":cur_agent"),
(agent_set_scripted_destination, ":cur_agent", pos2),
(try_begin),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_1"),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_2"),
(agent_set_wielded_item, ":cur_agent", -1),
(try_end),
(agent_force_rethink, ":cur_agent"),
(agent_set_look_target_agent, ":cur_agent", ":player_agent"),
(try_end),
(else_try),
(gt, "$g_tutorial_training_ground_melee_paused", 0),
(assign, "$g_tutorial_training_ground_melee_paused", 0),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(try_end),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_paused", 0),
(eq, "$g_tutorial_training_ground_melee_state", 0),
(try_begin),
(assign, "$g_tutorial_training_ground_melee_cur_fighter_1", -1),
(assign, "$g_tutorial_training_ground_melee_cur_fighter_2", -1),
(try_for_range, ":unused", 0, 2),
(try_begin),
(ge, "$g_tutorial_training_ground_melee_last_winner", 0),
(assign, "$g_tutorial_training_ground_melee_cur_fighter_1", "$g_tutorial_training_ground_melee_last_winner"),
(assign, "$g_tutorial_training_ground_melee_last_winner", -1),
(try_end),
(this_or_next|eq, "$g_tutorial_training_ground_melee_cur_fighter_1", -1),
(eq, "$g_tutorial_training_ground_melee_cur_fighter_2", -1),
(assign, ":num_candidates", 0),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_1"),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_2"),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_last_loser"),
(val_add, ":num_candidates", 1),
(try_end),
(store_random_in_range, ":random_candidate", 0, ":num_candidates"),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_1"),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_2"),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_last_loser"),
(val_sub, ":random_candidate", 1),
(lt, ":random_candidate", 0),
(try_begin),
(eq, "$g_tutorial_training_ground_melee_cur_fighter_1", -1),
(assign, "$g_tutorial_training_ground_melee_cur_fighter_1", ":cur_agent"),
(else_try),
(assign, "$g_tutorial_training_ground_melee_cur_fighter_2", ":cur_agent"),
(try_end),
(try_end),
(try_end),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_1"),
(neq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_2"),
(agent_set_wielded_item, ":cur_agent", -1),
(try_end),
(val_add, "$g_tutorial_training_ground_melee_state", 1), #fighters are chosen
(store_mission_timer_a, "$g_tutorial_training_ground_melee_next_action_time"),
(val_add, "$g_tutorial_training_ground_melee_next_action_time", 3),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_state", 1),
(try_begin),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_melee_next_action_time"),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_1"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_2"),
(this_or_next|eq, ":cur_agent_troop", "trp_tutorial_fighter_3"),
(eq, ":cur_agent_troop", "trp_tutorial_fighter_4"),
(try_begin),
(eq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_1"),
(entry_point_get_position, pos1, 30),
(agent_set_scripted_destination, ":cur_agent", pos1),
(else_try),
(eq, ":cur_agent", "$g_tutorial_training_ground_melee_cur_fighter_2"),
(entry_point_get_position, pos1, 31),
(agent_set_scripted_destination, ":cur_agent", pos1),
(else_try),
(agent_get_slot, ":spawn_point", ":cur_agent", slot_agent_spawn_entry_point),
(entry_point_get_position, pos1, ":spawn_point"),
(agent_set_scripted_destination, ":cur_agent", pos1),
(try_end),
(try_end),
(val_add, "$g_tutorial_training_ground_melee_state", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_state", 2),
(try_begin),
(agent_set_look_target_agent, "$g_tutorial_training_ground_melee_cur_fighter_1", "$g_tutorial_training_ground_melee_cur_fighter_2"),
(agent_set_look_target_agent, "$g_tutorial_training_ground_melee_cur_fighter_2", "$g_tutorial_training_ground_melee_cur_fighter_1"),
(agent_get_position, pos1, "$g_tutorial_training_ground_melee_cur_fighter_1"),
(entry_point_get_position, pos2, 30),
(get_sq_distance_between_positions, ":sq_dist_1", pos1, pos2),
(lt, ":sq_dist_1", 400), #2 meters
(agent_get_position, pos1, "$g_tutorial_training_ground_melee_cur_fighter_2"),
(entry_point_get_position, pos2, 31),
(get_sq_distance_between_positions, ":sq_dist_2", pos1, pos2),
(lt, ":sq_dist_2", 400), #2 meters
(val_add, "$g_tutorial_training_ground_melee_state", 1),
(store_mission_timer_a, "$g_tutorial_training_ground_melee_next_action_time"),
(val_add, "$g_tutorial_training_ground_melee_next_action_time", 1),
(try_end),
(else_try),
(eq, "$g_tutorial_training_ground_melee_state", 3),
(try_begin),
(agent_set_look_target_agent, "$g_tutorial_training_ground_melee_cur_fighter_1", "$g_tutorial_training_ground_melee_cur_fighter_2"),
(agent_set_look_target_agent, "$g_tutorial_training_ground_melee_cur_fighter_2", "$g_tutorial_training_ground_melee_cur_fighter_1"),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", "$g_tutorial_training_ground_melee_next_action_time"),
(agent_clear_scripted_mode, "$g_tutorial_training_ground_melee_cur_fighter_1"),
(agent_clear_scripted_mode, "$g_tutorial_training_ground_melee_cur_fighter_2"),
(agent_set_team, "$g_tutorial_training_ground_melee_cur_fighter_1", 1),
(agent_set_team, "$g_tutorial_training_ground_melee_cur_fighter_2", 2),
(agent_force_rethink, "$g_tutorial_training_ground_melee_cur_fighter_1"),
(agent_force_rethink, "$g_tutorial_training_ground_melee_cur_fighter_2"),
(val_add, "$g_tutorial_training_ground_melee_state", 1),
(try_end),
(try_end),
## (try_begin),
## (store_mission_timer_a, ":cur_time"),
## (gt, ":cur_time", 0),
## (tutorial_message, "str_talk_to_the_trainer"),
## (assign, "$g_tutorial_training_ground_state", 1),
## (try_end),
## (else_try),
## (eq, "$g_tutorial_training_ground_state", 1),
## (else_try),
## (eq, "$g_tutorial_training_ground_state", 2),
## (else_try),
## (eq, "$g_tutorial_training_ground_state", 3),
## (else_try),
## (eq, "$g_tutorial_training_ground_state", 4),
## (else_try),
## (eq, "$g_tutorial_training_ground_state", 5),
## (try_end),
], []),
],
),
(
"tutorial_1",0,-1,
"You enter the training ground.",
[
(0,mtef_leader_only,af_override_everything,0,1,[itm_tutorial_shield,itm_tutorial_sword,itm_tutorial_short_bow,itm_tutorial_arrows,itm_leather_jerkin,itm_leather_boots]), #af_override_weapons
],
[
(ti_tab_pressed, 0, 0, [],
[(try_begin),
(lt, "$tutorial_1_state", 5),
(question_box, "str_do_you_wish_to_leave_tutorial"),
(else_try),
(finish_mission,0),
(try_end),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(finish_mission,0),
]),
(ti_inventory_key_pressed, 0, 0, [(display_message, "str_cant_use_inventory_tutorial")], []),
(0, 0, ti_once, [
(tutorial_message_set_size, 17, 17),
(tutorial_message_set_position, 500, 650),
(tutorial_message_set_center_justify, 0),
(assign, "$tutorial_1_state", 0),
(assign, "$tutorial_1_msg_1_displayed", 0),
(assign, "$tutorial_1_msg_2_displayed", 0),
(assign, "$tutorial_1_msg_3_displayed", 0),
(assign, "$tutorial_1_msg_4_displayed", 0),
(assign, "$tutorial_1_msg_5_displayed", 0),
(assign, "$tutorial_1_msg_6_displayed", 0),
], []),
(0, 0, 0, [(try_begin),
(eq, "$tutorial_1_state", 0),
(try_begin),
(eq, "$tutorial_1_msg_1_displayed", 0),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 0),
(assign, "$tutorial_1_msg_1_displayed", 1),
(tutorial_message, "str_tutorial_1_msg_1"),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(entry_point_get_position,pos1,1),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(try_end),
(tutorial_message, "str_tutorial_1_msg_1"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position,pos2,1),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 100),
(val_add, "$tutorial_1_state", 1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 0),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(entry_point_get_position,pos1,2),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_1_state", 1),
(try_begin),
(eq, "$tutorial_1_msg_2_displayed", 0),
(assign, "$tutorial_1_msg_2_displayed", 1),
(tutorial_message, "str_tutorial_1_msg_2"),
(play_sound, "snd_tutorial_1"),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position,pos2,2),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 100),
(val_add, "$tutorial_1_state", 1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 1),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, 90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(entry_point_get_position,pos1,3),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_1_state", 2),
(try_begin),
(eq, "$tutorial_1_msg_3_displayed", 0),
(assign, "$tutorial_1_msg_3_displayed", 1),
(tutorial_message, "str_tutorial_1_msg_3"),
(assign, "$tutorial_num_total_dummies_destroyed", 0),
(play_sound, "snd_tutorial_1"),
(try_end),
(ge, "$tutorial_num_total_dummies_destroyed", 4),
(val_add, "$tutorial_1_state", 1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 2),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, 90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(else_try),
(eq, "$tutorial_1_state", 3),
(try_begin),
(eq, "$tutorial_1_msg_4_displayed", 0),
(assign, "$tutorial_1_msg_4_displayed", 1),
(tutorial_message, "str_tutorial_1_msg_4"),
(store_mission_timer_a, "$tutorial_time"),
(play_sound, "snd_tutorial_1"),
(try_end),
(store_mission_timer_a, ":cur_time"),
(val_sub, ":cur_time", "$tutorial_time"),
(gt, ":cur_time", 10),
(val_add, "$tutorial_1_state", 1),
(else_try),
(eq, "$tutorial_1_state", 4),
(try_begin),
(eq, "$tutorial_1_msg_5_displayed", 0),
(assign, "$tutorial_1_msg_5_displayed", 1),
(tutorial_message, "str_tutorial_1_msg_5"),
(assign, "$g_last_archery_point_earned", 0),
(assign, "$tutorial_num_arrows_hit", 0),
(play_sound, "snd_tutorial_1"),
(try_end),
(try_begin),
(get_player_agent_no, ":player_agent"),
(agent_get_ammo, ":cur_ammo", ":player_agent"),
(le, ":cur_ammo", 0),
(agent_refill_ammo, ":player_agent"),
(tutorial_message, "str_tutorial_ammo_refilled"),
(try_end),
(gt, "$g_last_archery_point_earned", 0),
(assign, "$g_last_archery_point_earned", 0),
(val_add, "$tutorial_num_arrows_hit", 1),
(gt, "$tutorial_num_arrows_hit", 2),
(val_add, "$tutorial_1_state", 1),
(else_try),
(eq, "$tutorial_1_state", 5),
(eq, "$tutorial_1_msg_6_displayed", 0),
(assign, "$tutorial_1_msg_6_displayed", 1),
(tutorial_message, "str_tutorial_1_msg_6"),
(play_sound, "snd_tutorial_2"),
(assign, "$tutorial_1_finished", 1),
(try_end),
], []),
],
),
## (
## "tutorial_1",0,-1,
## "You enter the training ground.",
## [
## (0,mtef_leader_only|mtef_team_0,af_override_horse|af_override_weapons,0,1,[itm_tutorial_shield,itm_tutorial_sword,itm_tutorial_short_bow,itm_tutorial_arrows]), #af_override_weapons
## (1,mtef_visitor_source|mtef_team_0,0,0,1,[]),
## (2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
## (3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
## (4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
## (5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
## (6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
## (7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
## (8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
## (9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
## (10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
## ],
## [
## (ti_tab_pressed, 0, 0, [],
## [(try_begin),
## (lt, "$tutorial_1_state", 5),
## (question_box, "str_do_you_wish_to_leave_tutorial"),
## (else_try),
## (finish_mission,0),
## (try_end),
## ]),
## (ti_question_answered, 0, 0, [],
## [(store_trigger_param_1,":answer"),
## (eq,":answer",0),
## (finish_mission,0),
## ]),
## (ti_inventory_key_pressed, 0, 0, [(display_message, "str_cant_use_inventory_tutorial")], []),
##
## (0, 0, ti_once, [
## (tutorial_message_set_size, 17, 17),
## (tutorial_message_set_position, 500, 650),
## (tutorial_message_set_center_justify, 0),
## (assign, "$tutorial_1_state", 0),
## ], []),
##
## (0, 0, 0, [(try_begin),
## (eq, "$tutorial_1_state", 0),
## (try_begin),
## (store_mission_timer_a, ":cur_time"),
## (gt, ":cur_time", 0),
## (tutorial_message, "str_talk_to_the_trainer"),
## (assign, "$tutorial_1_state", 1),
## (try_end),
## (else_try),
## (eq, "$tutorial_1_state", 1),
## (else_try),
## (eq, "$tutorial_1_state", 2),
## (else_try),
## (eq, "$tutorial_1_state", 3),
## (else_try),
## (eq, "$tutorial_1_state", 4),
## (else_try),
## (eq, "$tutorial_1_state", 5),
## (try_end),
## ], []),
## ],
## ),
(
"tutorial_2",mtf_arena_fight,-1,
"You enter the training ground.",
[
(0,mtef_leader_only|mtef_team_0,af_override_everything,0,1,[itm_tutorial_shield,itm_leather_jerkin,itm_leather_boots]),
(2,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_1,0,0,1,[]),
],
[
(ti_tab_pressed, 0, 0, [],
[(try_begin),
(lt, "$tutorial_2_state", 9),
(question_box,"str_do_you_wish_to_leave_tutorial"),
(else_try),
(finish_mission,0),
(try_end),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(finish_mission,0),
]),
(ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_tutorial")], []),
(0, 0, ti_once, [
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 2),
(main_hero_fallen),
(assign, "$tutorial_2_state", 100),
], []),
(0, 0, ti_once, [
(tutorial_message_set_size, 17, 17),
(tutorial_message_set_position, 500, 650),
(tutorial_message_set_center_justify, 0),
(assign, "$tutorial_2_state", 0),
(assign, "$tutorial_2_msg_1_displayed", 0),
(assign, "$tutorial_2_msg_2_displayed", 0),
(assign, "$tutorial_2_msg_3_displayed", 0),
(assign, "$tutorial_2_msg_4_displayed", 0),
(assign, "$tutorial_2_msg_5_displayed", 0),
(assign, "$tutorial_2_msg_6_displayed", 0),
(assign, "$tutorial_2_msg_7_displayed", 0),
(assign, "$tutorial_2_msg_8_displayed", 0),
(assign, "$tutorial_2_msg_9_displayed", 0),
(assign, "$tutorial_2_melee_agent_state", 0),
], []),
(10, 0, 0, [(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_archer"),
(agent_refill_ammo, reg0)], []),
(0, 0, 0, [(try_begin),
(eq, "$tutorial_2_state", 0),
(try_begin),
(eq, "$tutorial_2_msg_1_displayed", 0),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 0),
(assign, "$tutorial_2_msg_1_displayed", 1),
(tutorial_message, "str_tutorial_2_msg_1"),
(team_give_order, 1, grc_everyone, mordr_stand_ground),
(team_give_order, 1, grc_infantry, mordr_charge),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(agent_get_position, pos1, ":cur_agent"),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(try_end),
(get_player_agent_no, ":player_agent"),
(ge, ":player_agent", 0),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position,pos2,1),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 0),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, 90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_2_state", 1),
(else_try),
(eq, "$tutorial_2_state", 1),
(scene_prop_get_instance, ":barrier_object", "spr_barrier_4m", 0),
(prop_instance_get_position, pos1, ":barrier_object"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos2, ":player_agent"),
(position_is_behind_position, pos2, pos1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 0),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_2_state", 1),
(else_try),
(eq, "$tutorial_2_state", 2),
(get_player_agent_no, ":player_agent"),
(agent_set_kick_allowed, ":player_agent", 0), #don't let player kick while defending
(try_begin),
(eq, "$tutorial_2_melee_agent_state", 0),
(val_add, "$tutorial_2_melee_agent_state", 1),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 3),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(else_try),
(eq, "$tutorial_2_melee_agent_state", 1),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 3),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 250),
(agent_clear_scripted_mode, ":cur_agent"),
(val_add, "$tutorial_2_melee_agent_state", 1),
(store_mission_timer_a,"$tutorial_time"),
(else_try),
(eq, "$tutorial_2_melee_agent_state", 2),
(try_begin),
(eq, "$tutorial_2_msg_2_displayed", 0),
(assign, "$tutorial_2_msg_2_displayed", 1),
(play_sound, "snd_tutorial_1"),
(try_end),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(store_mission_timer_a,":cur_time"),
(val_sub, ":cur_time", "$tutorial_time"),
(store_sub, reg3, 20, ":cur_time"),
(tutorial_message, "str_tutorial_2_msg_2"),
(gt, ":cur_time", 20),
(entry_point_get_position, pos1, 3),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(val_add, "$tutorial_2_melee_agent_state", 1),
(else_try),
(eq, "$tutorial_2_melee_agent_state", 3),
(try_begin),
(eq, "$tutorial_2_msg_3_displayed", 0),
(assign, "$tutorial_2_msg_3_displayed", 1),
(tutorial_message, "str_tutorial_2_msg_3"),
(play_sound, "snd_tutorial_1"),
(try_end),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 3),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 250),
(entry_point_get_position, pos1, 2),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(val_add, "$tutorial_2_melee_agent_state", 1),
(else_try),
(eq, "$tutorial_2_melee_agent_state", 4),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 2),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 250),
(entry_point_get_position, pos1, 30),
(agent_set_position, ":cur_agent", pos1),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 1),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, 90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_2_melee_agent_state", 1),
(val_add, "$tutorial_2_state", 1),
(try_end),
(else_try),
(eq, "$tutorial_2_state", 3),
(scene_prop_get_instance, ":barrier_object", "spr_barrier_4m", 1),
(prop_instance_get_position, pos1, ":barrier_object"),
(get_player_agent_no, ":player_agent"),
(agent_set_kick_allowed, ":player_agent", 1), #reenable
(agent_get_position, pos2, ":player_agent"),
(position_is_behind_position, pos2, pos1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 1),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(store_mission_timer_a,"$tutorial_time"),
(val_add, "$tutorial_2_state", 1),
(else_try),
(eq, "$tutorial_2_state", 4),
(try_begin),
(eq, "$tutorial_2_msg_4_displayed", 0),
(assign, "$tutorial_2_msg_4_displayed", 1),
(play_sound, "snd_tutorial_1"),
(try_end),
(store_mission_timer_a,":cur_time"),
(val_sub, ":cur_time", "$tutorial_time"),
(store_sub, reg3, 20, ":cur_time"),
(tutorial_message, "str_tutorial_2_msg_4"),
(gt, ":cur_time", 20),
(entry_point_get_position,pos1,5),
(set_spawn_position, pos1),
(spawn_item, "itm_tutorial_sword"),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 3),
(agent_set_position, ":cur_agent", pos1),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 2),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, 90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_2_state", 1),
(else_try),
(eq, "$tutorial_2_state", 5),
(try_begin),
(eq, "$tutorial_2_msg_5_displayed", 0),
(assign, "$tutorial_2_msg_5_displayed", 1),
(tutorial_message, "str_tutorial_2_msg_5"),
(play_sound, "snd_tutorial_1"),
(try_end),
(scene_prop_get_instance, ":barrier_object", "spr_barrier_4m", 2),
(prop_instance_get_position, pos1, ":barrier_object"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos2, ":player_agent"),
(position_is_behind_position, pos2, pos1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 2),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_2_state", 1),
(else_try),
(eq, "$tutorial_2_state", 6),
(try_begin),
(eq, "$tutorial_2_msg_6_displayed", 0),
(assign, "$tutorial_2_msg_6_displayed", 1),
(tutorial_message, "str_tutorial_2_msg_6"),
(play_sound, "snd_tutorial_1"),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_has_item_equipped, ":player_agent", "itm_tutorial_sword"),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 3),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_2_state", 1),
(else_try),
(eq, "$tutorial_2_state", 7),
(try_begin),
(eq, "$tutorial_2_msg_7_displayed", 0),
(assign, "$tutorial_2_msg_7_displayed", 1),
(tutorial_message, "str_tutorial_2_msg_7"),
(play_sound, "snd_tutorial_1"),
(get_player_agent_no, ":player_agent"),
(agent_set_hit_points, ":player_agent", 100),
(try_end),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_archer"),
(assign, ":cur_agent", reg0),
(neg|agent_is_alive, ":cur_agent"),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(agent_clear_scripted_mode, ":cur_agent"),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_a", 4),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_2_state", 1),
(else_try),
(eq, "$tutorial_2_state", 8),
(try_begin),
(eq, "$tutorial_2_msg_8_displayed", 0),
(assign, "$tutorial_2_msg_8_displayed", 1),
(tutorial_message, "str_tutorial_2_msg_8"),
(play_sound, "snd_tutorial_1"),
(get_player_agent_no, ":player_agent"),
(agent_set_hit_points, ":player_agent", 100),
(try_end),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(neg|agent_is_alive, ":cur_agent"),
(val_add, "$tutorial_2_state", 1),
(else_try),
(eq, "$tutorial_2_state", 9),
(eq, "$tutorial_2_msg_9_displayed", 0),
(assign, "$tutorial_2_msg_9_displayed", 1),
(tutorial_message, "str_tutorial_2_msg_9"),
(play_sound, "snd_tutorial_2"),
(assign, "$tutorial_2_finished", 1),
(else_try),
(gt, "$tutorial_2_state", 30),
(tutorial_message, "str_tutorial_failed"),
(try_end),
], []),
],
),
(
"tutorial_3",mtf_arena_fight,-1,
"You enter the training ground.",
[
(0,mtef_leader_only|mtef_team_0,af_override_everything,0,1,[itm_leather_jerkin,itm_leather_boots]),
(3,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
(ti_tab_pressed, 0, 0, [],
[(try_begin),
(lt, "$tutorial_3_state", 12),
(question_box,"str_do_you_wish_to_leave_tutorial"),
(else_try),
(finish_mission,0),
(try_end),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(finish_mission,0),
]),
(ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_tutorial")], []),
(0, 0, ti_once, [
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 2),
(main_hero_fallen),
(assign, "$tutorial_3_state", 100),
], []),
(0, 0, ti_once, [
(tutorial_message_set_size, 17, 17),
(tutorial_message_set_position, 500, 650),
(tutorial_message_set_center_justify, 0),
(assign, "$tutorial_3_state", 0),
(assign, "$tutorial_3_msg_1_displayed", 0),
(assign, "$tutorial_3_msg_2_displayed", 0),
(assign, "$tutorial_3_msg_3_displayed", 0),
(assign, "$tutorial_3_msg_4_displayed", 0),
(assign, "$tutorial_3_msg_5_displayed", 0),
(assign, "$tutorial_3_msg_6_displayed", 0),
], []),
(0, 0, 0, [(try_begin),
(eq, "$tutorial_3_state", 0),
(try_begin),
(eq, "$tutorial_3_msg_1_displayed", 0),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 0),
(assign, "$tutorial_3_msg_1_displayed", 1),
(tutorial_message, "str_tutorial_3_msg_1"),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(agent_get_position, pos1, ":cur_agent"),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_swordsman"),
(assign, ":cur_agent", reg0),
(agent_get_position, pos1, ":cur_agent"),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(entry_point_get_position, pos1, 1),
(set_spawn_position, pos1),
(spawn_item, "itm_tutorial_staff_no_attack"),
(try_end),
(get_player_agent_no, ":player_agent"),
(ge, ":player_agent", 0),
(agent_has_item_equipped, ":player_agent", "itm_tutorial_staff_no_attack"),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 1),
(try_begin),
(eq, "$tutorial_3_msg_2_displayed", 0),
(assign, "$tutorial_3_msg_2_displayed", 1),
(tutorial_message, "str_tutorial_3_msg_2"),
(play_sound, "snd_tutorial_1"),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position,pos2,2),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 0),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 2),
(scene_prop_get_instance, ":barrier_object", "spr_barrier_4m", 0),
(prop_instance_get_position, pos1, ":barrier_object"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos2, ":player_agent"),
(position_is_behind_position, pos2, pos1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 0),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, 90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 3),
(get_player_agent_no, ":player_agent"),
(agent_set_kick_allowed, ":player_agent", 0), #don't let player kick while defending
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 4),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 4),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 4),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 250),
(agent_clear_scripted_mode, ":cur_agent"),
(val_add, "$tutorial_3_state", 1),
(store_mission_timer_a,"$tutorial_time"),
(else_try),
(eq, "$tutorial_3_state", 5),
(try_begin),
(eq, "$tutorial_3_msg_3_displayed", 0),
(assign, "$tutorial_3_msg_3_displayed", 1),
(play_sound, "snd_tutorial_1"),
(try_end),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(store_mission_timer_a,":cur_time"),
(val_sub, ":cur_time", "$tutorial_time"),
(store_sub, reg3, 20, ":cur_time"),
(tutorial_message, "str_tutorial_3_msg_3"),
(gt, ":cur_time", 20),
(entry_point_get_position, pos1, 4),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 6),
(try_begin),
(eq, "$tutorial_3_msg_4_displayed", 0),
(assign, "$tutorial_3_msg_4_displayed", 1),
(tutorial_message, "str_tutorial_3_msg_4"),
(play_sound, "snd_tutorial_1"),
(try_end),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 4),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 250),
(entry_point_get_position, pos1, 3),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 7),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 3),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 250),
(entry_point_get_position, pos1, 7),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(agent_set_position, ":cur_agent", pos1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 1),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 3),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 8),
(scene_prop_get_instance, ":barrier_object", "spr_barrier_4m", 1),
(prop_instance_get_position, pos1, ":barrier_object"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos2, ":player_agent"),
(position_is_behind_position, pos2, pos1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 1),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, 90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 9),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_swordsman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 6),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 10),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_swordsman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 6),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 250),
(agent_clear_scripted_mode, ":cur_agent"),
(val_add, "$tutorial_3_state", 1),
(store_mission_timer_a,"$tutorial_time"),
(else_try),
(eq, "$tutorial_3_state", 11),
(try_begin),
(eq, "$tutorial_3_msg_5_displayed", 0),
(assign, "$tutorial_3_msg_5_displayed", 1),
(play_sound, "snd_tutorial_1"),
(try_end),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_swordsman"),
(assign, ":cur_agent", reg0),
(store_mission_timer_a,":cur_time"),
(val_sub, ":cur_time", "$tutorial_time"),
(store_sub, reg3, 20, ":cur_time"),
(tutorial_message, "str_tutorial_3_msg_5"),
(gt, ":cur_time", 20),
(entry_point_get_position, pos1, 6),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 12),
(try_begin),
(eq, "$tutorial_3_msg_6_displayed", 0),
(assign, "$tutorial_3_msg_6_displayed", 1),
(tutorial_message, "str_tutorial_3_msg_6"),
(play_sound, "snd_tutorial_1"),
(try_end),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_swordsman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 6),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 250),
(entry_point_get_position, pos1, 5),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 13),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_swordsman"),
(assign, ":cur_agent", reg0),
(entry_point_get_position, pos1, 5),
(agent_get_position, pos2, ":cur_agent"),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 250),
(entry_point_get_position, pos1, 7),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(agent_set_position, ":cur_agent", pos1),
(val_add, "$tutorial_3_state", 1),
(else_try),
(gt, "$tutorial_3_state", 30),
(tutorial_message, "str_tutorial_failed"),
(try_end),
], []),
],
),
(
"tutorial_3_2",mtf_arena_fight,-1,
"You enter the training ground.",
[
(0,mtef_leader_only|mtef_team_0,af_override_everything,0,1,[itm_tutorial_staff,itm_leather_jerkin,itm_leather_boots]),
(4,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
(ti_tab_pressed, 0, 0, [],
[(try_begin),
(lt, "$tutorial_3_state", 5),
(question_box,"str_do_you_wish_to_leave_tutorial"),
(else_try),
(finish_mission,0),
(try_end),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(finish_mission,0),
]),
(ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_tutorial")], []),
(0, 0, ti_once, [
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 2),
(main_hero_fallen),
(assign, "$tutorial_3_state", 100),
], []),
(0, 0, ti_once, [
(tutorial_message_set_size, 17, 17),
(tutorial_message_set_position, 500, 650),
(tutorial_message_set_center_justify, 0),
(assign, "$tutorial_3_state", 0),
(assign, "$tutorial_3_msg_1_displayed", 0),
(assign, "$tutorial_3_msg_2_displayed", 0),
(assign, "$tutorial_3_msg_3_displayed", 0),
(assign, "$tutorial_3_msg_4_displayed", 0),
(assign, "$tutorial_3_msg_5_displayed", 0),
], []),
(0, 0, 0, [(try_begin),
(eq, "$tutorial_3_state", 0),
(try_begin),
(eq, "$tutorial_3_msg_1_displayed", 0),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 0),
(assign, "$tutorial_3_msg_1_displayed", 1),
(tutorial_message, "str_tutorial_3_2_msg_1"),
(play_sound, "snd_tutorial_1"),
(call_script, "script_cf_get_first_agent_with_troop_id","trp_tutorial_maceman"),
(assign, ":cur_agent", reg0),
(agent_get_position, pos1, ":cur_agent"),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_swordsman"),
(assign, ":cur_agent", reg0),
(agent_get_position, pos1, ":cur_agent"),
(agent_set_scripted_destination, ":cur_agent", pos1, 0),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position,pos2,2),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 0),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 1),
(try_begin),
(eq, "$tutorial_3_msg_2_displayed", 0),
(assign, "$tutorial_3_msg_2_displayed", 1),
(tutorial_message, "str_tutorial_3_2_msg_2"),
(play_sound, "snd_tutorial_1"),
(try_end),
(scene_prop_get_instance, ":barrier_object", "spr_barrier_4m", 0),
(prop_instance_get_position, pos1, ":barrier_object"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos2, ":player_agent"),
(position_is_behind_position, pos2, pos1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 0),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, 90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(agent_clear_scripted_mode, reg0),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 2),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_maceman"),
(neg|agent_is_alive, reg0),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 1),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 3),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, -90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 3),
(try_begin),
(eq, "$tutorial_3_msg_3_displayed", 0),
(assign, "$tutorial_3_msg_3_displayed", 1),
(tutorial_message, "str_tutorial_3_2_msg_3"),
(play_sound, "snd_tutorial_1"),
(try_end),
(scene_prop_get_instance, ":barrier_object", "spr_barrier_4m", 1),
(prop_instance_get_position, pos1, ":barrier_object"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos2, ":player_agent"),
(position_is_behind_position, pos2, pos1),
(scene_prop_get_instance, ":door_object", "spr_tutorial_door_b", 1),
(prop_instance_get_position, pos1, ":door_object"),
(position_rotate_z, pos1, 90),
(prop_instance_animate_to_position, ":door_object", pos1, 150),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_swordsman"),
(agent_clear_scripted_mode, reg0),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 4),
(try_begin),
(eq, "$tutorial_3_msg_4_displayed", 0),
(assign, "$tutorial_3_msg_4_displayed", 1),
(tutorial_message, "str_tutorial_3_2_msg_4"),
(play_sound, "snd_tutorial_1"),
(try_end),
(call_script, "script_cf_get_first_agent_with_troop_id", "trp_tutorial_swordsman"),
(neg|agent_is_alive, reg0),
(val_add, "$tutorial_3_state", 1),
(else_try),
(eq, "$tutorial_3_state", 5),
(eq, "$tutorial_3_msg_5_displayed", 0),
(assign, "$tutorial_3_msg_5_displayed", 1),
(tutorial_message, "str_tutorial_3_2_msg_5"),
(play_sound, "snd_tutorial_2"),
(assign, "$tutorial_3_finished", 1),
(else_try),
(gt, "$tutorial_3_state", 30),
(tutorial_message, "str_tutorial_failed"),
(try_end),
], []),
],
),
(
"tutorial_4",mtf_arena_fight,-1,
"You enter the training ground.",
[
(0,mtef_leader_only|mtef_team_0,af_override_everything,0,1,[itm_tutorial_sword,itm_tutorial_short_bow,itm_tutorial_arrows,itm_leather_jerkin,itm_leather_boots]), #af_override_weapons
],
[
(ti_tab_pressed, 0, 0, [],
[(try_begin),
(lt, "$tutorial_4_state", 11),
(question_box,"str_do_you_wish_to_leave_tutorial"),
(else_try),
(finish_mission,0),
(try_end),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(finish_mission,0),
]),
(ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_tutorial")], []),
(ti_before_mission_start, 0, 0, [],
[
(scene_set_day_time, 13),
]),
(0, 0, ti_once, [
(tutorial_message_set_size, 17, 17),
(tutorial_message_set_position, 500, 650),
(tutorial_message_set_center_justify, 0),
(assign, "$tutorial_4_state", 0),
(assign, "$tutorial_4_msg_1_displayed", 0),
(assign, "$tutorial_4_msg_2_displayed", 0),
(assign, "$tutorial_4_msg_3_displayed", 0),
(assign, "$tutorial_4_msg_4_displayed", 0),
(assign, "$tutorial_4_msg_5_displayed", 0),
(assign, "$tutorial_4_msg_6_displayed", 0),
(assign, "$tutorial_4_msg_7_displayed", 0),
], []),
(0, 0, 0, [(try_begin),
(eq, "$tutorial_4_state", 0),
(try_begin),
(eq, "$tutorial_4_msg_1_displayed", 0),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 0),
(assign, "$tutorial_4_msg_1_displayed", 1),
(tutorial_message, "str_tutorial_4_msg_1"),
(entry_point_get_position, pos1, 1),
(set_spawn_position, 1),
(spawn_horse, "itm_tutorial_saddle_horse"),
(assign, "$tutorial_num_total_dummies_destroyed", 0),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_horse, ":horse_agent", ":player_agent"),
(ge, ":horse_agent", 0),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 2),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 1),
(try_begin),
(eq, "$tutorial_4_msg_2_displayed", 0),
(assign, "$tutorial_4_msg_2_displayed", 1),
(tutorial_message, "str_tutorial_4_msg_2"),
(play_sound, "snd_tutorial_1"),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 2),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 3),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 2),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 3),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 4),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 3),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 4),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 5),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 4),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 5),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 6),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 5),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 6),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 1),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 6),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 1),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 7),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 7),
(try_begin),
(eq, "$tutorial_4_msg_3_displayed", 0),
(assign, "$tutorial_4_msg_3_displayed", 1),
(tutorial_message, "str_tutorial_4_msg_3"),
(play_sound, "snd_tutorial_1"),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 7),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 20),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 8),
(try_begin),
(eq, "$tutorial_4_msg_4_displayed", 0),
(assign, "$tutorial_4_msg_4_displayed", 1),
(tutorial_message, "str_tutorial_4_msg_4"),
(play_sound, "snd_tutorial_1"),
(try_end),
(ge, "$tutorial_num_total_dummies_destroyed", 2),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 8),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 9),
(try_begin),
(eq, "$tutorial_4_msg_5_displayed", 0),
(assign, "$tutorial_4_msg_5_displayed", 1),
(tutorial_message, "str_tutorial_4_msg_5"),
(play_sound, "snd_tutorial_1"),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 8),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 200),
(val_add, "$tutorial_4_state", 1),
(entry_point_get_position, pos1, 20),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_4_state", 10),
(try_begin),
(eq, "$tutorial_4_msg_6_displayed", 0),
(assign, "$tutorial_4_msg_6_displayed", 1),
(tutorial_message, "str_tutorial_4_msg_6"),
(play_sound, "snd_tutorial_1"),
(assign, "$g_last_archery_point_earned", 0),
(assign, "$tutorial_num_arrows_hit", 0),
(try_end),
(try_begin),
(get_player_agent_no, ":player_agent"),
(agent_get_ammo, ":cur_ammo", ":player_agent"),
(le, ":cur_ammo", 0),
(agent_refill_ammo, ":player_agent"),
(tutorial_message, "str_tutorial_ammo_refilled"),
(try_end),
(gt, "$g_last_archery_point_earned", 0),
(assign, "$g_last_archery_point_earned", 0),
(val_add, "$tutorial_num_arrows_hit", 1),
(gt, "$tutorial_num_arrows_hit", 2),
(val_add, "$tutorial_4_state", 1),
(else_try),
(eq, "$tutorial_4_state", 11),
(eq, "$tutorial_4_msg_7_displayed", 0),
(assign, "$tutorial_4_msg_7_displayed", 1),
(tutorial_message, "str_tutorial_4_msg_7"),
(play_sound, "snd_tutorial_2"),
(assign, "$tutorial_4_finished", 1),
(try_end),
], []),
],
),
(
"tutorial_5",mtf_arena_fight,-1,
"You enter the training ground.",
[
(0,mtef_visitor_source|mtef_team_0,af_override_everything,0,1,[itm_tutorial_sword,itm_tutorial_shield,itm_tutorial_short_bow,itm_tutorial_arrows,itm_tutorial_saddle_horse,itm_leather_jerkin,itm_leather_boots]),
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
],
[
(ti_tab_pressed, 0, 0, [],
[(try_begin),
(lt, "$tutorial_5_state", 5),
(question_box,"str_do_you_wish_to_leave_tutorial"),
(else_try),
(finish_mission,0),
(try_end),
]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
(finish_mission,0),
]),
(ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_tutorial")], []),
(0, 0, ti_once, [
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 2),
(main_hero_fallen),
(assign, "$tutorial_5_state", 100),
], []),
(0, 0, ti_once, [
(tutorial_message_set_size, 17, 17),
(tutorial_message_set_position, 500, 650),
(tutorial_message_set_center_justify, 0),
(assign, "$tutorial_5_state", 0),
(assign, "$tutorial_5_msg_1_displayed", 0),
(assign, "$tutorial_5_msg_2_displayed", 0),
(assign, "$tutorial_5_msg_3_displayed", 0),
(assign, "$tutorial_5_msg_4_displayed", 0),
(assign, "$tutorial_5_msg_5_displayed", 0),
(assign, "$tutorial_5_msg_6_displayed", 0),
], []),
(0, 0, ti_once, [(set_show_messages, 0),
(team_give_order, 0, grc_everyone, mordr_stand_ground),
(set_show_messages, 1),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 3),
], []),
(0, 0, 0, [(call_script, "script_cf_turn_windmill_fans", 0)], []),
(0, 0, 0, [(try_begin),
(eq, "$tutorial_5_state", 0),
(try_begin),
(eq, "$tutorial_5_msg_1_displayed", 0),
(store_mission_timer_a, ":cur_time"),
(gt, ":cur_time", 0),
(assign, "$tutorial_5_msg_1_displayed", 1),
(tutorial_message, "str_tutorial_5_msg_1"),
(entry_point_get_position, pos1, 5),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(try_end),
(call_script, "script_cf_team_get_average_position_of_agents_with_type_to_pos1", 0, grc_infantry),
(entry_point_get_position, pos2, 5),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 1000),
(val_add, "$tutorial_5_state", 1),
(entry_point_get_position, pos1, 6),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_red", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_5_state", 1),
(try_begin),
(eq, "$tutorial_5_msg_2_displayed", 0),
(assign, "$tutorial_5_msg_2_displayed", 1),
(tutorial_message, "str_tutorial_5_msg_2"),
(play_sound, "snd_tutorial_1"),
(try_end),
(call_script, "script_cf_team_get_average_position_of_agents_with_type_to_pos1", 0, grc_infantry),
(entry_point_get_position, pos2, 5),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 1000),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 6),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 500),
(val_add, "$tutorial_5_state", 1),
(entry_point_get_position, pos1, 7),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(entry_point_get_position, pos1, 30),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_red", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(else_try),
(eq, "$tutorial_5_state", 2),
(try_begin),
(eq, "$tutorial_5_msg_3_displayed", 0),
(assign, "$tutorial_5_msg_3_displayed", 1),
(tutorial_message, "str_tutorial_5_msg_3"),
(play_sound, "snd_tutorial_1"),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos1, ":player_agent"),
(entry_point_get_position, pos2, 7),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 500),
(val_add, "$tutorial_5_state", 1),
(modify_visitors_at_site,"scn_tutorial_5"),
(reset_visitors),
(set_visitor,5,"trp_vaegir_archer"),
(set_visitor,6,"trp_vaegir_archer"),
(set_visitor,7,"trp_vaegir_archer"),
(entry_point_get_position, pos1, 11),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(entry_point_get_position, pos1, 12),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_red", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(set_show_messages, 0),
(team_give_order, 0, grc_archers, mordr_stand_ground),
(set_show_messages, 1),
(else_try),
(eq, "$tutorial_5_state", 3),
(try_begin),
(eq, "$tutorial_5_msg_4_displayed", 0),
(assign, "$tutorial_5_msg_4_displayed", 1),
(tutorial_message, "str_tutorial_5_msg_4"),
(play_sound, "snd_tutorial_1"),
(try_end),
(call_script, "script_cf_team_get_average_position_of_agents_with_type_to_pos1", 0, grc_archers),
(entry_point_get_position, pos2, 11),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 1000),
(call_script, "script_cf_team_get_average_position_of_agents_with_type_to_pos1", 0, grc_infantry),
(entry_point_get_position, pos2, 12),
(get_distance_between_positions, ":cur_distance", pos1, pos2),
(le, ":cur_distance", 1000),
(val_add, "$tutorial_5_state", 1),
(entry_point_get_position, pos1, 30),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_red", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(modify_visitors_at_site,"scn_tutorial_5"),
(reset_visitors),
(set_visitor,8,"trp_bandit"),
(set_visitor,9,"trp_bandit"),
(set_visitor,10,"trp_bandit"),
(set_visitor,11,"trp_bandit"),
(team_give_order, 1, grc_everyone, mordr_charge),
(else_try),
(eq, "$tutorial_5_state", 4),
(try_begin),
(eq, "$tutorial_5_msg_5_displayed", 0),
(assign, "$tutorial_5_msg_5_displayed", 1),
(tutorial_message, "str_tutorial_5_msg_5"),
(play_sound, "snd_tutorial_1"),
(try_end),
(assign, ":enemy_count", 0),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_team, ":cur_team", ":cur_agent"),
(eq, ":cur_team", 1),
(val_add, ":enemy_count", 1),
(try_end),
(eq, ":enemy_count", 0),
(val_add, "$tutorial_5_state", 1),
(else_try),
(eq, "$tutorial_5_state", 5),
(eq, "$tutorial_5_msg_6_displayed", 0),
(assign, "$tutorial_5_msg_6_displayed", 1),
(tutorial_message, "str_tutorial_5_msg_6"),
(play_sound, "snd_tutorial_2"),
(assign, "$tutorial_5_finished", 1),
(else_try),
(gt, "$tutorial_5_state", 30),
(tutorial_message, "str_tutorial_failed"),
(entry_point_get_position, pos1, 30),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_yellow", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(scene_prop_get_instance, ":flag_object", "spr_tutorial_flag_red", 0),
(prop_instance_animate_to_position, ":flag_object", pos1, 1),
(try_end),
], []),
],
),
(
"quick_battle_battle",mtf_battle_mode,-1,
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
common_custom_battle_tab_press,
common_custom_battle_question_answered,
common_inventory_not_available,
(ti_before_mission_start, 0, 0, [],
[
(scene_set_day_time, 15),
]),
common_battle_init_banner,
(0, 0, ti_once, [],
[
(assign, "$g_battle_result", 0),
(call_script, "script_combat_music_set_situation_with_culture"),
]),
common_music_situation_update,
custom_battle_check_victory_condition,
common_battle_victory_display,
custom_battle_check_defeat_condition,
],
),
(
"quick_battle_siege", mtf_battle_mode,-1,
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(34,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(35,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(36,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(42,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(43,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
],
[
common_battle_mission_start,
common_battle_init_banner,
(0, 0, ti_once,
[
(assign, "$defender_team", 0),
(assign, "$attacker_team", 1),
(assign, "$defender_team_2", 2),
(assign, "$attacker_team_2", 3),
], []),
(ti_before_mission_start, 0, 0, [],
[
(scene_set_day_time, 15),
]),
common_custom_battle_tab_press,
common_custom_battle_question_answered,
common_inventory_not_available,
common_custom_siege_init,
common_music_situation_update,
custom_battle_check_victory_condition,
common_battle_victory_display,
custom_battle_check_defeat_condition,
common_siege_attacker_do_not_stall,
common_siege_refill_ammo,
common_siege_init_ai_and_belfry,
common_siege_move_belfry,
common_siege_rotate_belfry,
common_siege_assign_men_to_belfry,
common_siege_ai_trigger_init_2,
],
),
##
## (
## "quick_battle_siege_offense",mtf_battle_mode,-1,
## "You lead your men to battle.",
## [
## (0,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
## (1,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
## (2,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
## (3,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
## (4,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
## (5,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
## (6,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
## (7,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
##
## (8,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
## (9,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
## (10,mtef_visitor_source|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
##
## (11,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (12,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (13,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (14,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (15,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (40,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (41,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (42,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (43,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (44,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (45,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (46,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
## (47,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
##
## ],
## [
## common_custom_battle_tab_press,
## common_battle_init_banner,
## common_custom_battle_question_answered,
## common_custom_siege_init,
## common_inventory_not_available,
## common_music_situation_update,
## custom_battle_check_victory_condition,
## common_battle_victory_display,
## custom_battle_check_defeat_condition,
##
## (0, 0, ti_once,
## [
## (assign, "$defender_team", 0),
## (assign, "$attacker_team", 1),
## (assign, "$defender_team_2", 2),
## (assign, "$attacker_team_2", 3),
## ], []),
##
## common_siege_ai_trigger_init_2,
## common_siege_attacker_do_not_stall,
## common_siege_refill_ammo,
## common_siege_init_ai_and_belfry,
## common_siege_move_belfry,
## common_siege_rotate_belfry,
## common_siege_assign_men_to_belfry,
## ],
## ),
(
"multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(34,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(35,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(36,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(42,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(43,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(48,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(49,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(50,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(51,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(52,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(53,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(54,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(55,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(56,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(57,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(58,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(59,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(60,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(61,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(62,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(63,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
#multiplayer_server_check_belfry_movement,
multiplayer_server_check_polls,
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_multiplayer_server_on_agent_spawn_common", ":agent_no"),
]),
(ti_server_player_joined, 0, 0, [],
[
(store_trigger_param_1, ":player_no"),
(call_script, "script_multiplayer_server_player_joined_common", ":player_no"),
]),
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch),
(call_script, "script_multiplayer_server_before_mission_start_common"),
(multiplayer_make_everyone_enemy),
(call_script, "script_multiplayer_init_mission_variables"),
(call_script, "script_multiplayer_remove_destroy_mod_targets"),
(call_script, "script_multiplayer_remove_headquarters_flags"), # close this line and open map in deathmatch mod and use all ladders firstly
]), # to be able to edit maps without damaging any headquarters flags ext.
(ti_after_mission_start, 0, 0, [],
[
(set_spawn_effector_scene_prop_kind, 0, -1), #during this mission, agents of "team 0" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(set_spawn_effector_scene_prop_kind, 1, -1), #during this mission, agents of "team 1" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(call_script, "script_initialize_all_scene_prop_slots"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
(assign, "$g_multiplayer_ready_for_spawning_agent", 1),
]),
(ti_on_multiplayer_mission_end, 0, 0, [],
[
#ELITE_WARRIOR achievement
(try_begin),
(multiplayer_get_my_player, ":my_player_no"),
(is_between, ":my_player_no", 0, multiplayer_max_possible_player_id),
(player_get_team_no, ":my_player_team", ":my_player_no"),
(lt, ":my_player_team", multi_team_spectator),
(player_get_kill_count, ":kill_count", ":my_player_no"),
(player_get_death_count, ":death_count", ":my_player_no"),
(store_mul, ":my_score_plus_death", ":kill_count", 1000),
(val_sub, ":my_score_plus_death", ":death_count"),
(assign, ":continue", 1),
(get_max_players, ":num_players"),
(assign, ":end_cond", ":num_players"),
(try_for_range, ":player_no", 0, ":end_cond"),
(player_is_active, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(this_or_next|eq, ":player_team", 0),
(eq, ":player_team", 1),
(player_get_kill_count, ":kill_count", ":player_no"),
(player_get_death_count, ":death_count", ":player_no"), #get_death_count
(store_mul, ":player_score_plus_death", ":kill_count", 1000),
(val_sub, ":player_score_plus_death", ":death_count"),
(gt, ":player_score_plus_death", ":my_score_plus_death"),
(assign, ":continue", 0),
(assign, ":end_cond", 0), #break
(try_end),
(eq, ":continue", 1),
(unlock_achievement, ACHIEVEMENT_ELITE_WARRIOR),
(try_end),
#ELITE_WARRIOR achievement end
(call_script, "script_multiplayer_event_mission_end"),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(start_presentation, "prsnt_multiplayer_stats_chart_deathmatch"),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(call_script, "script_multiplayer_server_on_agent_killed_or_wounded_common", ":dead_agent_no", ":killer_agent_no"),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neg|player_is_busy_with_menus, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"), #if player is currently spectator do not spawn his agent
(lt, ":player_team", multi_team_spectator),
(player_get_troop_id, ":player_troop", ":player_no"), #if troop is not selected do not spawn his agent
(ge, ":player_troop", 0),
(player_get_agent_id, ":player_agent", ":player_no"),
(assign, ":spawn_new", 0),
(try_begin),
(player_get_slot, ":player_first_spawn", ":player_no", slot_player_first_spawn),
(eq, ":player_first_spawn", 1),
(assign, ":spawn_new", 1),
(player_set_slot, ":player_no", slot_player_first_spawn, 0),
(else_try),
(try_begin),
(lt, ":player_agent", 0),
(assign, ":spawn_new", 1),
(else_try),
(neg|agent_is_alive, ":player_agent"),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":player_agent"),
(gt, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":spawn_new", 1),
(try_end),
(try_end),
(eq, ":spawn_new", 1),
(call_script, "script_multiplayer_buy_agent_equipment", ":player_no"),
(troop_get_inventory_slot, ":has_item", ":player_troop", ek_horse),
(try_begin),
(ge, ":has_item", 0),
(assign, ":is_horseman", 1),
(else_try),
(assign, ":is_horseman", 0),
(try_end),
(call_script, "script_multiplayer_find_spawn_point", ":player_team", 0, ":is_horseman"),
(player_spawn_new_agent, ":player_no", reg0),
(try_end),
]),
(1, 0, 0, [], #do this in every new frame, but not at the same time
[
(multiplayer_is_server),
(store_mission_timer_a, ":mission_timer"),
(ge, ":mission_timer", 2),
(assign, ":team_1_count", 0),
(assign, ":team_2_count", 0),
(try_for_agents, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(assign, ":will_be_counted", 0),
(try_begin),
(agent_is_alive, ":cur_agent"),
(assign, ":will_be_counted", 1), #alive so will be counted
(else_try),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":cur_agent"),
(le, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":will_be_counted", 1),
(try_end),
(eq, ":will_be_counted", 1),
(agent_get_team, ":cur_team", ":cur_agent"),
(try_begin),
(eq, ":cur_team", 0),
(val_add, ":team_1_count", 1),
(else_try),
(eq, ":cur_team", 1),
(val_add, ":team_2_count", 1),
(try_end),
(try_end),
(store_sub, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1", ":team_1_count"),
(store_sub, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2", ":team_2_count"),
(val_max, "$g_multiplayer_num_bots_required_team_1", 0),
(val_max, "$g_multiplayer_num_bots_required_team_2", 0),
]),
(0, 0, 0, [],
[
(multiplayer_is_server),
(eq, "$g_multiplayer_ready_for_spawning_agent", 1),
(store_add, ":total_req", "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_required_team_2"),
(try_begin),
(gt, ":total_req", 0),
(store_random_in_range, ":random_req", 0, ":total_req"),
(val_sub, ":random_req", "$g_multiplayer_num_bots_required_team_1"),
(try_begin),
(lt, ":random_req", 0),
#add to team 1
(assign, ":selected_team", 0),
(val_sub, "$g_multiplayer_num_bots_required_team_1", 1),
(else_try),
#add to team 2
(assign, ":selected_team", 1),
(val_sub, "$g_multiplayer_num_bots_required_team_2", 1),
(try_end),
(team_get_faction, ":team_faction_no", ":selected_team"),
(assign, ":available_troops_in_faction", 0),
(try_for_range, ":troop_no", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
(store_troop_faction, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", ":team_faction_no"),
(val_add, ":available_troops_in_faction", 1),
(try_end),
(store_random_in_range, ":random_troop_index", 0, ":available_troops_in_faction"),
(assign, ":end_cond", multiplayer_ai_troops_end),
(try_for_range, ":troop_no", multiplayer_ai_troops_begin, ":end_cond"),
(store_troop_faction, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", ":team_faction_no"),
(val_sub, ":random_troop_index", 1),
(lt, ":random_troop_index", 0),
(assign, ":end_cond", 0),
(assign, ":selected_troop", ":troop_no"),
(try_end),
(troop_get_inventory_slot, ":has_item", ":selected_troop", ek_horse),
(try_begin),
(ge, ":has_item", 0),
(assign, ":is_horseman", 1),
(else_try),
(assign, ":is_horseman", 0),
(try_end),
(call_script, "script_multiplayer_find_spawn_point", ":selected_team", 0, ":is_horseman"),
(store_current_scene, ":cur_scene"),
(modify_visitors_at_site, ":cur_scene"),
(add_visitors_to_current_scene, reg0, ":selected_troop", 1, ":selected_team", -1),
(assign, "$g_multiplayer_ready_for_spawning_agent", 0),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
#checking for restarting the map
(assign, ":end_map", 0),
(try_begin),
(store_mission_timer_a, ":mission_timer"),
(store_mul, ":game_max_seconds", "$g_multiplayer_game_max_minutes", 60),
(gt, ":mission_timer", ":game_max_seconds"),
(assign, ":end_map", 1),
(try_end),
(try_begin),
(eq, ":end_map", 1),
(call_script, "script_game_multiplayer_get_game_type_mission_template", "$g_multiplayer_game_type"),
(start_multiplayer_mission, reg0, "$g_multiplayer_selected_map", 0),
(call_script, "script_game_set_multiplayer_mission_end"),
(try_end),
]),
(ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_multiplayer_mission_end_screen", 0),
(assign, "$g_multiplayer_stats_chart_opened_manually", 1),
(start_presentation, "prsnt_multiplayer_stats_chart_deathmatch"),
(try_end),
]),
multiplayer_once_at_the_first_frame,
(ti_escape_pressed, 0, 0, [],
[
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_stats_chart_deathmatch"),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(start_presentation, "prsnt_multiplayer_escape_menu"),
]),
],
),
(
"multiplayer_tdm",mtf_battle_mode,-1, #team_deathmatch mode
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(34,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(35,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(36,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(42,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(43,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(48,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(49,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(50,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(51,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(52,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(53,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(54,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(55,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(56,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(57,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(58,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(59,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(60,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(61,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(62,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(63,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
common_battle_init_banner,
multiplayer_server_check_polls,
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_multiplayer_server_on_agent_spawn_common", ":agent_no"),
]),
(ti_server_player_joined, 0, 0, [],
[
(store_trigger_param_1, ":player_no"),
(call_script, "script_multiplayer_server_player_joined_common", ":player_no"),
]),
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_multiplayer_game_type", multiplayer_game_type_team_deathmatch),
(call_script, "script_multiplayer_server_before_mission_start_common"),
(call_script, "script_multiplayer_init_mission_variables"),
(call_script, "script_multiplayer_remove_destroy_mod_targets"),
(call_script, "script_multiplayer_remove_headquarters_flags"),
]),
(ti_after_mission_start, 0, 0, [],
[
(set_spawn_effector_scene_prop_kind, 0, -1), #during this mission, agents of "team 0" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(set_spawn_effector_scene_prop_kind, 1, -1), #during this mission, agents of "team 1" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(call_script, "script_initialize_all_scene_prop_slots"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
(assign, "$g_multiplayer_ready_for_spawning_agent", 1),
]),
(ti_on_multiplayer_mission_end, 0, 0, [],
[
#GLORIOUS_MOTHER_FACTION achievement
(try_begin),
(multiplayer_get_my_player, ":my_player_no"),
(is_between, ":my_player_no", 0, multiplayer_max_possible_player_id),
(player_get_team_no, ":my_player_team", ":my_player_no"),
(lt, ":my_player_team", multi_team_spectator),
(team_get_score, ":team_1_score", 0),
(team_get_score, ":team_2_score", 1),
(assign, ":continue", 0),
(try_begin),
(eq, ":my_player_team", 0),
(gt, ":team_1_score", ":team_2_score"),
(assign, ":continue", 1),
(else_try),
(eq, ":my_player_team", 1),
(gt, ":team_2_score", ":team_1_score"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(unlock_achievement, ACHIEVEMENT_GLORIOUS_MOTHER_FACTION),
(try_end),
#GLORIOUS_MOTHER_FACTION achievement end
(call_script, "script_multiplayer_event_mission_end"),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(start_presentation, "prsnt_multiplayer_stats_chart"),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(call_script, "script_multiplayer_server_on_agent_killed_or_wounded_common", ":dead_agent_no", ":killer_agent_no"),
#adding 1 score points to killer agent's team. (special for "headquarters" and "team deathmatch" mod)
(try_begin),
(ge, ":killer_agent_no", 0),
(agent_is_human, ":dead_agent_no"),
(agent_is_human, ":killer_agent_no"),
(agent_get_team, ":killer_agent_team", ":killer_agent_no"),
(le, ":killer_agent_team", 1), #0 or 1 is ok
(agent_get_team, ":dead_agent_team", ":dead_agent_no"),
(neq, ":killer_agent_team", ":dead_agent_team"),
(team_get_score, ":team_score", ":killer_agent_team"),
(val_add, ":team_score", 1),
(team_set_score, ":killer_agent_team", ":team_score"),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neg|player_is_busy_with_menus, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"), #if player is currently spectator do not spawn his agent
(lt, ":player_team", multi_team_spectator),
(player_get_troop_id, ":player_troop", ":player_no"), #if troop is not selected do not spawn his agent
(ge, ":player_troop", 0),
(player_get_agent_id, ":player_agent", ":player_no"),
(assign, ":spawn_new", 0),
(try_begin),
(player_get_slot, ":player_first_spawn", ":player_no", slot_player_first_spawn),
(eq, ":player_first_spawn", 1),
(assign, ":spawn_new", 1),
(player_set_slot, ":player_no", slot_player_first_spawn, 0),
(else_try),
(try_begin),
(lt, ":player_agent", 0),
(assign, ":spawn_new", 1),
(else_try),
(neg|agent_is_alive, ":player_agent"),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":player_agent"),
(gt, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":spawn_new", 1),
(try_end),
(try_end),
(eq, ":spawn_new", 1),
(call_script, "script_multiplayer_buy_agent_equipment", ":player_no"),
(troop_get_inventory_slot, ":has_item", ":player_troop", ek_horse),
(try_begin),
(ge, ":has_item", 0),
(assign, ":is_horseman", 1),
(else_try),
(assign, ":is_horseman", 0),
(try_end),
(call_script, "script_multiplayer_find_spawn_point", ":player_team", 1, ":is_horseman"),
(player_spawn_new_agent, ":player_no", reg0),
(try_end),
]),
(1, 0, 0, [], #do this in every new frame, but not at the same time
[
(multiplayer_is_server),
(store_mission_timer_a, ":mission_timer"),
(ge, ":mission_timer", 2),
(assign, ":team_1_count", 0),
(assign, ":team_2_count", 0),
(try_for_agents, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(assign, ":will_be_counted", 0),
(try_begin),
(agent_is_alive, ":cur_agent"),
(assign, ":will_be_counted", 1), #alive so will be counted
(else_try),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":cur_agent"),
(le, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":will_be_counted", 1),
(try_end),
(eq, ":will_be_counted", 1),
(agent_get_team, ":cur_team", ":cur_agent"),
(try_begin),
(eq, ":cur_team", 0),
(val_add, ":team_1_count", 1),
(else_try),
(eq, ":cur_team", 1),
(val_add, ":team_2_count", 1),
(try_end),
(try_end),
(store_sub, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1", ":team_1_count"),
(store_sub, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2", ":team_2_count"),
(val_max, "$g_multiplayer_num_bots_required_team_1", 0),
(val_max, "$g_multiplayer_num_bots_required_team_2", 0),
]),
multiplayer_server_spawn_bots,
multiplayer_server_manage_bots,
(20, 0, 0, [],
[
(multiplayer_is_server),
#auto team balance control in every 20 seconds (tdm)
(call_script, "script_check_team_balance"),
]),
multiplayer_server_check_end_map,
(ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_multiplayer_mission_end_screen", 0),
(assign, "$g_multiplayer_stats_chart_opened_manually", 1),
(start_presentation, "prsnt_multiplayer_stats_chart"),
(try_end),
]),
multiplayer_once_at_the_first_frame,
multiplayer_battle_window_opened,
(ti_escape_pressed, 0, 0, [],
[
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_stats_chart"),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(start_presentation, "prsnt_multiplayer_escape_menu"),
]),
],
),
(
"multiplayer_hq", mtf_battle_mode,-1, #headquarters mode
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(34,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(35,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(36,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(42,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(43,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(48,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(49,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(50,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(51,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(52,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(53,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(54,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(55,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(56,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(57,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(58,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(59,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(60,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(61,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(62,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(63,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
common_battle_init_banner,
multiplayer_server_check_polls,
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_multiplayer_server_on_agent_spawn_common", ":agent_no"),
]),
(ti_server_player_joined, 0, 0, [],
[
(store_trigger_param_1, ":player_no"),
(call_script, "script_multiplayer_server_player_joined_common", ":player_no"),
]),
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(call_script, "script_multiplayer_server_before_mission_start_common"),
(store_mul, ":initial_hq_score", "$g_multiplayer_game_max_points", 10000),
(assign, "$g_score_team_1", ":initial_hq_score"),
(assign, "$g_score_team_2", ":initial_hq_score"),
(try_for_range, ":cur_flag_slot", multi_data_flag_owner_begin, multi_data_flag_owner_end),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_slot", -1),
(try_end),
(try_begin),
(multiplayer_is_server),
(try_for_range, ":cur_flag_slot", multi_data_flag_pull_code_begin, multi_data_flag_pull_code_end),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_slot", -1),
(try_end),
(try_end),
(call_script, "script_multiplayer_init_mission_variables"),
(call_script, "script_multiplayer_remove_destroy_mod_targets"),
(try_begin),
(multiplayer_is_server),
(team_set_score, 0, "$g_multiplayer_game_max_points"),
(team_set_score, 1, "$g_multiplayer_game_max_points"),
(try_end),
]),
(ti_after_mission_start, 0, 0, [],
[
(call_script, "script_determine_team_flags", 0),
(call_script, "script_determine_team_flags", 1),
(set_spawn_effector_scene_prop_kind, 0, "$team_1_flag_scene_prop"), #during this mission, agents of "team 0" will try to spawn around scene props with kind equal to $team_1_flag_scene_prop
(set_spawn_effector_scene_prop_kind, 1, "$team_2_flag_scene_prop"), #during this mission, agents of "team 1" will try to spawn around scene props with kind equal to $team_2_flag_scene_prop
(try_begin),
(multiplayer_is_server),
(assign, "$g_multiplayer_ready_for_spawning_agent", 1),
(assign, "$g_number_of_flags", 0),
#place base flags
(entry_point_get_position, pos1, multi_base_point_team_1),
(entry_point_get_position, pos3, multi_base_point_team_1),
(set_spawn_position, pos3),
(spawn_scene_prop, "spr_headquarters_pole_code_only", 0),
(set_spawn_position, pos3),
(spawn_scene_prop, "$team_1_flag_scene_prop", 0),
(set_spawn_position, pos3),
(spawn_scene_prop, "$team_2_flag_scene_prop", 0),
(set_spawn_position, pos3),
(spawn_scene_prop, "spr_headquarters_flag_gray_code_only", 0),
(store_add, ":cur_flag_slot", multi_data_flag_owner_begin, "$g_number_of_flags"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_slot", 1),
(val_add, "$g_number_of_flags", 1),
(entry_point_get_position, pos2, multi_base_point_team_2),
(entry_point_get_position, pos3, multi_base_point_team_2),
(set_spawn_position, pos3),
(spawn_scene_prop, "spr_headquarters_pole_code_only", 0),
(set_spawn_position, pos3),
(spawn_scene_prop, "$team_1_flag_scene_prop", 0),
(set_spawn_position, pos3),
(spawn_scene_prop, "$team_2_flag_scene_prop", 0),
(set_spawn_position, pos3),
(spawn_scene_prop, "spr_headquarters_flag_gray_code_only", 0),
(store_add, ":cur_flag_slot", multi_data_flag_owner_begin, "$g_number_of_flags"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_slot", 2),
(val_add, "$g_number_of_flags", 1),
(scene_prop_get_num_instances, ":num_instances_of_red_headquarters_flag", "spr_headquarters_flag_red"),
(scene_prop_get_num_instances, ":num_instances_of_blue_headquarters_flag", "spr_headquarters_flag_blue"),
(scene_prop_get_num_instances, ":num_instances_of_gray_headquarters_flag", "spr_headquarters_flag_gray"),
(store_add, ":end_cond", "spr_headquarters_flag_gray", 1),
(try_for_range, ":headquarters_flag_no", "spr_headquarters_flag_red", ":end_cond"),
(try_begin),
(eq, ":headquarters_flag_no", "spr_headquarters_flag_red"),
(assign, ":num_instances_of_headquarters_flag", ":num_instances_of_red_headquarters_flag"),
(else_try),
(eq, ":headquarters_flag_no", "spr_headquarters_flag_blue"),
(assign, ":num_instances_of_headquarters_flag", ":num_instances_of_blue_headquarters_flag"),
(else_try),
(eq, ":headquarters_flag_no", "spr_headquarters_flag_gray"),
(assign, ":num_instances_of_headquarters_flag", ":num_instances_of_gray_headquarters_flag"),
(try_end),
(gt, ":num_instances_of_headquarters_flag", 0),
(try_for_range, ":instance_no", 0, ":num_instances_of_headquarters_flag"),
(scene_prop_get_instance, ":flag_id", ":headquarters_flag_no", ":instance_no"),
(prop_instance_get_position, pos0, ":flag_id"),
(set_spawn_position, pos0),
(spawn_scene_prop, "spr_headquarters_pole_code_only", 0),
#place other flags
(try_for_range, ":headquarters_flag_no_will_be_added", "spr_headquarters_flag_red", ":end_cond"),
(set_spawn_position, pos0),
(try_begin),
(eq, ":headquarters_flag_no_will_be_added", "spr_headquarters_flag_red"),
(spawn_scene_prop, "$team_1_flag_scene_prop"),
(else_try),
(eq, ":headquarters_flag_no_will_be_added", "spr_headquarters_flag_blue"),
(spawn_scene_prop, "$team_2_flag_scene_prop"),
(else_try),
(eq, ":headquarters_flag_no_will_be_added", "spr_headquarters_flag_gray"),
(spawn_scene_prop, "spr_headquarters_flag_gray_code_only"),
(try_end),
(try_end),
#assign who owns this flag values
(store_add, ":cur_flag_slot", multi_data_flag_owner_begin, "$g_number_of_flags"),
(try_begin),
(eq, ":headquarters_flag_no", "spr_headquarters_flag_red"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_slot", 1),
(else_try),
(eq, ":headquarters_flag_no", "spr_headquarters_flag_blue"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_slot", 2),
(else_try),
(eq, ":headquarters_flag_no", "spr_headquarters_flag_gray"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_slot", 0),
(try_end),
(val_add, "$g_number_of_flags", 1),
(try_end),
(try_end),
(assign, "$g_number_of_initial_team_1_flags", 0),
(assign, "$g_number_of_initial_team_2_flags", 0),
(try_for_range, ":place_no", 0, "$g_number_of_flags"),
(store_add, ":cur_flag_slot", multi_data_flag_owner_begin, ":place_no"),
(troop_get_slot, ":current_owner", "trp_multiplayer_data", ":cur_flag_slot"),
(try_begin),
(eq, ":place_no", 0),
(entry_point_get_position, pos0, multi_base_point_team_1),
(scene_prop_get_instance, ":flag_id", "$team_1_flag_scene_prop", ":place_no"),
(assign, "$g_base_flag_team_1", ":flag_id"),
(else_try),
(eq, ":place_no", 1),
(entry_point_get_position, pos0, multi_base_point_team_2),
(scene_prop_get_instance, ":flag_id", "$team_2_flag_scene_prop", ":place_no"),
(assign, "$g_base_flag_team_2", ":flag_id"),
(else_try),
(assign, ":flag_start_red", 2),
(scene_prop_get_num_instances, ":num_initial_red_flags", "spr_headquarters_flag_red"),
(store_add, ":flag_start_blue", ":flag_start_red", ":num_initial_red_flags"),
(scene_prop_get_num_instances, ":num_initial_blue_flags", "spr_headquarters_flag_blue"),
(store_add, ":flag_start_gray", ":flag_start_blue", ":num_initial_blue_flags"),
(scene_prop_get_num_instances, ":num_initial_gray_flags", "spr_headquarters_flag_gray"),
(try_begin),
(ge, ":place_no", ":flag_start_red"),
(gt, ":num_initial_red_flags", 0),
(store_sub, ":flag_no", ":place_no", ":flag_start_red"),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_red", ":flag_no"),
(else_try),
(ge, ":place_no", ":flag_start_blue"),
(gt, ":num_initial_blue_flags", 0),
(store_sub, ":flag_no", ":place_no", ":flag_start_blue"),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_blue", ":flag_no"),
(else_try),
(ge, ":place_no", ":flag_start_gray"),
(gt, ":num_initial_gray_flags", 0),
(store_sub, ":flag_no", ":place_no", ":flag_start_gray"),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_gray", ":flag_no"),
(try_end),
(prop_instance_get_position, pos0, ":flag_id"),
(try_end),
(scene_prop_get_instance, ":pole_id", "spr_headquarters_pole_code_only", ":place_no"),
(prop_instance_set_position, ":pole_id", pos0),
(position_move_z, pos0, multi_headquarters_pole_height),
(try_begin),
(eq, ":current_owner", 0),
(scene_prop_get_instance, ":flag_id", "$team_1_flag_scene_prop", ":place_no"),
(prop_instance_set_position, ":flag_id", pos0),
(scene_prop_set_visibility, ":flag_id", 0),
(scene_prop_get_instance, ":flag_id", "$team_2_flag_scene_prop", ":place_no"),
(prop_instance_set_position, ":flag_id", pos0),
(scene_prop_set_visibility, ":flag_id", 0),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_gray_code_only", ":place_no"),
(prop_instance_set_position, ":flag_id", pos0),
(scene_prop_set_visibility, ":flag_id", 1),
(else_try),
(eq, ":current_owner", 1),
(scene_prop_get_instance, ":flag_id", "$team_1_flag_scene_prop", ":place_no"),
(prop_instance_set_position, ":flag_id", pos0),
(scene_prop_set_visibility, ":flag_id", 1),
(scene_prop_get_instance, ":flag_id", "$team_2_flag_scene_prop", ":place_no"),
(prop_instance_set_position, ":flag_id", pos0),
(scene_prop_set_visibility, ":flag_id", 0),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_gray_code_only", ":place_no"),
(prop_instance_set_position, ":flag_id", pos0),
(scene_prop_set_visibility, ":flag_id", 0),
(val_add, "$g_number_of_initial_team_1_flags", 1),
(else_try),
(scene_prop_get_instance, ":flag_id", "$team_1_flag_scene_prop", ":place_no"),
(prop_instance_set_position, ":flag_id", pos0),
(scene_prop_set_visibility, ":flag_id", 0),
(scene_prop_get_instance, ":flag_id", "$team_2_flag_scene_prop", ":place_no"),
(prop_instance_set_position, ":flag_id", pos0),
(scene_prop_set_visibility, ":flag_id", 1),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_gray_code_only", ":place_no"),
(prop_instance_set_position, ":flag_id", pos0),
(scene_prop_set_visibility, ":flag_id", 0),
(val_add, "$g_number_of_initial_team_2_flags", 1),
(try_end),
(try_end),
(else_try),
#these three lines both used in calculation of $g_number_of_flags and below part removing of initially placed flags
(scene_prop_get_num_instances, ":num_instances_of_red_headquarters_flag", "spr_headquarters_flag_red"),
(scene_prop_get_num_instances, ":num_instances_of_blue_headquarters_flag", "spr_headquarters_flag_blue"),
(scene_prop_get_num_instances, ":num_instances_of_gray_headquarters_flag", "spr_headquarters_flag_gray"),
(assign, "$g_number_of_flags", 2),
(val_add, "$g_number_of_flags", ":num_instances_of_red_headquarters_flag"),
(val_add, "$g_number_of_flags", ":num_instances_of_blue_headquarters_flag"),
(val_add, "$g_number_of_flags", ":num_instances_of_gray_headquarters_flag"),
(try_end),
#remove initially placed flags
(try_for_range, ":flag_no", 0, ":num_instances_of_red_headquarters_flag"),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_red", ":flag_no"),
(scene_prop_set_visibility, ":flag_id", 0),
(try_end),
(try_for_range, ":flag_no", 0, ":num_instances_of_blue_headquarters_flag"),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_blue", ":flag_no"),
(scene_prop_set_visibility, ":flag_id", 0),
(try_end),
(try_for_range, ":flag_no", 0, ":num_instances_of_gray_headquarters_flag"),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_gray", ":flag_no"),
(scene_prop_set_visibility, ":flag_id", 0),
(try_end),
(try_for_range, ":flag_no", 0, "$g_number_of_flags"),
(store_add, ":cur_flag_owned_seconds_counts_slot", multi_data_flag_owned_seconds_begin, ":flag_no"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_owned_seconds_counts_slot", 0),
(try_end),
(call_script, "script_initialize_all_scene_prop_slots"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
]),
(ti_on_multiplayer_mission_end, 0, 0, [],
[
#RUIN_THE_RAID achievement
(try_begin),
(multiplayer_get_my_player, ":my_player_no"),
(is_between, ":my_player_no", 0, multiplayer_max_possible_player_id),
(player_get_team_no, ":my_player_team", ":my_player_no"),
(lt, ":my_player_team", multi_team_spectator),
(call_script, "script_get_headquarters_scores"),
(assign, ":team_1_num_flags", reg0),
(assign, ":team_2_num_flags", reg1),
(assign, ":continue", 0),
(try_begin),
(eq, ":my_player_team", 0),
(gt, ":team_1_num_flags", ":team_2_num_flags"),
(assign, ":continue", 1),
(else_try),
(eq, ":my_player_team", 1),
(gt, ":team_2_num_flags", ":team_1_num_flags"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(unlock_achievement, ACHIEVEMENT_RUIN_THE_RAID),
(try_end),
#RUIN_THE_RAID achievement end
(call_script, "script_multiplayer_event_mission_end"),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(start_presentation, "prsnt_multiplayer_stats_chart"),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(call_script, "script_multiplayer_server_on_agent_killed_or_wounded_common", ":dead_agent_no", ":killer_agent_no"),
#adding 1 score points to killer agent's team. (special for "headquarters" and "team deathmatch" mod)
(try_begin),
(multiplayer_is_server),
(ge, ":killer_agent_no", 0),
(agent_is_human, ":dead_agent_no"),
(agent_is_human, ":killer_agent_no"),
(agent_get_team, ":killer_agent_team", ":killer_agent_no"),
(le, ":killer_agent_team", 1), #0 or 1 is ok
(agent_get_team, ":dead_agent_team", ":dead_agent_no"),
(neq, ":killer_agent_team", ":dead_agent_team"),
(team_get_score, ":team_score", ":dead_agent_team"),
(try_begin),
(eq, ":killer_agent_team", 0),
(val_add, "$g_score_team_2", -10000), #if someone died from "team 2" then "team 2" loses 1 score point
(else_try),
(val_add, "$g_score_team_1", -10000), #if someone died from "team 1" then "team 1" loses 1 score point
(try_end),
(val_sub, ":team_score", 1),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", ":dead_agent_team", ":team_score"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, ":dead_agent_team", ":team_score"),
(try_end),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
#trigger for (a) counting seconds of flags being owned by their owners & (b) to calculate seconds past after that flag's pull message has shown
(try_for_range, ":flag_no", 0, "$g_number_of_flags"),
#part a: counting seconds of flags being owned by their owners
(store_add, ":cur_flag_owned_seconds_counts_slot", multi_data_flag_owned_seconds_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_owned_seconds", "trp_multiplayer_data", ":cur_flag_owned_seconds_counts_slot"),
(val_add, ":cur_flag_owned_seconds", 1),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_owned_seconds_counts_slot", ":cur_flag_owned_seconds"),
#part b: to calculate seconds past after that flag's pull message has shown
(store_add, ":cur_flag_pull_code_slot", multi_data_flag_pull_code_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_pull_code", "trp_multiplayer_data", ":cur_flag_pull_code_slot"),
(store_mod, ":cur_flag_pull_message_seconds_past", ":cur_flag_pull_code", 100),
(try_begin),
(ge, ":cur_flag_pull_code", 100),
(lt, ":cur_flag_pull_message_seconds_past", 25),
(val_add, ":cur_flag_pull_code", 1),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_pull_code_slot", ":cur_flag_pull_code"),
(try_end),
(try_end),
]),
(0, 0, 0, [], #if this trigger takes lots of time in the future and make server machine runs headqurters mod
#very slow with lots of players make period of this trigger 1 seconds, but best is 0. Currently
#we are testing this mod with few players and no speed program occured.
[
(multiplayer_is_server),
#main trigger which controls which agent is moving/near which flag.
(try_for_range, ":flag_no", 0, "$g_number_of_flags"),
(store_add, ":cur_flag_owner_counts_slot", multi_data_flag_players_around_begin, ":flag_no"),
(troop_get_slot, ":current_owner_code", "trp_multiplayer_data", ":cur_flag_owner_counts_slot"),
(store_div, ":old_team_1_agent_count", ":current_owner_code", 100),
(store_mod, ":old_team_2_agent_count", ":current_owner_code", 100),
(assign, ":number_of_agents_around_flag_team_1", 0),
(assign, ":number_of_agents_around_flag_team_2", 0),
(scene_prop_get_instance, ":pole_id", "spr_headquarters_pole_code_only", ":flag_no"),
(prop_instance_get_position, pos0, ":pole_id"), #pos0 holds pole position.
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_agent_id, ":cur_agent", ":player_no"),
(ge, ":cur_agent", 0),
(agent_is_alive, ":cur_agent"),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(agent_get_position, pos1, ":cur_agent"), #pos1 holds agent's position.
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(get_sq_distance_between_position_heights, ":squared_height_dist", pos0, pos1),
(val_add, ":squared_dist", ":squared_height_dist"),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin),
(eq, ":cur_agent_team", 0),
(val_add, ":number_of_agents_around_flag_team_1", 1),
(else_try),
(eq, ":cur_agent_team", 1),
(val_add, ":number_of_agents_around_flag_team_2", 1),
(try_end),
(try_end),
(try_begin),
(this_or_next|neq, ":old_team_1_agent_count", ":number_of_agents_around_flag_team_1"),
(neq, ":old_team_2_agent_count", ":number_of_agents_around_flag_team_2"),
(store_add, ":cur_flag_owner_slot", multi_data_flag_owner_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_owner", "trp_multiplayer_data", ":cur_flag_owner_slot"),
(store_add, ":cur_flag_pull_code_slot", multi_data_flag_pull_code_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_pull_code", "trp_multiplayer_data", ":cur_flag_pull_code_slot"),
(store_mod, ":cur_flag_pull_message_seconds_past", ":cur_flag_pull_code", 100),
(store_div, ":cur_flag_puller_team_last", ":cur_flag_pull_code", 100),
(try_begin),
(assign, ":continue", 0),
(try_begin),
(neq, ":cur_flag_owner", 1),
(eq, ":old_team_1_agent_count", 0),
(gt, ":number_of_agents_around_flag_team_1", 0),
(eq, ":number_of_agents_around_flag_team_2", 0),
(assign, ":puller_team", 1),
(assign, ":continue", 1),
(else_try),
(neq, ":cur_flag_owner", 2),
(eq, ":old_team_2_agent_count", 0),
(eq, ":number_of_agents_around_flag_team_1", 0),
(gt, ":number_of_agents_around_flag_team_2", 0),
(assign, ":puller_team", 2),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(store_mul, ":puller_team_multiplied_by_100", ":puller_team", 100),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_pull_code_slot", ":puller_team_multiplied_by_100"),
(this_or_next|neq, ":cur_flag_puller_team_last", ":puller_team"),
(ge, ":cur_flag_pull_message_seconds_past", 25),
(store_mul, ":flag_code", ":puller_team", 100),
(val_add, ":flag_code", ":flag_no"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_flag_is_pulling, ":flag_code"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_flag_is_pulling, ":flag_code"),
(try_end),
(try_end),
(try_begin),
(store_mul, ":current_owner_code", ":number_of_agents_around_flag_team_1", 100),
(val_add, ":current_owner_code", ":number_of_agents_around_flag_team_2"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_owner_counts_slot", ":current_owner_code"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_num_agents_around_flag", ":flag_no", ":current_owner_code"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_num_agents_around_flag, ":flag_no", ":current_owner_code"),
(try_end),
(try_end),
(try_end),
(try_end),
(try_for_range, ":flag_no", 0, "$g_number_of_flags"),
(assign, ":new_flag_owner", -1),
(scene_prop_get_instance, ":pole_id", "spr_headquarters_pole_code_only", ":flag_no"),
(prop_instance_get_position, pos0, ":pole_id"), #pos0 holds pole position.
(store_add, ":cur_flag_owner_slot", multi_data_flag_owner_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_owner", "trp_multiplayer_data", ":cur_flag_owner_slot"),
(try_begin),
(try_begin),
(scene_prop_get_instance, ":flag_id", "$team_1_flag_scene_prop", ":flag_no"),
(scene_prop_get_visibility, ":flag_visibility", ":flag_id"),
(assign, ":cur_shown_flag", 1),
(eq, ":flag_visibility", 0),
(scene_prop_get_instance, ":flag_id", "$team_2_flag_scene_prop", ":flag_no"),
(scene_prop_get_visibility, ":flag_visibility", ":flag_id"),
(assign, ":cur_shown_flag", 2),
(eq, ":flag_visibility", 0),
(scene_prop_get_instance, ":flag_id", "spr_headquarters_flag_gray_code_only", ":flag_no"),
(scene_prop_get_visibility, ":flag_visibility", ":flag_id"),
(assign, ":cur_shown_flag", 0),
(try_end),
#flag_id holds shown flag after this point
(prop_instance_get_position, pos1, ":flag_id"), #pos1 holds gray/red/blue (current shown) flag position.
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(lt, ":squared_dist", multi_headquarters_distance_sq_to_change_flag), #if distance is less than 2 meters
(store_add, ":cur_flag_players_around_slot", multi_data_flag_players_around_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_players_around", "trp_multiplayer_data", ":cur_flag_players_around_slot"),
(store_div, ":number_of_agents_around_flag_team_1", ":cur_flag_players_around", 100),
(store_mod, ":number_of_agents_around_flag_team_2", ":cur_flag_players_around", 100),
(try_begin),
(gt, ":number_of_agents_around_flag_team_1", 0),
(eq, ":number_of_agents_around_flag_team_2", 0),
(assign, ":new_flag_owner", 0),
(assign, ":new_shown_flag", 1),
(else_try),
(eq, ":number_of_agents_around_flag_team_1", 0),
(gt, ":number_of_agents_around_flag_team_2", 0),
(assign, ":new_flag_owner", 0),
(assign, ":new_shown_flag", 2),
(else_try),
(eq, ":number_of_agents_around_flag_team_1", 0),
(eq, ":number_of_agents_around_flag_team_2", 0),
(neq, ":cur_shown_flag", 0),
(assign, ":new_flag_owner", 0),
(assign, ":new_shown_flag", 0),
(try_end),
(else_try),
(neq, ":cur_flag_owner", ":cur_shown_flag"),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(ge, ":squared_dist", multi_headquarters_distance_sq_to_set_flag), #if distance is more equal than 9 meters
(store_add, ":cur_flag_players_around_slot", multi_data_flag_players_around_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_players_around", "trp_multiplayer_data", ":cur_flag_players_around_slot"),
(store_div, ":number_of_agents_around_flag_team_1", ":cur_flag_players_around", 100),
(store_mod, ":number_of_agents_around_flag_team_2", ":cur_flag_players_around", 100),
(try_begin),
(eq, ":cur_shown_flag", 1),
(assign, ":new_flag_owner", 1),
(assign, ":new_shown_flag", 1),
(else_try),
(eq, ":cur_shown_flag", 2),
(assign, ":new_flag_owner", 2),
(assign, ":new_shown_flag", 2),
(try_end),
(try_end),
(try_end),
(try_begin),
(ge, ":new_flag_owner", 0),
(this_or_next|neq, ":new_flag_owner", ":cur_flag_owner"),
(neq, ":cur_shown_flag", ":new_shown_flag"),
(try_begin),
(neq, ":cur_flag_owner", 0),
(eq, ":new_flag_owner", 0),
(try_begin),
(eq, ":cur_flag_owner", 1),
(assign, ":neutralizer_team", 2),
(else_try),
(eq, ":cur_flag_owner", 2),
(assign, ":neutralizer_team", 1),
(try_end),
(store_mul, ":flag_code", ":neutralizer_team", 100),
(val_add, ":flag_code", ":flag_no"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_flag_neutralized, ":flag_code"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_flag_neutralized, ":flag_code"),
(try_end),
(try_end),
(try_begin),
(neq, ":cur_flag_owner", ":new_flag_owner"),
(neq, ":new_flag_owner", 0),
(store_mul, ":flag_code", ":new_flag_owner", 100),
(val_add, ":flag_code", ":flag_no"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_flag_captured, ":flag_code"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_flag_captured, ":flag_code"),
(try_end),
(try_end),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_num_agents_around_flag", ":flag_no", ":cur_flag_players_around"),
#for only server itself-----------------------------------------------------------------------------------------------
(assign, ":number_of_total_players", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_num_agents_around_flag, ":flag_no", ":cur_flag_players_around"),
(val_add, ":number_of_total_players", 1),
(try_end),
(store_mul, ":owner_code", ":new_flag_owner", 100),
(val_add, ":owner_code", ":new_shown_flag"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_change_flag_owner", ":flag_no", ":owner_code"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_change_flag_owner, ":flag_no", ":owner_code"),
(try_end),
(try_begin),
(neq, ":new_flag_owner", 0),
(try_begin),
(eq, ":new_flag_owner", 1),
(assign, ":number_of_players_around_flag", ":number_of_agents_around_flag_team_1"),
(else_try),
(assign, ":number_of_players_around_flag", ":number_of_agents_around_flag_team_2"),
(try_end),
(store_add, ":cur_flag_owned_seconds_counts_slot", multi_data_flag_owned_seconds_begin, ":flag_no"),
(troop_get_slot, ":current_flag_owned_seconds", "trp_multiplayer_data", ":cur_flag_owned_seconds_counts_slot"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_owned_seconds_counts_slot", 0),
(val_min, ":current_flag_owned_seconds", 360), #360 seconds is max time for hq, this will limit money awarding by (180 x total_number_of_players)
(scene_prop_get_instance, ":flag_of_team_1", "$team_1_flag_scene_prop", ":flag_no"),
(scene_prop_get_instance, ":flag_of_team_2", "$team_2_flag_scene_prop", ":flag_no"),
(try_begin),
(this_or_next|eq, "$g_base_flag_team_1", ":flag_of_team_1"),
(eq, "$g_base_flag_team_2", ":flag_of_team_2"),
(assign, ":flag_value", 2),
(else_try),
(assign, ":flag_value", 1),
(try_end),
(try_begin), #score awarding in flag capturing is changed in hq. If only one player captured flag he get 3 points,
(le, ":number_of_players_around_flag", 1), #if 2 player captured they get 2 points, if <=6 players get flag all get 1 points. There is no importance of flag value at scoring.
(assign, ":score_award_per_player", 3),
(else_try),
(eq, ":number_of_players_around_flag", 2),
(assign, ":score_award_per_player", 2),
(else_try),
(le, ":number_of_players_around_flag", 6),
(assign, ":score_award_per_player", 1),
(else_try),
(assign, ":score_award_per_player", 0),
(try_end),
(store_mul, ":total_money_award", ":current_flag_owned_seconds", ":number_of_total_players"), #total money will be shared after a flag capturing is (0.50 * seconds * number_of_players)
(val_mul, ":total_money_award", ":flag_value"), #example: if 15 players is playing and 120 seconds past before flag captured, award is 900 golds.
(val_div, ":total_money_award", 2),
(try_begin),
(gt, ":number_of_players_around_flag", 0), #if there are still any living agents around flag.
(store_div, ":money_award_per_player", ":total_money_award", ":number_of_players_around_flag"),
(try_end),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_agent_id, ":cur_agent", ":player_no"),
(ge, ":cur_agent", 0),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(val_add, ":cur_agent_team", 1),
(eq, ":cur_agent_team", ":new_flag_owner"),
(agent_get_position, pos1, ":cur_agent"),
(prop_instance_get_position, pos0, ":pole_id"),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(get_sq_distance_between_position_heights, ":squared_height_dist", pos0, pos1),
(val_add, ":squared_dist", ":squared_height_dist"),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(player_get_score, ":player_score", ":player_no"), #give score to player which helped flag to be owned by new_flag_owner team
(val_add, ":player_score", ":score_award_per_player"),
(player_set_score, ":player_no", ":player_score"),
(player_get_gold, ":player_gold", ":player_no"), #give money to player which helped flag to be owned by new_flag_owner team
(val_add, ":player_gold", ":money_award_per_player"),
(player_set_gold, ":player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(try_end),
(try_end),
(try_end),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
#trigger for increasing score in each second.
(assign, ":number_of_team_1_flags", 0),
(assign, ":number_of_team_2_flags", 0),
(assign, ":owned_flag_value", 0),
(assign, ":not_owned_flag_value", 0),
(try_for_range, ":flag_no", 0, "$g_number_of_flags"),
(store_add, ":cur_flag_owner_slot", multi_data_flag_owner_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_owner", "trp_multiplayer_data", ":cur_flag_owner_slot"),
(scene_prop_get_instance, ":flag_of_team_1", "$team_1_flag_scene_prop", ":flag_no"),
(scene_prop_get_instance, ":flag_of_team_2", "$team_2_flag_scene_prop", ":flag_no"),
(try_begin),
(this_or_next|eq, "$g_base_flag_team_1", ":flag_of_team_1"),
(eq, "$g_base_flag_team_2", ":flag_of_team_2"),
(assign, ":flag_value", 2),
(else_try),
(assign, ":flag_value", 1),
(try_end),
(try_begin),
(eq, ":cur_flag_owner", 1),
(val_add, ":number_of_team_1_flags", ":flag_value"),
(val_add, ":owned_flag_value", ":flag_value"),
(else_try),
(eq, ":cur_flag_owner", 2),
(val_add, ":number_of_team_2_flags", ":flag_value"),
(val_add, ":owned_flag_value", ":flag_value"),
(else_try),
(val_add, ":not_owned_flag_value", ":flag_value"),
(try_end),
(try_end),
(store_add, ":all_flag_value", ":owned_flag_value", ":not_owned_flag_value"),
(store_sub, ":cur_flag_difference", ":number_of_team_1_flags", ":number_of_team_2_flags"),
(store_mul, ":cur_flag_difference_mul_2", ":cur_flag_difference", 2),
(store_sub, ":initial_flag_difference", "$g_number_of_initial_team_1_flags", "$g_number_of_initial_team_2_flags"),
(assign, ":number_of_active_players", 0),
(get_max_players, ":end_cond"),
(try_for_range, ":player_no", 0, ":end_cond"),
(player_is_active, ":player_no"),
(val_add, ":number_of_active_players", 1),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(ge, ":cur_flag_difference_mul_2", ":initial_flag_difference"),
(store_sub, ":difference", ":cur_flag_difference_mul_2", ":initial_flag_difference"),
(store_mul, ":score_addition_winner", ":difference", 125),
(val_add, ":score_addition_winner", 500),
(store_div, ":score_addition_loser", 250000, ":score_addition_winner"),
(try_begin), #if number of owned flag values < all flag values give only a percentage of score to teams
(lt, ":owned_flag_value", ":all_flag_value"),
(val_mul, ":score_addition_loser", ":owned_flag_value"),
(val_div, ":score_addition_loser", ":all_flag_value"),
(val_mul, ":score_addition_winner", ":owned_flag_value"),
(val_div, ":score_addition_winner", ":all_flag_value"),
(try_end),
(call_script, "script_find_number_of_agents_constant"),
(val_mul, ":score_addition_winner", reg0),
(val_div, ":score_addition_winner", 100),
(val_mul, ":score_addition_loser", reg0),
(val_div, ":score_addition_loser", 100),
(val_mul, ":score_addition_winner", "$g_multiplayer_point_gained_from_flags"),
(val_div, ":score_addition_winner", 100),
(val_mul, ":score_addition_loser", "$g_multiplayer_point_gained_from_flags"),
(val_div, ":score_addition_loser", 100),
(try_begin),
(ge, ":number_of_active_players", 1),
(val_sub, "$g_score_team_2", ":score_addition_winner"),
(try_begin),
(ge, ":number_of_team_2_flags", 1),
(val_sub, "$g_score_team_1", ":score_addition_loser"),
(else_try),
(val_sub, "$g_score_team_2", ":score_addition_loser"),
(try_end),
(try_end),
(else_try),
(store_sub, ":difference", ":initial_flag_difference", ":cur_flag_difference_mul_2"),
(store_mul, ":score_addition_winner", ":difference", 125),
(val_add, ":score_addition_winner", 500),
(store_div, ":score_addition_loser", 250000, ":score_addition_winner"),
(try_begin), #if number of owned flag values < all flag values give only a percentage of score to teams
(lt, ":owned_flag_value", ":all_flag_value"),
(val_mul, ":score_addition_loser", ":owned_flag_value"),
(val_div, ":score_addition_loser", ":all_flag_value"),
(val_mul, ":score_addition_winner", ":owned_flag_value"),
(val_div, ":score_addition_winner", ":all_flag_value"),
(try_end),
(call_script, "script_find_number_of_agents_constant"),
(val_mul, ":score_addition_winner", reg0),
(val_div, ":score_addition_winner", 100),
(val_mul, ":score_addition_loser", reg0),
(val_div, ":score_addition_loser", 100),
(val_mul, ":score_addition_winner", "$g_multiplayer_point_gained_from_flags"),
(val_div, ":score_addition_winner", 100),
(val_mul, ":score_addition_loser", "$g_multiplayer_point_gained_from_flags"),
(val_div, ":score_addition_loser", 100),
(try_begin),
(ge, ":number_of_active_players", 1),
(try_begin),
(ge, ":number_of_team_1_flags", 1),
(val_sub, "$g_score_team_2", ":score_addition_loser"),
(else_try),
(val_sub, "$g_score_team_1", ":score_addition_loser"),
(try_end),
(val_sub, "$g_score_team_1", ":score_addition_winner"),
(try_end),
(try_end),
(team_get_score, ":team_score_1", 0),
(try_begin),
(store_div, ":team_new_score_1", "$g_score_team_1", 10000),
(neq, ":team_new_score_1", ":team_score_1"),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", 0, ":team_new_score_1"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, 0, ":team_new_score_1"),
(try_end),
(try_end),
(team_get_score, ":team_score_2", 1),
(try_begin),
(store_div, ":team_new_score_2", "$g_score_team_2", 10000),
(neq, ":team_new_score_2", ":team_score_2"),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", 1, ":team_new_score_2"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, 1, ":team_new_score_2"),
(try_end),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neg|player_is_busy_with_menus, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"), #if player is currently spectator do not spawn his agent
(lt, ":player_team", multi_team_spectator),
(player_get_troop_id, ":player_troop", ":player_no"), #if troop is not selected do not spawn his agent
(ge, ":player_troop", 0),
(player_get_agent_id, ":player_agent", ":player_no"),
(assign, ":spawn_new", 0),
(try_begin),
(player_get_slot, ":player_first_spawn", ":player_no", slot_player_first_spawn),
(eq, ":player_first_spawn", 1),
(assign, ":spawn_new", 1),
(player_set_slot, ":player_no", slot_player_first_spawn, 0),
(else_try),
(try_begin),
(lt, ":player_agent", 0),
(assign, ":spawn_new", 1),
(else_try),
(neg|agent_is_alive, ":player_agent"),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":player_agent"),
(gt, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":spawn_new", 1),
(try_end),
(try_end),
(eq, ":spawn_new", 1),
(call_script, "script_multiplayer_buy_agent_equipment", ":player_no"),
(troop_get_inventory_slot, ":has_item", ":player_troop", ek_horse),
(try_begin),
(ge, ":has_item", 0),
(assign, ":is_horseman", 1),
(else_try),
(assign, ":is_horseman", 0),
(try_end),
(call_script, "script_multiplayer_find_spawn_point", ":player_team", 0, ":is_horseman"),
(player_spawn_new_agent, ":player_no", reg0),
(try_end),
]),
(1, 0, 0, [], #do this in every new frame, but not at the same time
[
(multiplayer_is_server),
(store_mission_timer_a, ":mission_timer"),
(ge, ":mission_timer", 2),
(assign, ":team_1_count", 0),
(assign, ":team_2_count", 0),
(try_for_agents, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(assign, ":will_be_counted", 0),
(try_begin),
(agent_is_alive, ":cur_agent"),
(assign, ":will_be_counted", 1), #alive so will be counted
(else_try),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":cur_agent"),
(le, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":will_be_counted", 1), #new died (< g_multiplayer_respawn_period) so will be counted too
(try_end),
(eq, ":will_be_counted", 1),
(agent_get_team, ":cur_team", ":cur_agent"),
(try_begin),
(eq, ":cur_team", 0),
(val_add, ":team_1_count", 1),
(else_try),
(eq, ":cur_team", 1),
(val_add, ":team_2_count", 1),
(try_end),
(try_end),
(store_sub, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1", ":team_1_count"),
(store_sub, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2", ":team_2_count"),
(val_max, "$g_multiplayer_num_bots_required_team_1", 0),
(val_max, "$g_multiplayer_num_bots_required_team_2", 0),
]),
multiplayer_server_spawn_bots,
multiplayer_server_manage_bots,
(20, 0, 0, [],
[
(multiplayer_is_server),
#auto team balance control in every 10 seconds (hq)
(call_script, "script_check_team_balance"),
]),
multiplayer_server_check_end_map,
(ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_multiplayer_mission_end_screen", 0),
(assign, "$g_multiplayer_stats_chart_opened_manually", 1),
(start_presentation, "prsnt_multiplayer_stats_chart"),
(try_end),
]),
multiplayer_once_at_the_first_frame,
multiplayer_battle_window_opened,
(ti_escape_pressed, 0, 0, [],
[
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_stats_chart"),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(start_presentation, "prsnt_multiplayer_escape_menu"),
]),
],
),
(
"multiplayer_cf",mtf_battle_mode,-1, #capture_the_flag mode
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(34,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(35,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(36,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(42,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(43,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(48,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(49,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(50,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(51,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(52,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(53,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(54,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(55,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(56,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(57,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(58,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(59,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(60,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(61,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(62,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(63,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(64,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(65,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
common_battle_init_banner,
multiplayer_server_check_polls,
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_multiplayer_server_on_agent_spawn_common", ":agent_no"),
]),
(ti_server_player_joined, 0, 0, [],
[
(store_trigger_param_1, ":player_no"),
(call_script, "script_multiplayer_server_player_joined_common", ":player_no"),
]),
(ti_before_mission_start, 0, 0, [],
[
(try_begin),
(multiplayer_is_server),
(store_current_scene, ":cur_scene"),
(this_or_next|eq, ":cur_scene", "scn_random_multi_plain_medium"),
(this_or_next|eq, ":cur_scene", "scn_random_multi_plain_large"),
(this_or_next|eq, ":cur_scene", "scn_random_multi_steppe_medium"),
(eq, ":cur_scene", "scn_random_multi_steppe_large"),
(entry_point_get_position, pos0, 0),
(entry_point_set_position, 64, pos0),
(entry_point_get_position, pos1, 32),
(entry_point_set_position, 65, pos1),
(try_end),
(assign, "$g_multiplayer_game_type", multiplayer_game_type_capture_the_flag),
(call_script, "script_multiplayer_server_before_mission_start_common"),
(assign, "$flag_1_at_ground_timer", 0),
(assign, "$flag_2_at_ground_timer", 0),
(call_script, "script_multiplayer_init_mission_variables"),
(call_script, "script_multiplayer_remove_destroy_mod_targets"),
(call_script, "script_multiplayer_remove_headquarters_flags"),
]),
(ti_after_mission_start, 0, 0, [],
[
(call_script, "script_determine_team_flags", 0),
(call_script, "script_determine_team_flags", 1),
(set_spawn_effector_scene_prop_kind, 0, -1), #during this mission, agents of "team 0" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(set_spawn_effector_scene_prop_kind, 1, -1), #during this mission, agents of "team 1" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(try_begin),
(multiplayer_is_server),
(assign, "$g_multiplayer_ready_for_spawning_agent", 1),
(entry_point_get_position, pos0, multi_base_point_team_1),
(set_spawn_position, pos0),
(spawn_scene_prop, "$team_1_flag_scene_prop", 0),
(entry_point_get_position, pos0, multi_base_point_team_2),
(set_spawn_position, pos0),
(spawn_scene_prop, "$team_2_flag_scene_prop", 0),
(try_end),
(call_script, "script_initialize_all_scene_prop_slots"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
]),
(ti_on_multiplayer_mission_end, 0, 0, [],
[
(call_script, "script_multiplayer_event_mission_end"),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(start_presentation, "prsnt_multiplayer_stats_chart"),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(call_script, "script_multiplayer_server_on_agent_killed_or_wounded_common", ":dead_agent_no", ":killer_agent_no"),
(try_begin), #when an agent dies which carrying a flag, assign flag position to current position with
(agent_is_human, ":dead_agent_no"), #ground level z and do not change it again according to dead agent's any coordinate/rotation.
(agent_get_attached_scene_prop, ":attached_scene_prop", ":dead_agent_no"),
(try_begin),
(try_begin),
(multiplayer_is_server),
(ge, ":attached_scene_prop", 0), #moved from above after auto-set position
(multiplayer_get_my_player, ":my_player_no"),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_attached_scene_prop", ":dead_agent_no", -1),
(agent_set_horse_speed_factor, ":dead_agent_no", 100),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_attached_scene_prop, ":dead_agent_no", -1),
(try_end),
(prop_instance_get_position, pos0, ":attached_scene_prop"), #moved from above to here after auto-set position
(position_set_z_to_ground_level, pos0), #moved from above to here after auto-set position
(prop_instance_set_position, ":attached_scene_prop", pos0), #moved from above to here after auto-set position
(agent_get_team, ":dead_agent_team", ":dead_agent_no"),
(try_begin),
(eq, ":dead_agent_team", 0),
(assign, ":dead_agent_rival_team", 1),
(else_try),
(assign, ":dead_agent_rival_team", 0),
(try_end),
(team_set_slot, ":dead_agent_rival_team", slot_team_flag_situation, 2), #2-flag at ground
(multiplayer_get_my_player, ":my_player_no"),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_team_flag_situation", ":dead_agent_rival_team", 2),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_flag_situation, ":dead_agent_rival_team", 2), #flag at ground
(try_end),
(try_end),
(try_end),
(try_end),
]),
(1, 0, 0, [], #returning flag if it is not touched by anyone in 60 seconds
[
(multiplayer_is_server),
(try_for_range, ":team_no", 0, 2),
(try_begin),
(team_slot_eq, ":team_no", slot_team_flag_situation, 2),
(assign, ":flag_team_no", -1),
(try_begin),
(eq, ":team_no", 0),
(val_add, "$flag_1_at_ground_timer", 1),
(ge, "$flag_1_at_ground_timer", multi_max_seconds_flag_can_stay_in_ground),
(assign, ":flag_team_no", 0),
(else_try),
(val_add, "$flag_2_at_ground_timer", 1),
(ge, "$flag_2_at_ground_timer", multi_max_seconds_flag_can_stay_in_ground),
(assign, ":flag_team_no", 1),
(try_end),
(try_begin),
(ge, ":flag_team_no", 0),
(try_begin),
(eq, ":flag_team_no", 0),
(assign, "$flag_1_at_ground_timer", 0),
(else_try),
(eq, ":flag_team_no", 1),
(assign, "$flag_2_at_ground_timer", 0),
(try_end),
#cur agent returned his own flag to its default position!
(team_set_slot, ":flag_team_no", slot_team_flag_situation, 0), #0-flag at base
#return team flag to its starting position.
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_team_flag_situation", ":flag_team_no", 0),
#for only server itself-----------------------------------------------------------------------------------------------
(multiplayer_get_my_player, ":my_player_no"),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_flag_situation, ":flag_team_no", 0),
(try_end),
(scene_prop_get_instance, ":flag_red_id", "$team_1_flag_scene_prop", 0),
(scene_prop_get_instance, ":flag_blue_id", "$team_2_flag_scene_prop", 0),
(assign, ":team_1_flag_id", ":flag_red_id"),
(assign, ":team_1_base_entry_id", multi_base_point_team_1),
(assign, ":team_2_flag_id", ":flag_blue_id"),
(assign, ":team_2_base_entry_id", multi_base_point_team_2),
#return team flag to its starting position.
(try_begin),
(eq, ":flag_team_no", 0),
(entry_point_get_position, pos5, ":team_1_base_entry_id"), #moved from above to here after auto-set position
(prop_instance_set_position, ":team_1_flag_id", pos5), #moved from above to here after auto-set position
(else_try),
(entry_point_get_position, pos5, ":team_2_base_entry_id"), #moved from above to here after auto-set position
(prop_instance_set_position, ":team_2_flag_id", pos5), #moved from above to here after auto-set position
(try_end),
#(team_get_faction, ":team_faction", ":flag_team_no"),
#(str_store_faction_name, s1, ":team_faction"),
#(tutorial_message_set_position, 500, 500),
#(tutorial_message_set_size, 30, 30),
#(tutorial_message_set_center_justify, 1),
#(tutorial_message, "str_s1_returned_flag", 0xFFFFFFFF, 5),
(store_mul, ":minus_flag_team_no", ":flag_team_no", -1),
(val_sub, ":minus_flag_team_no", 1),
#for only server itself
(call_script, "script_show_multiplayer_message", multiplayer_message_type_flag_returned_home, ":minus_flag_team_no"),
#no need to send also server here
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_flag_returned_home, ":minus_flag_team_no"),
(try_end),
(try_end),
(else_try),
(try_begin),
(eq, ":team_no", 0),
(assign, "$flag_1_at_ground_timer", 0),
(else_try),
(assign, "$flag_2_at_ground_timer", 0),
(try_end),
(try_end),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neg|player_is_busy_with_menus, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"), #if player is currently spectator do not spawn his agent
(lt, ":player_team", multi_team_spectator),
(player_get_troop_id, ":player_troop", ":player_no"), #if troop is not selected do not spawn his agent
(ge, ":player_troop", 0),
(player_get_agent_id, ":player_agent", ":player_no"),
(assign, ":spawn_new", 0),
(try_begin),
(player_get_slot, ":player_first_spawn", ":player_no", slot_player_first_spawn),
(eq, ":player_first_spawn", 1),
(assign, ":spawn_new", 1),
(player_set_slot, ":player_no", slot_player_first_spawn, 0),
(else_try),
(try_begin),
(lt, ":player_agent", 0),
(assign, ":spawn_new", 1),
(else_try),
(neg|agent_is_alive, ":player_agent"),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":player_agent"),
(gt, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":spawn_new", 1),
(try_end),
(try_end),
(eq, ":spawn_new", 1),
(call_script, "script_multiplayer_buy_agent_equipment", ":player_no"),
(troop_get_inventory_slot, ":has_item", ":player_troop", ek_horse),
(try_begin),
(ge, ":has_item", 0),
(assign, ":is_horseman", 1),
(else_try),
(assign, ":is_horseman", 0),
(try_end),
(call_script, "script_multiplayer_find_spawn_point", ":player_team", 0, ":is_horseman"),
(player_spawn_new_agent, ":player_no", reg0),
(try_end),
]),
(1, 0, 0, [], #do this in every new frame, but not at the same time
[
(multiplayer_is_server),
(store_mission_timer_a, ":mission_timer"),
(ge, ":mission_timer", 2),
(assign, ":team_1_count", 0),
(assign, ":team_2_count", 0),
(try_for_agents, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(assign, ":will_be_counted", 0),
(try_begin),
(agent_is_alive, ":cur_agent"),
(assign, ":will_be_counted", 1), #alive so will be counted
(else_try),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":cur_agent"),
(le, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":will_be_counted", 1), #new died (< g_multiplayer_respawn_period) so will be counted too
(try_end),
(eq, ":will_be_counted", 1),
(agent_get_team, ":cur_team", ":cur_agent"),
(try_begin),
(eq, ":cur_team", 0),
(val_add, ":team_1_count", 1),
(else_try),
(eq, ":cur_team", 1),
(val_add, ":team_2_count", 1),
(try_end),
(try_end),
(store_sub, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1", ":team_1_count"),
(store_sub, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2", ":team_2_count"),
(val_max, "$g_multiplayer_num_bots_required_team_1", 0),
(val_max, "$g_multiplayer_num_bots_required_team_2", 0),
]),
multiplayer_server_spawn_bots,
multiplayer_server_manage_bots,
(0, 0, 0, [], #control any agent captured flag or made score.
[
(multiplayer_is_server),
(scene_prop_get_instance, ":flag_red_id", "$team_1_flag_scene_prop", 0),
(prop_instance_get_position, pos1, ":flag_red_id"), #hold position of flag of team 1 (red flag) at pos1
(scene_prop_get_instance, ":flag_blue_id", "$team_2_flag_scene_prop", 0),
(prop_instance_get_position, pos2, ":flag_blue_id"), #hold position of flag of team 2 (blue flag) at pos2
(multiplayer_get_my_player, ":my_player_no"),
(get_max_players, ":num_players"),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"), #horses cannot take flag
(agent_is_alive, ":cur_agent"),
(neg|agent_is_non_player, ":cur_agent"), #for now bots cannot take flag or return flags to home.
(agent_get_horse, ":cur_agent_horse", ":cur_agent"),
(eq, ":cur_agent_horse", -1), #horseman cannot take flag
(agent_get_attached_scene_prop, ":attached_scene_prop", ":cur_agent"),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(try_begin),
(eq, ":cur_agent_team", 0),
(assign, ":cur_agent_rival_team", 1),
(else_try),
(assign, ":cur_agent_rival_team", 0),
(try_end),
(try_begin),
(eq, ":cur_agent_team", 0),
(assign, ":our_flag_id", ":flag_red_id"),
(assign, ":our_base_entry_id", multi_base_point_team_1),
(else_try),
(assign, ":our_flag_id", ":flag_blue_id"),
(assign, ":our_base_entry_id", multi_base_point_team_2),
(try_end),
(agent_get_position, pos3, ":cur_agent"),
(prop_instance_get_position, pos4, ":our_flag_id"),
(get_distance_between_positions, ":dist", pos3, pos4),
(team_get_slot, ":cur_agent_flag_situation", ":cur_agent_team", slot_team_flag_situation),
(try_begin), #control if agent can return his own flag to default position
(eq, ":cur_agent_flag_situation", 2), #if our flag is at ground
(lt, ":dist", 100), #if this agent is near to his team's own flag
#cur agent returned his own flag to its default position!
(team_set_slot, ":cur_agent_team", slot_team_flag_situation, 0), #0-flag at base
#return team flag to its starting position.
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_team_flag_situation", ":cur_agent_team", 0),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_flag_situation, ":cur_agent_team", 0),
(try_end),
#return team flag to its starting position.
(entry_point_get_position, pos5, ":our_base_entry_id"), #moved from above to here after auto-set position
(prop_instance_set_position, ":our_flag_id", pos5), #moved from above to here after auto-set position
(try_begin), #give 1 score points to player which returns his/her flag to team base
(multiplayer_is_server),
(neg|agent_is_non_player, ":cur_agent"),
(agent_get_player_id, ":cur_agent_player_id", ":cur_agent"),
(player_get_score, ":cur_agent_player_score", ":cur_agent_player_id"),
(val_add, ":cur_agent_player_score", multi_capture_the_flag_score_flag_returning),
(player_set_score, ":cur_agent_player_id", ":cur_agent_player_score"),
(try_end),
#(team_get_faction, ":cur_agent_faction", ":cur_agent_team"),
#(str_store_faction_name, s1, ":cur_agent_faction"),
#(tutorial_message_set_position, 500, 500),
#(tutorial_message_set_size, 30, 30),
#(tutorial_message_set_center_justify, 1),
#(tutorial_message, "str_s1_returned_flag", 0xFFFFFFFF, 5),
#for only server itself
(call_script, "script_show_multiplayer_message", multiplayer_message_type_flag_returned_home, ":cur_agent"),
#no need to send also server here
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_flag_returned_home, ":cur_agent"),
(try_end),
(try_end),
(try_begin), #control if agent carries flag and made score
(neq, ":attached_scene_prop", -1), #if not agent is carrying anything
(try_begin),
(eq, ":cur_agent_team", 0),
(assign, ":rival_flag_id", ":flag_blue_id"),
(assign, ":rival_base_entry_id", multi_base_point_team_2),
(else_try),
(assign, ":rival_flag_id", ":flag_red_id"),
(assign, ":rival_base_entry_id", multi_base_point_team_1),
(try_end),
(eq, ":attached_scene_prop", ":rival_flag_id"), #if agent is carrying rival flag
(eq, ":cur_agent_flag_situation", 0), #if our flag is at home position
(lt, ":dist", 100), #if this agent (carrying rival flag) is near to his team's own
#cur_agent's team is scored!#
(team_get_score, ":cur_agent_team_score", ":cur_agent_team"), #this agent's team scored
(val_add, ":cur_agent_team_score", 1),
(team_set_score, ":cur_agent_team", ":cur_agent_team_score"),
(try_begin), #give 5 score points to player which connects two flag and make score to his/her team
(multiplayer_is_server),
(neg|agent_is_non_player, ":cur_agent"),
(agent_get_player_id, ":cur_agent_player_id", ":cur_agent"),
(player_get_score, ":cur_agent_player_score", ":cur_agent_player_id"),
(val_add, ":cur_agent_player_score", "$g_multiplayer_point_gained_from_capturing_flag"),
(player_set_score, ":cur_agent_player_id", ":cur_agent_player_score"),
(try_end),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", ":cur_agent_team", ":cur_agent_team_score"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, ":cur_agent_team", ":cur_agent_team_score"),
(try_end),
(agent_set_attached_scene_prop, ":cur_agent", -1),
(team_set_slot, ":cur_agent_rival_team", slot_team_flag_situation, 0), #0-flag at base
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_attached_scene_prop", ":cur_agent", -1),
(agent_set_horse_speed_factor, ":cur_agent", 100),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_attached_scene_prop, ":cur_agent", -1),
(try_end),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_team_flag_situation", ":cur_agent_rival_team", 0),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_flag_situation, ":cur_agent_rival_team", 0),
(try_end),
#return rival flag to its starting position
(entry_point_get_position, pos5, ":rival_base_entry_id"), #moved from above to here after auto-set position
(prop_instance_set_position, ":rival_flag_id", pos5), #moved from above to here after auto-set position
#(team_get_faction, ":cur_agent_faction", ":cur_agent_team"),
#(str_store_faction_name, s1, ":cur_agent_faction"),
#(player_get_agent_id, ":my_player_agent", ":my_player_no"),
#(try_begin),
# (ge, ":my_player_agent", 0),
# (agent_get_team, ":my_player_team", ":my_player_agent"),
# (try_begin),
# (eq, ":my_player_team", ":cur_agent_team"),
# (assign, ":text_font_color", 0xFF33DDFF),
# (else_try),
# (assign, ":text_font_color", 0xFFFF0000),
# (try_end),
#(else_try),
# (assign, ":text_font_color", 0xFFFFFFFF),
#(try_end),
#(tutorial_message_set_position, 500, 500),
#(tutorial_message_set_size, 30, 30),
#(tutorial_message_set_center_justify, 1),
#(tutorial_message, "str_s1_captured_flag", ":text_font_color", 5),
#for only server itself
(call_script, "script_show_multiplayer_message", multiplayer_message_type_capture_the_flag_score, ":cur_agent"),
#no need to send to also server here
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_capture_the_flag_score, ":cur_agent"),
(try_end),
(try_end),
(eq, ":attached_scene_prop", -1), #agents carrying other scene prop cannot take flag.
(agent_get_position, pos3, ":cur_agent"),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(try_begin),
(eq, ":cur_agent_team", 0), #if this agent is from team 1, look its distance to blue flag.
(get_distance_between_positions, ":dist", pos2, pos3),
(assign, ":rival_flag_id", ":flag_blue_id"),
(else_try), #if this agent is from team 2, look its distance to red flag.
(get_distance_between_positions, ":dist", pos1, pos3),
(assign, ":rival_flag_id", ":flag_red_id"),
(try_end),
(try_begin), #control if agent stole enemy flag
(le, ":dist", 100),
(neg|team_slot_eq, ":cur_agent_rival_team", slot_team_flag_situation, 1), #if flag is not already stolen.
(agent_set_attached_scene_prop, ":cur_agent", ":rival_flag_id"),
(agent_set_attached_scene_prop_x, ":cur_agent", 20),
(agent_set_attached_scene_prop_z, ":cur_agent", 50),
(try_begin),
(eq, ":cur_agent_team", 0),
(assign, "$flag_1_at_ground_timer", 0),
(else_try),
(eq, ":cur_agent_team", 1),
(assign, "$flag_2_at_ground_timer", 0),
(try_end),
#cur_agent stole rival team's flag!
(team_set_slot, ":cur_agent_rival_team", slot_team_flag_situation, 1), #1-stolen flag
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_attached_scene_prop", ":cur_agent", ":rival_flag_id"),
(agent_set_horse_speed_factor, ":cur_agent", 75),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_attached_scene_prop, ":cur_agent", ":rival_flag_id"),
(try_end),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_team_flag_situation", ":cur_agent_rival_team", 1),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_flag_situation, ":cur_agent_rival_team", 1),
(try_end),
#(team_get_faction, ":cur_agent_faction", ":cur_agent_team"),
#(str_store_faction_name, s1, ":cur_agent_faction"),
#(tutorial_message_set_position, 500, 500),
#(tutorial_message_set_size, 30, 30),
#(tutorial_message_set_center_justify, 1),
#(tutorial_message, "str_s1_taken_flag", 0xFFFFFFFF, 5),
#for only server itself
(call_script, "script_show_multiplayer_message", multiplayer_message_type_capture_the_flag_stole, ":cur_agent"),
#no need to send also server here
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_capture_the_flag_stole, ":cur_agent"),
(try_end),
(try_end),
(try_end),
]),
(20, 0, 0, [],
[
(multiplayer_is_server),
#auto team balance control in every 10 seconds (cf)
(call_script, "script_check_team_balance"),
]),
multiplayer_server_check_end_map,
(ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_multiplayer_mission_end_screen", 0),
(assign, "$g_multiplayer_stats_chart_opened_manually", 1),
(start_presentation, "prsnt_multiplayer_stats_chart"),
(try_end),
]),
multiplayer_once_at_the_first_frame,
(ti_battle_window_opened, 0, 0, [], [
(start_presentation, "prsnt_multiplayer_team_score_display"),
(start_presentation, "prsnt_multiplayer_flag_projection_display"),
]),
(ti_escape_pressed, 0, 0, [],
[
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_stats_chart"),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(start_presentation, "prsnt_multiplayer_escape_menu"),
]),
],
),
(
"multiplayer_sg",mtf_battle_mode,-1, #siege
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_1|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_1|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(34,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(35,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(36,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(37,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(38,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(39,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(40,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(41,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(42,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(43,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(44,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(45,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(46,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(47,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(48,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(49,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(50,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(51,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(52,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(53,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(54,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(55,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(56,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(57,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(58,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(59,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(60,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(61,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(62,mtef_visitor_source,0,aif_start_alarmed,1,[]),
(63,mtef_visitor_source,0,aif_start_alarmed,1,[]),
],
[
multiplayer_server_check_belfry_movement,
common_battle_init_banner,
multiplayer_server_check_polls,
(ti_server_player_joined, 0, 0, [],
[
(store_trigger_param_1, ":player_no"),
(call_script, "script_multiplayer_server_player_joined_common", ":player_no"),
(try_begin),
(multiplayer_is_server),
(this_or_next|player_is_active, ":player_no"),
(eq, ":player_no", 0),
(store_mission_timer_a, ":round_time"),
(val_sub, ":round_time", "$g_round_start_time"),
(try_begin),
(lt, ":round_time", 25),
(assign, ":number_of_respawns_spent", 0),
(else_try),
(lt, ":round_time", 60),
(assign, ":number_of_respawns_spent", 1),
(else_try),
(lt, ":round_time", 105),
(assign, ":number_of_respawns_spent", 2),
(else_try),
(lt, ":round_time", 160),
(assign, ":number_of_respawns_spent", 3),
(else_try),
(assign, ":number_of_respawns_spent", "$g_multiplayer_number_of_respawn_count"),
(try_end),
(player_set_slot, ":player_no", slot_player_spawn_count, ":number_of_respawns_spent"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_return_player_respawn_spent, ":number_of_respawns_spent"),
(try_end),
]),
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(call_script, "script_multiplayer_server_before_mission_start_common"),
(try_begin),
(multiplayer_is_server),
(try_for_range, ":cur_flag_slot", multi_data_flag_pull_code_begin, multi_data_flag_pull_code_end),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_slot", -1),
(try_end),
(assign, "$g_my_spawn_count", 0),
(else_try),
(assign, "$g_my_spawn_count", 0),
(try_end),
(assign, "$g_waiting_for_confirmation_to_terminate", 0),
(assign, "$g_round_ended", 0),
(try_begin),
(multiplayer_is_server),
(assign, "$g_round_start_time", 0),
(try_end),
(assign, "$my_team_at_start_of_round", -1),
(assign, "$g_flag_is_not_ready", 0),
(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(call_script, "script_multiplayer_init_mission_variables"),
(call_script, "script_multiplayer_remove_destroy_mod_targets"),
(call_script, "script_multiplayer_remove_headquarters_flags"),
]),
(ti_after_mission_start, 0, 0, [],
[
(call_script, "script_determine_team_flags", 0),
(set_spawn_effector_scene_prop_kind, 0, -1), #during this mission, agents of "team 0" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(set_spawn_effector_scene_prop_kind, 1, -1), #during this mission, agents of "team 1" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(call_script, "script_initialize_all_scene_prop_slots"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
(assign, "$g_number_of_flags", 0),
(try_begin),
(multiplayer_is_server),
(assign, "$g_multiplayer_ready_for_spawning_agent", 1),
#place base flags
(entry_point_get_position, pos1, multi_siege_flag_point),
(set_spawn_position, pos1),
(spawn_scene_prop, "spr_headquarters_pole_code_only", 0),
(position_move_z, pos1, multi_headquarters_pole_height),
(set_spawn_position, pos1),
(spawn_scene_prop, "$team_1_flag_scene_prop", 0),
(store_add, ":cur_flag_slot", multi_data_flag_owner_begin, "$g_number_of_flags"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_slot", 1),
(try_end),
(val_add, "$g_number_of_flags", 1),
(try_begin),
(multiplayer_is_server),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_a"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_a", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_belfry_platform_moved, 1),
(try_end),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_b"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_b", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_belfry_platform_moved, 1),
(try_end),
(call_script, "script_move_belfries_to_their_first_entry_point", "spr_belfry_a"),
(call_script, "script_move_belfries_to_their_first_entry_point", "spr_belfry_b"),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_a"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_a", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_number_of_agents_pushing, 0),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_next_entry_point_id, 0),
(try_end),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_b"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_b", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_number_of_agents_pushing, 0),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_next_entry_point_id, 0),
(try_end),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_a"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_a", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_belfry_platform_moved, 0),
(try_end),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_b"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_b", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_belfry_platform_moved, 0),
(try_end),
(try_end),
]),
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_multiplayer_server_on_agent_spawn_common", ":agent_no"),
(try_begin), #if my initial team still not initialized, find and assign its value.
(lt, "$my_team_at_start_of_round", 0),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_agent_id", ":my_player_no"),
(eq, ":my_agent_id", ":agent_no"),
(ge, ":my_agent_id", 0),
(agent_get_team, "$my_team_at_start_of_round", ":my_agent_id"),
(try_end),
(try_begin),
(neg|multiplayer_is_server),
(try_begin),
(eq, "$g_round_ended", 1),
(assign, "$g_round_ended", 0),
(assign, "$g_my_spawn_count", 0),
#initialize scene object slots at start of new round at clients.
(call_script, "script_initialize_all_scene_prop_slots"),
#these lines are done in only clients at start of each new round.
(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(call_script, "script_initialize_objects_clients"),
#end of lines
(try_end),
(try_end),
(try_begin),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_agent_id", ":my_player_no"),
(eq, ":my_agent_id", ":agent_no"),
(val_add, "$g_my_spawn_count", 1),
(try_begin),
(ge, "$g_my_spawn_count", "$g_multiplayer_number_of_respawn_count"),
(gt, "$g_multiplayer_number_of_respawn_count", 0),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_team_no, ":my_player_team_no", ":my_player_no"),
(eq, ":my_player_team_no", 0),
(assign, "$g_my_spawn_count", 999),
(try_end),
(try_end),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(call_script, "script_multiplayer_server_on_agent_killed_or_wounded_common", ":dead_agent_no", ":killer_agent_no"),
(try_begin), #if my initial team still not initialized, find and assign its value.
(lt, "$my_team_at_start_of_round", 0),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_agent_id", ":my_player_no"),
(ge, ":my_agent_id", 0),
(agent_get_team, "$my_team_at_start_of_round", ":my_agent_id"),
(try_end),
(try_begin),
(multiplayer_is_server),
(agent_is_human, ":dead_agent_no"),
(neg|agent_is_non_player, ":dead_agent_no"),
(agent_get_player_id, ":dead_agent_player_id", ":dead_agent_no"),
(player_set_slot, ":dead_agent_player_id", slot_player_spawned_this_round, 0),
(try_end),
]),
(ti_on_multiplayer_mission_end, 0, 0, [],
[
(call_script, "script_multiplayer_event_mission_end"),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(start_presentation, "prsnt_multiplayer_stats_chart"),
]),
(0, 0, 0, [], #if this trigger takes lots of time in the future and make server machine runs siege mod
#very slow with lots of players make period of this trigger 1 seconds, but best is 0. Currently
#we are testing this mod with few players and no speed problem occured.
[
(multiplayer_is_server),
(eq, "$g_round_ended", 0),
#main trigger which controls which agent is moving/near which flag.
(try_for_range, ":flag_no", 0, "$g_number_of_flags"),
(store_add, ":cur_flag_owner_counts_slot", multi_data_flag_players_around_begin, ":flag_no"),
(troop_get_slot, ":current_owner_code", "trp_multiplayer_data", ":cur_flag_owner_counts_slot"),
(store_div, ":old_team_1_agent_count", ":current_owner_code", 100),
(store_mod, ":old_team_2_agent_count", ":current_owner_code", 100),
(assign, ":number_of_agents_around_flag_team_1", 0),
(assign, ":number_of_agents_around_flag_team_2", 0),
(scene_prop_get_instance, ":pole_id", "spr_headquarters_pole_code_only", ":flag_no"),
(prop_instance_get_position, pos0, ":pole_id"), #pos0 holds pole position.
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_agent_id, ":cur_agent", ":player_no"),
(ge, ":cur_agent", 0),
(agent_is_alive, ":cur_agent"),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(agent_get_position, pos1, ":cur_agent"), #pos1 holds agent's position.
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(get_sq_distance_between_position_heights, ":squared_height_dist", pos0, pos1),
(val_add, ":squared_dist", ":squared_height_dist"),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin),
(eq, ":cur_agent_team", 0),
(val_add, ":number_of_agents_around_flag_team_1", 1),
(else_try),
(eq, ":cur_agent_team", 1),
(val_add, ":number_of_agents_around_flag_team_2", 1),
(try_end),
(try_end),
(try_begin),
(this_or_next|neq, ":old_team_1_agent_count", ":number_of_agents_around_flag_team_1"),
(neq, ":old_team_2_agent_count", ":number_of_agents_around_flag_team_2"),
(store_add, ":cur_flag_pull_code_slot", multi_data_flag_pull_code_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_pull_code", "trp_multiplayer_data", ":cur_flag_pull_code_slot"),
(store_mod, ":cur_flag_pull_message_seconds_past", ":cur_flag_pull_code", 100),
(store_div, ":cur_flag_puller_team_last", ":cur_flag_pull_code", 100),
(try_begin),
(eq, ":old_team_2_agent_count", 0),
(gt, ":number_of_agents_around_flag_team_2", 0),
(eq, ":number_of_agents_around_flag_team_1", 0),
(assign, ":puller_team", 2),
(store_mul, ":puller_team_multiplied_by_100", ":puller_team", 100),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_pull_code_slot", ":puller_team_multiplied_by_100"),
(this_or_next|neq, ":cur_flag_puller_team_last", ":puller_team"),
(ge, ":cur_flag_pull_message_seconds_past", 25),
(store_mul, ":flag_code", ":puller_team", 100),
(val_add, ":flag_code", ":flag_no"),
(try_end),
(try_begin),
(store_mul, ":current_owner_code", ":number_of_agents_around_flag_team_1", 100),
(val_add, ":current_owner_code", ":number_of_agents_around_flag_team_2"),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_owner_counts_slot", ":current_owner_code"),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_set_num_agents_around_flag", ":flag_no", ":current_owner_code"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_num_agents_around_flag, ":flag_no", ":current_owner_code"),
(try_end),
(try_end),
(try_end),
(try_end),
(try_for_range, ":flag_no", 0, "$g_number_of_flags"),
(eq, "$g_round_ended", 0), #if round still continues and any team did not sucseed yet
(eq, "$g_flag_is_not_ready", 0), #if round still continues and any team did not sucseed yet
(scene_prop_get_instance, ":pole_id", "spr_headquarters_pole_code_only", ":flag_no"),
(prop_instance_get_position, pos0, ":pole_id"), #pos0 holds pole position.
(try_begin),
(scene_prop_get_instance, ":flag_id", "$team_1_flag_scene_prop", ":flag_no"),
#flag_id holds shown flag after this point
(prop_instance_get_position, pos1, ":flag_id"), #pos1 holds gray/red/blue (current shown) flag position.
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(lt, ":squared_dist", multi_headquarters_distance_sq_to_change_flag), #if distance is less than 2 meters
(prop_instance_is_animating, ":is_animating", ":flag_id"),
(eq, ":is_animating", 1),
#end of round, attackers win
(assign, "$g_winner_team", 1),
(prop_instance_stop_animating, ":flag_id"),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_draw_this_round", "$g_winner_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_draw_this_round, "$g_winner_team"),
(try_end),
(assign, "$g_flag_is_not_ready", 1),
(try_end),
(try_end),
(try_end),
]),
(0, 0, 0, [], #if there is nobody in any teams do not reduce round time.
[
#(multiplayer_is_server),
(assign, ":human_agents_spawned_at_team_1", "$g_multiplayer_num_bots_team_1"),
(assign, ":human_agents_spawned_at_team_2", "$g_multiplayer_num_bots_team_2"),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":human_agents_spawned_at_team_1", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":human_agents_spawned_at_team_2", 1),
(try_end),
(try_end),
(try_begin),
(this_or_next|eq, ":human_agents_spawned_at_team_1", 0),
(eq, ":human_agents_spawned_at_team_2", 0),
(store_mission_timer_a, ":seconds_past_since_round_started"),
(val_sub, ":seconds_past_since_round_started", "$g_round_start_time"),
(le, ":seconds_past_since_round_started", 2),
(store_mission_timer_a, "$g_round_start_time"),
(try_end),
]),
(1, 0, 0, [(multiplayer_is_server),
(eq, "$g_round_ended", 0),
(eq, "$g_flag_is_not_ready", 0),
(store_mission_timer_a, ":current_time"),
(store_sub, ":seconds_past_in_round", ":current_time", "$g_round_start_time"),
(ge, ":seconds_past_in_round", "$g_multiplayer_round_max_seconds")],
[
(assign, ":flag_no", 0),
(store_add, ":cur_flag_owner_counts_slot", multi_data_flag_players_around_begin, ":flag_no"),
(troop_get_slot, ":current_owner_code", "trp_multiplayer_data", ":cur_flag_owner_counts_slot"),
(store_mod, ":team_2_agent_count_around_flag", ":current_owner_code", 100),
(try_begin),
(eq, ":team_2_agent_count_around_flag", 0),
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(assign, "$g_flag_is_not_ready", 1),
(assign, "$g_winner_team", 0),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_draw_this_round", "$g_winner_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_draw_this_round, "$g_winner_team"),
(try_end),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
#trigger for calculating seconds past after that flag's pull message has shown
(try_for_range, ":flag_no", 0, "$g_number_of_flags"),
(store_add, ":cur_flag_pull_code_slot", multi_data_flag_pull_code_begin, ":flag_no"),
(troop_get_slot, ":cur_flag_pull_code", "trp_multiplayer_data", ":cur_flag_pull_code_slot"),
(store_mod, ":cur_flag_pull_message_seconds_past", ":cur_flag_pull_code", 100),
(try_begin),
(ge, ":cur_flag_pull_code", 100),
(lt, ":cur_flag_pull_message_seconds_past", 25),
(val_add, ":cur_flag_pull_code", 1),
(troop_set_slot, "trp_multiplayer_data", ":cur_flag_pull_code_slot", ":cur_flag_pull_code"),
(try_end),
(try_end),
]),
(10, 0, 0, [(multiplayer_is_server)],
[
#auto team balance control during the round
(assign, ":number_of_players_at_team_1", 0),
(assign, ":number_of_players_at_team_2", 0),
(get_max_players, ":num_players"),
(try_for_range, ":cur_player", 0, ":num_players"),
(player_is_active, ":cur_player"),
(player_get_team_no, ":player_team", ":cur_player"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":number_of_players_at_team_1", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":number_of_players_at_team_2", 1),
(try_end),
(try_end),
#end of counting active players per team.
(store_sub, ":difference_of_number_of_players", ":number_of_players_at_team_1", ":number_of_players_at_team_2"),
(assign, ":number_of_players_will_be_moved", 0),
(try_begin),
(try_begin),
(store_mul, ":checked_value", "$g_multiplayer_auto_team_balance_limit", -1),
(le, ":difference_of_number_of_players", ":checked_value"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", -2),
(else_try),
(ge, ":difference_of_number_of_players", "$g_multiplayer_auto_team_balance_limit"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", 2),
(try_end),
(try_end),
#number of players will be moved calculated. (it is 0 if no need to make team balance)
(try_begin),
(gt, ":number_of_players_will_be_moved", 0),
(try_begin),
(eq, "$g_team_balance_next_round", 0),
(assign, "$g_team_balance_next_round", 1),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_auto_team_balance_next, 0), #0 is useless here
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_auto_team_balance_next),
(try_end),
(call_script, "script_warn_player_about_auto_team_balance"),
(try_end),
(try_end),
#team balance check part finished
]),
(1, 0, 3, [(multiplayer_is_server),
(eq, "$g_round_ended", 1),
(store_mission_timer_a, ":seconds_past_till_round_ended"),
(val_sub, ":seconds_past_till_round_ended", "$g_round_finish_time"),
(ge, ":seconds_past_till_round_ended", "$g_multiplayer_respawn_period")],
[
#auto team balance control at the end of round
(assign, ":number_of_players_at_team_1", 0),
(assign, ":number_of_players_at_team_2", 0),
(get_max_players, ":num_players"),
(try_for_range, ":cur_player", 0, ":num_players"),
(player_is_active, ":cur_player"),
(player_get_team_no, ":player_team", ":cur_player"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":number_of_players_at_team_1", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":number_of_players_at_team_2", 1),
(try_end),
(try_end),
#end of counting active players per team.
(store_sub, ":difference_of_number_of_players", ":number_of_players_at_team_1", ":number_of_players_at_team_2"),
(assign, ":number_of_players_will_be_moved", 0),
(try_begin),
(try_begin),
(store_mul, ":checked_value", "$g_multiplayer_auto_team_balance_limit", -1),
(le, ":difference_of_number_of_players", ":checked_value"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", -2),
(assign, ":team_with_more_players", 1),
(assign, ":team_with_less_players", 0),
(else_try),
(ge, ":difference_of_number_of_players", "$g_multiplayer_auto_team_balance_limit"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", 2),
(assign, ":team_with_more_players", 0),
(assign, ":team_with_less_players", 1),
(try_end),
(try_end),
#number of players will be moved calculated. (it is 0 if no need to make team balance)
(try_begin),
(gt, ":number_of_players_will_be_moved", 0),
(try_begin),
(try_for_range, ":unused", 0, ":number_of_players_will_be_moved"),
(assign, ":max_player_join_time", 0),
(assign, ":latest_joined_player_no", -1),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(eq, ":player_team", ":team_with_more_players"),
(player_get_slot, ":player_join_time", ":player_no", slot_player_join_time),
(try_begin),
(gt, ":player_join_time", ":max_player_join_time"),
(assign, ":max_player_join_time", ":player_join_time"),
(assign, ":latest_joined_player_no", ":player_no"),
(try_end),
(try_end),
(try_begin),
(ge, ":latest_joined_player_no", 0),
(try_begin),
#if player is living add +1 to his kill count because he will get -1 because of team change while living.
(player_get_agent_id, ":latest_joined_agent_id", ":latest_joined_player_no"),
(ge, ":latest_joined_agent_id", 0),
(agent_is_alive, ":latest_joined_agent_id"),
(player_get_kill_count, ":player_kill_count", ":latest_joined_player_no"), #adding 1 to his kill count, because he will lose 1 undeserved kill count for dying during team change
(val_add, ":player_kill_count", 1),
(player_set_kill_count, ":latest_joined_player_no", ":player_kill_count"),
(player_get_death_count, ":player_death_count", ":latest_joined_player_no"), #subtracting 1 to his death count, because he will gain 1 undeserved death count for dying during team change
(val_sub, ":player_death_count", 1),
(player_set_death_count, ":latest_joined_player_no", ":player_death_count"),
(player_get_score, ":player_score", ":latest_joined_player_no"), #adding 1 to his score count, because he will lose 1 undeserved score for dying during team change
(val_add, ":player_score", 1),
(player_set_score, ":latest_joined_player_no", ":player_score"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_4_int_to_player, ":player_no", multiplayer_event_set_player_score_kill_death, ":latest_joined_player_no", ":player_score", ":player_kill_count", ":player_death_count"),
(try_end),
(player_get_value_of_original_items, ":old_items_value", ":latest_joined_player_no"),
(player_get_gold, ":player_gold", ":latest_joined_player_no"),
(val_add, ":player_gold", ":old_items_value"),
(player_set_gold, ":latest_joined_player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(end_try),
(player_set_troop_id, ":latest_joined_player_no", -1),
(player_set_team_no, ":latest_joined_player_no", ":team_with_less_players"),
(multiplayer_send_message_to_player, ":latest_joined_player_no", multiplayer_event_force_start_team_selection),
(try_end),
(try_end),
#tutorial message (after team balance)
#(tutorial_message_set_position, 500, 500),
#(tutorial_message_set_size, 30, 30),
#(tutorial_message_set_center_justify, 1),
#(tutorial_message, "str_auto_team_balance_done", 0xFFFFFFFF, 5),
#for only server itself
(call_script, "script_show_multiplayer_message", multiplayer_message_type_auto_team_balance_done, 0),
#no need to send also server here
(multiplayer_get_my_player, ":my_player_no"),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_auto_team_balance_done),
(try_end),
(assign, "$g_team_balance_next_round", 0),
(try_end),
(try_end),
#team balance check part finished
(assign, "$g_team_balance_next_round", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_set_slot, ":player_no", slot_player_spawned_this_round, 0),
(player_set_slot, ":player_no", slot_player_spawned_at_siege_round, 0),
(player_get_agent_id, ":player_agent", ":player_no"),
(ge, ":player_agent", 0),
(agent_is_alive, ":player_agent"),
(player_save_picked_up_items_for_next_spawn, ":player_no"),
(player_get_value_of_original_items, ":old_items_value", ":player_no"),
(player_set_slot, ":player_no", slot_player_last_rounds_used_item_earnings, ":old_items_value"),
(try_end),
#money management
(assign, ":per_round_gold_addition", multi_battle_round_team_money_add),
(val_mul, ":per_round_gold_addition", "$g_multiplayer_round_earnings_multiplier"),
(val_div, ":per_round_gold_addition", 100),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_gold, ":player_gold", ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(try_begin),
(this_or_next|eq, ":player_team", 0),
(eq, ":player_team", 1),
(val_add, ":player_gold", ":per_round_gold_addition"),
(try_end),
#(below lines added new at 25.11.09 after Armagan decided new money system)
(try_begin),
(player_get_slot, ":old_items_value", ":player_no", slot_player_last_rounds_used_item_earnings),
(store_add, ":player_total_potential_gold", ":player_gold", ":old_items_value"),
(store_mul, ":minimum_gold", "$g_multiplayer_initial_gold_multiplier", 10),
(lt, ":player_total_potential_gold", ":minimum_gold"),
(store_sub, ":additional_gold", ":minimum_gold", ":player_total_potential_gold"),
(val_add, ":player_gold", ":additional_gold"),
(try_end),
#new money system addition end
(player_set_gold, ":player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(try_end),
#initialize my team at start of round (it will be assigned again at next round's first death)
(assign, "$my_team_at_start_of_round", -1),
#clear scene and end round
(multiplayer_clear_scene),
#assigning everbody's spawn counts to 0
(assign, "$g_my_spawn_count", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_set_slot, ":player_no", slot_player_spawn_count, 0),
(try_end),
#(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(call_script, "script_initialize_objects"),
#initialize moveable object positions
(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(call_script, "script_multiplayer_close_gate_if_it_is_open"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
(call_script, "script_move_belfries_to_their_first_entry_point", "spr_belfry_a"),
(call_script, "script_move_belfries_to_their_first_entry_point", "spr_belfry_b"),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_a"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_a", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_number_of_agents_pushing, 0),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_next_entry_point_id, 0),
(try_end),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_a"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_a", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_belfry_platform_moved, 0),
(try_end),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_b"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_b", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_number_of_agents_pushing, 0),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_next_entry_point_id, 0),
(try_end),
(scene_prop_get_num_instances, ":num_belfries", "spr_belfry_b"),
(try_for_range, ":belfry_no", 0, ":num_belfries"),
(scene_prop_get_instance, ":belfry_scene_prop_id", "spr_belfry_b", ":belfry_no"),
(scene_prop_set_slot, ":belfry_scene_prop_id", scene_prop_belfry_platform_moved, 0),
(try_end),
#initialize flag coordinates (move up the flag at pole)
(try_for_range, ":flag_no", 0, "$g_number_of_flags"),
(scene_prop_get_instance, ":pole_id", "spr_headquarters_pole_code_only", ":flag_no"),
(prop_instance_get_position, pos1, ":pole_id"),
(position_move_z, pos1, multi_headquarters_pole_height),
(scene_prop_get_instance, ":flag_id", "$team_1_flag_scene_prop", ":flag_no"),
(prop_instance_stop_animating, ":flag_id"),
(prop_instance_set_position, ":flag_id", pos1),
(try_end),
(assign, "$g_round_ended", 0),
(store_mission_timer_a, "$g_round_start_time"),
(call_script, "script_initialize_all_scene_prop_slots"),
#initialize round start time for clients
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_set_round_start_time, -9999),
(try_end),
(assign, "$g_flag_is_not_ready", 0),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neg|player_is_busy_with_menus, ":player_no"),
(player_slot_eq, ":player_no", slot_player_spawned_this_round, 0),
(player_get_team_no, ":player_team", ":player_no"), #if player is currently spectator do not spawn his agent
(lt, ":player_team", multi_team_spectator),
(player_get_troop_id, ":player_troop", ":player_no"), #if troop is not selected do not spawn his agent
(ge, ":player_troop", 0),
(player_get_agent_id, ":player_agent", ":player_no"), #new added for siege mod
(assign, ":spawn_new", 0),
(assign, ":num_active_players_in_team_0", 0),
(assign, ":num_active_players_in_team_1", 0),
(try_begin),
(assign, ":num_active_players", 0),
(get_max_players, ":num_players"),
(try_for_range, ":cur_player", 0, ":num_players"),
(player_is_active, ":cur_player"),
(player_get_team_no, ":cur_player_team", ":cur_player"),
(try_begin),
(eq, ":cur_player_team", 0),
(val_add, ":num_active_players_in_team_0", 1),
(else_try),
(eq, ":cur_player_team", 1),
(val_add, ":num_active_players_in_team_1", 1),
(try_end),
(val_add, ":num_active_players", 1),
(try_end),
(store_mission_timer_a, ":round_time"),
(val_sub, ":round_time", "$g_round_start_time"),
(eq, "$g_round_ended", 0),
(try_begin), #addition for siege mod to allow players spawn more than once (begin)
(lt, ":player_agent", 0),
(try_begin), #new added begin, to avoid siege-crack (rejoining of defenders when they die)
(eq, ":player_team", 0),
(player_get_slot, ":player_last_team_select_time", ":player_no", slot_player_last_team_select_time),
(store_mission_timer_a, ":current_time"),
(store_sub, ":elapsed_time", ":current_time", ":player_last_team_select_time"),
(assign, ":player_team_respawn_period", "$g_multiplayer_respawn_period"),
(val_add, ":player_team_respawn_period", multiplayer_siege_mod_defender_team_extra_respawn_time), #new added for siege mod
(lt, ":elapsed_time", ":player_team_respawn_period"),
(store_sub, ":round_time", ":current_time", "$g_round_start_time"),
(ge, ":round_time", multiplayer_new_agents_finish_spawning_time),
(gt, ":num_active_players", 2),
(store_mul, ":multipication_of_num_active_players_in_teams", ":num_active_players_in_team_0", ":num_active_players_in_team_1"),
(neq, ":multipication_of_num_active_players_in_teams", 0),
(assign, ":spawn_new", 0),
(else_try), #new added end
(assign, ":spawn_new", 1),
(try_end),
(else_try),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":player_agent"),
(assign, ":player_team_respawn_period", "$g_multiplayer_respawn_period"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":player_team_respawn_period", multiplayer_siege_mod_defender_team_extra_respawn_time),
(try_end),
(this_or_next|gt, ":elapsed_time", ":player_team_respawn_period"),
(player_slot_eq, ":player_no", slot_player_spawned_at_siege_round, 0),
(assign, ":spawn_new", 1),
(try_end),
(try_end), #addition for siege mod to allow players spawn more than once (end)
(player_get_slot, ":spawn_count", ":player_no", slot_player_spawn_count),
(try_begin),
(gt, "$g_multiplayer_number_of_respawn_count", 0),
(try_begin),
(eq, ":spawn_new", 1),
(eq, ":player_team", 0),
(ge, ":spawn_count", "$g_multiplayer_number_of_respawn_count"),
(assign, ":spawn_new", 0),
(else_try),
(eq, ":spawn_new", 1),
(eq, ":player_team", 1),
(ge, ":spawn_count", 999),
(assign, ":spawn_new", 0),
(try_end),
(try_end),
(eq, ":spawn_new", 1),
(call_script, "script_multiplayer_buy_agent_equipment", ":player_no"),
(player_get_slot, ":spawn_count", ":player_no", slot_player_spawn_count),
(val_add, ":spawn_count", 1),
(player_set_slot, ":player_no", slot_player_spawn_count, ":spawn_count"),
(try_begin),
(ge, ":spawn_count", "$g_multiplayer_number_of_respawn_count"),
(gt, "$g_multiplayer_number_of_respawn_count", 0),
(eq, ":player_team", 0),
(assign, ":spawn_count", 999),
(player_set_slot, ":player_no", slot_player_spawn_count, ":spawn_count"),
(try_end),
(assign, ":player_is_horseman", 0),
(player_get_item_id, ":item_id", ":player_no", ek_horse),
(try_begin),
(this_or_next|is_between, ":item_id", horses_begin, horses_end),
(this_or_next|eq, ":item_id", "itm_warhorse_sarranid"),
(eq, ":item_id", "itm_warhorse_steppe"),
(assign, ":player_is_horseman", 1),
(try_end),
(try_begin),
(lt, ":round_time", 20), #at start of game spawn at base entry point (only enemies)
(try_begin),
(eq, ":player_team", 0), #defenders in siege mod at start of round
(call_script, "script_multiplayer_find_spawn_point", ":player_team", 1, ":player_is_horseman"),
(assign, ":entry_no", reg0),
(else_try),
(eq, ":player_team", 1), #attackers in siege mod at start of round
(assign, ":entry_no", multi_initial_spawn_point_team_2), #change later
(try_end),
(else_try),
(call_script, "script_multiplayer_find_spawn_point", ":player_team", 0, ":player_is_horseman"),
(assign, ":entry_no", reg0),
(try_end),
(player_spawn_new_agent, ":player_no", ":entry_no"),
(player_set_slot, ":player_no", slot_player_spawned_this_round, 1),
(player_set_slot, ":player_no", slot_player_spawned_at_siege_round, 1),
(try_end),
]),
(1, 0, 0, [], #do this in every new frame, but not at the same time
[
(multiplayer_is_server),
(store_mission_timer_a, ":mission_timer"),
(ge, ":mission_timer", 2),
(assign, ":team_1_count", 0),
(assign, ":team_2_count", 0),
(try_for_agents, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(assign, ":will_be_counted", 0),
(try_begin),
(agent_is_alive, ":cur_agent"),
(assign, ":will_be_counted", 1), #alive so will be counted
(else_try),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":cur_agent"),
(le, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":will_be_counted", 1),
(try_end),
(eq, ":will_be_counted", 1),
(agent_get_team, ":cur_team", ":cur_agent"),
(try_begin),
(eq, ":cur_team", 0),
(val_add, ":team_1_count", 1),
(else_try),
(eq, ":cur_team", 1),
(val_add, ":team_2_count", 1),
(try_end),
(try_end),
(store_sub, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1", ":team_1_count"),
(store_sub, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2", ":team_2_count"),
(val_max, "$g_multiplayer_num_bots_required_team_1", 0),
(val_max, "$g_multiplayer_num_bots_required_team_2", 0),
]),
multiplayer_server_spawn_bots,
multiplayer_server_manage_bots,
multiplayer_server_check_end_map,
(ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_multiplayer_mission_end_screen", 0),
(assign, "$g_multiplayer_stats_chart_opened_manually", 1),
(start_presentation, "prsnt_multiplayer_stats_chart"),
(try_end),
]),
multiplayer_once_at_the_first_frame,
(ti_battle_window_opened, 0, 0, [], [
(start_presentation, "prsnt_multiplayer_round_time_counter"),
(start_presentation, "prsnt_multiplayer_team_score_display"),
]),
(ti_escape_pressed, 0, 0, [],
[
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_stats_chart"),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(start_presentation, "prsnt_multiplayer_escape_menu"),
]),
],
),
(
"multiplayer_bt",mtf_battle_mode,-1, #battle mode
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(34,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(35,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(36,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(42,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(43,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(48,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(49,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(50,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(51,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(52,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(53,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(54,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(55,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(56,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(57,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(58,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(59,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(60,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(61,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(62,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(63,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
common_battle_init_banner,
multiplayer_server_check_polls,
(ti_server_player_joined, 0, 0, [],
[
(store_trigger_param_1, ":player_no"),
(call_script, "script_multiplayer_server_player_joined_common", ":player_no"),
]),
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(call_script, "script_multiplayer_server_before_mission_start_common"),
(assign, "$g_waiting_for_confirmation_to_terminate", 0),
(assign, "$g_round_ended", 0),
(assign, "$g_battle_death_mode_started", 0),
(assign, "$g_reduced_waiting_seconds", 0),
(try_begin),
(multiplayer_is_server),
(assign, "$server_mission_timer_while_player_joined", 0),
(assign, "$g_round_start_time", 0),
(try_end),
(assign, "$my_team_at_start_of_round", -1),
(call_script, "script_multiplayer_init_mission_variables"),
(call_script, "script_multiplayer_remove_destroy_mod_targets"),
(call_script, "script_multiplayer_remove_headquarters_flags"),
]),
(ti_after_mission_start, 0, 0, [],
[
(call_script, "script_determine_team_flags", 0),
(call_script, "script_determine_team_flags", 1),
(set_spawn_effector_scene_prop_kind, 0, -1), #during this mission, agents of "team 0" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(set_spawn_effector_scene_prop_kind, 1, -1), #during this mission, agents of "team 1" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(try_begin),
(multiplayer_is_server),
(assign, "$g_multiplayer_ready_for_spawning_agent", 1),
(entry_point_get_position, pos0, multi_death_mode_point),
(position_set_z_to_ground_level, pos0),
(position_move_z, pos0, -2000),
(position_move_x, pos0, 100),
(set_spawn_position, pos0),
(spawn_scene_prop, "spr_headquarters_pole_code_only", 0),
(position_move_x, pos0, -200),
(set_spawn_position, pos0),
(spawn_scene_prop, "spr_headquarters_pole_code_only", 0),
(scene_prop_get_instance, ":pole_1_id", "spr_headquarters_pole_code_only", 0),
(prop_instance_get_position, pos0, ":pole_1_id"),
(spawn_scene_prop, "$team_1_flag_scene_prop", 0),
(position_move_z, pos0, multi_headquarters_flag_initial_height),
(prop_instance_set_position, reg0, pos0),
(scene_prop_get_instance, ":pole_2_id", "spr_headquarters_pole_code_only", 1),
(prop_instance_get_position, pos0, ":pole_2_id"),
(spawn_scene_prop, "$team_2_flag_scene_prop", 0),
(position_move_z, pos0, multi_headquarters_flag_initial_height),
(prop_instance_set_position, reg0, pos0),
(assign, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1"),
(assign, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2"),
(try_end),
(call_script, "script_initialize_all_scene_prop_slots"),
(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
]),
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_multiplayer_server_on_agent_spawn_common", ":agent_no"),
(try_begin), #if my initial team still not initialized, find and assign its value.
(lt, "$my_team_at_start_of_round", 0),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_agent_id", ":my_player_no"),
(eq, ":my_agent_id", ":agent_no"),
(ge, ":my_agent_id", 0),
(agent_get_team, "$my_team_at_start_of_round", ":my_agent_id"),
(try_end),
(call_script, "script_calculate_new_death_waiting_time_at_death_mod"),
(try_begin),
(neg|multiplayer_is_server),
(try_begin),
(eq, "$g_round_ended", 1),
(assign, "$g_round_ended", 0),
#initialize scene object slots at start of new round at clients.
(call_script, "script_initialize_all_scene_prop_slots"),
#these lines are done in only clients at start of each new round.
(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(call_script, "script_initialize_objects_clients"),
#end of lines
(try_begin),
(eq, "$g_team_balance_next_round", 1),
(assign, "$g_team_balance_next_round", 0),
(try_end),
(try_end),
(try_end),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(call_script, "script_multiplayer_server_on_agent_killed_or_wounded_common", ":dead_agent_no", ":killer_agent_no"),
(try_begin), #if my initial team still not initialized, find and assign its value.
(lt, "$my_team_at_start_of_round", 0),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_agent_id", ":my_player_no"),
(ge, ":my_agent_id", 0),
(agent_get_team, "$my_team_at_start_of_round", ":my_agent_id"),
(try_end),
(try_begin), #count players and if round ended understand this.
(agent_is_human, ":dead_agent_no"),
(assign, ":team1_living_players", 0),
(assign, ":team2_living_players", 0),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(try_begin),
(agent_is_alive, ":cur_agent"),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(try_begin),
(eq, ":cur_agent_team", 0),
(val_add, ":team1_living_players", 1),
(else_try),
(eq, ":cur_agent_team", 1),
(val_add, ":team2_living_players", 1),
(try_end),
(try_end),
(try_end),
(try_begin),
(eq, "$g_round_ended", 0),
(try_begin),
(this_or_next|eq, ":team1_living_players", 0),
(eq, ":team2_living_players", 0),
(assign, "$g_winner_team", -1),
(assign, reg0, "$g_multiplayer_respawn_period"),
(try_begin),
(eq, ":team1_living_players", 0),
(try_begin),
(neq, ":team2_living_players", 0),
(team_get_score, ":team_2_score", 1),
(val_add, ":team_2_score", 1),
(team_set_score, 1, ":team_2_score"),
(assign, "$g_winner_team", 1),
(try_end),
(call_script, "script_show_multiplayer_message", multiplayer_message_type_round_result_in_battle_mode, "$g_winner_team"), #1 is winner team
(call_script, "script_check_achievement_last_man_standing", "$g_winner_team"),
(else_try),
(try_begin),
(neq, ":team1_living_players", 0),
(team_get_score, ":team_1_score", 0),
(val_add, ":team_1_score", 1),
(team_set_score, 0, ":team_1_score"),
(assign, "$g_winner_team", 0),
(try_end),
(call_script, "script_show_multiplayer_message", multiplayer_message_type_round_result_in_battle_mode, "$g_winner_team"), #0 is winner team
(call_script, "script_check_achievement_last_man_standing", "$g_winner_team"),
(try_end),
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(try_end),
(try_end),
(try_end),
(try_begin),
(multiplayer_is_server),
(agent_is_human, ":dead_agent_no"),
(neg|agent_is_non_player, ":dead_agent_no"),
(ge, ":dead_agent_no", 0),
(agent_get_player_id, ":dead_agent_player_id", ":dead_agent_no"),
(ge, ":dead_agent_player_id", 0),
(set_fixed_point_multiplier, 100),
(agent_get_player_id, ":dead_agent_player_id", ":dead_agent_no"),
(agent_get_position, pos0, ":dead_agent_no"),
(position_get_x, ":x_coor", pos0),
(position_get_y, ":y_coor", pos0),
(position_get_z, ":z_coor", pos0),
(player_set_slot, ":dead_agent_player_id", slot_player_death_pos_x, ":x_coor"),
(player_set_slot, ":dead_agent_player_id", slot_player_death_pos_y, ":y_coor"),
(player_set_slot, ":dead_agent_player_id", slot_player_death_pos_z, ":z_coor"),
(try_end),
]),
(ti_on_multiplayer_mission_end, 0, 0, [],
[
(call_script, "script_multiplayer_event_mission_end"),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(start_presentation, "prsnt_multiplayer_stats_chart"),
]),
(1, 0, 0, [(multiplayer_is_server),
(eq, "$g_round_ended", 0),
(store_mission_timer_a, ":current_time"),
(store_sub, ":seconds_past_in_round", ":current_time", "$g_round_start_time"),
(ge, ":seconds_past_in_round", "$g_multiplayer_round_max_seconds"),
(assign, ":overtime_needed", 0), #checking for if overtime is needed. Overtime happens when lower heighted flag is going up
(try_begin),
(eq, "$g_battle_death_mode_started", 2), #if death mod is currently open
(scene_prop_get_instance, ":pole_1_id", "spr_headquarters_pole_code_only", 0),
(scene_prop_get_instance, ":pole_2_id", "spr_headquarters_pole_code_only", 1),
(scene_prop_get_instance, ":flag_1_id", "$team_1_flag_scene_prop", 0),
(scene_prop_get_instance, ":flag_2_id", "$team_2_flag_scene_prop", 0),
(prop_instance_get_position, pos1, ":pole_1_id"),
(prop_instance_get_position, pos2, ":pole_2_id"),
(prop_instance_get_position, pos3, ":flag_1_id"),
(prop_instance_get_position, pos4, ":flag_2_id"),
(get_distance_between_positions, ":height_of_flag_1", pos1, pos3),
(get_distance_between_positions, ":height_of_flag_2", pos2, pos4),
(store_add, ":height_of_flag_1_plus", ":height_of_flag_1", min_allowed_flag_height_difference_to_make_score),
(store_add, ":height_of_flag_2_plus", ":height_of_flag_2", min_allowed_flag_height_difference_to_make_score),
(try_begin),
(le, ":height_of_flag_1", ":height_of_flag_2_plus"),
(prop_instance_is_animating, ":is_animating", ":flag_1_id"),
(eq, ":is_animating", 1),
(prop_instance_get_animation_target_position, pos5, ":flag_1_id"),
(position_get_z, ":flag_2_animation_target_z", pos5),
(position_get_z, ":flag_1_cur_z", pos3),
(ge, ":flag_2_animation_target_z", ":flag_1_cur_z"),
(assign, ":overtime_needed", 1),
(try_end),
(try_begin),
(le, ":height_of_flag_2", ":height_of_flag_1_plus"),
(prop_instance_is_animating, ":is_animating", ":flag_2_id"),
(eq, ":is_animating", 1),
(prop_instance_get_animation_target_position, pos5, ":flag_2_id"),
(position_get_z, ":flag_2_animation_target_z", pos5),
(position_get_z, ":flag_2_cur_z", pos4),
(ge, ":flag_2_animation_target_z", ":flag_2_cur_z"),
(assign, ":overtime_needed", 1),
(try_end),
(try_end),
(eq, ":overtime_needed", 0),
],
[ #round time is up
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(assign, "$g_winner_team", -1),
(try_begin), #checking for winning by death mod
(eq, "$g_battle_death_mode_started", 2), #if death mod is currently open
(scene_prop_get_instance, ":pole_1_id", "spr_headquarters_pole_code_only", 0),
(scene_prop_get_instance, ":pole_2_id", "spr_headquarters_pole_code_only", 1),
(scene_prop_get_instance, ":flag_1_id", "$team_1_flag_scene_prop", 0),
(scene_prop_get_instance, ":flag_2_id", "$team_2_flag_scene_prop", 0),
(prop_instance_get_position, pos1, ":pole_1_id"),
(prop_instance_get_position, pos2, ":pole_2_id"),
(prop_instance_get_position, pos3, ":flag_1_id"),
(prop_instance_get_position, pos4, ":flag_2_id"),
(get_distance_between_positions, ":height_of_flag_1", pos1, pos3),
(get_distance_between_positions, ":height_of_flag_2", pos2, pos4),
(try_begin),
(ge, ":height_of_flag_1", ":height_of_flag_2"), #if flag_1 is higher than flag_2
(store_sub, ":difference_of_heights", ":height_of_flag_1", ":height_of_flag_2"),
(ge, ":difference_of_heights", min_allowed_flag_height_difference_to_make_score), #if difference between flag heights is greater than
(assign, "$g_winner_team", 0), #"min_allowed_flag_height_difference_to_make_score" const value
(else_try), #if flag_2 is higher than flag_1
(store_sub, ":difference_of_heights", ":height_of_flag_2", ":height_of_flag_1"),
(ge, ":difference_of_heights", min_allowed_flag_height_difference_to_make_score), #if difference between flag heights is greater than
(assign, "$g_winner_team", 1), #"min_allowed_flag_height_difference_to_make_score" const value
(try_end),
(try_end),
(multiplayer_get_my_player, ":my_player_no"), #send all players draw information of round.
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_draw_this_round", "$g_winner_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":player_no", ":my_player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_draw_this_round, "$g_winner_team"),
(try_end),
]),
(10, 0, 0, [(multiplayer_is_server)],
[
#auto team balance control during the round
(assign, ":number_of_players_at_team_1", 0),
(assign, ":number_of_players_at_team_2", 0),
(get_max_players, ":num_players"),
(try_for_range, ":cur_player", 0, ":num_players"),
(player_is_active, ":cur_player"),
(player_get_team_no, ":player_team", ":cur_player"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":number_of_players_at_team_1", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":number_of_players_at_team_2", 1),
(try_end),
(try_end),
#end of counting active players per team.
(store_sub, ":difference_of_number_of_players", ":number_of_players_at_team_1", ":number_of_players_at_team_2"),
(assign, ":number_of_players_will_be_moved", 0),
(try_begin),
(try_begin),
(store_mul, ":checked_value", "$g_multiplayer_auto_team_balance_limit", -1),
(le, ":difference_of_number_of_players", ":checked_value"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", -2),
(else_try),
(ge, ":difference_of_number_of_players", "$g_multiplayer_auto_team_balance_limit"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", 2),
(try_end),
(try_end),
#number of players will be moved calculated. (it is 0 if no need to make team balance)
(try_begin),
(gt, ":number_of_players_will_be_moved", 0),
(try_begin),
(eq, "$g_team_balance_next_round", 0),
(assign, "$g_team_balance_next_round", 1),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_auto_team_balance_next, 0), #0 is useless here
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_auto_team_balance_next),
(try_end),
(call_script, "script_warn_player_about_auto_team_balance"),
(try_end),
(try_end),
#team balance check part finished
]),
#checking for starting "death mode part 1"
(1, 0, 0, [(multiplayer_is_server),
(eq, "$g_round_ended", 0),
(eq, "$g_battle_death_mode_started", 0),
(store_mission_timer_a, ":seconds_past_till_round_started"),
(val_sub, ":seconds_past_till_round_started", "$g_round_start_time"),
(store_div, "$g_multiplayer_round_max_seconds_div_2", "$g_multiplayer_round_max_seconds", 2),
(ge, ":seconds_past_till_round_started", "$g_multiplayer_round_max_seconds_div_2")],
[
(call_script, "script_calculate_new_death_waiting_time_at_death_mod"),
(assign, "$g_battle_death_mode_started", 1),
]),
#checking during "death mode part 1" for entering "death mode part 2"
(1, 0, 0, [(multiplayer_is_server),
(eq, "$g_round_ended", 0),
(eq, "$g_battle_death_mode_started", 1),
(store_mission_timer_a, ":seconds_past_till_death_mode_part_1_started"),
(val_sub, ":seconds_past_till_death_mode_part_1_started", "$g_death_mode_part_1_start_time"),
(store_add, ":g_battle_waiting_seconds_plus_reduced_waiting_seconds", "$g_battle_waiting_seconds", "$g_reduced_waiting_seconds"),
(ge, ":seconds_past_till_death_mode_part_1_started", ":g_battle_waiting_seconds_plus_reduced_waiting_seconds"), #death mod start if anybody did not dies in "$g_battle_waiting_seconds" seconds
(store_mission_timer_a, ":current_time"),
(store_sub, ":seconds_past_in_round", ":current_time", "$g_round_start_time"),
(store_sub, ":g_multiplayer_round_max_seconds_sub_15", "$g_multiplayer_round_max_seconds", 15),
(lt, ":seconds_past_in_round", ":g_multiplayer_round_max_seconds_sub_15")], #death mod cannot start at last 15 seconds
[
(assign, "$g_battle_death_mode_started", 2),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_start_death_mode"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_start_death_mode),
(try_end),
(scene_prop_get_instance, ":pole_1_id", "spr_headquarters_pole_code_only", 0),
(scene_prop_get_instance, ":pole_2_id", "spr_headquarters_pole_code_only", 1),
(scene_prop_get_instance, ":flag_1_id", "$team_1_flag_scene_prop", 0),
(scene_prop_get_instance, ":flag_2_id", "$team_2_flag_scene_prop", 0),
#death mode started make 4 item related to death mode visible.
(store_random_in_range, "$g_random_entry_point", 0, 3),
(val_add, "$g_random_entry_point", multi_death_mode_point),
(entry_point_get_position, pos0, "$g_random_entry_point"),
(position_set_z_to_ground_level, pos0),
(position_move_x, pos0, 100),
(prop_instance_set_position, ":pole_1_id", pos0),
(position_move_x, pos0, -200),
(prop_instance_set_position, ":pole_2_id", pos0),
(prop_instance_get_position, pos0, ":pole_1_id"),
(position_move_z, pos0, multi_headquarters_flag_initial_height),
(prop_instance_set_position, ":flag_1_id", pos0),
(prop_instance_get_position, pos0, ":pole_2_id"),
(position_move_z, pos0, multi_headquarters_flag_initial_height),
(prop_instance_set_position, ":flag_2_id", pos0),
(start_presentation, "prsnt_multiplayer_flag_projection_display_bt"),
]),
(3, 0, 0, [(multiplayer_is_server), #this trigger is to reduce "$g_battle_waiting_seconds" at between last 66th and last 24th seconds 1 per 3 seconds, total 14 seconds.
(eq, "$g_round_ended", 0),
(eq, "$g_battle_death_mode_started", 1),
(store_mission_timer_a, ":seconds_past_till_death_mode_part_1_started"),
(val_sub, ":seconds_past_till_death_mode_part_1_started", "$g_death_mode_part_1_start_time"),
(store_add, ":g_battle_waiting_seconds_plus_reduced_waiting_seconds", "$g_battle_waiting_seconds", "$g_reduced_waiting_seconds"),
(val_sub, ":g_battle_waiting_seconds_plus_reduced_waiting_seconds", 20), #in last 20 seconds to master of field below code effects
(ge, ":seconds_past_till_death_mode_part_1_started", ":g_battle_waiting_seconds_plus_reduced_waiting_seconds"),], #death mod start if anybody did not dies in "$g_battle_waiting_seconds" seconds
[
(assign, ":there_are_fighting_agents", 0),
(try_for_agents, ":agent_no_1"),
(eq, ":there_are_fighting_agents", 0),
(agent_is_human, ":agent_no_1"),
(try_for_agents, ":agent_no_2"),
(agent_is_human, ":agent_no_2"),
(neq, ":agent_no_1", ":agent_no_2"),
(agent_get_team, ":agent_no_1_team", ":agent_no_1"),
(agent_get_team, ":agent_no_2_team", ":agent_no_2"),
(neq, ":agent_no_1_team", ":agent_no_2_team"),
(agent_get_position, pos1, ":agent_no_1"),
(agent_get_position, pos2, ":agent_no_2"),
(get_sq_distance_between_positions_in_meters, ":sq_dist_in_meters", pos1, pos2),
(le, ":sq_dist_in_meters", multi_max_sq_dist_between_agents_to_longer_mof_time),
(assign, ":there_are_fighting_agents", 1),
(try_end),
(try_end),
(try_begin),
(eq, ":there_are_fighting_agents", 1),
(val_add, "$g_reduced_waiting_seconds", 3),
#(display_message, "@{!}DEBUG : there are fighting agents"),
(try_end),
]),
(3, 0, 0, [(multiplayer_is_server), #this trigger is to reduce "$g_battle_waiting_seconds" at between last 66th and last 24th seconds 1 per 3 seconds, total 14 seconds.
(eq, "$g_round_ended", 0),
(eq, "$g_battle_death_mode_started", 1),
(store_mission_timer_a, ":current_time"),
(store_sub, ":seconds_past_in_round", ":current_time", "$g_round_start_time"),
(store_sub, ":g_multiplayer_round_max_seconds_sub_60", "$g_multiplayer_round_max_seconds", 66),
(ge, ":seconds_past_in_round", ":g_multiplayer_round_max_seconds_sub_60"),
(store_mission_timer_a, ":current_time"),
(store_sub, ":seconds_past_in_round", ":current_time", "$g_round_start_time"),
(store_sub, ":g_multiplayer_round_max_seconds_sub_20", "$g_multiplayer_round_max_seconds", 24),
(le, ":seconds_past_in_round", ":g_multiplayer_round_max_seconds_sub_20"),
],
[
(val_add, "$g_reduced_waiting_seconds", 1),
]),
(0, 0, 0, [(multiplayer_is_server),
(eq, "$g_round_ended", 0),
(eq, "$g_battle_death_mode_started", 2)],
[
(set_fixed_point_multiplier, 100),
(scene_prop_get_instance, ":pole_1_id", "spr_headquarters_pole_code_only", 0),
(scene_prop_get_instance, ":pole_2_id", "spr_headquarters_pole_code_only", 1),
(scene_prop_get_instance, ":flag_1_id", "$team_1_flag_scene_prop", 0),
(scene_prop_get_instance, ":flag_2_id", "$team_2_flag_scene_prop", 0),
(prop_instance_get_position, pos1, ":pole_1_id"),
(prop_instance_get_position, pos2, ":pole_2_id"),
(prop_instance_get_position, pos3, ":flag_1_id"),
(prop_instance_get_position, pos4, ":flag_2_id"),
(copy_position, pos7, pos1),
(position_move_z, pos7, multi_headquarters_flag_initial_height),
(copy_position, pos8, pos2),
(position_move_z, pos8, multi_headquarters_flag_initial_height),
(get_distance_between_positions, ":dist_1", pos1, pos3),
(get_distance_between_positions, ":dist_2", pos2, pos4),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", 0),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_agent_id, ":agent_id", ":player_no"),
(ge, ":agent_id", 0),
(agent_is_human, ":agent_id"),
(agent_is_alive, ":agent_id"),
(agent_get_team, ":agent_team", ":agent_id"),
(agent_get_position, pos0, ":agent_id"),
(agent_get_horse, ":agent_horse", ":agent_id"),
(eq, ":agent_horse", -1), #horseman cannot move flag
(try_begin),
(eq, ":agent_team", 0),
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin), #we found a team_1 agent in the flag_1 area, so flag_1 situation can be 1 or -2
(this_or_next|eq, ":there_are_agents_from_only_team_1_around_their_flag", 0),
(eq, ":there_are_agents_from_only_team_1_around_their_flag", 1),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", 1), #there are agents from only our team
(else_try),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", -2), #there are agents from both teams
(try_end),
(try_end),
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos2),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin), #we found a team_1 agent in the flag_2 area, so flag_2 situation can be -1 or -2
(eq, ":there_are_agents_from_only_team_2_around_their_flag", 0),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", -1), #there are agents from only rival team
(else_try),
(eq, ":there_are_agents_from_only_team_2_around_their_flag", 1),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", -2), #there are agents from both teams
(try_end),
(try_end),
(else_try),
(eq, ":agent_team", 1),
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos2),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin), #we found a team_2 agent in the flag 2 area, so flag_2 situation can be 1 or -2
(this_or_next|eq, ":there_are_agents_from_only_team_2_around_their_flag", 0),
(eq, ":there_are_agents_from_only_team_2_around_their_flag", 1),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", 1), #there are agents from only our team
(else_try),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", -2), #there are agents from both teams
(try_end),
(try_end),
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin), #we found a team_2 agent in the flag_1 area, so flag_1 situation can be -1 or -2
(eq, ":there_are_agents_from_only_team_1_around_their_flag", 0),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", -1), #there are agents from only rival team
(else_try),
(eq, ":there_are_agents_from_only_team_1_around_their_flag", 1),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", -2), #there are agents from both teams
(try_end),
(try_end),
(try_end),
(try_end),
#controlling battle win by death mode conditions
(try_begin),
(ge, ":dist_1", multi_headquarters_flag_height_to_win),
(assign, "$g_winner_team", 0),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_draw_this_round", "$g_winner_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_draw_this_round, "$g_winner_team"),
(try_end),
(team_get_score, ":team_1_score", 0),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", 0, ":team_1_score"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, 0, ":team_1_score"),
(try_end),
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(else_try),
(ge, ":dist_2", multi_headquarters_flag_height_to_win),
(assign, "$g_winner_team", 1),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_draw_this_round", "$g_winner_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_draw_this_round, "$g_winner_team"),
(try_end),
(team_get_score, ":team_2_score", 1),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", 1, ":team_2_score"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, 1, ":team_2_score"),
(try_end),
(call_script, "script_show_multiplayer_message", multiplayer_message_type_round_result_in_battle_mode, 0), #0 is winner team
(call_script, "script_check_achievement_last_man_standing", "$g_winner_team"),
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(try_end),
(try_begin),
(eq, "$g_round_ended", 0),
(position_get_z, ":flag_1_cur_z", pos3),
(prop_instance_is_animating, ":is_animating", ":flag_1_id"),
(try_begin), #if flag_1 is going down or up and there are agents from both teams
(eq, ":there_are_agents_from_only_team_1_around_their_flag", -2), #if there are agents from both teams
(eq, ":is_animating", 1),
(prop_instance_stop_animating, ":flag_1_id"), #stop flag_1
(else_try), #if flag_1 is going down
(this_or_next|eq, ":there_are_agents_from_only_team_1_around_their_flag", 0), #if there is no one
(eq, ":there_are_agents_from_only_team_1_around_their_flag", -1), #if there are agents from only team_2 (enemy of team_1)
(prop_instance_get_animation_target_position, pos9, ":flag_1_id"),
(position_get_z, ":flag_1_animation_target_z", pos9),
(this_or_next|eq, ":is_animating", 0), #if flag_1 is stopping
(gt, ":flag_1_animation_target_z", ":flag_1_cur_z"), #if flag_1 is going up
(get_distance_between_positions, ":time_1", pos3, pos7),
(gt, ":time_1", 0),
(val_mul, ":time_1", 16),
(prop_instance_animate_to_position, ":flag_1_id", pos7, ":time_1"), #move flag_1 down
(else_try), #if flag_1 is going down or stopping
(eq, ":there_are_agents_from_only_team_1_around_their_flag", 1), #if there is agents from only team_1 (current team)
(prop_instance_get_animation_target_position, pos9, ":flag_1_id"),
(position_get_z, ":flag_1_animation_target_z", pos9),
(this_or_next|eq, ":is_animating", 0), #if flag_1 is stopping
(lt, ":flag_1_animation_target_z", ":flag_1_cur_z"), #if flag_1 is going down
(copy_position, pos5, pos1),
(position_move_z, pos5, multi_headquarters_flag_height_to_win),
(get_distance_between_positions, ":time_1", pos3, pos5),
(gt, ":time_1", 0),
(val_mul, ":time_1", 8),
(prop_instance_animate_to_position, ":flag_1_id", pos5, ":time_1"), #move flag_1 up
(try_end),
(position_get_z, ":flag_2_cur_z", pos4),
(prop_instance_is_animating, ":is_animating", ":flag_2_id"),
(try_begin), #if flag is going down or up and there are agents from both teams
(eq, ":there_are_agents_from_only_team_2_around_their_flag", -2), #if there are agents from both teams
(eq, ":is_animating", 1),
(prop_instance_stop_animating, ":flag_2_id"), #stop flag_2
(else_try), #if flag_2 is going down
(this_or_next|eq, ":there_are_agents_from_only_team_2_around_their_flag", 0), #if there is no one
(eq, ":there_are_agents_from_only_team_2_around_their_flag", -1), #if there are agents from only team_1 (enemy of team_1)
(prop_instance_get_animation_target_position, pos9, ":flag_2_id"),
(position_get_z, ":flag_2_animation_target_z", pos9),
(this_or_next|eq, ":is_animating", 0), #if flag_2 is stopping
(gt, ":flag_2_animation_target_z", ":flag_2_cur_z"), #if flag_2 is going up
(get_distance_between_positions, ":time_2", pos4, pos8),
(gt, ":time_2", 0),
(val_mul, ":time_2", 16),
(prop_instance_animate_to_position, ":flag_2_id", pos8, ":time_2"), #move flag_2 down
(else_try), #if flag_2 is going down or stopping
(eq, ":there_are_agents_from_only_team_2_around_their_flag", 1), #if there is agents from only team_2 (current team)
(prop_instance_get_animation_target_position, pos9, ":flag_2_id"),
(position_get_z, ":flag_2_animation_target_z", pos9),
(this_or_next|eq, ":is_animating", 0), #if flag_2 is stopping
(lt, ":flag_2_animation_target_z", ":flag_2_cur_z"), #if flag_2 is going down
(copy_position, pos6, pos2),
(position_move_z, pos6, multi_headquarters_flag_height_to_win),
(get_distance_between_positions, ":time_2", pos4, pos6),
(gt, ":time_2", 0),
(val_mul, ":time_2", 8),
(prop_instance_animate_to_position, ":flag_2_id", pos6, ":time_2"), #move flag_2 up
(try_end),
(try_end),
]),
(1, 0, 3, [(multiplayer_is_server),
(eq, "$g_round_ended", 1),
(store_mission_timer_a, ":seconds_past_till_round_ended"),
(val_sub, ":seconds_past_till_round_ended", "$g_round_finish_time"),
(ge, ":seconds_past_till_round_ended", "$g_multiplayer_respawn_period")],
[
#auto team balance control at the end of round
(assign, ":number_of_players_at_team_1", 0),
(assign, ":number_of_players_at_team_2", 0),
(get_max_players, ":num_players"),
(try_for_range, ":cur_player", 0, ":num_players"),
(player_is_active, ":cur_player"),
(player_get_team_no, ":player_team", ":cur_player"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":number_of_players_at_team_1", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":number_of_players_at_team_2", 1),
(try_end),
(try_end),
#end of counting active players per team.
(store_sub, ":difference_of_number_of_players", ":number_of_players_at_team_1", ":number_of_players_at_team_2"),
(assign, ":number_of_players_will_be_moved", 0),
(try_begin),
(try_begin),
(store_mul, ":checked_value", "$g_multiplayer_auto_team_balance_limit", -1),
(le, ":difference_of_number_of_players", ":checked_value"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", -2),
(assign, ":team_with_more_players", 1),
(assign, ":team_with_less_players", 0),
(else_try),
(ge, ":difference_of_number_of_players", "$g_multiplayer_auto_team_balance_limit"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", 2),
(assign, ":team_with_more_players", 0),
(assign, ":team_with_less_players", 1),
(try_end),
(try_end),
#number of players will be moved calculated. (it is 0 if no need to make team balance)
(try_begin),
(gt, ":number_of_players_will_be_moved", 0),
(try_begin),
#(eq, "$g_team_balance_next_round", 1), #control if at pre round players are warned about team change.
(try_for_range, ":unused", 0, ":number_of_players_will_be_moved"),
(assign, ":max_player_join_time", 0),
(assign, ":latest_joined_player_no", -1),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(eq, ":player_team", ":team_with_more_players"),
(player_get_slot, ":player_join_time", ":player_no", slot_player_join_time),
(try_begin),
(gt, ":player_join_time", ":max_player_join_time"),
(assign, ":max_player_join_time", ":player_join_time"),
(assign, ":latest_joined_player_no", ":player_no"),
(try_end),
(try_end),
(try_begin),
(ge, ":latest_joined_player_no", 0),
(try_begin),
#if player is living add +1 to his kill count because he will get -1 because of team change while living.
(player_get_agent_id, ":latest_joined_agent_id", ":latest_joined_player_no"),
(ge, ":latest_joined_agent_id", 0),
(agent_is_alive, ":latest_joined_agent_id"),
(player_get_kill_count, ":player_kill_count", ":latest_joined_player_no"), #adding 1 to his kill count, because he will lose 1 undeserved kill count for dying during team change
(val_add, ":player_kill_count", 1),
(player_set_kill_count, ":latest_joined_player_no", ":player_kill_count"),
(player_get_death_count, ":player_death_count", ":latest_joined_player_no"), #subtracting 1 to his death count, because he will gain 1 undeserved death count for dying during team change
(val_sub, ":player_death_count", 1),
(player_set_death_count, ":latest_joined_player_no", ":player_death_count"),
(player_get_score, ":player_score", ":latest_joined_player_no"), #adding 1 to his score count, because he will lose 1 undeserved score for dying during team change
(val_add, ":player_score", 1),
(player_set_score, ":latest_joined_player_no", ":player_score"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_4_int_to_player, ":player_no", multiplayer_event_set_player_score_kill_death, ":latest_joined_player_no", ":player_score", ":player_kill_count", ":player_death_count"),
(try_end),
(player_get_value_of_original_items, ":old_items_value", ":latest_joined_player_no"),
(player_get_gold, ":player_gold", ":latest_joined_player_no"),
(val_add, ":player_gold", ":old_items_value"),
(player_set_gold, ":latest_joined_player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(end_try),
(player_set_troop_id, ":latest_joined_player_no", -1),
(player_set_team_no, ":latest_joined_player_no", ":team_with_less_players"),
(multiplayer_send_message_to_player, ":latest_joined_player_no", multiplayer_event_force_start_team_selection),
(try_end),
(try_end),
#tutorial message (after team balance)
#(tutorial_message_set_position, 500, 500),
#(tutorial_message_set_size, 30, 30),
#(tutorial_message_set_center_justify, 1),
#(tutorial_message, "str_auto_team_balance_done", 0xFFFFFFFF, 5),
#for only server itself
(call_script, "script_show_multiplayer_message", multiplayer_message_type_auto_team_balance_done, 0),
#no need to send also server here
(multiplayer_get_my_player, ":my_player_no"),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_auto_team_balance_done),
(try_end),
(assign, "$g_team_balance_next_round", 0),
(try_end),
(try_end),
#team balance check part finished
(assign, "$g_team_balance_next_round", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_set_slot, ":player_no", slot_player_spawned_this_round, 0),
(player_get_agent_id, ":player_agent", ":player_no"),
(ge, ":player_agent", 0),
(agent_is_alive, ":player_agent"),
(player_save_picked_up_items_for_next_spawn, ":player_no"),
(player_get_value_of_original_items, ":old_items_value", ":player_no"),
(player_set_slot, ":player_no", slot_player_last_rounds_used_item_earnings, ":old_items_value"),
(try_end),
#money management
(assign, ":per_round_gold_addition", multi_battle_round_team_money_add),
(val_mul, ":per_round_gold_addition", "$g_multiplayer_round_earnings_multiplier"),
(val_div, ":per_round_gold_addition", 100),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_gold, ":player_gold", ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(try_begin),
(this_or_next|eq, ":player_team", 0),
(eq, ":player_team", 1),
(val_add, ":player_gold", ":per_round_gold_addition"),
(try_end),
#(below lines added new at 25.11.09 after Armagan decided new money system)
(try_begin),
(player_get_slot, ":old_items_value", ":player_no", slot_player_last_rounds_used_item_earnings),
(store_add, ":player_total_potential_gold", ":player_gold", ":old_items_value"),
(store_mul, ":minimum_gold", "$g_multiplayer_initial_gold_multiplier", 10),
(lt, ":player_total_potential_gold", ":minimum_gold"),
(store_sub, ":additional_gold", ":minimum_gold", ":player_total_potential_gold"),
(val_add, ":player_gold", ":additional_gold"),
(try_end),
#new money system addition end
(player_set_gold, ":player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(try_end),
#initialize my team at start of round (it will be assigned again at next round's first death)
(assign, "$my_team_at_start_of_round", -1),
#clear scene and end round
(multiplayer_clear_scene),
(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(try_begin),
(eq, "$g_battle_death_mode_started", 2),
(call_script, "script_move_death_mode_flags_down"),
(try_end),
(assign, "$g_battle_death_mode_started", 0),
(assign, "$g_reduced_waiting_seconds", 0),
#initialize moveable object positions
(call_script, "script_multiplayer_close_gate_if_it_is_open"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
(assign, "$g_round_ended", 0),
(assign, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1"),
(assign, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2"),
(store_mission_timer_a, "$g_round_start_time"),
(call_script, "script_initialize_all_scene_prop_slots"),
#initialize round start times for clients
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_set_round_start_time, -9999), #this will also initialize moveable object slots.
(try_end),
]),
(0, 0, 0, [], #if there is nobody in any teams do not reduce round time.
[
#(multiplayer_is_server),
(assign, ":human_agents_spawned_at_team_1", "$g_multiplayer_num_bots_team_1"),
(assign, ":human_agents_spawned_at_team_2", "$g_multiplayer_num_bots_team_2"),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":human_agents_spawned_at_team_1", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":human_agents_spawned_at_team_2", 1),
(try_end),
(try_end),
(try_begin),
(this_or_next|eq, ":human_agents_spawned_at_team_1", 0),
(eq, ":human_agents_spawned_at_team_2", 0),
(store_mission_timer_a, ":seconds_past_since_round_started"),
(val_sub, ":seconds_past_since_round_started", "$g_round_start_time"),
(le, ":seconds_past_since_round_started", 2),
(store_mission_timer_a, "$g_round_start_time"),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neg|player_is_busy_with_menus, ":player_no"),
(try_begin),
(player_slot_eq, ":player_no", slot_player_spawned_this_round, 0),
(player_get_team_no, ":player_team", ":player_no"), #if player is currently spectator do not spawn his agent
(lt, ":player_team", multi_team_spectator),
(player_get_troop_id, ":player_troop", ":player_no"), #if troop is not selected do not spawn his agent
(ge, ":player_troop", 0),
(assign, ":spawn_new", 0),
(assign, ":num_active_players_in_team_0", 0),
(assign, ":num_active_players_in_team_1", 0),
(try_begin),
(assign, ":num_active_players", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no_2", 0, ":num_players"),
(player_is_active, ":player_no_2"),
(val_add, ":num_active_players", 1),
(player_get_team_no, ":player_team_2", ":player_no_2"),
(try_begin),
(eq, ":player_team_2", 0),
(val_add, ":num_active_players_in_team_0", 1),
(else_try),
(eq, ":player_team_2", 1),
(val_add, ":num_active_players_in_team_1", 1),
(try_end),
(try_end),
(store_mul, ":multipication_of_num_active_players_in_teams", ":num_active_players_in_team_0", ":num_active_players_in_team_1"),
(store_mission_timer_a, ":round_time"),
(val_sub, ":round_time", "$g_round_start_time"),
(this_or_next|lt, ":round_time", multiplayer_new_agents_finish_spawning_time),
(this_or_next|le, ":num_active_players", 2),
(eq, ":multipication_of_num_active_players_in_teams", 0),
(eq, "$g_round_ended", 0),
(assign, ":spawn_new", 1),
(try_end),
(eq, ":spawn_new", 1),
(try_begin),
(eq, ":player_team", 0),
(assign, ":entry_no", multi_initial_spawn_point_team_1),
(else_try),
(eq, ":player_team", 1),
(assign, ":entry_no", multi_initial_spawn_point_team_2),
(try_end),
(call_script, "script_multiplayer_buy_agent_equipment", ":player_no"),
(player_spawn_new_agent, ":player_no", ":entry_no"),
(player_set_slot, ":player_no", slot_player_spawned_this_round, 1),
(else_try), #spawning as a bot (if option ($g_multiplayer_player_respawn_as_bot) is 1)
(eq, "$g_multiplayer_player_respawn_as_bot", 1),
(player_get_agent_id, ":player_agent", ":player_no"),
(ge, ":player_agent", 0),
(neg|agent_is_alive, ":player_agent"),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":player_agent"),
(gt, ":elapsed_time", "$g_multiplayer_respawn_period"),
(player_get_team_no, ":player_team", ":player_no"),
(assign, ":is_found", 0),
(try_for_agents, ":cur_agent"),
(eq, ":is_found", 0),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_get_team ,":cur_team", ":cur_agent"),
(eq, ":cur_team", ":player_team"),
(assign, ":is_found", 1),
#(player_control_agent, ":player_no", ":cur_agent"),
(try_end),
(try_begin),
(eq, ":is_found", 1),
(call_script, "script_find_most_suitable_bot_to_control", ":player_no"),
(player_control_agent, ":player_no", reg0),
(player_get_slot, ":num_spawns", ":player_no", slot_player_spawned_this_round),
(val_add, ":num_spawns", 1),
(player_set_slot, ":player_no", slot_player_spawned_this_round, ":num_spawns"),
(try_end),
(try_end),
(try_end),
]),
multiplayer_server_spawn_bots,
multiplayer_server_manage_bots,
multiplayer_server_check_end_map,
(ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_multiplayer_mission_end_screen", 0),
(assign, "$g_multiplayer_stats_chart_opened_manually", 1),
(start_presentation, "prsnt_multiplayer_stats_chart"),
(try_end),
]),
multiplayer_once_at_the_first_frame,
(ti_battle_window_opened, 0, 0, [], [
(start_presentation, "prsnt_multiplayer_round_time_counter"),
(start_presentation, "prsnt_multiplayer_team_score_display"),
(try_begin),
(eq, "$g_battle_death_mode_started", 2),
(start_presentation, "prsnt_multiplayer_flag_projection_display_bt"),
(try_end),
]),
(ti_escape_pressed, 0, 0, [],
[
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_stats_chart"),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(start_presentation, "prsnt_multiplayer_escape_menu"),
]),
],
),
(
"multiplayer_fd",mtf_battle_mode,-1, #fight and destroy mode
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
(34,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(35,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(36,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(42,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(43,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(48,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(49,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(50,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(51,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(52,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(53,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(54,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(55,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(56,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(57,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(58,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(59,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(60,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(61,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(62,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(63,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
common_battle_init_banner,
multiplayer_server_check_polls,
(ti_server_player_joined, 0, 0, [],
[
(store_trigger_param_1, ":player_no"),
(call_script, "script_multiplayer_server_player_joined_common", ":player_no"),
]),
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(call_script, "script_multiplayer_server_before_mission_start_common"),
(assign, "$g_waiting_for_confirmation_to_terminate", 0),
(assign, "$g_round_ended", 0),
(assign, "$g_reduced_waiting_seconds", 0),
(try_begin),
(multiplayer_is_server),
(assign, "$g_round_start_time", 0),
(try_end),
(assign, "$my_team_at_start_of_round", -1),
(call_script, "script_multiplayer_init_mission_variables"),
(call_script, "script_multiplayer_remove_headquarters_flags"),
]),
(ti_after_mission_start, 0, 0, [],
[
(call_script, "script_determine_team_flags", 0),
(call_script, "script_determine_team_flags", 1),
(set_spawn_effector_scene_prop_kind, 0, -1), #during this mission, agents of "team 0" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(set_spawn_effector_scene_prop_kind, 1, -1), #during this mission, agents of "team 1" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(call_script, "script_initialize_all_scene_prop_slots"),
(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
(assign, "$g_destructible_target_1", "spr_catapult_destructible"),
(assign, "$g_destructible_target_2", "spr_trebuchet_destructible"),
#assigning destructible object team nos to 0. (0 is also used for showing defender team in siege mode)
(scene_prop_get_num_instances, ":num_destructible_target_1", "$g_destructible_target_1"),
(try_for_range, ":destructible_target_1_no", 0, ":num_destructible_target_1"),
(scene_prop_get_instance, ":destructible_target_1_id", "$g_destructible_target_1", ":destructible_target_1_no"),
(ge, ":destructible_target_1_id", 0),
(scene_prop_set_team, ":destructible_target_1_id", 0),
(try_end),
(scene_prop_get_num_instances, ":num_destructible_target_2", "$g_destructible_target_2"),
(try_for_range, ":destructible_target_2_no", 0, ":num_destructible_target_2"),
(scene_prop_get_instance, ":destructible_target_2_id", "$g_destructible_target_2", ":destructible_target_2_no"),
(ge, ":destructible_target_2_id", 0),
(scene_prop_set_team, ":destructible_target_2_id", 0),
(try_end),
(try_begin),
(scene_prop_get_num_instances, ":num_catapults", "spr_catapult_destructible"),
(ge, ":num_catapults", 1),
(scene_prop_get_instance, ":catapult_scene_prop_id", "spr_catapult_destructible", 0),
(scene_prop_get_team, "$g_defender_team", ":catapult_scene_prop_id"),
(else_try),
(scene_prop_get_num_instances, ":num_trebuchets", "spr_trebuchet_destructible"),
(ge, ":num_trebuchets", 1),
(scene_prop_get_instance, ":trebuchet_scene_prop_id", "spr_trebuchet_destructible", 0),
(scene_prop_get_team, "$g_defender_team", ":trebuchet_scene_prop_id"),
(try_end),
(assign, "$g_number_of_targets_destroyed", 0),
(try_begin),
(assign, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1"),
(assign, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2"),
(try_end),
(start_presentation, "prsnt_multiplayer_destructible_targets_display"),
(assign, "$g_multiplayer_ready_for_spawning_agent", 1),
]),
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_multiplayer_server_on_agent_spawn_common", ":agent_no"),
(try_begin), #if my initial team still not initialized, find and assign its value.
(lt, "$my_team_at_start_of_round", 0),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_agent_id", ":my_player_no"),
(eq, ":my_agent_id", ":agent_no"),
(ge, ":my_agent_id", 0),
(agent_get_team, "$my_team_at_start_of_round", ":my_agent_id"),
(try_end),
(try_begin),
(neg|multiplayer_is_server),
(try_begin),
(eq, "$g_round_ended", 1),
(assign, "$g_round_ended", 0),
#initialize scene object slots at start of new round at clients.
(call_script, "script_initialize_all_scene_prop_slots"),
#these lines are done in only clients at start of each new round.
(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(call_script, "script_initialize_objects_clients"),
#end of lines
(start_presentation, "prsnt_multiplayer_destructible_targets_display"),
(try_begin),
(eq, "$g_team_balance_next_round", 1),
(assign, "$g_team_balance_next_round", 0),
(try_end),
(try_end),
(try_end),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(call_script, "script_multiplayer_server_on_agent_killed_or_wounded_common", ":dead_agent_no", ":killer_agent_no"),
(try_begin), #if my initial team still not initialized, find and assign its value.
(lt, "$my_team_at_start_of_round", 0),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_agent_id", ":my_player_no"),
(ge, ":my_agent_id", 0),
(agent_get_team, "$my_team_at_start_of_round", ":my_agent_id"),
(try_end),
(try_begin), #count players and if round ended understand this.
(agent_is_human, ":dead_agent_no"),
(assign, ":team1_living_players", 0),
(assign, ":team2_living_players", 0),
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(try_begin),
(agent_is_alive, ":cur_agent"),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(try_begin),
(eq, ":cur_agent_team", 0),
(val_add, ":team1_living_players", 1),
(else_try),
(eq, ":cur_agent_team", 1),
(val_add, ":team2_living_players", 1),
(try_end),
(try_end),
(try_end),
(try_begin),
(eq, "$g_round_ended", 0),
(try_begin),
(this_or_next|eq, ":team1_living_players", 0),
(eq, ":team2_living_players", 0),
(assign, "$g_winner_team", -1),
(assign, reg0, "$g_multiplayer_respawn_period"),
(try_begin),
(eq, ":team1_living_players", 0),
(try_begin),
(neq, ":team2_living_players", 0),
(assign, "$g_winner_team", 1),
(try_end),
(try_begin),
(eq, "$g_winner_team", -1),
(else_try),
(eq, "$g_defender_team", 1), #if defender team killed all attackers
(try_begin),
(neg|multiplayer_is_server),
(call_script, "script_calculate_number_of_targets_destroyed"),
(try_end),
(store_sub, ":num_targets_saved", 2, "$g_number_of_targets_destroyed"),
(call_script, "script_show_multiplayer_message", multiplayer_message_type_defenders_saved_n_targets, ":num_targets_saved"), #1 or -1 is winner team
(else_try),
(call_script, "script_show_multiplayer_message", multiplayer_message_type_attackers_won_the_round, 0), #1 or -1 is winner team
(try_end),
(else_try),
(try_begin),
(neq, ":team1_living_players", 0),
(assign, "$g_winner_team", 0),
(try_end),
(try_begin),
(eq, "$g_winner_team", -1),
(else_try),
(eq, "$g_defender_team", 0), #if defender team killed all attackers
(try_begin),
(neg|multiplayer_is_server),
(call_script, "script_calculate_number_of_targets_destroyed"),
(try_end),
(store_sub, ":num_targets_saved", 2, "$g_number_of_targets_destroyed"),
(call_script, "script_show_multiplayer_message", multiplayer_message_type_defenders_saved_n_targets, ":num_targets_saved"), #0 or -1 is winner team
(else_try),
(call_script, "script_show_multiplayer_message", multiplayer_message_type_attackers_won_the_round, 0), #0 or -1 is winner team
(try_end),
(try_end),
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(try_begin), #destroy score (condition : remained no one)
(multiplayer_is_server),
(ge, "$g_winner_team", 0),
(lt, "$g_winner_team", 2),
(neq, "$g_winner_team", -1),
(team_get_score, ":team_score", "$g_winner_team"),
(store_sub, ":num_targets_remained", 2, "$g_number_of_targets_destroyed"),
(val_add, ":team_score", ":num_targets_remained"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", "$g_winner_team", ":team_score"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, "$g_winner_team", ":team_score"),
(try_end),
(try_end), #destroy score end
(try_begin),
(neq, "$g_defender_team", "$g_winner_team"),
(neq, "$g_winner_team", -1),
(assign, "$g_number_of_targets_destroyed", 2),
(try_end),
(try_end),
(try_end),
(try_end),
(try_begin),
(multiplayer_is_server),
(agent_is_human, ":dead_agent_no"),
(neg|agent_is_non_player, ":dead_agent_no"),
(ge, ":dead_agent_no", 0),
(agent_get_player_id, ":dead_agent_player_id", ":dead_agent_no"),
(ge, ":dead_agent_player_id", 0),
(set_fixed_point_multiplier, 100),
(agent_get_player_id, ":dead_agent_player_id", ":dead_agent_no"),
(agent_get_position, pos0, ":dead_agent_no"),
(position_get_x, ":x_coor", pos0),
(position_get_y, ":y_coor", pos0),
(position_get_z, ":z_coor", pos0),
(player_set_slot, ":dead_agent_player_id", slot_player_death_pos_x, ":x_coor"),
(player_set_slot, ":dead_agent_player_id", slot_player_death_pos_y, ":y_coor"),
(player_set_slot, ":dead_agent_player_id", slot_player_death_pos_z, ":z_coor"),
(try_end),
]),
(ti_on_multiplayer_mission_end, 0, 0, [],
[
(call_script, "script_multiplayer_event_mission_end"),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(start_presentation, "prsnt_multiplayer_stats_chart"),
]),
(1, 0, 0, [(multiplayer_is_server),
(eq, "$g_round_ended", 0),
(eq, "$g_number_of_targets_destroyed", 2),
],
[
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(multiplayer_get_my_player, ":my_player_no"), #send all players draw information of round.
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_draw_this_round", -9),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":player_no", ":my_player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_draw_this_round, -9),
(try_end),
]),
(1, 0, 0, [(multiplayer_is_server),
(eq, "$g_round_ended", 0),
(store_mission_timer_a, ":current_time"),
(store_sub, ":seconds_past_in_round", ":current_time", "$g_round_start_time"),
(ge, ":seconds_past_in_round", "$g_multiplayer_round_max_seconds"),
],
[ #round time is up
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(assign, "$g_winner_team", -9),
(multiplayer_get_my_player, ":my_player_no"), #send all players draw information of round.
(store_sub, ":num_targets_saved", 2, "$g_number_of_targets_destroyed"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_defenders_saved_n_targets, ":num_targets_saved"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_defenders_saved_n_targets, ":num_targets_saved"),
(try_end),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_draw_this_round", "$g_winner_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":player_no", ":my_player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_draw_this_round, "$g_winner_team"),
(try_end),
(try_begin), #destroy score (condition : time is up)
(multiplayer_is_server),
(assign, "$g_winner_team", "$g_defender_team"),
(team_get_score, ":team_score", "$g_winner_team"),
(store_sub, ":num_targets_remained", 2, "$g_number_of_targets_destroyed"),
(val_add, ":team_score", ":num_targets_remained"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", "$g_winner_team", ":team_score"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, "$g_winner_team", ":team_score"),
(try_end),
(try_end), #destroy score end
]),
(10, 0, 0, [(multiplayer_is_server)],
[
#auto team balance control during the round
(assign, ":number_of_players_at_team_1", 0),
(assign, ":number_of_players_at_team_2", 0),
(get_max_players, ":num_players"),
(try_for_range, ":cur_player", 0, ":num_players"),
(player_is_active, ":cur_player"),
(player_get_team_no, ":player_team", ":cur_player"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":number_of_players_at_team_1", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":number_of_players_at_team_2", 1),
(try_end),
(try_end),
#end of counting active players per team.
(store_sub, ":difference_of_number_of_players", ":number_of_players_at_team_1", ":number_of_players_at_team_2"),
(assign, ":number_of_players_will_be_moved", 0),
(try_begin),
(try_begin),
(store_mul, ":checked_value", "$g_multiplayer_auto_team_balance_limit", -1),
(le, ":difference_of_number_of_players", ":checked_value"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", -2),
(else_try),
(ge, ":difference_of_number_of_players", "$g_multiplayer_auto_team_balance_limit"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", 2),
(try_end),
(try_end),
#number of players will be moved calculated. (it is 0 if no need to make team balance)
(try_begin),
(gt, ":number_of_players_will_be_moved", 0),
(try_begin),
(eq, "$g_team_balance_next_round", 0),
(assign, "$g_team_balance_next_round", 1),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_auto_team_balance_next, 0), #0 is useless here
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_auto_team_balance_next),
(try_end),
(call_script, "script_warn_player_about_auto_team_balance"),
(try_end),
(try_end),
#team balance check part finished
]),
(0, 0, 0, [(multiplayer_is_server),
(eq, "$g_round_ended", 0),
(eq, "$g_battle_death_mode_started", 2)],
[
(set_fixed_point_multiplier, 100),
(scene_prop_get_instance, ":pole_1_id", "spr_headquarters_pole_code_only", 0),
(scene_prop_get_instance, ":pole_2_id", "spr_headquarters_pole_code_only", 1),
(scene_prop_get_instance, ":flag_1_id", "$team_1_flag_scene_prop", 0),
(scene_prop_get_instance, ":flag_2_id", "$team_2_flag_scene_prop", 0),
(prop_instance_get_position, pos1, ":pole_1_id"),
(prop_instance_get_position, pos2, ":pole_2_id"),
(prop_instance_get_position, pos3, ":flag_1_id"),
(prop_instance_get_position, pos4, ":flag_2_id"),
(copy_position, pos7, pos1),
(position_move_z, pos7, multi_headquarters_flag_initial_height),
(copy_position, pos8, pos2),
(position_move_z, pos8, multi_headquarters_flag_initial_height),
(get_distance_between_positions, ":dist_1", pos1, pos3),
(get_distance_between_positions, ":dist_2", pos2, pos4),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", 0),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_agent_id, ":agent_id", ":player_no"),
(ge, ":agent_id", 0),
(agent_is_human, ":agent_id"),
(agent_is_alive, ":agent_id"),
(agent_get_team, ":agent_team", ":agent_id"),
(agent_get_position, pos0, ":agent_id"),
(agent_get_horse, ":agent_horse", ":agent_id"),
(eq, ":agent_horse", -1), #horseman cannot move flag
(try_begin),
(eq, ":agent_team", 0),
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin), #we found a team_1 agent in the flag_1 area, so flag_1 situation can be 1 or -2
(eq, ":there_are_agents_from_only_team_1_around_their_flag", 0),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", 1), #there are agents from only our team
(else_try),
(eq, ":there_are_agents_from_only_team_1_around_their_flag", -1),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", -2), #there are agents from both teams
(try_end),
(try_end),
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos2),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin), #we found a team_1 agent in the flag_2 area, so flag_2 situation can be -1 or -2
(eq, ":there_are_agents_from_only_team_2_around_their_flag", 0),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", -1), #there are agents from only rival team
(else_try),
(eq, ":there_are_agents_from_only_team_2_around_their_flag", 1),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", -2), #there are agents from both teams
(try_end),
(try_end),
(else_try),
(eq, ":agent_team", 1),
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos2),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin), #we found a team_2 agent in the flag 2 area, so flag_2 situation can be 1 or -2
(eq, ":there_are_agents_from_only_team_2_around_their_flag", 0),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", 1), #there are agents from only our team
(else_try),
(assign, ":there_are_agents_from_only_team_2_around_their_flag", -2), #there are agents from both teams
(try_end),
(try_end),
(try_begin),
(get_sq_distance_between_positions, ":squared_dist", pos0, pos1),
(lt, ":squared_dist", multi_headquarters_max_distance_sq_to_raise_flags),
(try_begin), #we found a team_2 agent in the flag_1 area, so flag_1 situation can be -1 or -2
(eq, ":there_are_agents_from_only_team_1_around_their_flag", 0),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", -1), #there are agents from only rival team
(else_try),
(eq, ":there_are_agents_from_only_team_1_around_their_flag", 1),
(assign, ":there_are_agents_from_only_team_1_around_their_flag", -2), #there are agents from both teams
(try_end),
(try_end),
(try_end),
(try_end),
#controlling battle win by death mode conditions
(try_begin),
(ge, ":dist_1", multi_headquarters_flag_height_to_win),
(assign, "$g_winner_team", 0),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_draw_this_round", "$g_winner_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_draw_this_round, "$g_winner_team"),
(try_end),
(team_get_score, ":team_1_score", 0),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", 0, ":team_1_score"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, 0, ":team_1_score"),
(try_end),
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(else_try),
(ge, ":dist_2", multi_headquarters_flag_height_to_win),
(assign, "$g_winner_team", 1),
(get_max_players, ":num_players"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_draw_this_round", "$g_winner_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_draw_this_round, "$g_winner_team"),
(try_end),
(team_get_score, ":team_2_score", 1),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_team_set_score", 1, ":team_2_score"),
#for only server itself-----------------------------------------------------------------------------------------------
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_team_score, 1, ":team_2_score"),
(try_end),
(call_script, "script_show_multiplayer_message", multiplayer_message_type_round_result_in_battle_mode, 0), #0 is winner team
(call_script, "script_check_achievement_last_man_standing", "$g_winner_team"),
(store_mission_timer_a, "$g_round_finish_time"),
(assign, "$g_round_ended", 1),
(try_end),
(try_begin),
(eq, "$g_round_ended", 0),
(position_get_z, ":flag_1_cur_z", pos3),
(prop_instance_is_animating, ":is_animating", ":flag_1_id"),
(try_begin), #if flag_1 is going down or up and there are agents from both teams
(eq, ":there_are_agents_from_only_team_1_around_their_flag", -2), #if there are agents from both teams
(eq, ":is_animating", 1),
(prop_instance_stop_animating, ":flag_1_id"), #stop flag_1
(else_try), #if flag_1 is going down
(this_or_next|eq, ":there_are_agents_from_only_team_1_around_their_flag", 0), #if there is no one
(eq, ":there_are_agents_from_only_team_1_around_their_flag", -1), #if there are agents from only team_2 (enemy of team_1)
(prop_instance_get_animation_target_position, pos9, ":flag_1_id"),
(position_get_z, ":flag_1_animation_target_z", pos9),
(this_or_next|eq, ":is_animating", 0), #if flag_1 is stopping
(gt, ":flag_1_animation_target_z", ":flag_1_cur_z"), #if flag_1 is going up
(get_distance_between_positions, ":time_1", pos3, pos7),
(gt, ":time_1", 0),
(val_mul, ":time_1", 16),
(prop_instance_animate_to_position, ":flag_1_id", pos7, ":time_1"), #move flag_1 down
(else_try), #if flag_1 is going down or stopping
(eq, ":there_are_agents_from_only_team_1_around_their_flag", 1), #if there is agents from only team_1 (current team)
(prop_instance_get_animation_target_position, pos9, ":flag_1_id"),
(position_get_z, ":flag_1_animation_target_z", pos9),
(this_or_next|eq, ":is_animating", 0), #if flag_1 is stopping
(lt, ":flag_1_animation_target_z", ":flag_1_cur_z"), #if flag_1 is going down
(copy_position, pos5, pos1),
(position_move_z, pos5, multi_headquarters_flag_height_to_win),
(get_distance_between_positions, ":time_1", pos3, pos5),
(gt, ":time_1", 0),
(val_mul, ":time_1", 8),
(prop_instance_animate_to_position, ":flag_1_id", pos5, ":time_1"), #move flag_1 up
(try_end),
(position_get_z, ":flag_2_cur_z", pos4),
(prop_instance_is_animating, ":is_animating", ":flag_2_id"),
(try_begin), #if flag is going down or up and there are agents from both teams
(eq, ":there_are_agents_from_only_team_2_around_their_flag", -2), #if there are agents from both teams
(eq, ":is_animating", 1),
(prop_instance_stop_animating, ":flag_2_id"), #stop flag_2
(else_try), #if flag_2 is going down
(this_or_next|eq, ":there_are_agents_from_only_team_2_around_their_flag", 0), #if there is no one
(eq, ":there_are_agents_from_only_team_2_around_their_flag", -1), #if there are agents from only team_1 (enemy of team_1)
(prop_instance_get_animation_target_position, pos9, ":flag_2_id"),
(position_get_z, ":flag_2_animation_target_z", pos9),
(this_or_next|eq, ":is_animating", 0), #if flag_2 is stopping
(gt, ":flag_2_animation_target_z", ":flag_2_cur_z"), #if flag_2 is going up
(get_distance_between_positions, ":time_2", pos4, pos8),
(gt, ":time_2", 0),
(val_mul, ":time_2", 16),
(prop_instance_animate_to_position, ":flag_2_id", pos8, ":time_2"), #move flag_2 down
(else_try), #if flag_2 is going down or stopping
(eq, ":there_are_agents_from_only_team_2_around_their_flag", 1), #if there is agents from only team_2 (current team)
(prop_instance_get_animation_target_position, pos9, ":flag_2_id"),
(position_get_z, ":flag_2_animation_target_z", pos9),
(this_or_next|eq, ":is_animating", 0), #if flag_2 is stopping
(lt, ":flag_2_animation_target_z", ":flag_2_cur_z"), #if flag_2 is going down
(copy_position, pos6, pos2),
(position_move_z, pos6, multi_headquarters_flag_height_to_win),
(get_distance_between_positions, ":time_2", pos4, pos6),
(gt, ":time_2", 0),
(val_mul, ":time_2", 8),
(prop_instance_animate_to_position, ":flag_2_id", pos6, ":time_2"), #move flag_2 up
(try_end),
(try_end),
]),
(1, 0, 3, [(multiplayer_is_server),
(eq, "$g_round_ended", 1),
(store_mission_timer_a, ":seconds_past_till_round_ended"),
(val_sub, ":seconds_past_till_round_ended", "$g_round_finish_time"),
(ge, ":seconds_past_till_round_ended", "$g_multiplayer_respawn_period")],
[
#auto team balance control at the end of round
(assign, ":number_of_players_at_team_1", 0),
(assign, ":number_of_players_at_team_2", 0),
(get_max_players, ":num_players"),
(try_for_range, ":cur_player", 0, ":num_players"),
(player_is_active, ":cur_player"),
(player_get_team_no, ":player_team", ":cur_player"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":number_of_players_at_team_1", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":number_of_players_at_team_2", 1),
(try_end),
(try_end),
#end of counting active players per team.
(store_sub, ":difference_of_number_of_players", ":number_of_players_at_team_1", ":number_of_players_at_team_2"),
(assign, ":number_of_players_will_be_moved", 0),
(try_begin),
(try_begin),
(store_mul, ":checked_value", "$g_multiplayer_auto_team_balance_limit", -1),
(le, ":difference_of_number_of_players", ":checked_value"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", -2),
(assign, ":team_with_more_players", 1),
(assign, ":team_with_less_players", 0),
(else_try),
(ge, ":difference_of_number_of_players", "$g_multiplayer_auto_team_balance_limit"),
(store_div, ":number_of_players_will_be_moved", ":difference_of_number_of_players", 2),
(assign, ":team_with_more_players", 0),
(assign, ":team_with_less_players", 1),
(try_end),
(try_end),
#number of players will be moved calculated. (it is 0 if no need to make team balance)
(try_begin),
(gt, ":number_of_players_will_be_moved", 0),
(try_begin),
#(eq, "$g_team_balance_next_round", 1), #control if at pre round players are warned about team change.
(try_for_range, ":unused", 0, ":number_of_players_will_be_moved"),
(assign, ":max_player_join_time", 0),
(assign, ":latest_joined_player_no", -1),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(eq, ":player_team", ":team_with_more_players"),
(player_get_slot, ":player_join_time", ":player_no", slot_player_join_time),
(try_begin),
(gt, ":player_join_time", ":max_player_join_time"),
(assign, ":max_player_join_time", ":player_join_time"),
(assign, ":latest_joined_player_no", ":player_no"),
(try_end),
(try_end),
(try_begin),
(ge, ":latest_joined_player_no", 0),
(try_begin),
#if player is living add +1 to his kill count because he will get -1 because of team change while living.
(player_get_agent_id, ":latest_joined_agent_id", ":latest_joined_player_no"),
(ge, ":latest_joined_agent_id", 0),
(agent_is_alive, ":latest_joined_agent_id"),
(player_get_kill_count, ":player_kill_count", ":latest_joined_player_no"), #adding 1 to his kill count, because he will lose 1 undeserved kill count for dying during team change
(val_add, ":player_kill_count", 1),
(player_set_kill_count, ":latest_joined_player_no", ":player_kill_count"),
(player_get_death_count, ":player_death_count", ":latest_joined_player_no"), #subtracting 1 to his death count, because he will gain 1 undeserved death count for dying during team change
(val_sub, ":player_death_count", 1),
(player_set_death_count, ":latest_joined_player_no", ":player_death_count"),
(player_get_score, ":player_score", ":latest_joined_player_no"), #adding 1 to his score count, because he will lose 1 undeserved score for dying during team change
(val_add, ":player_score", 1),
(player_set_score, ":latest_joined_player_no", ":player_score"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_4_int_to_player, ":player_no", multiplayer_event_set_player_score_kill_death, ":latest_joined_player_no", ":player_score", ":player_kill_count", ":player_death_count"),
(try_end),
(player_get_value_of_original_items, ":old_items_value", ":latest_joined_player_no"),
(player_get_gold, ":player_gold", ":latest_joined_player_no"),
(val_add, ":player_gold", ":old_items_value"),
(player_set_gold, ":latest_joined_player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(end_try),
(player_set_troop_id, ":latest_joined_player_no", -1),
(player_set_team_no, ":latest_joined_player_no", ":team_with_less_players"),
(multiplayer_send_message_to_player, ":latest_joined_player_no", multiplayer_event_force_start_team_selection),
(try_end),
(try_end),
#tutorial message (after team balance)
#(tutorial_message_set_position, 500, 500),
#(tutorial_message_set_size, 30, 30),
#(tutorial_message_set_center_justify, 1),
#(tutorial_message, "str_auto_team_balance_done", 0xFFFFFFFF, 5),
#for only server itself
(call_script, "script_show_multiplayer_message", multiplayer_message_type_auto_team_balance_done, 0),
#no need to send also server here
(multiplayer_get_my_player, ":my_player_no"),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neq, ":my_player_no", ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_auto_team_balance_done),
(try_end),
(assign, "$g_team_balance_next_round", 0),
(try_end),
(try_end),
#team balance check part finished
(assign, "$g_team_balance_next_round", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_set_slot, ":player_no", slot_player_spawned_this_round, 0),
(player_get_agent_id, ":player_agent", ":player_no"),
(ge, ":player_agent", 0),
(agent_is_alive, ":player_agent"),
(player_save_picked_up_items_for_next_spawn, ":player_no"),
(player_get_value_of_original_items, ":old_items_value", ":player_no"),
(player_set_slot, ":player_no", slot_player_last_rounds_used_item_earnings, ":old_items_value"),
(try_end),
#money management
(assign, ":per_round_gold_addition", multi_battle_round_team_money_add),
(val_mul, ":per_round_gold_addition", "$g_multiplayer_round_earnings_multiplier"),
(val_div, ":per_round_gold_addition", 100),
(store_sub, ":num_targets_remained", 2, "$g_number_of_targets_destroyed"),
(store_mul, ":defender_money_add", ":num_targets_remained", multi_destroy_save_or_destroy_target_money_add),
(store_mul, ":attacker_money_add", "$g_number_of_targets_destroyed", multi_destroy_save_or_destroy_target_money_add),
(val_add, ":defender_money_add", 100), #defenders cannot get money from destroying catapult thats why they get more money per round.
(val_sub, ":attacker_money_add", 100), #attackers also get money from destroying catapult thats why they get less money per round.
(get_max_players, ":num_players"),
(val_mul, ":defender_money_add", "$g_multiplayer_round_earnings_multiplier"),
(val_div, ":defender_money_add", 100),
(val_mul, ":attacker_money_add", "$g_multiplayer_round_earnings_multiplier"),
(val_div, ":attacker_money_add", 100),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_gold, ":player_gold", ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(val_add, ":player_gold", ":per_round_gold_addition"), #standard
(try_begin),
(eq, ":player_team", "$g_defender_team"),
(val_add, ":player_gold", ":defender_money_add"),
(else_try),
(val_add, ":player_gold", ":attacker_money_add"),
(try_end),
#(below lines added new at 25.11.09 after Armagan decided new money system)
(try_begin),
(player_get_slot, ":old_items_value", ":player_no", slot_player_last_rounds_used_item_earnings),
(store_add, ":player_total_potential_gold", ":player_gold", ":old_items_value"),
(store_mul, ":minimum_gold", "$g_multiplayer_initial_gold_multiplier", 10),
(lt, ":player_total_potential_gold", ":minimum_gold"),
(store_sub, ":additional_gold", ":minimum_gold", ":player_total_potential_gold"),
(val_add, ":player_gold", ":additional_gold"),
(try_end),
#new money system addition end
(player_set_gold, ":player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(try_end),
#initialize my team at start of round (it will be assigned again at next round's first death)
(assign, "$my_team_at_start_of_round", -1),
#clear scene and end round
(multiplayer_clear_scene),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(player_set_slot, ":player_no", slot_player_damage_given_to_target_1, 0),
(player_set_slot, ":player_no", slot_player_damage_given_to_target_2, 0),
(try_end),
#initialize moveable object positions
(call_script, "script_multiplayer_initialize_belfry_wheel_rotations"),
(call_script, "script_multiplayer_close_gate_if_it_is_open"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
(assign, "$g_round_ended", 0),
(assign, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1"),
(assign, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2"),
(start_presentation, "prsnt_multiplayer_destructible_targets_display"),
#initializing catapult & trebuchet positions and hit points for destroy mod.
(call_script, "script_initialize_objects"),
(store_mission_timer_a, "$g_round_start_time"),
(call_script, "script_initialize_all_scene_prop_slots"),
#initialize round start times for clients
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_set_round_start_time, -9999), #this will also initialize moveable object slots.
(try_end),
]),
(0, 0, 0, [], #if there is nobody in any teams do not reduce round time.
[
#(multiplayer_is_server),
(assign, ":human_agents_spawned_at_team_1", "$g_multiplayer_num_bots_team_1"),
(assign, ":human_agents_spawned_at_team_2", "$g_multiplayer_num_bots_team_2"),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":human_agents_spawned_at_team_1", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":human_agents_spawned_at_team_2", 1),
(try_end),
(try_end),
(try_begin),
(this_or_next|eq, ":human_agents_spawned_at_team_1", 0),
(eq, ":human_agents_spawned_at_team_2", 0),
(store_mission_timer_a, ":seconds_past_since_round_started"),
(val_sub, ":seconds_past_since_round_started", "$g_round_start_time"),
(le, ":seconds_past_since_round_started", 2),
(store_mission_timer_a, "$g_round_start_time"),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neg|player_is_busy_with_menus, ":player_no"),
(try_begin),
(player_slot_eq, ":player_no", slot_player_spawned_this_round, 0),
(player_get_team_no, ":player_team", ":player_no"), #if player is currently spectator do not spawn his agent
(lt, ":player_team", multi_team_spectator),
(player_get_troop_id, ":player_troop", ":player_no"), #if troop is not selected do not spawn his agent
(ge, ":player_troop", 0),
(assign, ":spawn_new", 0),
(assign, ":num_active_players_in_team_0", 0),
(assign, ":num_active_players_in_team_1", 0),
(try_begin),
(assign, ":num_active_players", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no_2", 0, ":num_players"),
(player_is_active, ":player_no_2"),
(val_add, ":num_active_players", 1),
(player_get_team_no, ":player_team_2", ":player_no_2"),
(try_begin),
(eq, ":player_team_2", 0),
(val_add, ":num_active_players_in_team_0", 1),
(else_try),
(eq, ":player_team_2", 1),
(val_add, ":num_active_players_in_team_1", 1),
(try_end),
(try_end),
(store_mul, ":multipication_of_num_active_players_in_teams", ":num_active_players_in_team_0", ":num_active_players_in_team_1"),
(store_mission_timer_a, ":round_time"),
(val_sub, ":round_time", "$g_round_start_time"),
(this_or_next|lt, ":round_time", multiplayer_new_agents_finish_spawning_time),
(this_or_next|le, ":num_active_players", 2),
(eq, ":multipication_of_num_active_players_in_teams", 0),
(eq, "$g_round_ended", 0),
(assign, ":spawn_new", 1),
(try_end),
(eq, ":spawn_new", 1),
(try_begin),
(eq, ":player_team", 0),
(assign, ":entry_no", multi_initial_spawn_point_team_1),
(else_try),
(eq, ":player_team", 1),
(assign, ":entry_no", multi_initial_spawn_point_team_2),
(try_end),
(call_script, "script_multiplayer_buy_agent_equipment", ":player_no"),
(player_spawn_new_agent, ":player_no", ":entry_no"),
(player_set_slot, ":player_no", slot_player_spawned_this_round, 1),
(else_try), #spawning as a bot (if option ($g_multiplayer_player_respawn_as_bot) is 1)
(eq, "$g_multiplayer_player_respawn_as_bot", 1),
(player_get_agent_id, ":player_agent", ":player_no"),
(ge, ":player_agent", 0),
(neg|agent_is_alive, ":player_agent"),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":player_agent"),
(gt, ":elapsed_time", "$g_multiplayer_respawn_period"),
(player_get_team_no, ":player_team", ":player_no"),
(assign, ":is_found", 0),
(try_for_agents, ":cur_agent"),
(eq, ":is_found", 0),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_get_team ,":cur_team", ":cur_agent"),
(eq, ":cur_team", ":player_team"),
(assign, ":is_found", 1),
(try_end),
(try_begin),
(eq, ":is_found", 1),
(call_script, "script_find_most_suitable_bot_to_control", ":player_no"),
(player_control_agent, ":player_no", reg0),
(player_get_slot, ":num_spawns", ":player_no", slot_player_spawned_this_round),
(val_add, ":num_spawns", 1),
(player_set_slot, ":player_no", slot_player_spawned_this_round, ":num_spawns"),
(try_end),
(try_end),
(try_end),
]),
multiplayer_server_spawn_bots,
multiplayer_server_manage_bots,
multiplayer_server_check_end_map,
(ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_multiplayer_mission_end_screen", 0),
(assign, "$g_multiplayer_stats_chart_opened_manually", 1),
(start_presentation, "prsnt_multiplayer_stats_chart"),
(try_end),
]),
multiplayer_once_at_the_first_frame,
(ti_battle_window_opened, 0, 0, [], [
(start_presentation, "prsnt_multiplayer_round_time_counter"),
(start_presentation, "prsnt_multiplayer_team_score_display"),
]),
(ti_escape_pressed, 0, 0, [],
[
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_stats_chart"),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(start_presentation, "prsnt_multiplayer_escape_menu"),
]),
],
),
(
"bandit_lair",mtf_battle_mode,charge,
"Ambushing a bandit lair",
[
(0,mtef_team_0|mtef_use_exact_number,af_override_horse, aif_start_alarmed, 7,[]),
(1,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
(2,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
(3,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
(4,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
(5,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
(6,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
(7,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
(8,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
(9,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
(10,mtef_visitor_source|mtef_team_1,af_override_horse, aif_start_alarmed,20,[]),
],
[
common_battle_init_banner,
common_inventory_not_available,
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(assign, "$relative_of_merchant_is_found", 0),
(try_begin),
(agent_is_human, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_get_team, ":agent_team", ":agent_no"),
(eq, ":agent_team", 1),
(agent_get_position, pos4, ":agent_no"),
(agent_set_scripted_destination, ":agent_no", pos4, 1),
(try_end),
(try_begin),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(is_between, ":troop_no", "trp_relative_of_merchant", "trp_relative_of_merchants_end"),
(agent_set_team, ":agent_no", 7),
(team_set_relation, 0, 7, 0),
(try_end),
]),
(0, 0, 0,
[
(party_get_template_id, ":template", "$g_encountered_party"),
(eq, ":template", "pt_looter_lair"),
(check_quest_active, "qst_save_relative_of_merchant"),
(eq, "$relative_of_merchant_is_found", 0),
],
[
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(is_between, ":troop_no", "trp_relative_of_merchant", "trp_relative_of_merchants_end"),
(agent_set_scripted_destination, ":agent_no", pos0),
(agent_get_position, pos1, ":agent_no"),
(get_distance_between_positions, ":dist", pos0, pos1),
(le, ":dist", 200),
#(assign, "$g_talk_troop", "trp_relative_of_merchant"),
(start_mission_conversation, "trp_relative_of_merchant"),
(try_end),
]),
(ti_tab_pressed, 0, 0,
[
(display_message, "str_cannot_leave_now"),
], []),
(1, 0, ti_once, [],
[
(assign, "$defender_reinforcement_stage", 0),
(assign, "$bandits_spawned_extra", 0),
]),
(1, 0, 0, [],
[
(try_for_agents, ":bandit_id"),
(agent_is_alive, ":bandit_id"),
(agent_get_team, ":agent_team_1", ":bandit_id"),
(eq, ":agent_team_1", 1),
(agent_is_in_special_mode, ":bandit_id"),
(agent_is_human, ":bandit_id"),
(agent_get_position, pos0, ":bandit_id"),
(try_for_agents, ":player_team_agent_id"),
(agent_is_alive, ":player_team_agent_id"),
(agent_get_team, ":agent_team_2", ":player_team_agent_id"),
(eq, ":agent_team_2", 0),
(agent_is_human, ":player_team_agent_id"),
(store_agent_hit_points, ":bandit_hit_points", ":bandit_id"),
(assign, ":continue", 0),
(try_begin),
(lt, ":bandit_hit_points", 100),
(try_for_agents, ":bandit_2_id"),
(agent_is_alive, ":bandit_2_id"),
(agent_get_team, ":bandit_2_team", ":bandit_2_id"),
(eq, ":bandit_2_team", 1),
(neq, ":bandit_id", ":bandit_2_id"),
(agent_is_in_special_mode, ":bandit_2_id"),
(agent_is_human, ":bandit_2_id"),
(agent_get_position, pos1, ":bandit_id"),
(agent_get_position, pos2, ":bandit_2_id"),
(get_distance_between_positions, ":distance", pos1, pos2),
(le, ":distance", 1000),
(agent_clear_scripted_mode, ":bandit_2_id"),
(try_end),
(assign, ":continue", 1),
(else_try),
(agent_get_position, pos1, ":bandit_id"),
(agent_get_position, pos2, ":player_team_agent_id"),
(get_distance_between_positions, ":distance", pos1, pos2),
(le, ":distance", 4000),
(try_for_agents, ":bandit_2_id"),
(agent_is_alive, ":bandit_2_id"),
(agent_get_team, ":bandit_2_team", ":bandit_2_id"),
(eq, ":bandit_2_team", 1),
(neq, ":bandit_id", ":bandit_2_id"),
(agent_is_in_special_mode, ":bandit_2_id"),
(agent_is_human, ":bandit_2_id"),
(agent_get_position, pos1, ":bandit_id"),
(agent_get_position, pos2, ":bandit_2_id"),
(get_distance_between_positions, ":distance", pos1, pos2),
(le, ":distance", 1000),
(agent_clear_scripted_mode, ":bandit_2_id"),
(try_end),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(agent_clear_scripted_mode, ":bandit_id"),
(try_end),
(try_end),
]),
(30, 0, 0,
[
(le, "$defender_reinforcement_stage", 1),
],
[
(store_character_level, ":player_level", "trp_player"),
(store_add, ":number_of_bandits_will_be_spawned_at_each_period", 5, ":player_level"),
(val_div, ":number_of_bandits_will_be_spawned_at_each_period", 3),
(lt, "$bandits_spawned_extra", ":number_of_bandits_will_be_spawned_at_each_period"),
(val_add, "$bandits_spawned_extra", 1),
(party_get_template_id, ":template", "$g_encountered_party"),
(store_random_in_range, ":random_value", 0, 2),
(try_begin),
(eq, ":template", "pt_sea_raider_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_sea_raider"),
(else_try),
(eq, ":template", "pt_forest_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_forest_bandit"),
(else_try),
(eq, ":template", "pt_desert_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_desert_bandit"),
(else_try),
(eq, ":template", "pt_mountain_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_mountain_bandit"),
(else_try),
(eq, ":template", "pt_taiga_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_taiga_bandit"),
(else_try),
(eq, ":template", "pt_steppe_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_steppe_bandit"),
(else_try),
(this_or_next|eq, ":template", "pt_looter_lair"),
(neq, ":random_value", 0),
(assign, ":bandit_troop", "trp_looter"),
(try_end),
(store_current_scene, ":cur_scene"),
(modify_visitors_at_site, ":cur_scene"),
(store_random_in_range, ":random_entry_point", 2, 11),
(add_visitors_to_current_scene, ":random_entry_point", ":bandit_troop", 1),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
#(store_trigger_param_2, ":killer_agent_no"),
(store_trigger_param_3, ":is_wounded"),
(try_begin),
(ge, ":dead_agent_no", 0),
(agent_is_human, ":dead_agent_no"),
(agent_get_troop_id, ":dead_agent_troop_id", ":dead_agent_no"),
(str_store_troop_name, s6, ":dead_agent_troop_id"),
(try_begin),
(neg|agent_is_ally, ":dead_agent_no"),
(party_add_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
(try_begin),
(eq, ":is_wounded", 1),
(party_wound_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1),
(try_end),
(try_end),
(party_add_members, "p_temp_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
(eq, ":is_wounded", 1),
(party_wound_members, "p_temp_casualties", ":dead_agent_troop_id", 1),
(try_end),
(assign, ":number_of_enemies", 0),
(try_for_agents, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(neg|agent_is_ally, ":cur_agent"),
(val_add, ":number_of_enemies", 1),
(try_end),
(try_begin),
(le, ":number_of_enemies", 2),
(le, "$defender_reinforcement_stage", 1),
(val_add, "$defender_reinforcement_stage", 1),
(store_character_level, ":player_level", "trp_player"),
(store_add, ":number_of_bandits_will_be_spawned_at_each_period", 5, ":player_level"),
(val_div, ":number_of_bandits_will_be_spawned_at_each_period", 3),
(try_begin),
(ge, "$defender_reinforcement_stage", 2),
(val_sub, ":number_of_bandits_will_be_spawned_at_each_period", "$bandits_spawned_extra"),
(try_end),
(party_get_template_id, ":template", "$g_encountered_party"),
(store_random_in_range, ":random_value", 0, 2),
(try_begin),
(eq, ":template", "pt_sea_raider_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_sea_raider"),
(else_try),
(eq, ":template", "pt_forest_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_forest_bandit"),
(else_try),
(eq, ":template", "pt_desert_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_desert_bandit"),
(else_try),
(eq, ":template", "pt_mountain_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_mountain_bandit"),
(else_try),
(eq, ":template", "pt_taiga_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_taiga_bandit"),
(else_try),
(eq, ":template", "pt_steppe_bandit_lair"),
(eq, ":random_value", 0),
(assign, ":bandit_troop", "trp_steppe_bandit"),
(else_try),
(this_or_next|eq, ":template", "pt_looter_lair"),
(neq, ":random_value", 0),
(assign, ":bandit_troop", "trp_looter"),
(try_end),
(store_current_scene, ":cur_scene"),
(modify_visitors_at_site, ":cur_scene"),
(try_for_range, ":unused", 0, ":number_of_bandits_will_be_spawned_at_each_period"),
(store_random_in_range, ":random_entry_point", 2, 11),
(add_visitors_to_current_scene, ":random_entry_point", ":bandit_troop", 1),
(try_end),
(try_end),
#no need to adjust courage in bandit lair for now
#(call_script, "script_apply_death_effect_on_courage_scores", ":dead_agent_no", ":killer_agent_no"),
]),
(0, 0, ti_once, [],
[
(call_script, "script_music_set_situation_with_culture", mtf_sit_ambushed),
(set_party_battle_mode),
]),
(2, 0, ti_once,
[
(neg|main_hero_fallen),
(num_active_teams_le, 1),
],
[
(party_get_template_id, ":template", "$g_encountered_party"),
(try_begin),
(eq, ":template", "pt_looter_lair"),
(check_quest_active, "qst_save_relative_of_merchant"),
(store_faction_of_party, ":starting_town_faction", "$g_starting_town"),
(try_begin),
(eq, ":starting_town_faction", "fac_kingdom_1"),
(assign, ":troop_of_merchant", "trp_relative_of_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_2"),
(assign, ":troop_of_merchant", "trp_relative_of_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_3"),
(assign, ":troop_of_merchant", "trp_relative_of_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_4"),
(assign, ":troop_of_merchant", "trp_relative_of_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_5"),
(assign, ":troop_of_merchant", "trp_relative_of_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_6"),
(assign, ":troop_of_merchant", "trp_relative_of_merchant"),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(assign, ":minimum_distance", 100000),
(try_for_range, ":entry_no", 1, 10),
(entry_point_get_position, pos1, ":entry_no"),
(get_distance_between_positions, ":dist", pos0, pos1),
(le, ":dist", ":minimum_distance"),
(ge, ":dist", 1000),
(assign, ":nearest_entry_point", ":entry_no"),
(assign, ":minimum_distance", ":dist"),
(try_end),
(add_visitors_to_current_scene, ":nearest_entry_point", ":troop_of_merchant", 1, 0),
(try_end),
]),
common_battle_order_panel,
common_battle_order_panel_tick,
(1, 4, ti_once,
[
(assign, ":continue", 0),
(party_get_template_id, ":template", "$g_encountered_party"),
(try_begin),
(eq, ":template", "pt_looter_lair"),
(check_quest_active, "qst_save_relative_of_merchant"),
(this_or_next|main_hero_fallen),
(eq, "$relative_of_merchant_is_found", 1),
(assign, ":continue", 1),
(else_try),
(this_or_next|neq|eq, ":template", "pt_looter_lair"),
(neg|check_quest_active, "qst_save_relative_of_merchant"),
(store_mission_timer_a,":cur_time"),
(ge, ":cur_time", 5),
(this_or_next|main_hero_fallen),
(num_active_teams_le, 1),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
],
[
(try_begin),
(main_hero_fallen),
(else_try),
(party_set_slot, "$g_encountered_party", slot_party_ai_substate, 2),
(try_end),
(finish_mission),
]),
]),
(
"alley_fight", mtf_battle_mode,charge,
"Alley fight",
[
(0,mtef_team_0|mtef_use_exact_number,af_override_horse,aif_start_alarmed,7,[]),
(1,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,20,[]),
(2,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,20,[]),
(3,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,20,[]),
],
[
common_battle_init_banner,
common_inventory_not_available,
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(get_player_agent_no, ":player_agent"),
(neq, ":agent_no", ":player_agent"),
(assign, "$g_main_attacker_agent", ":agent_no"),
(agent_ai_set_aggressiveness, ":agent_no", 199),
(try_begin),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(is_between, ":troop_no", "trp_swadian_merchant", "trp_startup_merchants_end"),
(agent_set_team, ":agent_no", 7),
(team_set_relation, 0, 7, 0),
(try_end),
]),
(0, 0, 0,
[
(eq, "$talked_with_merchant", 0),
],
[
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(is_between, ":troop_no", "trp_swadian_merchant", "trp_startup_merchants_end"),
(agent_set_scripted_destination, ":agent_no", pos0),
(agent_get_position, pos1, ":agent_no"),
(get_distance_between_positions, ":dist", pos0, pos1),
(le, ":dist", 200),
(assign, "$talk_context", tc_back_alley),
(start_mission_conversation, ":troop_no"),
(try_end),
]),
(1, 0, 0, [],
[
(get_player_agent_no, ":player_agent"),
(ge, "$g_main_attacker_agent", 0),
(ge, ":player_agent", 0),
(agent_is_active, "$g_main_attacker_agent"),
(agent_is_active, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(agent_get_position, pos1, "$g_main_attacker_agent"),
(get_distance_between_positions, ":dist", pos0, pos1),
(ge, ":dist", 5),
(agent_set_scripted_destination, "$g_main_attacker_agent", pos0),
]),
(ti_tab_pressed, 0, 0, [],
[
(display_message, "str_cannot_leave_now"),
]),
(0, 0, ti_once, [],
[
(call_script, "script_music_set_situation_with_culture", mtf_sit_ambushed),
(set_party_battle_mode),
]),
(0, 0, ti_once,
[
(neg|main_hero_fallen),
(num_active_teams_le, 1),
],
[
(store_faction_of_party, ":starting_town_faction", "$g_starting_town"),
(try_begin),
(eq, ":starting_town_faction", "fac_kingdom_1"),
(assign, ":troop_of_merchant", "trp_swadian_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_2"),
(assign, ":troop_of_merchant", "trp_vaegir_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_3"),
(assign, ":troop_of_merchant", "trp_khergit_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_4"),
(assign, ":troop_of_merchant", "trp_nord_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_5"),
(assign, ":troop_of_merchant", "trp_rhodok_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_6"),
(assign, ":troop_of_merchant", "trp_sarranid_merchant"),
(try_end),
(add_visitors_to_current_scene, 3, ":troop_of_merchant", 1, 0),
]),
(1, 0, ti_once,
[
(eq, "$talked_with_merchant", 1),
],
[
(try_begin),
(main_hero_fallen),
(assign, "$g_killed_first_bandit", 0),
(else_try),
(assign, "$g_killed_first_bandit", 1),
(try_end),
(finish_mission),
(assign, "$g_main_attacker_agent", 0),
(assign, "$talked_with_merchant", 1),
(assign, "$current_startup_quest_phase", 1),
(change_screen_return),
(set_trigger_result, 1),
(get_player_agent_no, ":player_agent"),
(store_agent_hit_points, ":hit_points", ":player_agent"),
(try_begin),
(lt, ":hit_points", 90),
(agent_set_hit_points, ":player_agent", 90),
(try_end),
]),
(1, 3, ti_once,
[
(main_hero_fallen),
],
[
(try_begin),
(main_hero_fallen),
(assign, "$g_killed_first_bandit", 0),
(else_try),
(assign, "$g_killed_first_bandit", 1),
(try_end),
(finish_mission),
(assign, "$g_main_attacker_agent", 0),
(assign, "$talked_with_merchant", 1),
(assign, "$current_startup_quest_phase", 1),
(change_screen_return),
(set_trigger_result, 1),
(get_player_agent_no, ":player_agent"),
(store_agent_hit_points, ":hit_points", ":player_agent"),
(try_begin),
(lt, ":hit_points", 90),
(agent_set_hit_points, ":player_agent", 90),
(try_end),
]),
]),
(
"meeting_merchant",0,-1,
"Meeting with the merchant",
[
(0,mtef_team_0,af_override_horse,0,1,[]),
(1,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(2,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(3,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(4,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(5,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(6,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(7,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(8,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(9,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
],
[
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(try_begin),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(is_between, ":troop_no", "trp_swadian_merchant", "trp_startup_merchants_end"),
(agent_set_team, ":agent_no", 7),
(team_set_relation, 0, 7, 0),
(try_end),
]),
(1, 0, ti_once, [],
[
(assign, "$dialog_with_merchant_ended", 0),
(store_current_scene, ":cur_scene"),
(scene_set_slot, ":cur_scene", slot_scene_visited, 1),
(try_begin),
(eq, "$sneaked_into_town", 1),
(call_script, "script_music_set_situation_with_culture", mtf_sit_town_infiltrate),
(else_try),
(eq, "$talk_context", tc_tavern_talk),
(call_script, "script_music_set_situation_with_culture", mtf_sit_tavern),
(else_try),
(call_script, "script_music_set_situation_with_culture", mtf_sit_town),
(try_end),
]),
(1, 0, 0,
[
(assign, ":continue", 0),
(try_begin),
(ge, "$dialog_with_merchant_ended", 6),
(assign, ":continue", 1),
(else_try),
(ge, "$dialog_with_merchant_ended", 1),
(neg|conversation_screen_is_active),
(try_begin),
(eq, "$dialog_with_merchant_ended", 1),
(check_quest_active, "qst_collect_men"),
(tutorial_box, "str_start_up_first_quest", "@Tutorial"),
(try_end),
(val_add, "$dialog_with_merchant_ended", 1),
(assign, ":continue", 0),
(try_end),
(try_begin),
(conversation_screen_is_active),
(tutorial_message, -1),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
],
[
(tutorial_message_set_size, 17, 17),
(tutorial_message_set_position, 500, 650),
(tutorial_message_set_center_justify, 0),
(tutorial_message_set_background, 1),
(tutorial_message, "str_press_tab_to_exit_from_town"),
]),
(ti_before_mission_start, 0, 0, [],
[
#(call_script, "script_change_banners_and_chest"),
]),
(ti_inventory_key_pressed, 0, 0,
[
(set_trigger_result, 1),
], []),
(ti_tab_pressed, 0, 0,
[
(try_begin),
(gt, "$dialog_with_merchant_ended", 0),
(assign, ":max_dist", 0),
(party_get_position, pos1, "$current_town"),
(try_for_range, ":unused", 0, 10),
(map_get_random_position_around_position, pos0, pos1, 2),
(get_distance_between_positions, ":dist", pos0, pos1),
(ge, ":dist", ":max_dist"),
(assign, ":max_dist", ":dist"),
(copy_position, pos2, pos0),
(try_end),
(party_set_position, "p_main_party", pos2),
(finish_mission),
(assign, "$current_startup_quest_phase", 2),
(tutorial_message, -1),
(tutorial_message_set_background, 0),
(change_screen_map),
(try_begin),
(check_quest_finished, "qst_save_town_from_bandits"),
(assign, "$g_do_one_more_meeting_with_merchant", 1),
(else_try),
#will do this at first spawning in the map
(set_spawn_radius, 50),
(try_for_range, ":unused", 0, 20),
(spawn_around_party, "p_main_party", "pt_looters"),
(try_end),
(try_end),
(set_trigger_result, 1),
(else_try),
(display_message, "str_cannot_leave_now"),
(try_end),
], []),
]),
(
"town_fight",0,-1,
"Town Fight",
[
(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(1,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
(2,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(3,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(4,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(5,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(6,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(7,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(8,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
(9,mtef_visitor_source,af_override_horse,0,1,[]),
(10,mtef_visitor_source,af_override_horse,0,1,[]),
(11,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
(12,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
(13,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
(14,mtef_visitor_source,af_override_horse,0,1,[]),
(15,mtef_visitor_source,af_override_horse,0,1,[]),
(16,mtef_visitor_source,af_override_horse,0,1,[]),
(17,mtef_visitor_source,af_override_horse,0,1,[]),
(18,mtef_visitor_source,af_override_horse,0,1,[]),
(19,mtef_visitor_source,af_override_horse,0,1,[]),
(20,mtef_visitor_source,af_override_horse,0,1,[]),
(21,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
(22,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
(23,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #guard
(24,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #guard
(25,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #guard
(26,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #guard
(27,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #guard
(28,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #guard
(29,mtef_visitor_source,af_override_horse,0,1,[]),
(30,mtef_visitor_source,af_override_horse,0,1,[]),
(31,mtef_visitor_source,af_override_horse,0,1,[]),
(32,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #town walker point
(33,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #town walker point
(34,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #town walker point
(35,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #town walker point
(36,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #town walker point
(37,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #town walker point
(38,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #town walker point
(39,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #town walker point
(40,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]), #in towns, can be used for guard reinforcements
(41,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]), #in towns, can be used for guard reinforcements
(42,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]), #in towns, can be used for guard reinforcements
(43,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]), #in towns, can be used for guard reinforcements
(44,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
],
[
common_battle_init_banner,
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(agent_set_team, ":agent_no", 0),
]),
(ti_before_mission_start, 0, 0, [],
[
(mission_disable_talk),
(assign, "$g_main_attacker_agent", 0),
(set_party_battle_mode),
(assign, "$number_of_bandits_killed_by_player", 0),
(assign, "$number_of_civilian_loses", 0),
(set_fixed_point_multiplier, 100),
]),
(1, 0, ti_once,
[
(call_script, "script_init_town_walker_agents"),
],
[]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
#(store_trigger_param_3, ":is_wounded"),
(try_begin),
(agent_get_team, ":dead_agent_team_no", ":dead_agent_no"),
(eq, ":dead_agent_team_no", 1),
(get_player_agent_no, ":player_agent"),
(eq, ":player_agent", ":killer_agent_no"),
(val_add, "$number_of_bandits_killed_by_player", 1),
(else_try),
(eq, ":dead_agent_team_no", 0),
(val_add, "$number_of_civilian_loses", 1),
(try_end),
]),
(1, 0, 0,
[
(lt, "$merchant_sign_count", 8),
(val_add, "$merchant_sign_count", 1),
(try_begin),
(eq, "$merchant_sign_count", 2),
(get_player_agent_no, ":player_agent"),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":agent_troop_id", ":agent_no"),
(ge, ":agent_troop_id", "trp_swadian_merchant"),
(lt, ":agent_troop_id", "trp_startup_merchants_end"),
(assign, "$g_city_merchant_troop_id", ":agent_troop_id"),
(assign, "$g_city_merchant_agent_id", ":agent_no"),
(agent_get_position, pos0, ":player_agent"),
(agent_get_position, pos1, ":agent_no"),
(assign, ":max_dif", -1000),
(try_for_range, ":target_entry_point", 0, 64),
#(neg|entry_point_is_auto_generated, ":target_entry_point"),
(entry_point_get_position, pos6, ":target_entry_point"),
(get_distance_between_positions, ":dist_to_player", pos0, pos6),
(get_distance_between_positions, ":dist_to_merchant", pos1, pos6),
(store_sub, ":dif", ":dist_to_merchant", ":dist_to_player"),
(ge, ":dist_to_merchant", 15),
(ge, ":dif", ":max_dif"),
(copy_position, pos2, pos6),
(assign, ":max_dif", ":dif"),
(try_end),
(agent_set_scripted_destination, ":agent_no", pos2, 0),
(agent_set_speed_limit, ":agent_no", 10),
(try_end),
(else_try),
(eq, "$merchant_sign_count", 5),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(agent_set_scripted_destination, "$g_city_merchant_agent_id", pos0, 0),
(agent_set_speed_limit, "$g_city_merchant_agent_id", 10),
(else_try),
(eq, "$merchant_sign_count", 7),
(agent_clear_scripted_mode, "$g_city_merchant_agent_id"),
(assign, "$talk_context", tc_town_talk),
(start_mission_conversation, "$g_city_merchant_troop_id"),
(try_end),
],
[]),
(1, 0, 0, [],
[
(ge, "$merchant_sign_count", 8),
(get_player_agent_no, ":player_agent"),
(try_for_agents, ":agent_no"),
(neq, ":agent_no", ":player_agent"),
(agent_is_alive, ":agent_no"),
(agent_get_team, ":agent_team", ":agent_no"),
(eq, ":agent_team", 0),
(agent_get_position, pos0, ":agent_no"),
(assign, ":minimum_distance", 10000),
(try_for_agents, ":bandit_no"),
(agent_is_alive, ":bandit_no"),
(agent_get_team, ":bandit_team", ":bandit_no"),
(eq, ":bandit_team", 1),
(agent_get_position, pos1, ":bandit_no"),
(get_distance_between_positions, ":dist", pos0, pos1),
(le, ":dist", ":minimum_distance"),
(assign, ":minimum_distance", ":dist"),
(copy_position, pos2, pos1),
(try_end),
(assign, reg1, ":dist"),
(try_begin),
(le, ":minimum_distance", 500),
(agent_clear_scripted_mode, ":agent_no"),
(else_try),
(lt, ":minimum_distance", 10000),
(agent_set_scripted_destination, ":agent_no", pos2, 0),
(try_end),
(try_end),
]),
(3, 0, 0,
[
(lt, "$merchant_sign_count", 8),
(call_script, "script_tick_town_walkers")
],
[]),
(2, 0, 0,
[
(call_script, "script_center_ambiance_sounds")
],
[]),
(ti_before_mission_start, 0, 0,
[],
[
(call_script, "script_change_banners_and_chest")
]),
(1, 4, ti_once,
[
(this_or_next|main_hero_fallen),
(num_active_teams_le, 1),
(ge, "$merchant_sign_count", 8),
],
[
(try_begin),
(main_hero_fallen),
(assign, "$g_killed_first_bandit", 0),
(else_try),
(assign, "$g_killed_first_bandit", 1),
(try_end),
(assign, "$current_startup_quest_phase", 4),
(mission_enable_talk),
(finish_mission),
(unlock_achievement, ACHIEVEMENT_GET_UP_STAND_UP),
(change_screen_return),
(set_trigger_result, 1),
]),
(ti_inventory_key_pressed, 0, 0,
[
(try_begin),
(eq, "$g_mt_mode", tcm_default),
(set_trigger_result,1),
(else_try),
(eq, "$g_mt_mode", tcm_disguised),
(display_message,"str_cant_use_inventory_disguised"),
(else_try),
(display_message, "str_cant_use_inventory_now"),
(try_end),
], []),
(ti_tab_pressed, 0, 0,
[
(display_message, "str_cannot_leave_now"),
], []),
]),
(
"multiplayer_duel",mtf_battle_mode,-1, #duel mode
"You lead your men to battle.",
[
(0,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(14,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(15,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(16,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(17,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(18,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(19,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(20,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(21,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(22,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(23,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(24,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(25,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(26,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(27,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(28,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(29,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(30,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(31,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
(32,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(33,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(34,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(35,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(36,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(37,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(38,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(39,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(40,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(41,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(42,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(43,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(44,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(45,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(46,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(48,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(49,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(50,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(51,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(52,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(53,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(54,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(55,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(56,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(57,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(58,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(59,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(60,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(61,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(62,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(63,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
],
[
multiplayer_server_check_polls,
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_multiplayer_server_on_agent_spawn_common", ":agent_no"),
]),
(ti_server_player_joined, 0, 0, [],
[
(store_trigger_param_1, ":player_no"),
(call_script, "script_multiplayer_server_player_joined_common", ":player_no"),
]),
(ti_before_mission_start, 0, 0, [],
[
(assign, "$g_multiplayer_game_type", multiplayer_game_type_duel),
(call_script, "script_multiplayer_server_before_mission_start_common"),
#make everyone see themselves as allies, no friendly fire
(team_set_relation, 0, 0, 1),
(team_set_relation, 0, 1, 1),
(team_set_relation, 1, 1, 1),
(mission_set_duel_mode, 1),
(call_script, "script_multiplayer_init_mission_variables"),
(call_script, "script_multiplayer_remove_destroy_mod_targets"),
(call_script, "script_multiplayer_remove_headquarters_flags"), # close this line and open map in deathmatch mod and use all ladders firstly
]), # to be able to edit maps without damaging any headquarters flags ext.
(ti_after_mission_start, 0, 0, [],
[
(set_spawn_effector_scene_prop_kind, 0, -1), #during this mission, agents of "team 0" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(set_spawn_effector_scene_prop_kind, 1, -1), #during this mission, agents of "team 1" will try to spawn around scene props with kind equal to -1(no effector for this mod)
(call_script, "script_initialize_all_scene_prop_slots"),
(call_script, "script_multiplayer_move_moveable_objects_initial_positions"),
(assign, "$g_multiplayer_ready_for_spawning_agent", 1),
]),
(ti_on_multiplayer_mission_end, 0, 0, [],
[
(call_script, "script_multiplayer_event_mission_end"),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(start_presentation, "prsnt_multiplayer_stats_chart_deathmatch"),
]),
(ti_on_agent_killed_or_wounded, 0, 0, [],
[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":killer_agent_no"),
(call_script, "script_multiplayer_server_on_agent_killed_or_wounded_common", ":dead_agent_no", ":killer_agent_no"),
(try_begin),
(get_player_agent_no, ":player_agent"),
(agent_is_active, ":player_agent"),
(agent_slot_ge, ":player_agent", slot_agent_in_duel_with, 0),
(try_begin),
(eq, ":dead_agent_no", ":player_agent"),
(display_message, "str_you_have_lost_a_duel"),
(else_try),
(agent_slot_eq, ":player_agent", slot_agent_in_duel_with, ":dead_agent_no"),
(display_message, "str_you_have_won_a_duel"),
(try_end),
(try_end),
(try_begin),
(agent_slot_ge, ":dead_agent_no", slot_agent_in_duel_with, 0),
(agent_get_slot, ":duelist_agent_no", ":dead_agent_no", slot_agent_in_duel_with),
(agent_set_slot, ":dead_agent_no", slot_agent_in_duel_with, -1),
(try_begin),
(agent_is_active, ":duelist_agent_no"),
(agent_set_slot, ":duelist_agent_no", slot_agent_in_duel_with, -1),
(agent_clear_relations_with_agents, ":duelist_agent_no"),
(try_begin),
(agent_get_player_id, ":duelist_player_no", ":duelist_agent_no"),
(neg|player_is_active, ":duelist_player_no"), #might be AI
(agent_force_rethink, ":duelist_agent_no"),
(try_end),
(try_end),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(neg|player_is_busy_with_menus, ":player_no"),
(player_get_team_no, ":player_team", ":player_no"), #if player is currently spectator do not spawn his agent
(lt, ":player_team", multi_team_spectator),
(player_get_troop_id, ":player_troop", ":player_no"), #if troop is not selected do not spawn his agent
(ge, ":player_troop", 0),
(player_get_agent_id, ":player_agent", ":player_no"),
(assign, ":spawn_new", 0),
(try_begin),
(player_get_slot, ":player_first_spawn", ":player_no", slot_player_first_spawn),
(eq, ":player_first_spawn", 1),
(assign, ":spawn_new", 1),
(player_set_slot, ":player_no", slot_player_first_spawn, 0),
(else_try),
(try_begin),
(lt, ":player_agent", 0),
(assign, ":spawn_new", 1),
(else_try),
(neg|agent_is_alive, ":player_agent"),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":player_agent"),
(gt, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":spawn_new", 1),
(try_end),
(try_end),
(eq, ":spawn_new", 1),
(call_script, "script_multiplayer_buy_agent_equipment", ":player_no"),
(troop_get_inventory_slot, ":has_item", ":player_troop", ek_horse),
(try_begin),
(ge, ":has_item", 0),
(assign, ":is_horseman", 1),
(else_try),
(assign, ":is_horseman", 0),
(try_end),
(call_script, "script_multiplayer_find_spawn_point", ":player_team", 0, ":is_horseman"),
(player_spawn_new_agent, ":player_no", reg0),
(try_end),
]),
(1, 0, 0, [], #do this in every new frame, but not at the same time
[
(multiplayer_is_server),
(store_mission_timer_a, ":mission_timer"),
(ge, ":mission_timer", 2),
(assign, ":team_1_count", 0),
(assign, ":team_2_count", 0),
(try_for_agents, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(assign, ":will_be_counted", 0),
(try_begin),
(agent_is_alive, ":cur_agent"),
(assign, ":will_be_counted", 1), #alive so will be counted
(else_try),
(agent_get_time_elapsed_since_removed, ":elapsed_time", ":cur_agent"),
(le, ":elapsed_time", "$g_multiplayer_respawn_period"),
(assign, ":will_be_counted", 1),
(try_end),
(eq, ":will_be_counted", 1),
(agent_get_team, ":cur_team", ":cur_agent"),
(try_begin),
(eq, ":cur_team", 0),
(val_add, ":team_1_count", 1),
(else_try),
(eq, ":cur_team", 1),
(val_add, ":team_2_count", 1),
(try_end),
(try_end),
(store_sub, "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_team_1", ":team_1_count"),
(store_sub, "$g_multiplayer_num_bots_required_team_2", "$g_multiplayer_num_bots_team_2", ":team_2_count"),
(val_max, "$g_multiplayer_num_bots_required_team_1", 0),
(val_max, "$g_multiplayer_num_bots_required_team_2", 0),
]),
(0, 0, 0, [],
[
(multiplayer_is_server),
(eq, "$g_multiplayer_ready_for_spawning_agent", 1),
(store_add, ":total_req", "$g_multiplayer_num_bots_required_team_1", "$g_multiplayer_num_bots_required_team_2"),
(try_begin),
(gt, ":total_req", 0),
(store_random_in_range, ":random_req", 0, ":total_req"),
(val_sub, ":random_req", "$g_multiplayer_num_bots_required_team_1"),
(try_begin),
(lt, ":random_req", 0),
#add to team 1
(assign, ":selected_team", 0),
(val_sub, "$g_multiplayer_num_bots_required_team_1", 1),
(else_try),
#add to team 2
(assign, ":selected_team", 1),
(val_sub, "$g_multiplayer_num_bots_required_team_2", 1),
(try_end),
(team_get_faction, ":team_faction_no", ":selected_team"),
(assign, ":available_troops_in_faction", 0),
(try_for_range, ":troop_no", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
(store_troop_faction, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", ":team_faction_no"),
(val_add, ":available_troops_in_faction", 1),
(try_end),
(store_random_in_range, ":random_troop_index", 0, ":available_troops_in_faction"),
(assign, ":end_cond", multiplayer_ai_troops_end),
(try_for_range, ":troop_no", multiplayer_ai_troops_begin, ":end_cond"),
(store_troop_faction, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", ":team_faction_no"),
(val_sub, ":random_troop_index", 1),
(lt, ":random_troop_index", 0),
(assign, ":end_cond", 0),
(assign, ":selected_troop", ":troop_no"),
(try_end),
(troop_get_inventory_slot, ":has_item", ":selected_troop", ek_horse),
(try_begin),
(ge, ":has_item", 0),
(assign, ":is_horseman", 1),
(else_try),
(assign, ":is_horseman", 0),
(try_end),
(call_script, "script_multiplayer_find_spawn_point", ":selected_team", 0, ":is_horseman"),
(store_current_scene, ":cur_scene"),
(modify_visitors_at_site, ":cur_scene"),
(add_visitors_to_current_scene, reg0, ":selected_troop", 1, ":selected_team", -1),
(assign, "$g_multiplayer_ready_for_spawning_agent", 0),
(try_end),
]),
(1, 0, 0, [],
[
(multiplayer_is_server),
#checking for restarting the map
(assign, ":end_map", 0),
(try_begin),
(store_mission_timer_a, ":mission_timer"),
(store_mul, ":game_max_seconds", "$g_multiplayer_game_max_minutes", 60),
(gt, ":mission_timer", ":game_max_seconds"),
(assign, ":end_map", 1),
(try_end),
(try_begin),
(eq, ":end_map", 1),
(call_script, "script_game_multiplayer_get_game_type_mission_template", "$g_multiplayer_game_type"),
(start_multiplayer_mission, reg0, "$g_multiplayer_selected_map", 0),
(call_script, "script_game_set_multiplayer_mission_end"),
(try_end),
]),
(ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_multiplayer_mission_end_screen", 0),
(assign, "$g_multiplayer_stats_chart_opened_manually", 1),
(start_presentation, "prsnt_multiplayer_stats_chart_deathmatch"),
(try_end),
]),
multiplayer_once_at_the_first_frame,
(ti_escape_pressed, 0, 0, [],
[
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_stats_chart_deathmatch"),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(start_presentation, "prsnt_multiplayer_escape_menu"),
]),
(1, 0, 0, [],
[
(store_mission_timer_a, ":mission_timer"),
(store_sub, ":duel_start_time", ":mission_timer", 3),
(try_for_agents, ":cur_agent"),
(agent_slot_ge, ":cur_agent", slot_agent_in_duel_with, 0),
(agent_get_slot, ":duel_time", ":cur_agent", slot_agent_duel_start_time),
(ge, ":duel_time", 0),
(le, ":duel_time", ":duel_start_time"),
(agent_set_slot, ":cur_agent", slot_agent_duel_start_time, -1),
(agent_get_slot, ":opponent_agent", ":cur_agent", slot_agent_in_duel_with),
(agent_is_active, ":opponent_agent"),
(agent_add_relation_with_agent, ":cur_agent", ":opponent_agent", -1),
(agent_force_rethink, ":cur_agent"),
(try_end),
]),
],
),
]
| Python |
itm_no_item = 0
itm_tutorial_spear = 1
itm_tutorial_club = 2
itm_tutorial_battle_axe = 3
itm_tutorial_arrows = 4
itm_tutorial_bolts = 5
itm_tutorial_short_bow = 6
itm_tutorial_crossbow = 7
itm_tutorial_throwing_daggers = 8
itm_tutorial_saddle_horse = 9
itm_tutorial_shield = 10
itm_tutorial_staff_no_attack = 11
itm_tutorial_staff = 12
itm_tutorial_sword = 13
itm_tutorial_axe = 14
itm_tutorial_dagger = 15
itm_horse_meat = 16
itm_practice_sword = 17
itm_heavy_practice_sword = 18
itm_practice_dagger = 19
itm_practice_axe = 20
itm_arena_axe = 21
itm_arena_sword = 22
itm_arena_sword_two_handed = 23
itm_arena_lance = 24
itm_practice_staff = 25
itm_practice_lance = 26
itm_practice_shield = 27
itm_practice_bow = 28
itm_practice_crossbow = 29
itm_practice_javelin = 30
itm_practice_javelin_melee = 31
itm_practice_throwing_daggers = 32
itm_practice_throwing_daggers_100_amount = 33
itm_practice_horse = 34
itm_practice_arrows = 35
itm_practice_bolts = 36
itm_practice_arrows_10_amount = 37
itm_practice_arrows_100_amount = 38
itm_practice_bolts_9_amount = 39
itm_practice_boots = 40
itm_red_tourney_armor = 41
itm_blue_tourney_armor = 42
itm_green_tourney_armor = 43
itm_gold_tourney_armor = 44
itm_red_tourney_helmet = 45
itm_blue_tourney_helmet = 46
itm_green_tourney_helmet = 47
itm_gold_tourney_helmet = 48
itm_arena_shield_red = 49
itm_arena_shield_blue = 50
itm_arena_shield_green = 51
itm_arena_shield_yellow = 52
itm_arena_armor_white = 53
itm_arena_armor_red = 54
itm_arena_armor_blue = 55
itm_arena_armor_green = 56
itm_arena_armor_yellow = 57
itm_arena_tunic_white = 58
itm_arena_tunic_red = 59
itm_arena_tunic_blue = 60
itm_arena_tunic_green = 61
itm_arena_tunic_yellow = 62
itm_arena_helmet_red = 63
itm_arena_helmet_blue = 64
itm_arena_helmet_green = 65
itm_arena_helmet_yellow = 66
itm_steppe_helmet_white = 67
itm_steppe_helmet_red = 68
itm_steppe_helmet_blue = 69
itm_steppe_helmet_green = 70
itm_steppe_helmet_yellow = 71
itm_tourney_helm_white = 72
itm_tourney_helm_red = 73
itm_tourney_helm_blue = 74
itm_tourney_helm_green = 75
itm_tourney_helm_yellow = 76
itm_arena_turban_red = 77
itm_arena_turban_blue = 78
itm_arena_turban_green = 79
itm_arena_turban_yellow = 80
itm_book_tactics = 81
itm_book_persuasion = 82
itm_book_leadership = 83
itm_book_intelligence = 84
itm_book_trade = 85
itm_book_weapon_mastery = 86
itm_book_engineering = 87
itm_book_wound_treatment_reference = 88
itm_book_training_reference = 89
itm_book_surgery_reference = 90
itm_spice = 91
itm_salt = 92
itm_oil = 93
itm_pottery = 94
itm_raw_flax = 95
itm_linen = 96
itm_wool = 97
itm_wool_cloth = 98
itm_raw_silk = 99
itm_raw_dyes = 100
itm_velvet = 101
itm_iron = 102
itm_tools = 103
itm_raw_leather = 104
itm_leatherwork = 105
itm_raw_date_fruit = 106
itm_furs = 107
itm_wine = 108
itm_ale = 109
itm_smoked_fish = 110
itm_cheese = 111
itm_honey = 112
itm_sausages = 113
itm_cabbages = 114
itm_dried_meat = 115
itm_apples = 116
itm_raw_grapes = 117
itm_raw_olives = 118
itm_grain = 119
itm_cattle_meat = 120
itm_bread = 121
itm_chicken = 122
itm_pork = 123
itm_butter = 124
itm_siege_supply = 125
itm_quest_wine = 126
itm_quest_ale = 127
itm_tutorial_sword = 128
itm_tutorial_axe = 129
itm_tutorial_spear = 130
itm_tutorial_club = 131
itm_tutorial_battle_axe = 132
itm_tutorial_arrows = 133
itm_tutorial_bolts = 134
itm_tutorial_short_bow = 135
itm_tutorial_crossbow = 136
itm_tutorial_throwing_daggers = 137
itm_tutorial_saddle_horse = 138
itm_tutorial_shield = 139
itm_tutorial_staff_no_attack = 140
itm_tutorial_staff = 141
itm_sumpter_horse = 142
itm_saddle_horse = 143
itm_steppe_horse = 144
itm_arabian_horse_a = 145
itm_courser = 146
itm_arabian_horse_b = 147
itm_hunter = 148
itm_warhorse = 149
itm_charger = 150
itm_arrows = 151
itm_khergit_arrows = 152
itm_barbed_arrows = 153
itm_bodkin_arrows = 154
itm_bolts = 155
itm_steel_bolts = 156
itm_cartridges = 157
itm_pilgrim_disguise = 158
itm_pilgrim_hood = 159
itm_leather_gloves = 160
itm_mail_mittens = 161
itm_scale_gauntlets = 162
itm_lamellar_gauntlets = 163
itm_gauntlets = 164
itm_wrapping_boots = 165
itm_woolen_hose = 166
itm_blue_hose = 167
itm_hunter_boots = 168
itm_hide_boots = 169
itm_ankle_boots = 170
itm_nomad_boots = 171
itm_leather_boots = 172
itm_splinted_leather_greaves = 173
itm_mail_chausses = 174
itm_splinted_greaves = 175
itm_mail_boots = 176
itm_iron_greaves = 177
itm_black_greaves = 178
itm_khergit_leather_boots = 179
itm_sarranid_boots_a = 180
itm_sarranid_boots_b = 181
itm_sarranid_boots_c = 182
itm_sarranid_boots_d = 183
itm_sarranid_head_cloth = 184
itm_sarranid_head_cloth_b = 185
itm_sarranid_felt_head_cloth = 186
itm_sarranid_felt_head_cloth_b = 187
itm_lady_dress_ruby = 188
itm_lady_dress_green = 189
itm_lady_dress_blue = 190
itm_red_dress = 191
itm_brown_dress = 192
itm_green_dress = 193
itm_khergit_lady_dress = 194
itm_khergit_lady_dress_b = 195
itm_sarranid_lady_dress = 196
itm_sarranid_lady_dress_b = 197
itm_sarranid_common_dress = 198
itm_sarranid_common_dress_b = 199
itm_courtly_outfit = 200
itm_nobleman_outfit = 201
itm_nomad_armor = 202
itm_khergit_armor = 203
itm_leather_jacket = 204
itm_rawhide_coat = 205
itm_leather_armor = 206
itm_fur_coat = 207
itm_coat = 208
itm_leather_coat = 209
itm_mail_coat = 210
itm_long_mail_coat = 211
itm_mail_with_tunic_red = 212
itm_mail_with_tunic_green = 213
itm_hide_coat = 214
itm_merchant_outfit = 215
itm_homespun_dress = 216
itm_thick_coat = 217
itm_coat_with_cape = 218
itm_steppe_outfit = 219
itm_nordic_outfit = 220
itm_nordic_armor = 221
itm_hide_armor = 222
itm_cloaked_tunic = 223
itm_sleeveless_tunic = 224
itm_sleeveless_leather_tunic = 225
itm_linen_shirt = 226
itm_wool_coat = 227
itm_dress = 228
itm_blue_dress = 229
itm_peasant_dress = 230
itm_woolen_dress = 231
itm_shirt = 232
itm_linen_tunic = 233
itm_short_tunic = 234
itm_red_shirt = 235
itm_red_tunic = 236
itm_green_tunic = 237
itm_blue_tunic = 238
itm_robe = 239
itm_coarse_tunic = 240
itm_leather_apron = 241
itm_tabard = 242
itm_leather_vest = 243
itm_steppe_armor = 244
itm_gambeson = 245
itm_blue_gambeson = 246
itm_red_gambeson = 247
itm_padded_cloth = 248
itm_aketon_green = 249
itm_leather_jerkin = 250
itm_nomad_vest = 251
itm_ragged_outfit = 252
itm_padded_leather = 253
itm_tribal_warrior_outfit = 254
itm_nomad_robe = 255
itm_studded_leather_coat = 256
itm_byrnie = 257
itm_haubergeon = 258
itm_lamellar_vest = 259
itm_lamellar_vest_khergit = 260
itm_mail_shirt = 261
itm_mail_hauberk = 262
itm_mail_with_surcoat = 263
itm_surcoat_over_mail = 264
itm_brigandine_red = 265
itm_lamellar_armor = 266
itm_scale_armor = 267
itm_banded_armor = 268
itm_cuir_bouilli = 269
itm_coat_of_plates = 270
itm_coat_of_plates_red = 271
itm_plate_armor = 272
itm_black_armor = 273
itm_pelt_coat = 274
itm_khergit_elite_armor = 275
itm_vaegir_elite_armor = 276
itm_sarranid_elite_armor = 277
itm_sarranid_dress_a = 278
itm_sarranid_dress_b = 279
itm_sarranid_cloth_robe = 280
itm_sarranid_cloth_robe_b = 281
itm_skirmisher_armor = 282
itm_archers_vest = 283
itm_sarranid_leather_armor = 284
itm_sarranid_cavalry_robe = 285
itm_arabian_armor_b = 286
itm_sarranid_mail_shirt = 287
itm_mamluke_mail = 288
itm_burlap_tunic = 289
itm_heraldic_mail_with_surcoat = 290
itm_heraldic_mail_with_tunic = 291
itm_heraldic_mail_with_tunic_b = 292
itm_heraldic_mail_with_tabard = 293
itm_turret_hat_ruby = 294
itm_turret_hat_blue = 295
itm_turret_hat_green = 296
itm_head_wrappings = 297
itm_court_hat = 298
itm_wimple_a = 299
itm_wimple_with_veil = 300
itm_straw_hat = 301
itm_common_hood = 302
itm_hood_b = 303
itm_hood_c = 304
itm_hood_d = 305
itm_headcloth = 306
itm_woolen_hood = 307
itm_arming_cap = 308
itm_fur_hat = 309
itm_nomad_cap = 310
itm_nomad_cap_b = 311
itm_steppe_cap = 312
itm_padded_coif = 313
itm_woolen_cap = 314
itm_felt_hat = 315
itm_felt_hat_b = 316
itm_leather_cap = 317
itm_female_hood = 318
itm_leather_steppe_cap_a = 319
itm_leather_steppe_cap_b = 320
itm_leather_steppe_cap_c = 321
itm_leather_warrior_cap = 322
itm_skullcap = 323
itm_mail_coif = 324
itm_footman_helmet = 325
itm_nasal_helmet = 326
itm_norman_helmet = 327
itm_segmented_helmet = 328
itm_helmet_with_neckguard = 329
itm_flat_topped_helmet = 330
itm_kettle_hat = 331
itm_spiked_helmet = 332
itm_nordic_helmet = 333
itm_khergit_lady_hat = 334
itm_khergit_lady_hat_b = 335
itm_sarranid_felt_hat = 336
itm_turban = 337
itm_desert_turban = 338
itm_sarranid_warrior_cap = 339
itm_sarranid_horseman_helmet = 340
itm_sarranid_helmet1 = 341
itm_sarranid_mail_coif = 342
itm_sarranid_veiled_helmet = 343
itm_nordic_archer_helmet = 344
itm_nordic_veteran_archer_helmet = 345
itm_nordic_footman_helmet = 346
itm_nordic_fighter_helmet = 347
itm_nordic_huscarl_helmet = 348
itm_nordic_warlord_helmet = 349
itm_vaegir_fur_cap = 350
itm_vaegir_fur_helmet = 351
itm_vaegir_spiked_helmet = 352
itm_vaegir_lamellar_helmet = 353
itm_vaegir_noble_helmet = 354
itm_vaegir_war_helmet = 355
itm_vaegir_mask = 356
itm_bascinet = 357
itm_bascinet_2 = 358
itm_bascinet_3 = 359
itm_guard_helmet = 360
itm_black_helmet = 361
itm_full_helm = 362
itm_great_helmet = 363
itm_winged_great_helmet = 364
itm_wooden_stick = 365
itm_cudgel = 366
itm_hammer = 367
itm_club = 368
itm_winged_mace = 369
itm_spiked_mace = 370
itm_military_hammer = 371
itm_maul = 372
itm_sledgehammer = 373
itm_warhammer = 374
itm_pickaxe = 375
itm_spiked_club = 376
itm_fighting_pick = 377
itm_military_pick = 378
itm_morningstar = 379
itm_sickle = 380
itm_cleaver = 381
itm_knife = 382
itm_butchering_knife = 383
itm_dagger = 384
itm_falchion = 385
itm_scimitar = 386
itm_scimitar_b = 387
itm_arabian_sword_a = 388
itm_arabian_sword_b = 389
itm_sarranid_cavalry_sword = 390
itm_arabian_sword_d = 391
itm_great_sword = 392
itm_sword_of_war = 393
itm_hatchet = 394
itm_hand_axe = 395
itm_fighting_axe = 396
itm_axe = 397
itm_voulge = 398
itm_battle_axe = 399
itm_war_axe = 400
itm_sword_two_handed_b = 401
itm_sword_two_handed_a = 402
itm_khergit_sword_two_handed_a = 403
itm_khergit_sword_two_handed_b = 404
itm_two_handed_cleaver = 405
itm_military_cleaver_b = 406
itm_military_cleaver_c = 407
itm_military_sickle_a = 408
itm_bastard_sword_a = 409
itm_bastard_sword_b = 410
itm_one_handed_war_axe_a = 411
itm_one_handed_battle_axe_a = 412
itm_one_handed_war_axe_b = 413
itm_one_handed_battle_axe_b = 414
itm_one_handed_battle_axe_c = 415
itm_two_handed_axe = 416
itm_two_handed_battle_axe_2 = 417
itm_shortened_voulge = 418
itm_great_axe = 419
itm_long_axe = 420
itm_long_axe_alt = 421
itm_long_axe_b = 422
itm_long_axe_b_alt = 423
itm_long_axe_c = 424
itm_long_axe_c_alt = 425
itm_bardiche = 426
itm_great_bardiche = 427
itm_voulge = 428
itm_long_bardiche = 429
itm_great_long_bardiche = 430
itm_hafted_blade_b = 431
itm_hafted_blade_a = 432
itm_shortened_military_scythe = 433
itm_sword_medieval_a = 434
itm_sword_medieval_b = 435
itm_sword_medieval_b_small = 436
itm_sword_medieval_c = 437
itm_sword_medieval_c_small = 438
itm_sword_medieval_c_long = 439
itm_sword_medieval_d_long = 440
itm_sword_viking_1 = 441
itm_sword_viking_2 = 442
itm_sword_viking_2_small = 443
itm_sword_viking_3 = 444
itm_sword_viking_3_small = 445
itm_sword_khergit_1 = 446
itm_sword_khergit_2 = 447
itm_sword_khergit_3 = 448
itm_sword_khergit_4 = 449
itm_mace_1 = 450
itm_mace_2 = 451
itm_mace_3 = 452
itm_mace_4 = 453
itm_club_with_spike_head = 454
itm_long_spiked_club = 455
itm_long_hafted_knobbed_mace = 456
itm_long_hafted_spiked_mace = 457
itm_sarranid_two_handed_mace_1 = 458
itm_sarranid_mace_1 = 459
itm_sarranid_axe_a = 460
itm_sarranid_axe_b = 461
itm_sarranid_two_handed_axe_a = 462
itm_sarranid_two_handed_axe_b = 463
itm_scythe = 464
itm_pitch_fork = 465
itm_military_fork = 466
itm_battle_fork = 467
itm_boar_spear = 468
itm_jousting_lance = 469
itm_double_sided_lance = 470
itm_glaive = 471
itm_poleaxe = 472
itm_polehammer = 473
itm_staff = 474
itm_quarter_staff = 475
itm_iron_staff = 476
itm_shortened_spear = 477
itm_spear = 478
itm_bamboo_spear = 479
itm_war_spear = 480
itm_military_scythe = 481
itm_light_lance = 482
itm_lance = 483
itm_heavy_lance = 484
itm_great_lance = 485
itm_pike = 486
itm_ashwood_pike = 487
itm_awlpike = 488
itm_awlpike_long = 489
itm_bec_de_corbin_a = 490
itm_wooden_shield = 491
itm_nordic_shield = 492
itm_fur_covered_shield = 493
itm_steel_shield = 494
itm_plate_covered_round_shield = 495
itm_leather_covered_round_shield = 496
itm_hide_covered_round_shield = 497
itm_shield_heater_c = 498
itm_norman_shield_1 = 499
itm_norman_shield_2 = 500
itm_norman_shield_3 = 501
itm_norman_shield_4 = 502
itm_norman_shield_5 = 503
itm_norman_shield_6 = 504
itm_norman_shield_7 = 505
itm_norman_shield_8 = 506
itm_tab_shield_round_a = 507
itm_tab_shield_round_b = 508
itm_tab_shield_round_c = 509
itm_tab_shield_round_d = 510
itm_tab_shield_round_e = 511
itm_tab_shield_kite_a = 512
itm_tab_shield_kite_b = 513
itm_tab_shield_kite_c = 514
itm_tab_shield_kite_d = 515
itm_tab_shield_kite_cav_a = 516
itm_tab_shield_kite_cav_b = 517
itm_tab_shield_heater_a = 518
itm_tab_shield_heater_b = 519
itm_tab_shield_heater_c = 520
itm_tab_shield_heater_d = 521
itm_tab_shield_heater_cav_a = 522
itm_tab_shield_heater_cav_b = 523
itm_tab_shield_pavise_a = 524
itm_tab_shield_pavise_b = 525
itm_tab_shield_pavise_c = 526
itm_tab_shield_pavise_d = 527
itm_tab_shield_small_round_a = 528
itm_tab_shield_small_round_b = 529
itm_tab_shield_small_round_c = 530
itm_darts = 531
itm_war_darts = 532
itm_javelin = 533
itm_javelin_melee = 534
itm_throwing_spears = 535
itm_throwing_spear_melee = 536
itm_jarid = 537
itm_jarid_melee = 538
itm_stones = 539
itm_throwing_knives = 540
itm_throwing_daggers = 541
itm_light_throwing_axes = 542
itm_light_throwing_axes_melee = 543
itm_throwing_axes = 544
itm_throwing_axes_melee = 545
itm_heavy_throwing_axes = 546
itm_heavy_throwing_axes_melee = 547
itm_hunting_bow = 548
itm_short_bow = 549
itm_nomad_bow = 550
itm_long_bow = 551
itm_khergit_bow = 552
itm_strong_bow = 553
itm_war_bow = 554
itm_hunting_crossbow = 555
itm_light_crossbow = 556
itm_crossbow = 557
itm_heavy_crossbow = 558
itm_sniper_crossbow = 559
itm_flintlock_pistol = 560
itm_torch = 561
itm_lyre = 562
itm_lute = 563
itm_strange_armor = 564
itm_strange_boots = 565
itm_strange_helmet = 566
itm_strange_sword = 567
itm_strange_great_sword = 568
itm_strange_short_sword = 569
itm_court_dress = 570
itm_rich_outfit = 571
itm_khergit_guard_armor = 572
itm_felt_steppe_cap = 573
itm_khergit_war_helmet = 574
itm_khergit_helmet = 575
itm_khergit_guard_boots = 576
itm_khergit_guard_helmet = 577
itm_khergit_cavalry_helmet = 578
itm_black_hood = 579
itm_light_leather = 580
itm_light_leather_boots = 581
itm_mail_and_plate = 582
itm_light_mail_and_plate = 583
itm_byzantion_helmet_a = 584
itm_magyar_helmet_a = 585
itm_rus_helmet_a = 586
itm_sipahi_helmet_a = 587
itm_shahi = 588
itm_rabati = 589
itm_tunic_with_green_cape = 590
itm_keys = 591
itm_bride_dress = 592
itm_bride_crown = 593
itm_bride_shoes = 594
itm_practice_bow_2 = 595
itm_practice_arrows_2 = 596
itm_plate_boots = 597
itm_heraldic_mail_with_surcoat_for_tableau = 598
itm_mail_boots_for_tableau = 599
itm_warhorse_sarranid = 600
itm_warhorse_steppe = 601
itm_items_end = 602
| Python |
ground_gray_stone = 0
ground_brown_stone = 1
ground_turf = 2
ground_steppe = 3
ground_snow = 4
ground_earth = 5
ground_desert = 6
ground_forest = 7
ground_pebbles = 8
ground_village = 9
ground_path = 10
| Python |
str_no_string = 0
str_empty_string = 1
str_yes = 2
str_no = 3
str_blank_string = 4
str_error_string = 5
str_noone = 6
str_s0 = 7
str_blank_s1 = 8
str_reg1 = 9
str_s50_comma_s51 = 10
str_s50_and_s51 = 11
str_s52_comma_s51 = 12
str_s52_and_s51 = 13
str_s5_s_party = 14
str_given_by_s1_at_s2 = 15
str_given_by_s1_in_wilderness = 16
str_s7_raiders = 17
str_bandits_eliminated_by_another = 18
str_msg_battle_won = 19
str_tutorial_map1 = 20
str_change_color_1 = 21
str_change_color_2 = 22
str_change_background = 23
str_change_flag_type = 24
str_change_map_flag_type = 25
str_randomize = 26
str_sample_banner = 27
str_sample_map_banner = 28
str_number_of_charges = 29
str_change_charge_1 = 30
str_change_charge_1_color = 31
str_change_charge_2 = 32
str_change_charge_2_color = 33
str_change_charge_3 = 34
str_change_charge_3_color = 35
str_change_charge_4 = 36
str_change_charge_4_color = 37
str_change_charge_position = 38
str_choose_position = 39
str_choose_charge = 40
str_choose_background = 41
str_choose_flag_type = 42
str_choose_map_flag_type = 43
str_choose_color = 44
str_accept = 45
str_charge_no_1 = 46
str_charge_no_2 = 47
str_charge_no_3 = 48
str_charge_no_4 = 49
str_change = 50
str_color_no_1 = 51
str_color_no_2 = 52
str_charge = 53
str_color = 54
str_flip_horizontal = 55
str_flip_vertical = 56
str_hold_fire = 57
str_blunt_hold_fire = 58
str_tutorial_ammo_refilled = 59
str_tutorial_failed = 60
str_tutorial_1_msg_1 = 61
str_tutorial_1_msg_2 = 62
str_tutorial_1_msg_3 = 63
str_tutorial_1_msg_4 = 64
str_tutorial_1_msg_5 = 65
str_tutorial_1_msg_6 = 66
str_tutorial_2_msg_1 = 67
str_tutorial_2_msg_2 = 68
str_tutorial_2_msg_3 = 69
str_tutorial_2_msg_4 = 70
str_tutorial_2_msg_5 = 71
str_tutorial_2_msg_6 = 72
str_tutorial_2_msg_7 = 73
str_tutorial_2_msg_8 = 74
str_tutorial_2_msg_9 = 75
str_tutorial_3_msg_1 = 76
str_tutorial_3_msg_2 = 77
str_tutorial_3_msg_3 = 78
str_tutorial_3_msg_4 = 79
str_tutorial_3_msg_5 = 80
str_tutorial_3_msg_6 = 81
str_tutorial_3_2_msg_1 = 82
str_tutorial_3_2_msg_2 = 83
str_tutorial_3_2_msg_3 = 84
str_tutorial_3_2_msg_4 = 85
str_tutorial_3_2_msg_5 = 86
str_tutorial_4_msg_1 = 87
str_tutorial_4_msg_2 = 88
str_tutorial_4_msg_3 = 89
str_tutorial_4_msg_4 = 90
str_tutorial_4_msg_5 = 91
str_tutorial_4_msg_6 = 92
str_tutorial_4_msg_7 = 93
str_tutorial_5_msg_1 = 94
str_tutorial_5_msg_2 = 95
str_tutorial_5_msg_3 = 96
str_tutorial_5_msg_4 = 97
str_tutorial_5_msg_5 = 98
str_tutorial_5_msg_6 = 99
str_trainer_help_1 = 100
str_trainer_help_2 = 101
str_custom_battle_1 = 102
str_custom_battle_2 = 103
str_custom_battle_3 = 104
str_custom_battle_4 = 105
str_custom_battle_5 = 106
str_finished = 107
str_delivered_damage = 108
str_archery_target_hit = 109
str_use_baggage_for_inventory = 110
str_cant_use_inventory_now = 111
str_cant_use_inventory_arena = 112
str_cant_use_inventory_disguised = 113
str_cant_use_inventory_tutorial = 114
str_1_denar = 115
str_reg1_denars = 116
str_january_reg1_reg2 = 117
str_february_reg1_reg2 = 118
str_march_reg1_reg2 = 119
str_april_reg1_reg2 = 120
str_may_reg1_reg2 = 121
str_june_reg1_reg2 = 122
str_july_reg1_reg2 = 123
str_august_reg1_reg2 = 124
str_september_reg1_reg2 = 125
str_october_reg1_reg2 = 126
str_november_reg1_reg2 = 127
str_december_reg1_reg2 = 128
str_town_nighttime = 129
str_door_locked = 130
str_castle_is_abondened = 131
str_town_is_abondened = 132
str_place_is_occupied_by_player = 133
str_place_is_occupied_by_enemy = 134
str_place_is_occupied_by_friendly = 135
str_do_you_want_to_retreat = 136
str_give_up_fight = 137
str_do_you_wish_to_leave_tutorial = 138
str_do_you_wish_to_surrender = 139
str_can_not_retreat = 140
str_s1_joined_battle_enemy = 141
str_s1_joined_battle_friend = 142
str_entrance_to_town_forbidden = 143
str_sneaking_to_town_impossible = 144
str_battle_won = 145
str_battle_lost = 146
str_attack_walls_success = 147
str_attack_walls_failure = 148
str_attack_walls_continue = 149
str_order_attack_success = 150
str_order_attack_failure = 151
str_order_attack_continue = 152
str_join_order_attack_success = 153
str_join_order_attack_failure = 154
str_join_order_attack_continue = 155
str_siege_defender_order_attack_success = 156
str_siege_defender_order_attack_failure = 157
str_siege_defender_order_attack_continue = 158
str_hero_taken_prisoner = 159
str_hero_freed = 160
str_center_captured = 161
str_troop_relation_increased = 162
str_troop_relation_detoriated = 163
str_faction_relation_increased = 164
str_faction_relation_detoriated = 165
str_party_gained_morale = 166
str_party_lost_morale = 167
str_other_party_gained_morale = 168
str_other_party_lost_morale = 169
str_qst_follow_spy_noticed_you = 170
str_father = 171
str_husband = 172
str_wife = 173
str_daughter = 174
str_mother = 175
str_son = 176
str_brother = 177
str_sister = 178
str_he = 179
str_she = 180
str_s3s_s2 = 181
str_s5_is_s51 = 182
str_s5_is_the_ruler_of_s51 = 183
str_s5_is_a_nobleman_of_s6 = 184
str_relation_mnus_100 = 185
str_relation_mnus_90 = 186
str_relation_mnus_80 = 187
str_relation_mnus_70 = 188
str_relation_mnus_60 = 189
str_relation_mnus_50 = 190
str_relation_mnus_40 = 191
str_relation_mnus_30 = 192
str_relation_mnus_20 = 193
str_relation_mnus_10 = 194
str_relation_plus_0 = 195
str_relation_plus_10 = 196
str_relation_plus_20 = 197
str_relation_plus_30 = 198
str_relation_plus_40 = 199
str_relation_plus_50 = 200
str_relation_plus_60 = 201
str_relation_plus_70 = 202
str_relation_plus_80 = 203
str_relation_plus_90 = 204
str_relation_mnus_100_ns = 205
str_relation_mnus_90_ns = 206
str_relation_mnus_80_ns = 207
str_relation_mnus_70_ns = 208
str_relation_mnus_60_ns = 209
str_relation_mnus_50_ns = 210
str_relation_mnus_40_ns = 211
str_relation_mnus_30_ns = 212
str_relation_mnus_20_ns = 213
str_relation_mnus_10_ns = 214
str_relation_plus_0_ns = 215
str_relation_plus_10_ns = 216
str_relation_plus_20_ns = 217
str_relation_plus_30_ns = 218
str_relation_plus_40_ns = 219
str_relation_plus_50_ns = 220
str_relation_plus_60_ns = 221
str_relation_plus_70_ns = 222
str_relation_plus_80_ns = 223
str_relation_plus_90_ns = 224
str_relation_reg1 = 225
str_center_relation_mnus_100 = 226
str_center_relation_mnus_90 = 227
str_center_relation_mnus_80 = 228
str_center_relation_mnus_70 = 229
str_center_relation_mnus_60 = 230
str_center_relation_mnus_50 = 231
str_center_relation_mnus_40 = 232
str_center_relation_mnus_30 = 233
str_center_relation_mnus_20 = 234
str_center_relation_mnus_10 = 235
str_center_relation_plus_0 = 236
str_center_relation_plus_10 = 237
str_center_relation_plus_20 = 238
str_center_relation_plus_30 = 239
str_center_relation_plus_40 = 240
str_center_relation_plus_50 = 241
str_center_relation_plus_60 = 242
str_center_relation_plus_70 = 243
str_center_relation_plus_80 = 244
str_center_relation_plus_90 = 245
str_town_prosperity_0 = 246
str_town_prosperity_10 = 247
str_town_prosperity_20 = 248
str_town_prosperity_30 = 249
str_town_prosperity_40 = 250
str_town_prosperity_50 = 251
str_town_prosperity_60 = 252
str_town_prosperity_70 = 253
str_town_prosperity_80 = 254
str_town_prosperity_90 = 255
str_town_prosperity_100 = 256
str_village_prosperity_0 = 257
str_village_prosperity_10 = 258
str_village_prosperity_20 = 259
str_village_prosperity_30 = 260
str_village_prosperity_40 = 261
str_village_prosperity_50 = 262
str_village_prosperity_60 = 263
str_village_prosperity_70 = 264
str_village_prosperity_80 = 265
str_village_prosperity_90 = 266
str_village_prosperity_100 = 267
str_town_alt_prosperity_0 = 268
str_town_alt_prosperity_20 = 269
str_town_alt_prosperity_40 = 270
str_town_alt_prosperity_60 = 271
str_town_alt_prosperity_80 = 272
str_village_alt_prosperity_0 = 273
str_village_alt_prosperity_20 = 274
str_village_alt_prosperity_40 = 275
str_village_alt_prosperity_60 = 276
str_village_alt_prosperity_80 = 277
str_oasis_village_alt_prosperity_0 = 278
str_oasis_village_alt_prosperity_20 = 279
str_oasis_village_alt_prosperity_40 = 280
str_oasis_village_alt_prosperity_60 = 281
str_oasis_village_alt_prosperity_80 = 282
str_acres_grain = 283
str_acres_orchard = 284
str_acres_oasis = 285
str_looms = 286
str_boats = 287
str_head_cattle = 288
str_head_sheep = 289
str_mills = 290
str_kilns = 291
str_pans = 292
str_deposits = 293
str_hives = 294
str_breweries = 295
str_presses = 296
str_smithies = 297
str_caravans = 298
str_traps = 299
str_gardens = 300
str_tanneries = 301
str_master_miller = 302
str_master_brewer = 303
str_master_presser = 304
str_master_smith = 305
str_master_tanner = 306
str_master_weaver = 307
str_master_dyer = 308
str_war_report_minus_4 = 309
str_war_report_minus_3 = 310
str_war_report_minus_2 = 311
str_war_report_minus_1 = 312
str_war_report_0 = 313
str_war_report_plus_1 = 314
str_war_report_plus_2 = 315
str_war_report_plus_3 = 316
str_war_report_plus_4 = 317
str_persuasion_summary_very_bad = 318
str_persuasion_summary_bad = 319
str_persuasion_summary_average = 320
str_persuasion_summary_good = 321
str_persuasion_summary_very_good = 322
str_secret_sign_1 = 323
str_secret_sign_2 = 324
str_secret_sign_3 = 325
str_secret_sign_4 = 326
str_countersign_1 = 327
str_countersign_2 = 328
str_countersign_3 = 329
str_countersign_4 = 330
str_name_1 = 331
str_name_2 = 332
str_name_3 = 333
str_name_4 = 334
str_name_5 = 335
str_name_6 = 336
str_name_7 = 337
str_name_8 = 338
str_name_9 = 339
str_name_10 = 340
str_name_11 = 341
str_name_12 = 342
str_name_13 = 343
str_name_14 = 344
str_name_15 = 345
str_name_16 = 346
str_name_17 = 347
str_name_18 = 348
str_name_19 = 349
str_name_20 = 350
str_name_21 = 351
str_name_22 = 352
str_name_23 = 353
str_name_24 = 354
str_name_25 = 355
str_surname_1 = 356
str_surname_2 = 357
str_surname_3 = 358
str_surname_4 = 359
str_surname_5 = 360
str_surname_6 = 361
str_surname_7 = 362
str_surname_8 = 363
str_surname_9 = 364
str_surname_10 = 365
str_surname_11 = 366
str_surname_12 = 367
str_surname_13 = 368
str_surname_14 = 369
str_surname_15 = 370
str_surname_16 = 371
str_surname_17 = 372
str_surname_18 = 373
str_surname_19 = 374
str_surname_20 = 375
str_surname_21 = 376
str_surname_22 = 377
str_surname_23 = 378
str_surname_24 = 379
str_surname_25 = 380
str_surname_26 = 381
str_surname_27 = 382
str_surname_28 = 383
str_surname_29 = 384
str_surname_30 = 385
str_surname_31 = 386
str_surname_32 = 387
str_surname_33 = 388
str_surname_34 = 389
str_surname_35 = 390
str_surname_36 = 391
str_surname_37 = 392
str_surname_38 = 393
str_surname_39 = 394
str_surname_40 = 395
str_surname_41 = 396
str_surnames_end = 397
str_number_of_troops_killed_reg1 = 398
str_number_of_troops_wounded_reg1 = 399
str_number_of_own_troops_killed_reg1 = 400
str_number_of_own_troops_wounded_reg1 = 401
str_retreat = 402
str_siege_continues = 403
str_casualty_display = 404
str_casualty_display_hp = 405
str_quest_log_updated = 406
str_banner_selection_text = 407
str_retirement_text_1 = 408
str_retirement_text_2 = 409
str_retirement_text_3 = 410
str_retirement_text_4 = 411
str_retirement_text_5 = 412
str_retirement_text_6 = 413
str_retirement_text_7 = 414
str_retirement_text_8 = 415
str_retirement_text_9 = 416
str_retirement_text_10 = 417
str_loot_village = 418
str_steal_from_villagers = 419
str_rob_caravan = 420
str_sell_slavery = 421
str_men_hungry = 422
str_men_unpaid = 423
str_excessive_casualties = 424
str_surrender = 425
str_flee_battle = 426
str_pay_bandits = 427
str_fail_quest = 428
str_squander_money = 429
str_murder_merchant = 430
str_round_up_serfs = 431
str_battle_fate_1 = 432
str_battle_fate_2 = 433
str_battle_fate_3 = 434
str_battle_fate_4 = 435
str_battle_fate_5 = 436
str_npc_morale_report = 437
str_happy = 438
str_content = 439
str_concerned = 440
str_not_happy = 441
str_miserable = 442
str_morale_reg1 = 443
str_bar_enthusiastic = 444
str_bar_content = 445
str_bar_weary = 446
str_bar_disgruntled = 447
str_bar_miserable = 448
str_here_plus_space = 449
str_npc1_intro = 450
str_npc2_intro = 451
str_npc3_intro = 452
str_npc4_intro = 453
str_npc5_intro = 454
str_npc6_intro = 455
str_npc7_intro = 456
str_npc8_intro = 457
str_npc9_intro = 458
str_npc10_intro = 459
str_npc11_intro = 460
str_npc12_intro = 461
str_npc13_intro = 462
str_npc14_intro = 463
str_npc15_intro = 464
str_npc16_intro = 465
str_npc1_intro_response_1 = 466
str_npc2_intro_response_1 = 467
str_npc3_intro_response_1 = 468
str_npc4_intro_response_1 = 469
str_npc5_intro_response_1 = 470
str_npc6_intro_response_1 = 471
str_npc7_intro_response_1 = 472
str_npc8_intro_response_1 = 473
str_npc9_intro_response_1 = 474
str_npc10_intro_response_1 = 475
str_npc11_intro_response_1 = 476
str_npc12_intro_response_1 = 477
str_npc13_intro_response_1 = 478
str_npc14_intro_response_1 = 479
str_npc15_intro_response_1 = 480
str_npc16_intro_response_1 = 481
str_npc1_intro_response_2 = 482
str_npc2_intro_response_2 = 483
str_npc3_intro_response_2 = 484
str_npc4_intro_response_2 = 485
str_npc5_intro_response_2 = 486
str_npc6_intro_response_2 = 487
str_npc7_intro_response_2 = 488
str_npc8_intro_response_2 = 489
str_npc9_intro_response_2 = 490
str_npc10_intro_response_2 = 491
str_npc11_intro_response_2 = 492
str_npc12_intro_response_2 = 493
str_npc13_intro_response_2 = 494
str_npc14_intro_response_2 = 495
str_npc15_intro_response_2 = 496
str_npc16_intro_response_2 = 497
str_npc1_backstory_a = 498
str_npc2_backstory_a = 499
str_npc3_backstory_a = 500
str_npc4_backstory_a = 501
str_npc5_backstory_a = 502
str_npc6_backstory_a = 503
str_npc7_backstory_a = 504
str_npc8_backstory_a = 505
str_npc9_backstory_a = 506
str_npc10_backstory_a = 507
str_npc11_backstory_a = 508
str_npc12_backstory_a = 509
str_npc13_backstory_a = 510
str_npc14_backstory_a = 511
str_npc15_backstory_a = 512
str_npc16_backstory_a = 513
str_npc1_backstory_b = 514
str_npc2_backstory_b = 515
str_npc3_backstory_b = 516
str_npc4_backstory_b = 517
str_npc5_backstory_b = 518
str_npc6_backstory_b = 519
str_npc7_backstory_b = 520
str_npc8_backstory_b = 521
str_npc9_backstory_b = 522
str_npc10_backstory_b = 523
str_npc11_backstory_b = 524
str_npc12_backstory_b = 525
str_npc13_backstory_b = 526
str_npc14_backstory_b = 527
str_npc15_backstory_b = 528
str_npc16_backstory_b = 529
str_npc1_backstory_c = 530
str_npc2_backstory_c = 531
str_npc3_backstory_c = 532
str_npc4_backstory_c = 533
str_npc5_backstory_c = 534
str_npc6_backstory_c = 535
str_npc7_backstory_c = 536
str_npc8_backstory_c = 537
str_npc9_backstory_c = 538
str_npc10_backstory_c = 539
str_npc11_backstory_c = 540
str_npc12_backstory_c = 541
str_npc13_backstory_c = 542
str_npc14_backstory_c = 543
str_npc15_backstory_c = 544
str_npc16_backstory_c = 545
str_npc1_backstory_later = 546
str_npc2_backstory_later = 547
str_npc3_backstory_later = 548
str_npc4_backstory_later = 549
str_npc5_backstory_later = 550
str_npc6_backstory_later = 551
str_npc7_backstory_later = 552
str_npc8_backstory_later = 553
str_npc9_backstory_later = 554
str_npc10_backstory_later = 555
str_npc11_backstory_later = 556
str_npc12_backstory_later = 557
str_npc13_backstory_later = 558
str_npc14_backstory_later = 559
str_npc15_backstory_later = 560
str_npc16_backstory_later = 561
str_npc1_backstory_response_1 = 562
str_npc2_backstory_response_1 = 563
str_npc3_backstory_response_1 = 564
str_npc4_backstory_response_1 = 565
str_npc5_backstory_response_1 = 566
str_npc6_backstory_response_1 = 567
str_npc7_backstory_response_1 = 568
str_npc8_backstory_response_1 = 569
str_npc9_backstory_response_1 = 570
str_npc10_backstory_response_1 = 571
str_npc11_backstory_response_1 = 572
str_npc12_backstory_response_1 = 573
str_npc13_backstory_response_1 = 574
str_npc14_backstory_response_1 = 575
str_npc15_backstory_response_1 = 576
str_npc16_backstory_response_1 = 577
str_npc1_backstory_response_2 = 578
str_npc2_backstory_response_2 = 579
str_npc3_backstory_response_2 = 580
str_npc4_backstory_response_2 = 581
str_npc5_backstory_response_2 = 582
str_npc6_backstory_response_2 = 583
str_npc7_backstory_response_2 = 584
str_npc8_backstory_response_2 = 585
str_npc9_backstory_response_2 = 586
str_npc10_backstory_response_2 = 587
str_npc11_backstory_response_2 = 588
str_npc12_backstory_response_2 = 589
str_npc13_backstory_response_2 = 590
str_npc14_backstory_response_2 = 591
str_npc15_backstory_response_2 = 592
str_npc16_backstory_response_2 = 593
str_npc1_signup = 594
str_npc2_signup = 595
str_npc3_signup = 596
str_npc4_signup = 597
str_npc5_signup = 598
str_npc6_signup = 599
str_npc7_signup = 600
str_npc8_signup = 601
str_npc9_signup = 602
str_npc10_signup = 603
str_npc11_signup = 604
str_npc12_signup = 605
str_npc13_signup = 606
str_npc14_signup = 607
str_npc15_signup = 608
str_npc16_signup = 609
str_npc1_signup_2 = 610
str_npc2_signup_2 = 611
str_npc3_signup_2 = 612
str_npc4_signup_2 = 613
str_npc5_signup_2 = 614
str_npc6_signup_2 = 615
str_npc7_signup_2 = 616
str_npc8_signup_2 = 617
str_npc9_signup_2 = 618
str_npc10_signup_2 = 619
str_npc11_signup_2 = 620
str_npc12_signup_2 = 621
str_npc13_signup_2 = 622
str_npc14_signup_2 = 623
str_npc15_signup_2 = 624
str_npc16_signup_2 = 625
str_npc1_signup_response_1 = 626
str_npc2_signup_response_1 = 627
str_npc3_signup_response_1 = 628
str_npc4_signup_response_1 = 629
str_npc5_signup_response_1 = 630
str_npc6_signup_response_1 = 631
str_npc7_signup_response_1 = 632
str_npc8_signup_response_1 = 633
str_npc9_signup_response_1 = 634
str_npc10_signup_response_1 = 635
str_npc11_signup_response_1 = 636
str_npc12_signup_response_1 = 637
str_npc13_signup_response_1 = 638
str_npc14_signup_response_1 = 639
str_npc15_signup_response_1 = 640
str_npc16_signup_response_1 = 641
str_npc1_signup_response_2 = 642
str_npc2_signup_response_2 = 643
str_npc3_signup_response_2 = 644
str_npc4_signup_response_2 = 645
str_npc5_signup_response_2 = 646
str_npc6_signup_response_2 = 647
str_npc7_signup_response_2 = 648
str_npc8_signup_response_2 = 649
str_npc9_signup_response_2 = 650
str_npc10_signup_response_2 = 651
str_npc11_signup_response_2 = 652
str_npc12_signup_response_2 = 653
str_npc13_signup_response_2 = 654
str_npc14_signup_response_2 = 655
str_npc15_signup_response_2 = 656
str_npc16_signup_response_2 = 657
str_npc1_payment = 658
str_npc2_payment = 659
str_npc3_payment = 660
str_npc4_payment = 661
str_npc5_payment = 662
str_npc6_payment = 663
str_npc7_payment = 664
str_npc8_payment = 665
str_npc9_payment = 666
str_npc10_payment = 667
str_npc11_payment = 668
str_npc12_payment = 669
str_npc13_payment = 670
str_npc14_payment = 671
str_npc15_payment = 672
str_npc16_payment = 673
str_npc1_payment_response = 674
str_npc2_payment_response = 675
str_npc3_payment_response = 676
str_npc4_payment_response = 677
str_npc5_payment_response = 678
str_npc6_payment_response = 679
str_npc7_payment_response = 680
str_npc8_payment_response = 681
str_npc9_payment_response = 682
str_npc10_payment_response = 683
str_npc11_payment_response = 684
str_npc12_payment_response = 685
str_npc13_payment_response = 686
str_npc14_payment_response = 687
str_npc15_payment_response = 688
str_npc16_payment_response = 689
str_npc1_morality_speech = 690
str_npc2_morality_speech = 691
str_npc3_morality_speech = 692
str_npc4_morality_speech = 693
str_npc5_morality_speech = 694
str_npc6_morality_speech = 695
str_npc7_morality_speech = 696
str_npc8_morality_speech = 697
str_npc9_morality_speech = 698
str_npc10_morality_speech = 699
str_npc11_morality_speech = 700
str_npc12_morality_speech = 701
str_npc13_morality_speech = 702
str_npc14_morality_speech = 703
str_npc15_morality_speech = 704
str_npc16_morality_speech = 705
str_npc1_2ary_morality_speech = 706
str_npc2_2ary_morality_speech = 707
str_npc3_2ary_morality_speech = 708
str_npc4_2ary_morality_speech = 709
str_npc5_2ary_morality_speech = 710
str_npc6_2ary_morality_speech = 711
str_npc7_2ary_morality_speech = 712
str_npc8_2ary_morality_speech = 713
str_npc9_2ary_morality_speech = 714
str_npc10_2ary_morality_speech = 715
str_npc11_2ary_morality_speech = 716
str_npc12_2ary_morality_speech = 717
str_npc13_2ary_morality_speech = 718
str_npc14_2ary_morality_speech = 719
str_npc15_2ary_morality_speech = 720
str_npc16_2ary_morality_speech = 721
str_npc1_personalityclash_speech = 722
str_npc2_personalityclash_speech = 723
str_npc3_personalityclash_speech = 724
str_npc4_personalityclash_speech = 725
str_npc5_personalityclash_speech = 726
str_npc6_personalityclash_speech = 727
str_npc7_personalityclash_speech = 728
str_npc8_personalityclash_speech = 729
str_npc9_personalityclash_speech = 730
str_npc10_personalityclash_speech = 731
str_npc11_personalityclash_speech = 732
str_npc12_personalityclash_speech = 733
str_npc13_personalityclash_speech = 734
str_npc14_personalityclash_speech = 735
str_npc15_personalityclash_speech = 736
str_npc16_personalityclash_speech = 737
str_npc1_personalityclash_speech_b = 738
str_npc2_personalityclash_speech_b = 739
str_npc3_personalityclash_speech_b = 740
str_npc4_personalityclash_speech_b = 741
str_npc5_personalityclash_speech_b = 742
str_npc6_personalityclash_speech_b = 743
str_npc7_personalityclash_speech_b = 744
str_npc8_personalityclash_speech_b = 745
str_npc9_personalityclash_speech_b = 746
str_npc10_personalityclash_speech_b = 747
str_npc11_personalityclash_speech_b = 748
str_npc12_personalityclash_speech_b = 749
str_npc13_personalityclash_speech_b = 750
str_npc14_personalityclash_speech_b = 751
str_npc15_personalityclash_speech_b = 752
str_npc16_personalityclash_speech_b = 753
str_npc1_personalityclash2_speech = 754
str_npc2_personalityclash2_speech = 755
str_npc3_personalityclash2_speech = 756
str_npc4_personalityclash2_speech = 757
str_npc5_personalityclash2_speech = 758
str_npc6_personalityclash2_speech = 759
str_npc7_personalityclash2_speech = 760
str_npc8_personalityclash2_speech = 761
str_npc9_personalityclash2_speech = 762
str_npc10_personalityclash2_speech = 763
str_npc11_personalityclash2_speech = 764
str_npc12_personalityclash2_speech = 765
str_npc13_personalityclash2_speech = 766
str_npc14_personalityclash2_speech = 767
str_npc15_personalityclash2_speech = 768
str_npc16_personalityclash2_speech = 769
str_npc1_personalityclash2_speech_b = 770
str_npc2_personalityclash2_speech_b = 771
str_npc3_personalityclash2_speech_b = 772
str_npc4_personalityclash2_speech_b = 773
str_npc5_personalityclash2_speech_b = 774
str_npc6_personalityclash2_speech_b = 775
str_npc7_personalityclash2_speech_b = 776
str_npc8_personalityclash2_speech_b = 777
str_npc9_personalityclash2_speech_b = 778
str_npc10_personalityclash2_speech_b = 779
str_npc11_personalityclash2_speech_b = 780
str_npc12_personalityclash2_speech_b = 781
str_npc13_personalityclash2_speech_b = 782
str_npc14_personalityclash2_speech_b = 783
str_npc15_personalityclash2_speech_b = 784
str_npc16_personalityclash2_speech_b = 785
str_npc1_personalitymatch_speech = 786
str_npc2_personalitymatch_speech = 787
str_npc3_personalitymatch_speech = 788
str_npc4_personalitymatch_speech = 789
str_npc5_personalitymatch_speech = 790
str_npc6_personalitymatch_speech = 791
str_npc7_personalitymatch_speech = 792
str_npc8_personalitymatch_speech = 793
str_npc9_personalitymatch_speech = 794
str_npc10_personalitymatch_speech = 795
str_npc11_personalitymatch_speech = 796
str_npc12_personalitymatch_speech = 797
str_npc13_personalitymatch_speech = 798
str_npc14_personalitymatch_speech = 799
str_npc15_personalitymatch_speech = 800
str_npc16_personalitymatch_speech = 801
str_npc1_personalitymatch_speech_b = 802
str_npc2_personalitymatch_speech_b = 803
str_npc3_personalitymatch_speech_b = 804
str_npc4_personalitymatch_speech_b = 805
str_npc5_personalitymatch_speech_b = 806
str_npc6_personalitymatch_speech_b = 807
str_npc7_personalitymatch_speech_b = 808
str_npc8_personalitymatch_speech_b = 809
str_npc9_personalitymatch_speech_b = 810
str_npc10_personalitymatch_speech_b = 811
str_npc11_personalitymatch_speech_b = 812
str_npc12_personalitymatch_speech_b = 813
str_npc13_personalitymatch_speech_b = 814
str_npc14_personalitymatch_speech_b = 815
str_npc15_personalitymatch_speech_b = 816
str_npc16_personalitymatch_speech_b = 817
str_npc1_retirement_speech = 818
str_npc2_retirement_speech = 819
str_npc3_retirement_speech = 820
str_npc4_retirement_speech = 821
str_npc5_retirement_speech = 822
str_npc6_retirement_speech = 823
str_npc7_retirement_speech = 824
str_npc8_retirement_speech = 825
str_npc9_retirement_speech = 826
str_npc10_retirement_speech = 827
str_npc11_retirement_speech = 828
str_npc12_retirement_speech = 829
str_npc13_retirement_speech = 830
str_npc14_retirement_speech = 831
str_npc15_retirement_speech = 832
str_npc16_retirement_speech = 833
str_npc1_rehire_speech = 834
str_npc2_rehire_speech = 835
str_npc3_rehire_speech = 836
str_npc4_rehire_speech = 837
str_npc5_rehire_speech = 838
str_npc6_rehire_speech = 839
str_npc7_rehire_speech = 840
str_npc8_rehire_speech = 841
str_npc9_rehire_speech = 842
str_npc10_rehire_speech = 843
str_npc11_rehire_speech = 844
str_npc12_rehire_speech = 845
str_npc13_rehire_speech = 846
str_npc14_rehire_speech = 847
str_npc15_rehire_speech = 848
str_npc16_rehire_speech = 849
str_npc1_home_intro = 850
str_npc2_home_intro = 851
str_npc3_home_intro = 852
str_npc4_home_intro = 853
str_npc5_home_intro = 854
str_npc6_home_intro = 855
str_npc7_home_intro = 856
str_npc8_home_intro = 857
str_npc9_home_intro = 858
str_npc10_home_intro = 859
str_npc11_home_intro = 860
str_npc12_home_intro = 861
str_npc13_home_intro = 862
str_npc14_home_intro = 863
str_npc15_home_intro = 864
str_npc16_home_intro = 865
str_npc1_home_description = 866
str_npc2_home_description = 867
str_npc3_home_description = 868
str_npc4_home_description = 869
str_npc5_home_description = 870
str_npc6_home_description = 871
str_npc7_home_description = 872
str_npc8_home_description = 873
str_npc9_home_description = 874
str_npc10_home_description = 875
str_npc11_home_description = 876
str_npc12_home_description = 877
str_npc13_home_description = 878
str_npc14_home_description = 879
str_npc15_home_description = 880
str_npc16_home_description = 881
str_npc1_home_description_2 = 882
str_npc2_home_description_2 = 883
str_npc3_home_description_2 = 884
str_npc4_home_description_2 = 885
str_npc5_home_description_2 = 886
str_npc6_home_description_2 = 887
str_npc7_home_description_2 = 888
str_npc8_home_description_2 = 889
str_npc9_home_description_2 = 890
str_npc10_home_description_2 = 891
str_npc11_home_description_2 = 892
str_npc12_home_description_2 = 893
str_npc13_home_description_2 = 894
str_npc14_home_description_2 = 895
str_npc15_home_description_2 = 896
str_npc16_home_description_2 = 897
str_npc1_home_recap = 898
str_npc2_home_recap = 899
str_npc3_home_recap = 900
str_npc4_home_recap = 901
str_npc5_home_recap = 902
str_npc6_home_recap = 903
str_npc7_home_recap = 904
str_npc8_home_recap = 905
str_npc9_home_recap = 906
str_npc10_home_recap = 907
str_npc11_home_recap = 908
str_npc12_home_recap = 909
str_npc13_home_recap = 910
str_npc14_home_recap = 911
str_npc15_home_recap = 912
str_npc16_home_recap = 913
str_npc1_honorific = 914
str_npc2_honorific = 915
str_npc3_honorific = 916
str_npc4_honorific = 917
str_npc5_honorific = 918
str_npc6_honorific = 919
str_npc7_honorific = 920
str_npc8_honorific = 921
str_npc9_honorific = 922
str_npc10_honorific = 923
str_npc11_honorific = 924
str_npc12_honorific = 925
str_npc13_honorific = 926
str_npc14_honorific = 927
str_npc15_honorific = 928
str_npc16_honorific = 929
str_npc1_kingsupport_1 = 930
str_npc2_kingsupport_1 = 931
str_npc3_kingsupport_1 = 932
str_npc4_kingsupport_1 = 933
str_npc5_kingsupport_1 = 934
str_npc6_kingsupport_1 = 935
str_npc7_kingsupport_1 = 936
str_npc8_kingsupport_1 = 937
str_npc9_kingsupport_1 = 938
str_npc10_kingsupport_1 = 939
str_npc11_kingsupport_1 = 940
str_npc12_kingsupport_1 = 941
str_npc13_kingsupport_1 = 942
str_npc14_kingsupport_1 = 943
str_npc15_kingsupport_1 = 944
str_npc16_kingsupport_1 = 945
str_npc1_kingsupport_2 = 946
str_npc2_kingsupport_2 = 947
str_npc3_kingsupport_2 = 948
str_npc4_kingsupport_2 = 949
str_npc5_kingsupport_2 = 950
str_npc6_kingsupport_2 = 951
str_npc7_kingsupport_2 = 952
str_npc8_kingsupport_2 = 953
str_npc9_kingsupport_2 = 954
str_npc10_kingsupport_2 = 955
str_npc11_kingsupport_2 = 956
str_npc12_kingsupport_2 = 957
str_npc13_kingsupport_2 = 958
str_npc14_kingsupport_2 = 959
str_npc15_kingsupport_2 = 960
str_npc16_kingsupport_2 = 961
str_npc1_kingsupport_2a = 962
str_npc2_kingsupport_2a = 963
str_npc3_kingsupport_2a = 964
str_npc4_kingsupport_2a = 965
str_npc5_kingsupport_2a = 966
str_npc6_kingsupport_2a = 967
str_npc7_kingsupport_2a = 968
str_npc8_kingsupport_2a = 969
str_npc9_kingsupport_2a = 970
str_npc10_kingsupport_2a = 971
str_npc11_kingsupport_2a = 972
str_npc12_kingsupport_2a = 973
str_npc13_kingsupport_2a = 974
str_npc14_kingsupport_2a = 975
str_npc15_kingsupport_2a = 976
str_npc16_kingsupport_2a = 977
str_npc1_kingsupport_2b = 978
str_npc2_kingsupport_2b = 979
str_npc3_kingsupport_2b = 980
str_npc4_kingsupport_2b = 981
str_npc5_kingsupport_2b = 982
str_npc6_kingsupport_2b = 983
str_npc7_kingsupport_2b = 984
str_npc8_kingsupport_2b = 985
str_npc9_kingsupport_2b = 986
str_npc10_kingsupport_2b = 987
str_npc11_kingsupport_2b = 988
str_npc12_kingsupport_2b = 989
str_npc13_kingsupport_2b = 990
str_npc14_kingsupport_2b = 991
str_npc15_kingsupport_2b = 992
str_npc16_kingsupport_2b = 993
str_npc1_kingsupport_3 = 994
str_npc2_kingsupport_2 = 995
str_npc3_kingsupport_3 = 996
str_npc4_kingsupport_3 = 997
str_npc5_kingsupport_3 = 998
str_npc6_kingsupport_3 = 999
str_npc7_kingsupport_3 = 1000
str_npc8_kingsupport_3 = 1001
str_npc9_kingsupport_3 = 1002
str_npc10_kingsupport_3 = 1003
str_npc11_kingsupport_3 = 1004
str_npc12_kingsupport_3 = 1005
str_npc13_kingsupport_3 = 1006
str_npc14_kingsupport_3 = 1007
str_npc15_kingsupport_3 = 1008
str_npc16_kingsupport_3 = 1009
str_npc1_kingsupport_objection = 1010
str_npc2_kingsupport_objection = 1011
str_npc3_kingsupport_objection = 1012
str_npc4_kingsupport_objection = 1013
str_npc5_kingsupport_objection = 1014
str_npc6_kingsupport_objection = 1015
str_npc7_kingsupport_objection = 1016
str_npc8_kingsupport_objection = 1017
str_npc9_kingsupport_objection = 1018
str_npc10_kingsupport_objection = 1019
str_npc11_kingsupport_objection = 1020
str_npc12_kingsupport_objection = 1021
str_npc13_kingsupport_objection = 1022
str_npc14_kingsupport_objection = 1023
str_npc15_kingsupport_objection = 1024
str_npc16_kingsupport_objection = 1025
str_npc1_intel_mission = 1026
str_npc2_intel_mission = 1027
str_npc3_intel_mission = 1028
str_npc4_intel_mission = 1029
str_npc5_intel_mission = 1030
str_npc6_intel_mission = 1031
str_npc7_intel_mission = 1032
str_npc8_intel_mission = 1033
str_npc9_intel_mission = 1034
str_npc10_intel_mission = 1035
str_npc11_intel_mission = 1036
str_npc12_intel_mission = 1037
str_npc13_intel_mission = 1038
str_npc14_intel_mission = 1039
str_npc15_intel_mission = 1040
str_npc16_intel_mission = 1041
str_npc1_fief_acceptance = 1042
str_npc2_fief_acceptance = 1043
str_npc3_fief_acceptance = 1044
str_npc4_fief_acceptance = 1045
str_npc5_fief_acceptance = 1046
str_npc6_fief_acceptance = 1047
str_npc7_fief_acceptance = 1048
str_npc8_fief_acceptance = 1049
str_npc9_fief_acceptance = 1050
str_npc10_fief_acceptance = 1051
str_npc11_fief_acceptance = 1052
str_npc12_fief_acceptance = 1053
str_npc13_fief_acceptance = 1054
str_npc14_fief_acceptance = 1055
str_npc15_fief_acceptance = 1056
str_npc16_fief_acceptance = 1057
str_npc1_woman_to_woman = 1058
str_npc2_woman_to_woman = 1059
str_npc3_woman_to_woman = 1060
str_npc4_woman_to_woman = 1061
str_npc5_woman_to_woman = 1062
str_npc6_woman_to_woman = 1063
str_npc7_woman_to_woman = 1064
str_npc8_woman_to_woman = 1065
str_npc9_woman_to_woman = 1066
str_npc10_woman_to_woman = 1067
str_npc11_woman_to_woman = 1068
str_npc12_woman_to_woman = 1069
str_npc13_woman_to_woman = 1070
str_npc14_woman_to_woman = 1071
str_npc15_woman_to_woman = 1072
str_npc16_woman_to_woman = 1073
str_npc1_turn_against = 1074
str_npc2_turn_against = 1075
str_npc3_turn_against = 1076
str_npc4_turn_against = 1077
str_npc4_turn_against = 1078
str_npc6_turn_against = 1079
str_npc7_turn_against = 1080
str_npc8_turn_against = 1081
str_npc9_turn_against = 1082
str_npc10_turn_against = 1083
str_npc11_turn_against = 1084
str_npc12_turn_against = 1085
str_npc13_turn_against = 1086
str_npc14_turn_against = 1087
str_npc15_turn_against = 1088
str_npc16_turn_against = 1089
str_comment_intro_liege_affiliated = 1090
str_comment_intro_famous_liege = 1091
str_comment_intro_famous_martial = 1092
str_comment_intro_famous_badtempered = 1093
str_comment_intro_famous_pitiless = 1094
str_comment_intro_famous_cunning = 1095
str_comment_intro_famous_sadistic = 1096
str_comment_intro_famous_goodnatured = 1097
str_comment_intro_famous_upstanding = 1098
str_comment_intro_noble_liege = 1099
str_comment_intro_noble_martial = 1100
str_comment_intro_noble_badtempered = 1101
str_comment_intro_noble_pitiless = 1102
str_comment_intro_noble_cunning = 1103
str_comment_intro_noble_sadistic = 1104
str_comment_intro_noble_goodnatured = 1105
str_comment_intro_noble_upstanding = 1106
str_comment_intro_common_liege = 1107
str_comment_intro_common_martial = 1108
str_comment_intro_common_badtempered = 1109
str_comment_intro_common_pitiless = 1110
str_comment_intro_common_cunning = 1111
str_comment_intro_common_sadistic = 1112
str_comment_intro_common_goodnatured = 1113
str_comment_intro_common_upstanding = 1114
str_comment_intro_female_famous_liege = 1115
str_comment_intro_female_famous_martial = 1116
str_comment_intro_female_famous_badtempered = 1117
str_comment_intro_female_famous_pitiless = 1118
str_comment_intro_female_famous_cunning = 1119
str_comment_intro_female_famous_sadistic = 1120
str_comment_intro_female_famous_goodnatured = 1121
str_comment_intro_female_famous_upstanding = 1122
str_comment_intro_female_noble_liege = 1123
str_comment_intro_female_noble_martial = 1124
str_comment_intro_female_noble_badtempered = 1125
str_comment_intro_female_noble_pitiless = 1126
str_comment_intro_female_noble_cunning = 1127
str_comment_intro_female_noble_sadistic = 1128
str_comment_intro_female_noble_goodnatured = 1129
str_comment_intro_female_noble_upstanding = 1130
str_comment_intro_female_admiring_liege = 1131
str_comment_intro_female_admiring_martial = 1132
str_comment_intro_female_badtempered_admiring = 1133
str_comment_intro_female_pitiless_admiring = 1134
str_comment_intro_female_cunning_admiring = 1135
str_comment_intro_female_sadistic_admiring = 1136
str_comment_intro_female_admiring_goodnatured = 1137
str_comment_intro_female_admiring_upstanding = 1138
str_comment_intro_female_common_liege = 1139
str_comment_intro_female_common_martial = 1140
str_comment_intro_female_common_badtempered = 1141
str_comment_intro_female_common_pitiless = 1142
str_comment_intro_female_common_cunning = 1143
str_comment_intro_female_common_sadistic = 1144
str_comment_intro_female_common_goodnatured = 1145
str_comment_intro_female_common_upstanding = 1146
str_rejoinder_intro_female_common_badtempered = 1147
str_rejoinder_intro_female_noble_sadistic = 1148
str_rejoinder_intro_female_common_sadistic = 1149
str_rejoinder_intro_female_noble_pitiless = 1150
str_rejoinder_intro_female_common_pitiless = 1151
str_rejoinder_intro_noble_sadistic = 1152
str_rejoinder_intro_female_pitiless_admiring = 1153
str_rejoinder_intro_female_common_upstanding = 1154
str_rejoinder_intro_female_noble_upstanding = 1155
str_rejoinder_intro_female_common_martial = 1156
str_rejoinder_intro_female_sadistic_admiring = 1157
str_rejoinder_intro_female_badtempered_admiring = 1158
str_comment_you_raided_my_village_enemy_benevolent = 1159
str_comment_you_raided_my_village_enemy_spiteful = 1160
str_comment_you_raided_my_village_enemy_coldblooded = 1161
str_comment_you_raided_my_village_enemy = 1162
str_comment_you_raided_my_village_unfriendly_spiteful = 1163
str_comment_you_raided_my_village_friendly = 1164
str_comment_you_raided_my_village_default = 1165
str_comment_you_stole_cattles_from_my_village_enemy_benevolent = 1166
str_comment_you_stole_cattles_from_my_village_enemy_spiteful = 1167
str_comment_you_stole_cattles_from_my_village_enemy_coldblooded = 1168
str_comment_you_stole_cattles_from_my_village_enemy = 1169
str_comment_you_stole_cattles_from_my_village_unfriendly_spiteful = 1170
str_comment_you_stole_cattles_from_my_village_friendly = 1171
str_comment_you_stole_cattles_from_my_village_default = 1172
str_comment_you_robbed_my_village_enemy_coldblooded = 1173
str_comment_you_robbed_my_village_enemy = 1174
str_comment_you_robbed_my_village_friendly_spiteful = 1175
str_comment_you_robbed_my_village_friendly = 1176
str_comment_you_robbed_my_village_default = 1177
str_comment_you_accosted_my_caravan_enemy = 1178
str_comment_you_accosted_my_caravan_default = 1179
str_comment_you_helped_villagers_benevolent = 1180
str_comment_you_helped_villagers_friendly_cruel = 1181
str_comment_you_helped_villagers_friendly = 1182
str_comment_you_helped_villagers_unfriendly_spiteful = 1183
str_comment_you_helped_villagers_cruel = 1184
str_comment_you_helped_villagers_default = 1185
str_comment_you_give_castle_in_my_control = 1186
str_comment_you_captured_a_castle_allied_friendly = 1187
str_comment_you_captured_a_castle_allied_spiteful = 1188
str_comment_you_captured_a_castle_allied_unfriendly_spiteful = 1189
str_comment_you_captured_a_castle_allied_unfriendly = 1190
str_comment_you_captured_a_castle_allied = 1191
str_comment_you_captured_my_castle_enemy_spiteful = 1192
str_comment_you_captured_my_castle_enemy_chivalrous = 1193
str_comment_you_captured_my_castle_enemy = 1194
str_comment_we_defeated_a_lord_unfriendly_spiteful = 1195
str_comment_we_defeated_a_lord_unfriendly = 1196
str_comment_we_defeated_a_lord_cruel = 1197
str_comment_we_defeated_a_lord_quarrelsome = 1198
str_comment_we_defeated_a_lord_upstanding = 1199
str_comment_we_defeated_a_lord_default = 1200
str_comment_we_fought_in_siege_unfriendly_spiteful = 1201
str_comment_we_fought_in_siege_unfriendly = 1202
str_comment_we_fought_in_siege_cruel = 1203
str_comment_we_fought_in_siege_quarrelsome = 1204
str_comment_we_fought_in_siege_upstanding = 1205
str_comment_we_fought_in_siege_default = 1206
str_comment_we_fought_in_major_battle_unfriendly_spiteful = 1207
str_comment_we_fought_in_major_battle_unfriendly = 1208
str_comment_we_fought_in_major_battle_cruel = 1209
str_comment_we_fought_in_major_battle_quarrelsome = 1210
str_comment_we_fought_in_major_battle_upstanding = 1211
str_comment_we_fought_in_major_battle_default = 1212
str_comment_you_defeated_a_lord_allied_liege = 1213
str_comment_you_defeated_a_lord_allied_unfriendly_spiteful = 1214
str_comment_you_defeated_a_lord_allied_spiteful = 1215
str_comment_you_defeated_a_lord_allied_unfriendly_chivalrous = 1216
str_comment_you_defeated_a_lord_allied = 1217
str_comment_you_defeated_me_enemy_chivalrous = 1218
str_comment_you_defeated_me_enemy_spiteful = 1219
str_comment_you_defeated_me_enemy = 1220
str_comment_i_defeated_you_enemy_spiteful = 1221
str_comment_i_defeated_you_enemy_chivalrous = 1222
str_comment_i_defeated_you_enemy_benevolent = 1223
str_comment_i_defeated_you_enemy_coldblooded = 1224
str_comment_i_defeated_you_enemy = 1225
str_comment_we_were_defeated_unfriendly_spiteful = 1226
str_comment_we_were_defeated_unfriendly = 1227
str_comment_we_were_defeated_cruel = 1228
str_comment_we_were_defeated_default = 1229
str_comment_you_were_defeated_allied_friendly_spiteful = 1230
str_comment_you_were_defeated_allied_unfriendly_cruel = 1231
str_comment_you_were_defeated_allied_spiteful = 1232
str_comment_you_were_defeated_allied_pitiless = 1233
str_comment_you_were_defeated_allied_unfriendly_upstanding = 1234
str_comment_you_were_defeated_allied_unfriendly = 1235
str_comment_you_were_defeated_allied = 1236
str_comment_you_helped_my_ally_unfriendly_chivalrous = 1237
str_comment_you_helped_my_ally_unfriendly = 1238
str_comment_you_helped_my_ally_liege = 1239
str_comment_you_helped_my_ally_unfriendly_spiteful = 1240
str_comment_you_helped_my_ally_spiteful = 1241
str_comment_you_helped_my_ally_chivalrous = 1242
str_comment_you_helped_my_ally_default = 1243
str_comment_you_were_defeated_allied_unfriendly = 1244
str_comment_you_were_defeated_allied = 1245
str_comment_you_abandoned_us_unfriendly_spiteful = 1246
str_comment_you_abandoned_us_unfriendly_pitiless = 1247
str_comment_you_abandoned_us_spiteful = 1248
str_comment_you_abandoned_us_chivalrous = 1249
str_comment_you_abandoned_us_benefitofdoubt = 1250
str_comment_you_abandoned_us_default = 1251
str_comment_you_ran_from_me_enemy_spiteful = 1252
str_comment_you_ran_from_me_enemy_chivalrous = 1253
str_comment_you_ran_from_me_enemy_benevolent = 1254
str_comment_you_ran_from_me_enemy_coldblooded = 1255
str_comment_you_ran_from_me_enemy = 1256
str_comment_you_ran_from_foe_allied_chivalrous = 1257
str_comment_you_ran_from_foe_allied_upstanding = 1258
str_comment_you_ran_from_foe_allied_spiteful = 1259
str_comment_you_defeated_my_friend_enemy_pragmatic = 1260
str_comment_you_defeated_my_friend_enemy_chivalrous = 1261
str_comment_you_defeated_my_friend_enemy_spiteful = 1262
str_comment_you_defeated_my_friend_enemy = 1263
str_comment_you_captured_a_lord_allied_friendly_spiteful = 1264
str_comment_you_captured_a_lord_allied_unfriendly_spiteful = 1265
str_comment_you_captured_a_lord_allied_chivalrous = 1266
str_comment_you_captured_a_lord_allied = 1267
str_comment_you_let_go_a_lord_allied_chivalrous = 1268
str_comment_you_let_go_a_lord_allied_upstanding = 1269
str_comment_you_let_go_a_lord_allied_coldblooded = 1270
str_comment_you_let_go_a_lord_allied_unfriendly_spiteful = 1271
str_comment_you_let_go_a_lord_allied = 1272
str_comment_you_let_me_go_spiteful = 1273
str_comment_you_let_me_go_enemy_chivalrous = 1274
str_comment_you_let_me_go_enemy_coldblooded = 1275
str_comment_you_let_me_go_enemy = 1276
str_comment_you_let_me_go_default = 1277
str_comment_pledged_allegiance_allied_martial_unfriendly = 1278
str_comment_pledged_allegiance_allied_martial = 1279
str_comment_pledged_allegiance_allied_quarrelsome_unfriendly = 1280
str_comment_pledged_allegiance_allied_quarrelsome = 1281
str_comment_pledged_allegiance_allied_selfrighteous_unfriendly = 1282
str_comment_pledged_allegiance_allied_selfrighteous = 1283
str_comment_pledged_allegiance_allied_cunning_unfriendly = 1284
str_comment_pledged_allegiance_allied_cunning = 1285
str_comment_pledged_allegiance_allied_debauched_unfriendly = 1286
str_comment_pledged_allegiance_allied_debauched = 1287
str_comment_pledged_allegiance_allied_goodnatured_unfriendly = 1288
str_comment_pledged_allegiance_allied_goodnatured = 1289
str_comment_pledged_allegiance_allied_upstanding_unfriendly = 1290
str_comment_pledged_allegiance_allied_upstanding = 1291
str_comment_our_king_granted_you_a_fief_allied_friendly_cruel = 1292
str_comment_our_king_granted_you_a_fief_allied_friendly_cynical = 1293
str_comment_our_king_granted_you_a_fief_allied_friendly = 1294
str_comment_our_king_granted_you_a_fief_allied_unfriendly_upstanding = 1295
str_comment_our_king_granted_you_a_fief_allied_unfriendly_spiteful = 1296
str_comment_our_king_granted_you_a_fief_allied_spiteful = 1297
str_comment_our_king_granted_you_a_fief_allied = 1298
str_comment_you_renounced_your_alliegance_enemy_friendly = 1299
str_comment_you_renounced_your_alliegance_friendly = 1300
str_comment_you_renounced_your_alliegance_unfriendly_spiteful = 1301
str_comment_you_renounced_your_alliegance_unfriendly_moralizing = 1302
str_comment_you_renounced_your_alliegance_enemy = 1303
str_comment_you_renounced_your_alliegance_default = 1304
str_comment_you_claimed_the_throne_1_player_liege = 1305
str_comment_you_claimed_the_throne_2_player_liege = 1306
str_comment_lord_intervened_against_me = 1307
str_comment_i_protested_marshall_appointment = 1308
str_comment_i_blamed_defeat = 1309
str_comment_i_was_entitled_to_fief = 1310
str_comment_i_quarreled_with_troop_over_woman = 1311
str_comment_i_quarreled_with_you_over_woman_default = 1312
str_comment_i_quarreled_with_you_over_woman_derisive = 1313
str_comment_player_suggestion_succeeded = 1314
str_comment_player_suggestion_failed = 1315
str_comment_you_enfiefed_a_commoner_hesitant = 1316
str_comment_you_enfiefed_a_commoner_derisive = 1317
str_comment_you_enfiefed_a_commoner_nasty = 1318
str_comment_marriage_normal_family = 1319
str_comment_marriage_normal = 1320
str_comment_marriage_normal_nasty = 1321
str_comment_marriage_elopement_family = 1322
str_comment_marriage_elopement_liege = 1323
str_comment_you_broke_truce_as_my_vassal = 1324
str_comment_you_attacked_neutral_as_my_vassal = 1325
str_personality_archetypes = 1326
str_martial = 1327
str_quarrelsome = 1328
str_selfrighteous = 1329
str_cunning = 1330
str_debauched = 1331
str_goodnatured = 1332
str_upstanding = 1333
str_roguish = 1334
str_benevolent = 1335
str_mercantile = 1336
str_surrender_demand_default = 1337
str_surrender_demand_martial = 1338
str_surrender_demand_quarrelsome = 1339
str_surrender_demand_pitiless = 1340
str_surrender_demand_cunning = 1341
str_surrender_demand_sadistic = 1342
str_surrender_demand_goodnatured = 1343
str_surrender_demand_upstanding = 1344
str_surrender_offer_default = 1345
str_surrender_offer_martial = 1346
str_surrender_offer_quarrelsome = 1347
str_surrender_offer_pitiless = 1348
str_surrender_offer_cunning = 1349
str_surrender_offer_sadistic = 1350
str_surrender_offer_goodnatured = 1351
str_surrender_offer_upstanding = 1352
str_lord_declines_negotiation_offer_default = 1353
str_lord_declines_negotiation_offer_martial = 1354
str_lord_declines_negotiation_offer_quarrelsome = 1355
str_lord_declines_negotiation_offer_pitiless = 1356
str_lord_declines_negotiation_offer_cunning = 1357
str_lord_declines_negotiation_offer_sadistic = 1358
str_lord_declines_negotiation_offer_goodnatured = 1359
str_lord_declines_negotiation_offer_upstanding = 1360
str_prisoner_released_default = 1361
str_prisoner_released_martial = 1362
str_prisoner_released_quarrelsome = 1363
str_prisoner_released_pitiless = 1364
str_prisoner_released_cunning = 1365
str_prisoner_released_sadistic = 1366
str_prisoner_released_goodnatured = 1367
str_prisoner_released_upstanding = 1368
str_enemy_meet_default = 1369
str_enemy_meet_martial = 1370
str_enemy_meet_quarrelsome = 1371
str_enemy_meet_pitiless = 1372
str_enemy_meet_cunning = 1373
str_enemy_meet_sadistic = 1374
str_enemy_meet_goodnatured = 1375
str_enemy_meet_upstanding = 1376
str_battle_won_default = 1377
str_battle_won_martial = 1378
str_battle_won_quarrelsome = 1379
str_battle_won_pitiless = 1380
str_battle_won_cunning = 1381
str_battle_won_sadistic = 1382
str_battle_won_goodnatured = 1383
str_battle_won_upstanding = 1384
str_battle_won_grudging_default = 1385
str_battle_won_grudging_martial = 1386
str_battle_won_grudging_quarrelsome = 1387
str_battle_won_grudging_pitiless = 1388
str_battle_won_grudging_cunning = 1389
str_battle_won_grudging_sadistic = 1390
str_battle_won_grudging_goodnatured = 1391
str_battle_won_grudging_upstanding = 1392
str_battle_won_unfriendly_default = 1393
str_battle_won_unfriendly_martial = 1394
str_battle_won_unfriendly_quarrelsome = 1395
str_battle_won_unfriendly_pitiless = 1396
str_battle_won_unfriendly_cunning = 1397
str_battle_won_unfriendly_sadistic = 1398
str_battle_won_unfriendly_goodnatured = 1399
str_battle_won_unfriendly_upstanding = 1400
str_troop_train_request_default = 1401
str_troop_train_request_martial = 1402
str_troop_train_request_quarrelsome = 1403
str_troop_train_request_pitiless = 1404
str_troop_train_request_cunning = 1405
str_troop_train_request_sadistic = 1406
str_troop_train_request_goodnatured = 1407
str_troop_train_request_upstanding = 1408
str_unprovoked_attack_default = 1409
str_unprovoked_attack_martial = 1410
str_unprovoked_attack_quarrelsome = 1411
str_unprovoked_attack_pitiless = 1412
str_unprovoked_attack_cunning = 1413
str_unprovoked_attack_sadistic = 1414
str_unprovoked_attack_goodnatured = 1415
str_unprovoked_attack_upstanding = 1416
str_unnecessary_attack_default = 1417
str_unnecessary_attack_martial = 1418
str_unnecessary_attack_quarrelsome = 1419
str_unnecessary_attack_pitiless = 1420
str_unnecessary_attack_cunning = 1421
str_unnecessary_attack_sadistic = 1422
str_unnecessary_attack_goodnatured = 1423
str_unnecessary_attack_upstanding = 1424
str_lord_challenged_default = 1425
str_lord_challenged_martial = 1426
str_lord_challenged_quarrelsome = 1427
str_lord_challenged_pitiless = 1428
str_lord_challenged_cunning = 1429
str_lord_challenged_sadistic = 1430
str_lord_challenged_goodnatured = 1431
str_lord_challenged_upstanding = 1432
str_lord_mission_failed_default = 1433
str_lord_mission_failed_martial = 1434
str_lord_mission_failed_quarrelsome = 1435
str_lord_mission_failed_pitiless = 1436
str_lord_mission_failed_cunning = 1437
str_lord_mission_failed_sadistic = 1438
str_lord_mission_failed_goodnatured = 1439
str_lord_mission_failed_upstanding = 1440
str_lord_follow_refusal_default = 1441
str_lord_follow_refusal_martial = 1442
str_lord_follow_refusal_quarrelsome = 1443
str_lord_follow_refusal_pitiless = 1444
str_lord_follow_refusal_cunning = 1445
str_lord_follow_refusal_sadistic = 1446
str_lord_follow_refusal_goodnatured = 1447
str_lord_follow_refusal_upstanding = 1448
str_lord_insult_default = 1449
str_lord_insult_martial = 1450
str_lord_insult_quarrelsome = 1451
str_lord_insult_pitiless = 1452
str_lord_insult_cunning = 1453
str_lord_insult_sadistic = 1454
str_lord_insult_goodnatured = 1455
str_lord_insult_upstanding = 1456
str_lord_derogatory_default = 1457
str_lord_derogatory_martial = 1458
str_lord_derogatory_quarrelsome = 1459
str_lord_derogatory_pitiless = 1460
str_lord_derogatory_cunning = 1461
str_lord_derogatory_sadistic = 1462
str_lord_derogatory_goodnatured = 1463
str_lord_derogatory_upstanding = 1464
str_lord_derogatory_result = 1465
str_lord_derogatory_martial_action = 1466
str_lord_derogatory_quarrelsome_action = 1467
str_lord_derogatory_pitiles_action = 1468
str_lord_derogatory_cunning_action = 1469
str_lord_derogatory_sadistic_action = 1470
str_lord_derogatory_goodnatured_action = 1471
str_lord_derogatory_upstanding_action = 1472
str_rebellion_dilemma_default = 1473
str_rebellion_dilemma_martial = 1474
str_rebellion_dilemma_quarrelsome = 1475
str_rebellion_dilemma_pitiless = 1476
str_rebellion_dilemma_cunning = 1477
str_rebellion_dilemma_sadistic = 1478
str_rebellion_dilemma_goodnatured = 1479
str_rebellion_dilemma_upstanding = 1480
str_rebellion_dilemma_2_default = 1481
str_rebellion_dilemma_2_martial = 1482
str_rebellion_dilemma_2_quarrelsome = 1483
str_rebellion_dilemma_2_pitiless = 1484
str_rebellion_dilemma_2_cunning = 1485
str_rebellion_dilemma_2_sadistic = 1486
str_rebellion_dilemma_2_goodnatured = 1487
str_rebellion_dilemma_2_upstanding = 1488
str_political_philosophy_default = 1489
str_political_philosophy_martial = 1490
str_political_philosophy_quarrelsome = 1491
str_political_philosophy_pitiless = 1492
str_political_philosophy_cunning = 1493
str_political_philosophy_sadistic = 1494
str_political_philosophy_goodnatured = 1495
str_political_philosophy_upstanding = 1496
str_political_philosophy_roguish = 1497
str_political_philosophy_benefactor = 1498
str_political_philosophy_custodian = 1499
str_rebellion_prior_argument_very_favorable = 1500
str_rebellion_prior_argument_favorable = 1501
str_rebellion_prior_argument_unfavorable = 1502
str_rebellion_prior_argument_very_unfavorable = 1503
str_rebellion_rival_default = 1504
str_rebellion_rival_martial = 1505
str_rebellion_rival_quarrelsome = 1506
str_rebellion_rival_pitiless = 1507
str_rebellion_rival_cunning = 1508
str_rebellion_rival_sadistic = 1509
str_rebellion_rival_goodnatured = 1510
str_rebellion_rival_upstanding = 1511
str_rebellion_argument_favorable = 1512
str_rebellion_argument_neutral = 1513
str_rebellion_argument_unfavorable = 1514
str_rebellion_persuasion_favorable = 1515
str_rebellion_persuasion_neutral = 1516
str_rebellion_persuasion_unfavorable = 1517
str_rebellion_relation_very_favorable = 1518
str_rebellion_relation_favorable = 1519
str_rebellion_relation_neutral = 1520
str_rebellion_relation_unfavorable = 1521
str_and_comma_3 = 1522
str_but_comma_3 = 1523
str_and_comma_1 = 1524
str_but_comma_1 = 1525
str_and_comma_2 = 1526
str_but_comma_2 = 1527
str_rebellion_agree_default = 1528
str_rebellion_agree_martial = 1529
str_rebellion_agree_quarrelsome = 1530
str_rebellion_agree_pitiless = 1531
str_rebellion_agree_cunning = 1532
str_rebellion_agree_sadistic = 1533
str_rebellion_agree_goodnatured = 1534
str_rebellion_agree_upstanding = 1535
str_rebellion_refuse_default = 1536
str_rebellion_refuse_martial = 1537
str_rebellion_refuse_quarrelsome = 1538
str_rebellion_agree_pitiless = 1539
str_rebellion_agree_cunning = 1540
str_rebellion_agree_sadistic = 1541
str_rebellion_agree_goodnatured = 1542
str_rebellion_agree_upstanding = 1543
str_talk_later_default = 1544
str_talk_later_martial = 1545
str_talk_later_quarrelsome = 1546
str_talk_later_pitiless = 1547
str_talk_later_cunning = 1548
str_talk_later_sadistic = 1549
str_talk_later_goodnatured = 1550
str_talk_later_upstanding = 1551
str_npc_claim_throne_liege = 1552
str_npc_claim_throne_liege_martial = 1553
str_npc_claim_throne_liege_quarrelsome = 1554
str_npc_claim_throne_liege_pitiless = 1555
str_npc_claim_throne_liege_cunning = 1556
str_npc_claim_throne_liege_sadistic = 1557
str_npc_claim_throne_liege_goodnatured = 1558
str_npc_claim_throne_liege_upstanding = 1559
str_gossip_about_character_default = 1560
str_gossip_about_character_martial = 1561
str_gossip_about_character_quarrelsome = 1562
str_gossip_about_character_selfrighteous = 1563
str_gossip_about_character_cunning = 1564
str_gossip_about_character_sadistic = 1565
str_gossip_about_character_goodnatured = 1566
str_gossip_about_character_upstanding = 1567
str_latest_rumor = 1568
str_changed_my_mind_default = 1569
str_changed_my_mind_martial = 1570
str_changed_my_mind_quarrelsome = 1571
str_changed_my_mind_pitiless = 1572
str_changed_my_mind_cunning = 1573
str_changed_my_mind_sadistic = 1574
str_changed_my_mind_goodnatured = 1575
str_changed_my_mind_upstanding = 1576
str_swadian_rebellion_pretender_intro = 1577
str_vaegir_rebellion_pretender_intro = 1578
str_khergit_rebellion_pretender_intro = 1579
str_nord_rebellion_pretender_intro = 1580
str_rhodok_rebellion_pretender_intro = 1581
str_sarranid_rebellion_pretender_intro = 1582
str_swadian_rebellion_pretender_story_1 = 1583
str_vaegir_rebellion_pretender_story_1 = 1584
str_khergit_rebellion_pretender_story_1 = 1585
str_nord_rebellion_pretender_story_1 = 1586
str_rhodok_rebellion_pretender_story_1 = 1587
str_sarranid_rebellion_pretender_story_1 = 1588
str_swadian_rebellion_pretender_story_2 = 1589
str_vaegir_rebellion_pretender_story_2 = 1590
str_khergit_rebellion_pretender_story_2 = 1591
str_nord_rebellion_pretender_story_2 = 1592
str_rhodok_rebellion_pretender_story_2 = 1593
str_sarranid_rebellion_pretender_story_2 = 1594
str_swadian_rebellion_pretender_story_3 = 1595
str_vaegir_rebellion_pretender_story_3 = 1596
str_khergit_rebellion_pretender_story_3 = 1597
str_nord_rebellion_pretender_story_3 = 1598
str_rhodok_rebellion_pretender_story_3 = 1599
str_sarranid_rebellion_pretender_story_3 = 1600
str_swadian_rebellion_monarch_response_1 = 1601
str_vaegir_rebellion_monarch_response_1 = 1602
str_khergit_rebellion_monarch_response_1 = 1603
str_nord_rebellion_monarch_response_1 = 1604
str_rhodok_rebellion_monarch_response_1 = 1605
str_sarranid_rebellion_monarch_response_1 = 1606
str_swadian_rebellion_monarch_response_2 = 1607
str_vaegir_rebellion_monarch_response_2 = 1608
str_khergit_rebellion_monarch_response_2 = 1609
str_nord_rebellion_monarch_response_2 = 1610
str_rhodok_rebellion_monarch_response_2 = 1611
str_sarranid_rebellion_monarch_response_2 = 1612
str_courtship_comment_conventional_generic = 1613
str_courtship_comment_adventurous_generic = 1614
str_courtship_comment_otherworldly_generic = 1615
str_courtship_comment_ambitious_generic = 1616
str_courtship_comment_moralist_generic = 1617
str_feast_description = 1618
str_feast_description_2 = 1619
str_feast_description_3 = 1620
str_feast_description_4 = 1621
str_feast_description_5 = 1622
str_feast_description_6 = 1623
str_feast_lengthy_description_1 = 1624
str_feast_lengthy_description_2 = 1625
str_feast_lengthy_description_3 = 1626
str_feast_lengthy_description_4 = 1627
str_feast_lengthy_description_5 = 1628
str_feast_lengthy_description_6 = 1629
str_kingdom_1_adjective = 1630
str_kingdom_2_adjective = 1631
str_kingdom_3_adjective = 1632
str_kingdom_4_adjective = 1633
str_kingdom_5_adjective = 1634
str_kingdom_6_adjective = 1635
str_credits_1 = 1636
str_credits_2 = 1637
str_credits_3 = 1638
str_credits_4 = 1639
str_credits_5 = 1640
str_credits_6 = 1641
str_credits_7 = 1642
str_credits_8 = 1643
str_credits_9 = 1644
str_credits_10 = 1645
str_credits_11 = 1646
str_credits_12 = 1647
str_multi_scene_1 = 1648
str_multi_scene_2 = 1649
str_multi_scene_3 = 1650
str_multi_scene_4 = 1651
str_multi_scene_5 = 1652
str_multi_scene_6 = 1653
str_multi_scene_7 = 1654
str_multi_scene_8 = 1655
str_multi_scene_9 = 1656
str_multi_scene_10 = 1657
str_multi_scene_11 = 1658
str_multi_scene_16 = 1659
str_multi_scene_17 = 1660
str_multi_scene_18 = 1661
str_multi_scene_19 = 1662
str_multi_scene_20 = 1663
str_multi_scene_21 = 1664
str_multi_scene_22 = 1665
str_multi_scene_12 = 1666
str_multi_scene_13 = 1667
str_multi_scene_14 = 1668
str_multi_scene_15 = 1669
str_multi_scene_end = 1670
str_multi_game_type_1 = 1671
str_multi_game_type_2 = 1672
str_multi_game_type_3 = 1673
str_multi_game_type_4 = 1674
str_multi_game_type_5 = 1675
str_multi_game_type_6 = 1676
str_multi_game_type_7 = 1677
str_multi_game_type_8 = 1678
str_multi_game_types_end = 1679
str_poll_kick_player_s1_by_s0 = 1680
str_poll_ban_player_s1_by_s0 = 1681
str_poll_change_map_to_s1_by_s0 = 1682
str_poll_change_map_to_s1_and_factions_to_s2_and_s3_by_s0 = 1683
str_poll_change_number_of_bots_to_reg0_and_reg1_by_s0 = 1684
str_poll_kick_player = 1685
str_poll_ban_player = 1686
str_poll_change_map = 1687
str_poll_change_map_with_faction = 1688
str_poll_change_number_of_bots = 1689
str_poll_time_left = 1690
str_poll_result_yes = 1691
str_poll_result_no = 1692
str_total_item_cost_reg0 = 1693
str_server_name = 1694
str_game_password = 1695
str_map = 1696
str_game_type = 1697
str_max_number_of_players = 1698
str_number_of_bots_in_team_reg1 = 1699
str_team_reg1_faction = 1700
str_enable_valve_anti_cheat = 1701
str_allow_friendly_fire = 1702
str_allow_melee_friendly_fire = 1703
str_friendly_fire_damage_self_ratio = 1704
str_friendly_fire_damage_friend_ratio = 1705
str_spectator_camera = 1706
str_control_block_direction = 1707
str_map_time_limit = 1708
str_round_time_limit = 1709
str_players_take_control_of_a_bot_after_death = 1710
str_team_points_limit = 1711
str_point_gained_from_flags = 1712
str_point_gained_from_capturing_flag = 1713
str_respawn_period = 1714
str_add_to_official_game_servers_list = 1715
str_combat_speed = 1716
str_combat_speed_0 = 1717
str_combat_speed_1 = 1718
str_combat_speed_2 = 1719
str_combat_speed_3 = 1720
str_combat_speed_4 = 1721
str_off = 1722
str_on = 1723
str_defender_spawn_count_limit = 1724
str_unlimited = 1725
str_automatic = 1726
str_by_mouse_movement = 1727
str_free = 1728
str_stick_to_any_player = 1729
str_stick_to_team_members = 1730
str_stick_to_team_members_view = 1731
str_make_factions_voteable = 1732
str_make_kick_voteable = 1733
str_make_ban_voteable = 1734
str_bots_upper_limit_for_votes = 1735
str_make_maps_voteable = 1736
str_valid_vote_ratio = 1737
str_auto_team_balance_limit = 1738
str_welcome_message = 1739
str_initial_gold_multiplier = 1740
str_battle_earnings_multiplier = 1741
str_round_earnings_multiplier = 1742
str_allow_player_banners = 1743
str_force_default_armor = 1744
str_reg0 = 1745
str_s0_reg0 = 1746
str_s0_s1 = 1747
str_reg0_dd_reg1reg2 = 1748
str_s0_dd_reg0 = 1749
str_respawning_in_reg0_seconds = 1750
str_no_more_respawns_remained_this_round = 1751
str_reg0_respawns_remained = 1752
str_this_is_your_last_respawn = 1753
str_wait_next_round = 1754
str_yes_wo_dot = 1755
str_no_wo_dot = 1756
str_we_resign = 1757
str_i_resign = 1758
str_s1_returned_flag = 1759
str_s1_auto_returned_flag = 1760
str_s1_captured_flag = 1761
str_s1_taken_flag = 1762
str_s1_neutralized_flag_reg0 = 1763
str_s1_captured_flag_reg0 = 1764
str_s1_pulling_flag_reg0 = 1765
str_s1_destroyed_target_0 = 1766
str_s1_destroyed_target_1 = 1767
str_s1_destroyed_catapult = 1768
str_s1_destroyed_trebuchet = 1769
str_s1_destroyed_all_targets = 1770
str_s1_saved_1_target = 1771
str_s1_saved_2_targets = 1772
str_s1_defended_castle = 1773
str_s1_captured_castle = 1774
str_auto_team_balance_in_20_seconds = 1775
str_auto_team_balance_next_round = 1776
str_auto_team_balance_done = 1777
str_s1_won_round = 1778
str_round_draw = 1779
str_round_draw_no_one_remained = 1780
str_death_mode_started = 1781
str_reset_to_default = 1782
str_done = 1783
str_player_name = 1784
str_kills = 1785
str_deaths = 1786
str_ping = 1787
str_dead = 1788
str_reg0_dead = 1789
str_bots_reg0_agents = 1790
str_bot_1_agent = 1791
str_score = 1792
str_score_reg0 = 1793
str_flags_reg0 = 1794
str_reg0_players = 1795
str_reg0_player = 1796
str_open_gate = 1797
str_close_gate = 1798
str_open_door = 1799
str_close_door = 1800
str_raise_ladder = 1801
str_drop_ladder = 1802
str_back = 1803
str_start_map = 1804
str_choose_an_option = 1805
str_choose_a_poll_type = 1806
str_choose_faction = 1807
str_choose_a_faction = 1808
str_choose_troop = 1809
str_choose_a_troop = 1810
str_choose_items = 1811
str_options = 1812
str_redefine_keys = 1813
str_submit_a_poll = 1814
str_administrator_panel = 1815
str_kick_player = 1816
str_ban_player = 1817
str_mute_player = 1818
str_unmute_player = 1819
str_quit = 1820
str_poll_for_changing_the_map = 1821
str_poll_for_changing_the_map_and_factions = 1822
str_poll_for_changing_number_of_bots = 1823
str_poll_for_kicking_a_player = 1824
str_poll_for_banning_a_player = 1825
str_choose_a_player = 1826
str_choose_a_map = 1827
str_choose_a_faction_for_team_reg0 = 1828
str_choose_number_of_bots_for_team_reg0 = 1829
str_spectator = 1830
str_spectators = 1831
str_score = 1832
str_command = 1833
str_profile_banner_selection_text = 1834
str_use_default_banner = 1835
str_party_morale_is_low = 1836
str_weekly_report = 1837
str_has_deserted_the_party = 1838
str_have_deserted_the_party = 1839
str_space = 1840
str_us_ = 1841
str_allies_ = 1842
str_enemies_ = 1843
str_routed = 1844
str_weekly_budget = 1845
str_income_from_s0 = 1846
str_mercenary_payment_from_s0 = 1847
str_s0s_party = 1848
str_loss_due_to_tax_inefficiency = 1849
str_wages_for_s0 = 1850
str_earlier_debts = 1851
str_net_change = 1852
str_earlier_wealth = 1853
str_new_wealth = 1854
str_new_debts = 1855
str_completed_faction_troop_assignments_cheat_mode_reg3 = 1856
str_completed_political_events_cheat_mode_reg3 = 1857
str_assigned_love_interests_attraction_seed_reg3 = 1858
str_located_kingdom_ladies_cheat_mode_reg3 = 1859
str_team_reg0_bot_count_is_reg1 = 1860
str_input_is_not_correct_for_the_command_type_help_for_more_information = 1861
str_maximum_seconds_for_round_is_reg0 = 1862
str_respawn_period_is_reg0_seconds = 1863
str_bots_upper_limit_for_votes_is_reg0 = 1864
str_map_is_voteable = 1865
str_map_is_not_voteable = 1866
str_factions_are_voteable = 1867
str_factions_are_not_voteable = 1868
str_players_respawn_as_bot = 1869
str_players_do_not_respawn_as_bot = 1870
str_kicking_a_player_is_voteable = 1871
str_kicking_a_player_is_not_voteable = 1872
str_banning_a_player_is_voteable = 1873
str_banning_a_player_is_not_voteable = 1874
str_player_banners_are_allowed = 1875
str_player_banners_are_not_allowed = 1876
str_default_armor_is_forced = 1877
str_default_armor_is_not_forced = 1878
str_percentage_of_yes_votes_required_for_a_poll_to_get_accepted_is_reg0 = 1879
str_auto_team_balance_threshold_is_reg0 = 1880
str_starting_gold_ratio_is_reg0 = 1881
str_combat_gold_bonus_ratio_is_reg0 = 1882
str_round_gold_bonus_ratio_is_reg0 = 1883
str_point_gained_from_flags_is_reg0 = 1884
str_point_gained_from_capturing_flag_is_reg0 = 1885
str_map_time_limit_is_reg0 = 1886
str_team_points_limit_is_reg0 = 1887
str_defender_spawn_count_limit_is_s1 = 1888
str_system_error = 1889
str_prisoner_granted_parole = 1890
str_prisoner_not_offered_parole = 1891
str__age_reg1_family_ = 1892
str_s49_s12_s11_rel_reg0 = 1893
str_s49_s12_s11 = 1894
str_lord_info_string = 1895
str_updating_faction_notes_for_s14_temp_=_reg4 = 1896
str_foreign_relations__ = 1897
str_s21__the_s5_is_at_war_with_the_s14 = 1898
str_s21_the_s5_has_had_the_upper_hand_in_the_fighting = 1899
str_s21_the_s5_has_gotten_the_worst_of_the_fighting = 1900
str_s21_the_fighting_has_gone_on_for_some_time_and_the_war_may_end_soon_with_a_truce = 1901
str_s21_the_fighting_has_begun_relatively_recently_and_the_war_may_continue_for_some_time = 1902
str_s21_reg4reg5 = 1903
str__however_the_truce_is_no_longer_binding_on_the_s14 = 1904
str_s21__the_s5_is_bound_by_truce_not_to_attack_the_s14s18_the_truce_will_expire_in_reg1_days = 1905
str_s21__the_s5_has_recently_suffered_provocation_by_subjects_of_the_s14_and_there_is_a_risk_of_war = 1906
str_s21__the_s5_has_no_outstanding_issues_with_the_s14 = 1907
str_s21_the_s14_was_recently_provoked_by_subjects_of_the_s5_and_there_is_a_risk_of_war_ = 1908
str_s21_cheat_mode_assessment_s14_ = 1909
str_the_s5_is_ruled_by_s6_it_occupies_s8_its_vassals_are_s10__s21 = 1910
str_assigned_lord_reputation_and_relations_cheat_mode_reg3 = 1911
str_caravan_trades_in_s5_originally_from_s4_ = 1912
str_your_hero_prisoned_at_s1 = 1913
str_old_morale_is_reg0_new_morale_is_reg1 = 1914
str_our_per_person__reg0_num_people__reg1_total_gain__reg2 = 1915
str_ene_per_person__reg0_num_people__reg1_total_gain__reg2 = 1916
str_all_per_person__reg0_num_people__reg1_total_gain__reg2 = 1917
str_loss_ratio_is_reg1 = 1918
str_total_enemy_morale_gain__reg6_last_total_enemy_morale_gain__reg7_remaining_enemy_population__reg5 = 1919
str_reg4_killed_reg5_wounded_reg6_routed = 1920
str_reg4_killed_reg5_routed = 1921
str_reg4_killed_reg5_wounded = 1922
str_reg4_wounded_reg5_routed = 1923
str_routed = 1924
str_caravan_in_s10_considers_s11_total_price_dif_=_reg3 = 1925
str_test__caravan_in_s3_selects_for_s4_trade_score_reg3 = 1926
str_prisoner_relative_is_reg0 = 1927
str_test_diagnosis__traveller_attacks_for_s4 = 1928
str_traveller_attack_found = 1929
str_s42 = 1930
str_test_diagnostic_quest_found_for_s4 = 1931
str_s4_changing_sides_aborts_quest = 1932
str_s4_awarded_to_s5 = 1933
str_s11_reacts_to_granting_of_s12_to_s10 = 1934
str_debug__hiring_men_to_s7_ideal_size__reg6_ideal_top_size__reg7_hiring_budget__reg8 = 1935
str_debug__hiring_men_to_party_for_s0 = 1936
str_calculating_sortie_for_s4_strength_of_reg3_vs_reg4_enemies = 1937
str_s4_sorties = 1938
str_current_wealth_reg1_taxes_last_collected_from_s4 = 1939
str_s4_considers_going_to_s5_to_pay_court_to_s6 = 1940
str_relation_with_1_bug_found_here__probably_because_s5_has_just_been_captured = 1941
str_s4_has_reg4_chance_of_going_to_home_center = 1942
str_s4_has_reg4_chance_of_recruiting_troops = 1943
str_s4_has_reg4_chance_of_going_to_s5 = 1944
str_s4_has_reg5_chance_of_patrolling_s6 = 1945
str_s4_has_reg5_chance_of_raiding_s6 = 1946
str_s4_has_reg5_chance_of_besieging_s6 = 1947
str_sum_chances_reg6 = 1948
str_deciding_faction_ai_for_s3 = 1949
str_s5_decides_s14 = 1950
str_lords_of_the_s1_gather_for_a_feast_at_s2 = 1951
str_s5_begins_offensive = 1952
str_renown_change_of_reg4_reduced_to_reg5_because_of_high_existing_renown = 1953
str_s14 = 1954
str_players_kingdom_has_had_reg3_days_of_peace = 1955
str_s4_is_present_at_the_center_and_in_place_of_honor = 1956
str_s4_is_present_at_the_center_as_a_refugee = 1957
str_s4_is_present_at_the_center_and_not_attending_the_feast = 1958
str_s4_is_present_at_the_center_and_is_married = 1959
str_s4_is_present_at_the_center_and_is_attending_the_feast = 1960
str_s4_is_present_at_the_center_and_is_awaiting_the_player_in_private = 1961
str_s4_is_present_at_the_center_and_is_allowed_to_meet_the_player = 1962
str_s4_is_present_at_the_center_and_is_not_allowed_to_meet_the_player = 1963
str_no_relation = 1964
str_wife = 1965
str_husband = 1966
str_father = 1967
str_mother = 1968
str_daughter = 1969
str_son = 1970
str_sister = 1971
str_brother = 1972
str_niece = 1973
str_nephew = 1974
str_aunt = 1975
str_uncle = 1976
str_cousin = 1977
str_daughterinlaw = 1978
str_soninlaw = 1979
str_motherinlaw = 1980
str_fatherinlaw = 1981
str_sisterinlaw = 1982
str_brotherinlaw = 1983
str_print_party_members_entered = 1984
str_num_companion_stacks_=_reg10 = 1985
str_someone = 1986
str_i_take_what_work_i_can_sirmadame_i_carry_water_or_help_the_merchants_with_their_loads_or_help_build_things_if_theres_things_to_be_built = 1987
str_dna_reg4_total_production_reg5_modula_reg7 = 1988
str_agent_produces_s9 = 1989
str_im_not_doing_anything_sirmadame_theres_no_work_to_be_had_around_here_these_days = 1990
str_im_not_doing_anything_sirmadame_i_have_no_land_of_my_own_and_theres_no_work_to_be_had_around_here_these_days = 1991
str_why_im_still_living_off_of_your_kindness_and_goodness_sirmadame_hopefully_there_will_be_work_shortly = 1992
str_i_work_in_the_fields_just_outside_the_walls_where_they_grow_grain_we_dont_quite_grow_enough_to_meet_our_needs_though_and_have_to_import_grain_from_the_surrounding_countryside = 1993
str_i_work_mostly_in_the_fields_growing_grain_in_the_town_they_grind_it_to_make_bread_or_ale_and_we_can_also_boil_it_as_a_porridge = 1994
str_i_work_in_the_breweries_making_ale_the_poor_folk_drink_a_lot_of_it_as_its_cheaper_than_wine_we_make_it_with_grain_brought_in_from_the_countryside = 1995
str_i_work_in_a_mill_grinding_flour_to_make_bread_bread_is_cheap_keeps_well_and_fills_the_stomach = 1996
str_i_tend_cattle_we_dry_and_salt_meat_to_preserve_it_and_make_cheese_from_the_milk = 1997
str_i_tend_cattle_we_dry_and_salt_meat_to_preserve_it_and_make_cheese_from_the_milk_so_it_doesnt_spoil = 1998
str_i_tend_sheep_we_send_the_wool_to_the_cities_to_be_woven_into_cloth_and_make_mutton_sausage_when_we_cull_the_herds = 1999
str_i_work_at_a_loom_spinning_cloth_from_wool_wool_is_some_of_the_cheapest_cloth_you_can_buy_but_it_will_still_keep_you_warm = 2000
str_i_crew_a_fishing_boat_we_salt_and_smoke_the_flesh_to_sell_it_far_inland = 2001
str_i_sift_salt_from_a_nearby_flat_they_need_salt_everywhere_to_preserve_meat_and_fish = 2002
str_i_mine_iron_from_a_vein_in_a_nearby_cliffside_they_use_it_to_make_tools_arms_and_other_goods = 2003
str_i_make_pottery_which_people_use_to_store_grain_and_carry_water = 2004
str_trade_explanation_tools = 2005
str_trade_explanation_oil = 2006
str_trade_explanation_linen = 2007
str_trade_explanation_velvet = 2008
str_trade_explanation_spice = 2009
str_trade_explanation_apples = 2010
str_trade_explanation_grapes = 2011
str_trade_explanation_dyes = 2012
str_trade_explanation_leatherwork = 2013
str_trade_explanation_flax = 2014
str_trade_explanation_dates = 2015
str_trade_explanation_dates = 2016
str_trade_explanation_olives = 2017
str_s10_has_reg4_needs_reg5 = 2018
str_s14_i_hear_that_you_can_find_a_good_price_for_it_in_s15 = 2019
str_s1_reg1 = 2020
str_s1_reg2 = 2021
str_s1_reg3 = 2022
str_s1_reg4 = 2023
str_s1_reg5 = 2024
str_s1_reg6 = 2025
str_s1_reg7 = 2026
str_s1_reg8 = 2027
str_s1_reg9 = 2028
str_reg13 = 2029
str_reg14 = 2030
str_reg15 = 2031
str_reg16 = 2032
str_reg17 = 2033
str_reg18 = 2034
str_reg19 = 2035
str_reg20 = 2036
str_reg21 = 2037
str_assigning_lords_to_empty_centers = 2038
str_assign_lords_to_empty_centers_just_happened = 2039
str_s4_of_the_s5_is_unassigned = 2040
str_s4_of_the_s5_is_reserved_for_player = 2041
str_s4_of_the_s5_has_no_fiefs = 2042
str_s4_unassigned_centers_plus_landless_lords_=_reg4 = 2043
str_s4_holds_s5_in_reserve = 2044
str_s2s_rebellion = 2045
str_political_suggestion = 2046
str_updating_volunteers_for_s4_faction_is_s5 = 2047
str_shuffling_companion_locations = 2048
str_s4_is_at_s5 = 2049
str_instability_reg0_of_lords_are_disgruntled_reg1_are_restless = 2050
str_reg1shehe_is_prisoner_of_s1 = 2051
str_s39_rival = 2052
str_s40 = 2053
str_s41_s39_rival = 2054
str_reputation_cheat_mode_only_martial_ = 2055
str_reputation_cheat_mode_only_debauched_ = 2056
str_reputation_cheat_mode_only_pitiless_ = 2057
str_reputation_cheat_mode_only_calculating_ = 2058
str_reputation_cheat_mode_only_quarrelsome_ = 2059
str_reputation_cheat_mode_only_goodnatured_ = 2060
str_reputation_cheat_mode_only_upstanding_ = 2061
str_reputation_cheat_mode_only_conventional_ = 2062
str_reputation_cheat_mode_only_adventurous_ = 2063
str_reputation_cheat_mode_only_romantic_ = 2064
str_reputation_cheat_mode_only_moralist_ = 2065
str_reputation_cheat_mode_only_ambitious_ = 2066
str_reputation_cheat_mode_only_reg11_ = 2067
str_love_interest = 2068
str_betrothed = 2069
str_s40_s39_s2_reg0 = 2070
str_other_relations_s40_ = 2071
str_relation_with_liege_reg0_ = 2072
str_sense_of_security_military_reg1_court_position_reg3_ = 2073
str_s46s45s44s48 = 2074
str_political_details_s47_ = 2075
str_checking_volunteer_availability_script = 2076
str_center_relation_at_least_zero = 2077
str_relationfaction_conditions_met = 2078
str_troops_available = 2079
str_party_has_capacity = 2080
str_personality_clash_conversation_begins = 2081
str_personality_match_conversation_begins = 2082
str_the_s55 = 2083
str_travellers_on_the_road = 2084
str_attack_on_travellers_found_reg3_hours_ago = 2085
str_trade_event_found_reg3_hours_ago = 2086
str_a_short_while_ago = 2087
str_one_day_ago = 2088
str_two_days_day_ago = 2089
str_earlier_this_week = 2090
str_about_a_week_ago = 2091
str_about_two_weeks_ago = 2092
str_several_weeks_ago = 2093
str_unknown_assailants = 2094
str_swadians = 2095
str_vaegirs = 2096
str_khergits = 2097
str_nords = 2098
str_rhodoks = 2099
str_sarranids = 2100
str_bandits = 2101
str_deserters = 2102
str_your_followers = 2103
str_we_have_heard_that_travellers_heading_to_s40_were_attacked_on_the_road_s46_by_s39 = 2104
str_s43_s44 = 2105
str_we_have_heard_that_travellers_coming_from_s40_were_attacked_on_the_road_s46_by_s39 = 2106
str_travellers_coming_from_s40_traded_here_s46 = 2107
str_s44 = 2108
str_it_is_still_early_in_the_caravan_season_so_we_have_seen_little_tradings42 = 2109
str_there_has_been_very_little_trading_activity_here_recentlys42 = 2110
str_there_has_some_trading_activity_here_recently_but_not_enoughs42 = 2111
str_there_has_some_trading_activity_here_recently_but_the_roads_are_dangerouss42 = 2112
str_the_roads_around_here_are_very_dangerouss42 = 2113
str_we_have_received_many_traders_in_town_here_although_there_is_some_danger_on_the_roadss42 = 2114
str_we_have_received_many_traders_in_town_heres42 = 2115
str_s44_s41 = 2116
str_s41 = 2117
str_there_is_little_news_about_the_caravan_routes_to_the_towns_of_s44_and_nearby_parts_but_no_news_is_good_news_and_those_are_therefore_considered_safe = 2118
str_s47_also_the_roads_to_the_villages_of_s44_and_other_outlying_hamlets_are_considered_safe = 2119
str_however_the_roads_to_the_villages_of_s44_and_other_outlying_hamlets_are_considered_safe = 2120
str_we_have_shortages_of = 2121
str_s33_s34_reg1 = 2122
str_we_have_adequate_stores_of_all_commodities = 2123
str_s33_and_some_other_commodities = 2124
str_the_roads_are_full_of_brigands_friend_but_that_name_in_particular_does_not_sound_familiar_good_hunting_to_you_nonetheless = 2125
str_less_than_an_hour_ago = 2126
str_maybe_reg3_hours_ago = 2127
str_reg3_days_ago = 2128
str_youre_in_luck_we_sighted_those_bastards_s16_near_s17_hurry_and_you_might_be_able_to_pick_up_their_trail_while_its_still_hot = 2129
str_you_speak_of_claims_to_the_throne_good_there_is_nothing_id_rather_do_than_fight_for_a_good_cause = 2130
str_you_speak_of_claims_to_the_throne_well_there_is_nothing_id_rather_do_than_fight_for_a_good_cause_but_the_claim_you_make_seems_somewhat_weak = 2131
str_i_am_pleased_that_you_speak_of_upholding_my_ancient_rights_which_are_sometimes_trod_upon_in_these_sorry_days = 2132
str_i_am_pleased_that_you_speak_of_upholding_my_ancient_rights_but_sometimes_men_make_pledges_before_they_are_king_which_they_cannot_keep_once_they_take_the_throne = 2133
str_you_speak_of_protecting_the_commons_well_i_supposed_thats_good_but_sometimes_the_commons_overstep_their_boundaries_im_more_concerned_that_your_claim_be_legal_so_i_can_swing_my_sword_with_a_good_conscience = 2134
str_you_speak_of_giving_me_land_good_i_ask_for_no_more_than_my_due = 2135
str_you_speak_of_giving_me_land_unfortunately_you_are_not_wellknown_for_rewarding_those_to_whom_you_have_made_such_offers = 2136
str_you_speak_of_unifying_calradia_well_i_believe_that_well_always_be_fighting__its_important_that_we_fight_for_a_rightful_cause = 2137
str_you_talk_of_claims_to_the_throne_but_i_leave_bickering_about_legalities_to_the_lawyers_and_clerks = 2138
str_you_speak_of_ruling_justly_hah_ill_believe_theres_such_a_thing_as_a_just_king_when_i_see_one = 2139
str_you_spoke_of_protecting_the_rights_of_the_nobles_if_you_did_youd_be_the_first_king_to_do_so_in_a_very_long_time = 2140
str_you_speak_of_giving_me_land_ay_well_lets_see_if_you_deliver = 2141
str_you_speak_of_giving_me_land_bah_youre_not_known_for_delivering_on_your_pledges = 2142
str_you_speak_of_unifying_calradia_well_youve_done_a_good_job_at_making_calradia_bend_its_knee_to_you_so_maybe_thats_not_just_talk = 2143
str_you_speak_of_unifying_calradia_id_be_impressed_if_i_thought_you_could_do_it_but_unfortunately_you_dont = 2144
str_you_speak_of_claims_to_the_throne_well_any_peasant_can_claim_to_be_a_kings_bastard = 2145
str_well_its_a_fine_thing_to_court_the_commons_with_promises_but_what_do_you_have_to_offer_me = 2146
str_you_speak_of_protecting_the_rights_of_lords_that_would_make_a_fine_change_if_my_rights_as_lord_would_be_respected = 2147
str_you_speak_of_protecting_the_rights_of_lords_that_would_make_a_fine_change_if_my_rights_as_lord_would_be_respected_however_it_is_easy_for_you_to_make_promises_while_you_are_weak_that_you_have_no_intention_of_keeping_when_you_are_strong = 2148
str_you_speak_of_giving_me_land_well_my_family_is_of_ancient_and_noble_lineage_so_you_promise_me_no_more_than_my_due_still_your_gesture_is_appreciated = 2149
str_you_speak_of_giving_me_land_well_you_make_that_pledge_but_i_am_not_impressed = 2150
str_you_speak_of_unifying_calradia_well_much_of_this_land_now_bends_its_knee_to_you_so_perhaps_that_is_not_just_talk = 2151
str_you_speak_of_unifying_calradia_but_right_now_yours_is_just_one_squabbling_faction_among_many = 2152
str_you_speak_of_claims_well_no_offense_but_a_claim_unsupported_by_might_rarely_prospers = 2153
str_you_speak_of_protecting_the_commons_well_i_suppose_that_will_make_for_a_more_prosperous_realm_ive_always_tried_to_treat_my_peasants_decently_saves_going_to_bed_worrying_about_whether_youll_wake_up_with_the_roof_on_fire = 2154
str_you_speak_of_protecting_the_commons_very_well_but_remember_that_peasants_are_more_likely_to_cause_trouble_if_you_make_promises_then_dont_deliver_than_if_you_never_made_the_promise_in_the_first_place = 2155
str_you_speak_of_protecting_the_rights_of_lords_good_youd_be_well_advised_to_do_that__men_fight_better_for_a_king_wholl_respect_their_rights = 2156
str_you_speak_of_protecting_the_rights_of_lords_very_well_but_remember__failing_to_keep_promises_which_you_made_while_scrambling_up_the_throne_is_the_quickest_way_to_topple_off_of_it_once_you_get_there = 2157
str_you_speak_of_giving_me_land_very_good_but_often_i_find_that_when_a_man_makes_too_many_promises_trying_to_get_to_the_top_he_has_trouble_keeping_them_once_he_reaches_it = 2158
str_you_speak_of_unifying_calradia_well_many_have_said_that_you_might_very_well_be_the_one_to_do_it = 2159
str_you_speak_of_unifying_calradia_well_all_the_kings_say_that_im_not_sure_that_you_will_succeed_while_they_fail = 2160
str_you_speak_of_claims_do_you_think_i_care_for_the_nattering_of_lawyers = 2161
str_you_speak_of_protecting_the_commons_how_kind_of_you_i_shall_tell_my_swineherd_all_about_your_sweet_promises_no_doubt_he_will_become_your_most_faithful_vassal = 2162
str_you_speak_of_protecing_the_rights_of_lords_such_sweet_words_but_ill_tell_you_this__the_only_rights_that_are_respected_in_this_world_are_the_rights_to_dominate_whoever_is_weaker_and_to_submit_to_whoever_is_stronger = 2163
str_you_speak_of_giving_me_land_yes_very_good__but_you_had_best_deliver = 2164
str_you_speak_of_giving_me_land_hah_perhaps_all_those_others_to_whom_you_promised_lands_will_simply_step_aside = 2165
str_you_speak_of_unifying_calradia_you_may_indeed_humble_the_other_kings_of_this_land_and_in_that_case_i_would_hope_that_you_would_remember_me_as_your_faithful_servant = 2166
str_you_speak_of_unifying_calradia_but_you_are_weak_and_i_think_that_you_will_remain_weak = 2167
str_you_speak_of_claims_its_good_for_a_king_to_have_a_strong_claim_although_admittedly_im_more_concerned_that_he_rules_just_ly_than_with_legalities_anyway_your_claim_seems_wellfounded_to_me = 2168
str_you_speak_of_claims_but_your_claim_seems_a_bit_weak_to_me = 2169
str_you_speak_of_protecting_the_commons_i_like_that_my_tenants_are_a_happy_lot_i_think_but_i_hear_of_others_in_other_estates_that_arent_so_fortunate = 2170
str_you_speak_of_protecting_the_commons_im_glad_to_hear_you_say_that_but_do_me_a_favor__dont_promise_the_commons_anything_you_cant_deliver_thats_a_sure_way_to_get_them_to_rebel_and_it_breaks_my_heart_to_have_to_put_them_down = 2171
str_you_speak_of_protecting_the_rights_of_lords_well_very_good_i_suppose_but_you_know__we_lords_can_take_of_ourselves_its_the_common_folk_who_need_a_strong_king_to_look_out_for_them_to_my_mind = 2172
str_you_speak_of_giving_me_land_its_kind_of_you_really_though_that_is_not_necessary = 2173
str_you_speak_of_unifying_calradia_well_maybe_you_can_unite_this_land_by_the_sword_but_im_not_sure_that_this_will_make_you_a_good_ruler = 2174
str_you_speak_of_claims_a_king_must_have_a_strong_legal_claim_for_there_not_to_be_chaos_in_the_realm_and_yours_is_wellestablished = 2175
str_you_speak_of_claims_a_king_must_have_a_strong_legal_claim_for_there_not_to_be_chaos_in_the_realm_but_your_claim_is_not_so_strong = 2176
str_you_speak_of_protecting_the_rights_of_lords_it_is_of_course_important_that_a_king_respect_the_rights_of_his_vassals_although_i_worry_that_a_king_who_took_a_throne_without_proper_cause_would_not_rule_with_justice = 2177
str_you_speak_of_protecting_the_rights_of_lords_it_is_of_course_important_that_a_king_respect_the_rights_of_his_vassals_however_i_would_like_to_know_that_you_would_indeed_deliver_on_your_promises = 2178
str_you_speak_of_protecting_the_commons_i_would_be_pleased_to_serve_a_king_who_respected_the_rights_of_his_subjects_although_i_worry_that_a_king_who_took_a_throne_without_proper_cause_would_not_rule_with_justice = 2179
str_you_speak_of_protecting_the_commons_i_would_be_pleased_to_serve_a_king_who_respected_the_rights_of_his_subjects_however_i_would_like_to_know_that_you_would_indeed_deliver_on_your_promises = 2180
str_i_am_not_swayed_by_promises_of_reward = 2181
str_you_speak_of_unifying_calradia_it_would_be_good_to_bring_peace_to_the_realm_and_i_believe_that_you_are_strong_enough_to_do_so = 2182
str_you_speak_of_unifying_calradia_it_would_be_good_to_bring_peace_the_realm_but_with_your_kingdom_in_its_current_state_i_worry_that_you_are_just_bringing_more_discord = 2183
str_s15 = 2184
str_my_s11_s15 = 2185
str_stop_gap__s15_is_the_rival_of_s16 = 2186
str_my_s11_s18 = 2187
str_the_socalled_s11_s18 = 2188
str_s18_would_cheat_me_of_my_inheritance_by_heaven_i_know_my_rights_and_im_not_going_to_back_down = 2189
str_s18_once_questioned_my_honour_and_my_bravery_i_long_for_the_day_when_i_can_meet_him_in_battle_and_make_him_retract_his_statement = 2190
str_s18_once_questioned_my_judgment_in_battle_by_heaven_would_he_have_us_shirk_our_duty_to_smite_our_sovereigns_foes = 2191
str_s18_seems_to_think_he_has_the_right_to_some_of_my_property_well_he_does_not = 2192
str_s18_once_took_something_i_said_amiss_stubborn_bastard_wont_give_it_up_and_keeps_trying_to_get_me_to_recant_my_words = 2193
str_s18_is_a_crafty_weasel_and_i_dont_trust_him_one_bit = 2194
str_s18_i_despite_him_he_puts_on_such_a_nauseating_display_of_virtue_and_thinks_nothing_of_insulting_his_betters = 2195
str_s18_entered_into_a_little_deal_with_me_and_is_now_trying_to_wriggle_out_of_it = 2196
str_s18_once_ran_an_errand_for_me_and_now_thinks_i_owe_him_something_i_owe_his_ilk_nothing = 2197
str_s18_is_soft_and_weak_and_not_fit_to_govern_a_fief_and_i_have_always_detested_him = 2198
str_s18_is_a_quarrelsome_oaf_and_a_liability_in_my_opinion_and_ive_let_him_know_as_much = 2199
str_s18_i_am_sorry_to_say_is_far_too_softhearted_a_man_to_be_given_any_kind_of_responsibility_his_chivalry_will_allow_the_enemy_to_flee_to_fight_another_day_and_will_cost_the_lives_of_my_own_faithful_men = 2200
str_s18_seems_to_have_something_against_me_for_some_reason_i_dont_like_to_talk_ill_of_people_but_i_think_hes_can_be_a_bit_of_a_cad_sometimes = 2201
str_s18_has_always_treated_me_contemptuously_although_i_have_done_him_no_wrong = 2202
str_s18_is_thoroughly_dishonorable_and_a_compulsive_spinner_of_intrigues_which_i_fear_will_drag_us_into_wars_or_incite_rebellions = 2203
str_s18_disappoints_me_i_once_scolded_for_his_rashness_in_battle_and_he_took_offense_i_do_not_care_to_apologize_for_my_efforts_to_save_his_life_and_the_lives_of_his_men = 2204
str_s18_squanders_money_and_carouses_in_a_way_most_unbefitting_a_noble_by_doing_so_he_disgraces_us_all = 2205
str_s18_has_been_speaking_ill_of_me_behind_my_back_or_so_they_say = 2206
str_s18_is_a_disgrace_reg3shehe_consorts_with_merchants_lends_money_at_interest_uses_coarse_language_and_shows_no_attempt_to_uphold_the_dignity_of_the_honor_bestowed_upon_reg3herhim = 2207
str_s18_has_condemned_me_for_engaging_in_commerce_what_could_possibly_be_wrong_with_that = 2208
str_s18_i_have_heard_has_been_encouraging_seditious_ideas_among_the_peasantry__a_foolish_move_which_endangers_us_all = 2209
str_s18_has_called_me_out_for_the_way_i_deal_with_my_tenants_well_so_be_it_if_i_teach_them_that_they_are_the_equal_of_anyone_with_socalled_gentle_blood_what_is_it_to_reg3herhim = 2210
str_a_most_gallant_gentleman_who_knows_how_to_treat_a_lady = 2211
str_a_base_cad = 2212
str_a_man_who_treats_me_as_his_equal_which_is_rare = 2213
str_appears_to_value_me_with_his_estate_and_his_horse_as_prizes_worth_having = 2214
str_a_bit_dull_but_what_can_you_expect = 2215
str_the_man_whom_destiny_intends_for_me = 2216
str_is_not_right_for_me__i_cannot_say_why_but_he_makes_my_skin_crawl = 2217
str_is_a_man_who_clearly_intends_to_make_his_mark_in_the_world = 2218
str_is_a_layabout_a_naif_prey_for_others_who_are_cleverer_than_he = 2219
str_is_a_man_of_stalwart_character = 2220
str_appears_to_be_a_man_of_low_morals = 2221
str_appears_to_be_a_man_who_lacks_selfdiscipline = 2222
str_check_reg8_s4_reconciles_s5_and_s6_ = 2223
str_diagnostic__player_should_receive_consultation_quest_here_if_not_already_active = 2224
str_check_reg8_s4_rules_in_s5s_favor_in_quarrel_with_s6_ = 2225
str_check_reg8_new_rivalry_generated_between_s5_and_s6 = 2226
str_check_reg8_s5_attempts_to_win_over_s6 = 2227
str_s1_has_no_lords = 2228
str_do_political_consequences_for_s4_victory_over_s5 = 2229
str_bandits_attacked_a_party_on_the_roads_so_a_bounty_is_probably_available = 2230
str_travellers_attacked_on_road_from_s15_to_s16 = 2231
str_s15_shares_joy_of_victory_with_s16 = 2232
str_faction_marshall_s15_involved_in_defeat = 2233
str_player_faction_marshall_involved_in_defeat = 2234
str_s14_of_s15_defeated_in_battle_loses_one_point_relation_with_liege = 2235
str_s14_defeated_in_battle_by_s15_loses_one_point_relation = 2236
str_s14_blames_s15_for_defeat = 2237
str_s32_is_undeclared_rebel = 2238
str_small_bonus_for_no_base = 2239
str_s15_considered_member_of_faction_s20_weight_of_reg15 = 2240
str_checking_for_recruitment_argument_reg24 = 2241
str_g_talk_troop_s20_evaluates_being_vassal_to_s22_of_s21 = 2242
str_base_result_for_security_reg1 = 2243
str_result_for_security_weighted_by_personality_reg2 = 2244
str_base_result_for_political_connections_reg3 = 2245
str_result_for_political_connections_weighted_by_personality_reg4 = 2246
str_result_for_argument_strength_reg7 = 2247
str_result_for_argument_appeal_reg17 = 2248
str_combined_result_for_argument_modified_by_persuasion_reg8 = 2249
str_base_changing_sides_penalty_reg9 = 2250
str_changing_sides_penalty_weighted_by_personality_reg10 = 2251
str_combined_bonuses_and_penalties_=_reg0 = 2252
str_intrigue_test_troop_party_is_active = 2253
str_intrigue_test_troop_party_is_not_in_battle = 2254
str_intrigue_test_troop_is_not_prisoner = 2255
str_intrigue_test_troop_is_nearby = 2256
str_s20_relation_with_s15_changed_by_reg4_to_reg14 = 2257
str_total_additions_reg4 = 2258
str_total_subtractions_reg4 = 2259
str_checking_lord_reactions_in_s15 = 2260
str_s14_protests_the_appointment_of_s15_as_marshall = 2261
str_s11_relocates_to_s10 = 2262
str_checking_s3_at_s5_with_s11_relationship_with_s4_score_reg0 = 2263
str_s3_feast_concludes_at_s4 = 2264
str_attendance_reg3_nobles_out_of_reg4 = 2265
str_romantic_chemistry_reg0 = 2266
str_personality_modifier_reg2 = 2267
str_renown_modifier_reg3 = 2268
str_final_score_reg0 = 2269
str_s4_pursues_suit_with_s5_in_s7 = 2270
str_note__favor_event_logged = 2271
str_result_lady_forced_to_agree_to_engagement = 2272
str_result_lady_rejects_suitor = 2273
str_result_happy_engagement_between_s4_and_s5 = 2274
str_result_s4_elopes_with_s5 = 2275
str_result_s4_reluctantly_agrees_to_engagement_with_s5 = 2276
str_result_stalemate_patience_roll_=_reg3 = 2277
str_s3_marries_s4_at_s5 = 2278
str__i_must_attend_to_this_matter_before_i_worry_about_the_affairs_of_the_realm = 2279
str_the_other_matter_took_precedence = 2280
str_i_cannot_leave_this_fortress_now_as_it_is_under_siege = 2281
str_after_all_we_are_under_siege = 2282
str_we_are_not_strong_enough_to_face_the_enemy_out_in_the_open = 2283
str_i_should_probably_seek_shelter_behind_some_stout_walls = 2284
str_enemies_are_reported_to_be_nearby_and_we_should_stand_ready_to_either_man_the_walls_or_sortie_out_to_do_battle = 2285
str_the_enemy_is_nearby = 2286
str_as_the_marshall_i_am_assembling_the_army_of_the_realm = 2287
str_as_the_marshall_i_am_assembling_the_army_of_the_realm_and_travel_to_lands_near_s10_to_inform_more_vassals = 2288
str_i_intend_to_assemble_the_army_of_the_realm = 2289
str_as_the_marshall_i_am_leading_the_siege = 2290
str_i_intend_to_begin_the_siege = 2291
str_as_the_marshall_i_am_leading_our_raid = 2292
str_i_intend_to_start_our_raid = 2293
str_as_the_marshall_i_am_leading_our_forces_in_search_of_the_enemy = 2294
str_i_intend_to_lead_our_forces_out_to_find_the_enemy = 2295
str_as_the_marshall_i_am_leading_our_forces_to_engage_the_enemy_in_battle = 2296
str_i_intend_to_lead_our_forces_out_to_engage_the_enemy = 2297
str_i_dont_have_enough_troops_and_i_need_to_get_some_more = 2298
str_i_am_running_low_on_troops = 2299
str_we_are_following_your_direction = 2300
str_i_need_to_make_preparations_for_your_wedding = 2301
str_after_all_i_need_to_make_preparations_for_your_wedding = 2302
str_i_am_heading_to_the_site_of_our_wedding = 2303
str_after_all_we_are_soon_to_be_wed = 2304
str_i_am_hosting_a_feast_there = 2305
str_i_have_a_feast_to_host = 2306
str_i_am_to_be_the_bridegroom_there = 2307
str_my_wedding_day_draws_near = 2308
str_i_have_too_much_loot_and_too_many_prisoners_and_need_to_secure_them = 2309
str_i_should_think_of_dropping_off_some_of_my_prisoners = 2310
str_i_need_to_reinforce_it_as_it_is_poorly_garrisoned = 2311
str_there_is_a_hole_in_our_defenses = 2312
str_i_am_following_the_marshals_orders = 2313
str_the_marshal_has_given_me_this_command = 2314
str_i_am_answering_the_marshals_summons = 2315
str_our_realm_needs_my_support_there_is_enemy_raiding_one_of_our_villages_which_is_not_to_far_from_here_i_am_going_there = 2316
str_the_marshal_has_issued_a_summons = 2317
str_comradeinarms = 2318
str_i_am_supporting_my_s11_s10 = 2319
str_i_believe_that_one_of_my_comrades_is_in_need = 2320
str_s20_decided_to_attack_s21 = 2321
str_a_fortress_is_vulnerable = 2322
str_i_believe_that_the_enemy_may_be_vulnerable = 2323
str_i_need_to_inspect_my_properties_and_collect_my_dues = 2324
str_it_has_been_too_long_since_i_have_inspected_my_estates = 2325
str_my_men_are_weary_so_we_are_returning_home = 2326
str_my_men_are_becoming_weary = 2327
str_i_have_a_score_to_settle_with_the_lord_there = 2328
str_i_am_thinking_of_settling_an_old_score = 2329
str_i_am_short_of_money_and_i_hear_that_there_is_much_wealth_there = 2330
str_i_need_to_refill_my_purse_preferably_with_the_enemys_money = 2331
str_by_striking_at_the_enemys_richest_lands_perhaps_i_can_draw_them_out_to_battle = 2332
str_i_am_thinking_of_going_on_the_attack = 2333
str_perhaps_if_i_strike_one_more_blow_we_may_end_this_war_on_our_terms_ = 2334
str_we_may_be_able_to_bring_this_war_to_a_close_with_a_few_more_blows = 2335
str_i_wish_to_attend_the_feast_there = 2336
str_there_is_a_feast_which_i_wish_to_attend = 2337
str_there_is_a_fair_lady_there_whom_i_wish_to_court = 2338
str_i_have_the_inclination_to_pay_court_to_a_fair_lady = 2339
str_we_have_heard_reports_that_the_enemy_is_in_the_area = 2340
str_i_have_heard_reports_of_enemy_incursions_into_our_territory = 2341
str_i_need_to_spend_some_time_with_my_household = 2342
str_it_has_been_a_long_time_since_i_have_been_able_to_spend_time_with_my_household = 2343
str_i_am_watching_the_borders = 2344
str_i_may_be_needed_to_watch_the_borders = 2345
str_i_will_guard_the_areas_near_my_home = 2346
str_i_am_perhaps_needed_most_at_home = 2347
str_i_cant_think_of_anything_better_to_do = 2348
str_i_am_completing_what_i_have_already_begun = 2349
str_i_dont_even_have_a_home_to_which_to_return = 2350
str_debug__s10_decides_s14_faction_ai_s15 = 2351
str__i_am_acting_independently_because_no_marshal_is_appointed = 2352
str__i_am_acting_independently_because_our_marshal_is_currently_indisposed = 2353
str__i_am_acting_independently_because_our_realm_is_currently_not_on_campaign = 2354
str__i_am_not_accompanying_the_marshal_because_i_fear_that_he_may_lead_us_into_disaster = 2355
str_i_am_not_accompanying_the_marshal_because_i_question_his_judgment = 2356
str_i_am_not_accompanying_the_marshal_because_i_can_do_greater_deeds = 2357
str__s16_has_kept_us_on_campaign_on_far_too_long_and_there_are_other_pressing_matters_to_which_i_must_attend = 2358
str__i_am_not_participating_in_the_marshals_campaign_because_i_do_not_know_where_to_find_our_main_army = 2359
str__i_am_acting_independently_although_some_enemies_have_been_spotted_within_our_borders_they_havent_come_in_force_and_the_local_troops_should_be_able_to_dispatch_them = 2360
str__the_needs_of_the_realm_must_come_first = 2361
str_we_are_likely_to_be_overwhelmed_by_the_s9_let_each_defend_their_own = 2362
str_we_should_see_this_siege_through = 2363
str_we_should_prepare_to_defend_s21_but_we_should_gather_our_forces_until_we_are_strong_enough_to_engage_them = 2364
str_we_should_prepare_to_defend_s21_but_first_we_have_to_gather = 2365
str_we_should_ride_to_break_the_siege_of_s21 = 2366
str_we_should_ride_to_defeat_the_enemy_gathered_near_s21 = 2367
str_we_have_located_s21s_army_and_we_should_engage_it = 2368
str_this_offensive_needs_to_wind_down_soon_so_the_vassals_can_attend_to_their_own_business = 2369
str_the_vassals_are_tired_we_let_them_rest_for_some_time = 2370
str_the_vassals_still_need_time_to_attend_to_their_own_business = 2371
str_it_is_time_to_go_on_the_offensive_and_we_must_first_assemble_the_army = 2372
str_we_must_continue_to_gather_the_army_before_we_ride_forth_on_an_offensive_operation = 2373
str_there_is_no_need_to_beat_around_the_borders__we_can_take_one_of_their_important_towns = 2374
str_we_should_exploit_our_success_over_s21_by_seizing_one_of_their_fortresses = 2375
str_we_shall_leave_a_fiery_trail_through_the_heart_of_the_enemys_lands_targeting_the_wealthy_settlements_if_we_can = 2376
str_the_army_will_be_disbanded_because_we_have_been_waiting_too_long_without_a_target = 2377
str_it_is_time_for_the_feast_to_conclude = 2378
str_we_should_continue_the_feast_unless_there_is_an_emergency = 2379
str_you_had_wished_to_hold_a_feast = 2380
str_your_wedding_day_approaches_my_lady = 2381
str_your_wedding_day_approaches = 2382
str_s22_and_s23_wish_to_marry = 2383
str_it_has_been_a_long_time_since_the_lords_of_the_realm_gathered_for_a_feast = 2384
str_the_circumstances_which_led_to_this_decision_no_longer_apply_so_we_should_stop_and_reconsider_shortly = 2385
str_we_cant_think_of_anything_to_do = 2386
str_s15_is_at_war_with_s16_ = 2387
str_in_the_short_term_s15_has_a_truce_with_s16_as_a_matter_of_general_policy_ = 2388
str_in_the_short_term_s15_was_recently_provoked_by_s16_and_is_under_pressure_to_declare_war_as_a_matter_of_general_policy_ = 2389
str_envoymodified_diplomacy_score_honor_plus_relation_plus_envoy_persuasion_=_reg4 = 2390
str_s12s15_cannot_negotiate_with_s16_as_to_do_so_would_undermine_reg4herhis_own_claim_to_the_throne_this_civil_war_must_almost_certainly_end_with_the_defeat_of_one_side_or_another = 2391
str_s12s15_considers_s16_to_be_dangerous_and_untrustworthy_and_shehe_wants_to_bring_s16_down = 2392
str_s12s15_is_anxious_to_reclaim_old_lands_such_as_s18_now_held_by_s16 = 2393
str_s12s15_feels_that_reg4shehe_is_winning_the_war_against_s16_and_sees_no_reason_not_to_continue = 2394
str_s12s15_faces_too_much_internal_discontent_to_feel_comfortable_ignoring_recent_provocations_by_s16s_subjects = 2395
str_s12even_though_reg4shehe_is_fighting_on_two_fronts_s15_is_inclined_to_continue_the_war_against_s16_for_a_little_while_longer_for_the_sake_of_honor = 2396
str_s12s15_feels_that_reg4shehe_must_pursue_the_war_against_s16_for_a_little_while_longer_for_the_sake_of_honor = 2397
str_s12s15_is_currently_on_the_offensive_against_s17_now_held_by_s16_and_reluctant_to_negotiate = 2398
str_s12s15_is_alarmed_by_the_growing_power_of_s16 = 2399
str_s12s15_distrusts_s16_and_fears_that_any_deals_struck_between_the_two_realms_will_not_be_kept = 2400
str_s12s15_is_at_war_on_too_many_fronts_and_eager_to_make_peace_with_s16 = 2401
str_s12s15_seems_to_think_that_s16_and_reg4shehe_have_a_common_enemy_in_the_s17 = 2402
str_s12s15_feels_frustrated_by_reg4herhis_inability_to_strike_a_decisive_blow_against_s16 = 2403
str_s12s15_has_suffered_enough_in_the_war_with_s16_for_too_little_gain_and_is_ready_to_pursue_a_peace = 2404
str_s12s15_would_like_to_firm_up_a_truce_with_s16_to_respond_to_the_threat_from_the_s17 = 2405
str_s12s15_wishes_to_be_at_peace_with_s16_so_as_to_pursue_the_war_against_the_s17 = 2406
str_s12s15_seems_to_be_intimidated_by_s16_and_would_like_to_avoid_hostilities = 2407
str_s12s15_has_no_particular_reason_to_continue_the_war_with_s16_and_would_probably_make_peace_if_given_the_opportunity = 2408
str_s12s15_seems_to_be_willing_to_improve_relations_with_s16 = 2409
str_excuse_me_how_can_you_possibly_imagine_yourself_worthy_to_marry_into_our_family = 2410
str_em_with_regard_to_her_ladyship_we_were_looking_specifically_for_a_groom_of_some_distinction_fight_hard_count_your_dinars_and_perhaps_some_day_in_the_future_we_may_speak_of_such_things_my_good_man = 2411
str_em_with_regard_to_her_ladyship_we_were_looking_specifically_for_a_groom_of_some_distinction = 2412
str_it_is_too_early_for_you_to_be_speaking_of_such_things_you_are_still_making_your_mark_in_the_world = 2413
str_you_dont_serve_the_s4_so_id_say_no_one_day_we_may_be_at_war_and_i_prefer_not_to_have_to_kill_my_inlaws_if_at_all_possible = 2414
str_as_you_are_not_a_vassal_of_the_s4_i_must_decline_your_request_the_twists_of_fate_may_mean_that_we_will_one_day_cross_swords_and_i_would_hope_not_to_make_a_widow_of_a_lady_whom_i_am_obligated_to_protect = 2415
str_as_you_are_not_a_pledged_vassal_of_our_liege_with_the_right_to_hold_land_i_must_refuse_your_request_to_marry_into_our_family = 2416
str_look_here_lad__the_young_s14_has_been_paying_court_to_s16_and_youll_have_to_admit__hes_a_finer_catch_for_her_than_you_so_lets_have_no_more_of_this_talk_shall_we = 2417
str_i_do_not_care_for_you_sir_and_i_consider_it_my_duty_to_protect_the_ladies_of_my_household_from_undesirable_suitors = 2418
str_hmm_young_girls_may_easily_be_led_astray_so_out_of_a_sense_of_duty_to_the_ladies_of_my_household_i_think_i_would_like_to_get_to_know_you_a_bit_better_we_may_speak_of_this_at_a_later_date = 2419
str_you_may_indeed_make_a_fine_match_for_the_young_mistress = 2420
str_madame__given_our_relations_in_the_past_this_proposal_is_most_surprising_i_do_not_think_that_you_are_the_kind_of_woman_who_can_be_bent_to_a_hushands_will_and_i_would_prefer_not_to_have_our_married_life_be_a_source_of_constant_acrimony = 2421
str_i_would_prefer_to_marry_a_proper_maiden_who_will_obey_her_husband_and_is_not_likely_to_split_his_head_with_a_sword = 2422
str_my_lady_while_i_admire_your_valor_you_will_forgive_me_if_i_tell_you_that_a_woman_like_you_does_not_uphold_to_my_ideal_of_the_feminine_of_the_delicate_and_of_the_pure = 2423
str_nah_i_want_a_woman_wholl_keep_quiet_and_do_what_shes_told_i_dont_think_thats_you = 2424
str_my_lady_you_are_possessed_of_great_charms_but_no_properties_until_you_obtain_some_to_marry_you_would_be_an_act_of_ingratitude_towards_my_ancestors_and_my_lineage = 2425
str_my_lady_you_are_a_woman_of_no_known_family_of_no_possessions__in_short_a_nobody_do_you_think_that_you_are_fit_to_marry_into_may_family = 2426
str_my_lady__forgive_me__the_quality_of_our_bond_is_not_of_the_sort_which_the_poets_tell_us_is_necessary_to_sustain_a_happy_marriage = 2427
str_um_i_think_that_if_i_want_to_stay_on_s4s_good_side_id_best_not_marry_you = 2428
str_you_serve_another_realm_i_dont_see_s4_granting_reg4herhis_blessing_to_our_union = 2429
str_madame_my_heart_currently_belongs_to_s4 = 2430
str_my_lady_you_are_a_woman_of_great_spirit_and_bravery_possessed_of_beauty_grace_and_wit_i_shall_give_your_proposal_consideration = 2431
str_my_lady_you_are_a_woman_of_great_spirit_and_bravery_possessed_of_beauty_grace_and_wit_i_would_be_most_honored_were_you_to_become_my_wife = 2432
str_poem_choice_reg4_lady_rep_reg5 = 2433
str_ah__kais_and_layali__such_a_sad_tale_many_a_time_has_it_been_recounted_for_my_family_by_the_wandering_poets_who_come_to_our_home_and_it_has_never_failed_to_bring_tears_to_our_eyes = 2434
str_kais_and_layali_three_hundred_stanzas_of_pathetic_sniveling_if_you_ask_me_if_kais_wanted_to_escape_heartbreak_he_should_have_learned_to_live_within_his_station_and_not_yearn_for_what_he_cannot_have = 2435
str_kais_and_layali_no_one_should_ever_have_written_such_a_sad_poem_if_it_was_the_destiny_of_kais_and_layali_to_be_together_than_their_love_should_have_conquered_all_obstacles = 2436
str_ah_kais_and_layali_a_very_old_standby_but_moving_in_its_way = 2437
str_the_saga_of_helgered_and_kara_such_happy_times_in_which_our_ancestors_lived_women_like_kara_could_venture_out_into_the_world_like_men_win_a_name_for_themselves_and_not_linger_in_their_husbands_shadow = 2438
str_ah_the_saga_of_helgered_and_kara_now_there_was_a_lady_who_knew_what_she_wanted_and_was_not_afraid_to_obtain_it = 2439
str_the_saga_of_helgered_and_kara_a_terrible_tale__but_it_speaks_of_a_very_great_love_if_she_were_willing_to_make_war_on_her_own_family = 2440
str_the_saga_of_helgered_and_kara_as_i_recall_kara_valued_her_own_base_passions_over_duty_to_her_family_that_she_made_war_on_her_own_father_i_have_no_time_for_a_poem_which_praises_such_a_woman = 2441
str_the_saga_of_helgered_and_kara_how_could_a_woman_don_armor_and_carry_a_sword_how_could_a_man_love_so_ungentle_a_creature = 2442
str_a_conversation_in_the_garden_i_cannot_understand_the_lady_in_that_poem_if_she_loves_the_man_why_does_she_tease_him_so = 2443
str_a_conversation_in_the_garden_let_us_see__it_is_morally_unedifying_it_exalts_deception_it_ends_with_a_maiden_surrendering_to_her_base_passions_and_yet_i_cannot_help_but_find_it_charming_perhaps_because_it_tells_us_that_love_need_not_be_tragic_to_be_memorable = 2444
str_a_conversation_in_the_garden_now_that_is_a_tale_every_lady_should_know_by_heart_to_learn_the_subtleties_of_the_politics_she_must_practice = 2445
str_a_conversation_in_the_garden_it_is_droll_i_suppose__although_there_is_nothing_there_that_truly_stirs_my_soul = 2446
str_storming_the_fortress_of_love_ah_yes_the_lady_sits_within_doing_nothing_while_the_man_is_the_one_who_strives_and_achieves_i_have_enough_of_that_in_my_daily_life_why_listen_to_poems_about_it = 2447
str_storming_the_fortress_of_love_ah_yes_an_uplifting_tribute_to_the_separate_virtues_of_man_and_woman = 2448
str_storming_the_fortress_of_love_ah_yes_but_although_it_is_a_fine_tale_of_virtues_it_speaks_nothing_of_passion = 2449
str_storming_the_fortress_of_love_ah_a_sermon_dressed_up_as_a_love_poem_if_you_ask_me = 2450
str_a_hearts_desire_ah_such_a_beautiful_account_of_the_perfect_perfect_love_to_love_like_that_must_be_to_truly_know_rapture = 2451
str_a_hearts_desire_silly_if_you_ask_me_if_the_poet_desires_a_lady_then_he_should_endeavor_to_win_her__and_not_dress_up_his_desire_with_a_pretense_of_piety = 2452
str_a_hearts_desire_hmm__it_is_an_interesting_exploration_of_earthly_and_divine_love_it_does_speak_of_the_spiritual_quest_which_brings_out_the_best_in_man_but_i_wonder_if_the_poet_has_not_confused_his_yearning_for_higher_things_with_his_baser_passions = 2453
str_a_hearts_desire_oh_yes__it_is_very_worthy_and_philosophical_but_if_i_am_to_listen_to_a_bard_strum_a_lute_for_three_hours_i_personally_prefer_there_to_be_a_bit_of_a_story = 2454
str_result_reg4_string_s11 = 2455
str_calculating_effect_for_policy_for_s3 = 2456
str_reg3_units_of_s4_for_reg5_guests_and_retinue = 2457
str_reg3_units_of_spice_of_reg5_to_be_consumed = 2458
str_reg3_units_of_oil_of_reg5_to_be_consumed = 2459
str_of_food_which_must_come_before_everything_else_the_amount_is_s8 = 2460
str_s9_and_the_variety_is_s8_ = 2461
str_s9_of_drink_which_guests_will_expect_in_great_abundance_the_amount_is_s8 = 2462
str_s9_of_spice_which_is_essential_to_demonstrate_that_we_spare_no_expense_as_hosts_the_amount_is_s8_ = 2463
str_s9_of_oil_which_we_shall_require_to_light_the_lamps_the_amount_is_s8 = 2464
str_s9_overall_our_table_will_be_considered_s8 = 2465
str_rebel = 2466
str_bandit = 2467
str_relation_of_prisoner_with_captor_is_reg0 = 2468
str_s5_suffers_attrition_reg3_x_s4 = 2469
str_s65 = 2470
str_s10_said_on_s1_s11__ = 2471
str_rumor_note_to_s3s_slot_reg4_s5 = 2472
str_totalling_casualties_caused_during_mission = 2473
str_removing_s4_from_s5 = 2474
str_s4_joins_prison_break = 2475
str_helper_is_spawned = 2476
str_leaving_area_during_prison_break = 2477
str_talk_to_the_trainer = 2478
str_woman = 2479
str_man = 2480
str_noble = 2481
str_common = 2482
str_may_find_that_you_are_able_to_take_your_place_among_calradias_great_lords_relatively_quickly = 2483
str_may_face_some_difficulties_establishing_yourself_as_an_equal_among_calradias_great_lords = 2484
str_may_face_great_difficulties_establishing_yourself_as_an_equal_among_calradias_great_lords = 2485
str_current_party_morale_is_reg5_current_party_morale_modifiers_are__base_morale__50_party_size_s2reg1_leadership_s3reg2_food_variety_s4reg3s5s6_recent_events_s7reg4_total__reg5___ = 2486
str_s1extra_morale_for_s9_troops__reg6_ = 2487
str_courtships_in_progress_ = 2488
str_s1_s2_relation_reg3_last_visit_reg4_days_ago = 2489
str_s1__poems_known = 2490
str_s1_storming_the_castle_of_love_allegoric = 2491
str_s1_kais_and_layali_tragic = 2492
str_s1_a_conversation_in_the_garden_comic = 2493
str_s1_helgered_and_kara_epic = 2494
str_s1_a_hearts_desire_mystic = 2495
str_no_companions_in_service = 2496
str_gathering_support = 2497
str_expected_back_imminently = 2498
str_expected_back_in_approximately_reg3_days = 2499
str_gathering_intelligence = 2500
str_diplomatic_embassy_to_s9 = 2501
str_serving_as_minister = 2502
str_in_your_court_at_s9 = 2503
str_under_arms = 2504
str_in_your_party = 2505
str_s4_s8_s5 = 2506
str_s2_s3 = 2507
str_attacking_enemy_army_near_s11 = 2508
str_holding_feast_at_s11 = 2509
str_sfai_reg4 = 2510
str_s9s10_current_state_s11_hours_at_current_state_reg3_current_strategic_thinking_s14_marshall_s12_since_the_last_offensive_ended_reg4_hours_since_the_decisive_event_reg10_hours_since_the_last_rest_reg9_hours_since_the_last_feast_ended_reg5_hours_percent_disgruntled_lords_reg7_percent_restless_lords_reg8__ = 2511
str__right_to_rule_reg12 = 2512
str_political_arguments_made_legality_reg3_rights_of_lords_reg4_unificationpeace_reg5_rights_of_commons_reg6_fief_pledges_reg7 = 2513
str_renown_reg2_honour_rating_reg3s12_friends_s8_enemies_s6_s9 = 2514
str_you_lie_stunned_for_several_minutes_then_stagger_to_your_feet_to_find_your_s10_standing_over_you_you_have_lost_the_duel = 2515
str_s10_lies_in_the_arenas_dust_for_several_minutes_then_staggers_to_his_feet_you_have_won_the_duel = 2516
str_debug__you_fought_with_a_center_so_no_change_in_morale = 2517
str__this_castle_is_temporarily_under_royal_control = 2518
str__this_castle_does_not_seem_to_be_under_anyones_control = 2519
str__this_town_is_temporarily_under_royal_control = 2520
str__the_townspeople_seem_to_have_declared_their_independence = 2521
str_to_your_husband_s11 = 2522
str__you_see_the_banner_of_your_wifehusband_s7_over_the_castle_gate = 2523
str__the_banner_of_your_wifehusband_s7_flies_over_the_town_gates = 2524
str__the_lord_is_currently_holding_a_feast_in_his_hall = 2525
str__join_the_feast = 2526
str_belligerent_drunk_in_s4 = 2527
str_belligerent_drunk_not_found = 2528
str_roughlooking_character_in_s4 = 2529
str_roughlooking_character_not_found = 2530
str__however_you_have_sufficiently_distinguished_yourself_to_be_invited_to_attend_the_ongoing_feast_in_the_lords_castle = 2531
str_s8_you_are_also_invited_to_attend_the_ongoing_feast_in_the_castle = 2532
str___hardship_index_reg0_avg_towns_reg1_avg_villages_reg2__ = 2533
str___s3_price_=_reg4_calradian_average_reg6_capital_reg11_s4_base_reg1modified_by_raw_material_reg2modified_by_prosperity_reg3_calradian_average_production_base_reg5_total_reg12_consumed_reg7used_as_raw_material_reg8modified_total_reg9_calradian_consumption_base_reg10_total_reg13s1_ = 2534
str_s11_unfortunately_s12_was_wounded_and_had_to_be_left_behind = 2535
str_s11_also_s12_was_wounded_and_had_to_be_left_behind = 2536
str_trial_influences_s17s_relation_with_s18_by_reg3 = 2537
str_with_the_s10 = 2538
str_outside_calradia = 2539
str_you_have_been_indicted_for_treason_to_s7_your_properties_have_been_confiscated_and_you_would_be_well_advised_to_flee_for_your_life = 2540
str_by_order_of_s6_s4_of_the_s5_has_been_indicted_for_treason_the_lord_has_been_stripped_of_all_reg4herhis_properties_and_has_fled_for_reg4herhis_life_he_is_rumored_to_have_gone_into_exile_s11 = 2541
str_local_notables_from_s1_a_village_claimed_by_the_s4_have_been_mistreated_by_their_overlords_from_the_s3_and_petition_s5_for_protection = 2542
str_villagers_from_s1_stole_some_cattle_from_s2 = 2543
str_villagers_from_s1_abducted_a_woman_from_a_prominent_family_in_s2_to_marry_one_of_their_boys = 2544
str_villagers_from_s1_killed_some_farmers_from_s2_in_a_fight_over_the_diversion_of_a_stream = 2545
str_your_new_minister_ = 2546
str_s10_is_your_new_minister_and_ = 2547
str_due_to_the_fall_of_s10_your_court_has_been_relocated_to_s12 = 2548
str_after_to_the_fall_of_s10_your_faithful_vassal_s9_has_invited_your_court_to_s11_ = 2549
str_after_to_the_fall_of_s11_your_court_has_nowhere_to_go = 2550
str_s8_wishes_to_inform_you_that_the_lords_of_s9_will_be_gathering_for_a_feast_at_his_great_hall_in_s10_and_invites_you_to_be_part_of_this_august_assembly = 2551
str_consult_with_s11_at_your_court_in_s12 = 2552
str_as_brief_as_our_separation_has_been_the_longing_in_my_heart_to_see_you_has_made_it_seem_as_many_years = 2553
str_although_it_has_only_been_a_short_time_since_your_departure_but_i_would_be_most_pleased_to_see_you_again = 2554
str_although_i_have_received_no_word_from_you_for_quite_some_time_i_am_sure_that_you_must_have_been_very_busy_and_that_your_failure_to_come_see_me_in_no_way_indicates_that_your_attentions_to_me_were_insincere_ = 2555
str_i_trust_that_you_have_comported_yourself_in_a_manner_becoming_a_gentleman_during_our_long_separation_ = 2556
str_it_has_been_many_days_since_you_came_and_i_would_very_much_like_to_see_you_again = 2557
str__you_should_ask_my_s11_s16s_permission_but_i_have_no_reason_to_believe_that_he_will_prevent_you_from_coming_to_see_me = 2558
str__you_should_first_ask_her_s11_s16s_permission = 2559
str__alas_as_we_know_my_s11_s16_will_not_permit_me_to_see_you_however_i_believe_that_i_can_arrange_away_for_you_to_enter_undetected = 2560
str__as_my_s11_s16_has_already_granted_permission_for_you_to_see_me_i_shall_expect_your_imminent_arrival = 2561
str_visit_s3_who_was_last_at_s4s18 = 2562
str_giver_troop_=_s2 = 2563
str_the_guards_at_the_gate_have_been_ordered_to_allow_you_through_you_might_be_imagining_things_but_you_think_one_of_them_may_have_given_you_a_wink = 2564
str_the_guards_glare_at_you_and_you_know_better_than_to_ask_permission_to_enter_however_as_you_walk_back_towards_your_lodgings_an_elderly_lady_dressed_in_black_approaches_you_i_am_s11s_nurse_she_whispers_urgently_don_this_dress_and_throw_the_hood_over_your_face_i_will_smuggle_you_inside_the_castle_to_meet_her_in_the_guise_of_a_skullery_maid__the_guards_will_not_look_too_carefully_but_i_beg_you_for_all_of_our_sakes_be_discrete = 2565
str_the_guards_glare_at_you_and_you_know_better_than_to_ask_permission_to_enter_however_as_you_walk_back_towards_your_lodgings_an_elderly_lady_dressed_in_black_approaches_you_i_am_s11s_nurse_she_whispers_urgently_wait_for_a_while_by_the_spring_outside_the_walls_i_will_smuggle_her_ladyship_out_to_meet_you_dressed_in_the_guise_of_a_shepherdess_but_i_beg_you_for_all_of_our_sakes_be_discrete = 2566
str_the_guards_glare_at_you_and_you_know_better_than_to_ask_permission_to_enter_however_as_you_walk_back_towards_your_lodgings_an_elderly_lady_dressed_in_black_approaches_you_i_am_s11s_nurse_she_whispers_urgently_her_ladyship_asks_me_to_say_that_yearns_to_see_you_but_that_you_should_bide_your_time_a_bit_her_ladyship_says_that_to_arrange_a_clandestine_meeting_so_soon_after_your_last_encounter_would_be_too_dangerous = 2567
str_the_guards_glare_at_you_and_you_know_better_than_to_ask_permission_to_enter = 2568
str_s3_commander_of_party_reg4_which_is_not_his_troop_leaded_party_reg5 = 2569
str_party_with_commander_mismatch__check_log_for_details_ = 2570
str_s4_adds_wealth_has_reg4_wealth_accumulated = 2571
str_doing_political_calculations_for_s9 = 2572
str_s9_does_not_have_a_fief = 2573
str_current_wealth_reg1 = 2574
str_debug__attempting_to_spawn_s4 = 2575
str_debug__s0_is_spawning_around_party__s7 = 2576
str_no_trigger_noted = 2577
str_triggered_by_npc_is_quitting = 2578
str_triggered_by_npc_has_grievance = 2579
str_triggered_by_npc_has_personality_clash = 2580
str_triggered_by_npc_has_political_grievance = 2581
str_triggered_by_npc_to_rejoin_party = 2582
str_triggered_by_npc_has_sisterly_advice = 2583
str_triggered_by_local_histories = 2584
str_s1_reg0_s2 = 2585
str_s3_reg0_s2 = 2586
str_s1_s2 = 2587
str_wanted_bandits_spotted_by_s4 = 2588
str_s4_ready_to_voice_objection_to_s3s_mission_if_in_party = 2589
str_test_effective_relation_=_reg3 = 2590
str_g_talk_troop_=_reg0__g_encountered_party_=_reg1__slot_value_=_reg2 = 2591
str_strange_that_one_didnt_seem_like_your_ordenary_troublemaker_he_didnt_drink_all_that_much__he_just_stood_there_quietly_and_watched_the_door_you_may_wish_to_consider_whether_you_have_any_enemies_who_know_you_are_in_town_a_pity_that_blood_had_to_be_spilled_in_my_establishment = 2592
str_wielded_item_reg3 = 2593
str_you_never_let_him_draw_his_weapon_still_it_looked_like_he_was_going_to_kill_you_take_his_sword_and_purse_i_suppose_he_was_trouble_but_its_not_good_for_an_establishment_to_get_a_name_as_a_place_where_men_are_killed = 2594
str_well_id_say_that_he_started_it_that_entitles_you_to_his_sword_and_purse_i_suppose_have_a_drink_on_the_house_as_i_daresay_youve_saved_a_patron_or_two_a_broken_skull_still_i_hope_he_still_has_a_pulse_its_not_good_for_an_establishment_to_get_a_name_as_a_place_where_men_are_killed = 2595
str_stop_no_shooting_no_shooting = 2596
str_em_ill_stay_out_of_this = 2597
str_the_s12_is_a_labyrinth_of_rivalries_and_grudges_lords_ignore_their_lieges_summons_and_many_are_ripe_to_defect = 2598
str_the_s12_is_shaky_many_lords_do_not_cooperate_with_each_other_and_some_might_be_tempted_to_defect_to_a_liege_that_they_consider_more_worthy = 2599
str_the_s12_is_fairly_solid_some_lords_bear_enmities_for_each_other_but_they_tend_to_stand_together_against_outside_enemies = 2600
str_the_s12_is_a_rock_of_stability_politically_speaking_whatever_the_lords_may_think_of_each_other_they_fight_as_one_against_the_common_foe = 2601
str_tribune_s12 = 2602
str_lady_s12 = 2603
str_lord_s12 = 2604
str_resolve_the_dispute_between_s11_and_s12 = 2605
str_in_doing_so_you_will_be_in_violation_of_your_truce_is_that_what_you_want = 2606
str_if_you_attack_without_provocation_some_of_your_vassals_may_consider_you_to_be_too_warlike_is_that_what_you_want = 2607
str_our_men_are_ready_to_ride_forth_at_your_bidding_are_you_sure_this_is_what_you_want = 2608
str_seek_recognition = 2609
str_seek_vassalhood = 2610
str_seek_a_truce = 2611
str__promised_fief = 2612
str_no_fiefss12 = 2613
str_fiefs_s0s12 = 2614
str_please_s65_ = 2615
str__s15_is_also_being_held_here_and_you_may_wish_to_see_if_reg4shehe_will_join_us = 2616
str_one_thing_in_our_favor_is_that_s12s_grip_is_very_shaky_he_rules_over_a_labyrinth_of_rivalries_and_grudges_lords_often_fail_to_cooperate_and_many_would_happily_seek_a_better_liege = 2617
str_thankfully_s12s_grip_is_fairly_shaky_many_lords_do_not_cooperate_with_each_other_and_some_might_be_tempted_to_seek_a_better_liege = 2618
str_unfortunately_s12s_grip_is_fairly_strong_until_we_can_shake_it_we_may_have_to_look_long_and_hard_for_allies = 2619
str_unfortunately_s12s_grip_is_very_strong_unless_we_can_loosen_it_it_may_be_difficult_to_find_allies = 2620
str_playername_come_to_plague_me_some_more_have_you = 2621
str_ah_it_is_you_again = 2622
str_well_playername = 2623
str_comment_found_s1 = 2624
str_rejoinder_noted = 2625
str_s11 = 2626
str_flagon_of_mead = 2627
str_skin_of_kumis = 2628
str_mug_of_kvass = 2629
str_cup_of_wine = 2630
str_you_intend_to_challenge_s13_to_force_him_to_retract_an_insult = 2631
str_intrigue_impatience=_reg3_must_be_less_than_100 = 2632
str_youll_have_to_speak_to_me_at_some_other_time_then = 2633
str_this_is_no_time_for_words = 2634
str_lord_not_alone = 2635
str_of_course_my_wife = 2636
str_perhaps_not_our_marriage_has_become_a_bit_strained_dont_you_think = 2637
str_why_is_that_my_wife_actually_our_marriage_has_become_such_that_i_prefer_to_have_a_witness_for_all_of_our_converations = 2638
str_all_right_then_what_do_you_have_to_say_out_with_it = 2639
str_bah__im_in_no_mood_for_whispering_in_the_corner = 2640
str_bah_i_dont_like_you_that_much_im_not_going_to_go_plot_with_you_in_some_corner = 2641
str_well__now_what_do_you_have_to_propose = 2642
str_trying_our_hand_at_intrigue_are_we_i_think_not = 2643
str_hah_i_trust_you_as_a_i_would_a_serpent_i_think_not = 2644
str_i_do_not_like_to_conduct_my_business_in_the_shadows_but_sometimes_it_must_be_done_what_do_you_have_to_say = 2645
str_i_would_prefer_to_conduct_our_affairs_out_in_the_open = 2646
str_do_not_take_this_amiss_but_with_you_i_would_prefer_to_conduct_our_affairs_out_in_the_open = 2647
str_hmm_you_have_piqued_my_interest_what_do_you_have_to_say = 2648
str_em_lets_keep_our_affairs_out_in_the_open_for_the_time_being = 2649
str_thats_sensible__the_world_is_full_of_churls_who_poke_their_noses_into_their_betters_business_now_tell_me_what_it_is_that_you_have_to_say = 2650
str_what_do_you_take_me_for_a_plotter = 2651
str_well_i_normally_like_to_keep_things_out_in_the_open_but_im_sure_someone_like_you_would_not_want_to_talk_in_private_unless_heshe_had_a_good_reason_what_is_it = 2652
str_surely_we_can_discuss_whatever_you_want_to_discuss_out_here_in_the_open_cant_we = 2653
str_im_a_simple__man_not_one_for_intrigue_but_id_guess_that_you_have_something_worthwhile_to_say_what_is_it = 2654
str_forgive_me_but_im_not_one_for_going_off_in_corners_to_plot = 2655
str_please_do_not_take_this_amiss_but_i_do_not_trust_you = 2656
str_certainly_playername_what_is_it = 2657
str_forgive_me_but_id_prefer_to_keep_our_conversations_in_the_open = 2658
str_please_do_not_take_this_amiss_but_im_not_sure_you_and_i_are_still_on_those_terms = 2659
str_persuasion__relation_less_than_5 = 2660
str_s15 = 2661
str_persuasion__2__lord_reputation_modifier__relation_less_than_10 = 2662
str_s13 = 2663
str_placeholder = 2664
str_really_well_this_is_the_first_i_have_heard_of_it_unless_you_build_up_support_for_that_claim_you_may_find_it_difficult_to_find_allies_however_whenever_you_see_fit_to_declare_yourself_publically_as_queen_i_should_be_honored_to_be_your_consort = 2665
str_yes_i_have_heard_such_talk_while_it_is_good_that_you_are_building_up_your_support_i_do_not_think_that_you_are_quite_ready_to_proclaim_yourself_yet_however_i_will_let_you_be_the_judge_of_that_and_when_you_decide_i_should_be_honored_to_be_your_consort = 2666
str_yes_and_many_others_in_calradia_think_so_as_well_perhaps_it_is_time_that_you_declared_yourself_and_we_shall_ride_forth_together_to_claim_your_throne_i_should_be_honored_to_be_your_consort = 2667
str_i_am_disturbed_about_my_lord_s15s_choice_of_companions = 2668
str_well_ill_be_honest_i_feel_that_sometimes_s15_overlooks_my_rights_and_extends_his_protection_to_the_unworthy = 2669
str_heh_one_thing_that_ill_say_about_s15_is_that_he_has_a_ripe_batch_of_bastards_in_his_court = 2670
str_well_sometimes_i_have_to_say_that_i_question_s15s_judgment_regarding_those_who_he_keeps_in_his_court = 2671
str_s15_is_a_weak_man_who_too_easily_lends_his_ear_to_evil_council_and_gives_his_protection_to_some_who_have_done_me_wrong = 2672
str_i_will_confess_that_sometimes_i_worry_about_s15s_judgment_particularly_in_the_matter_of_the_counsel_that_he_keeps = 2673
str_what_do_i_think_i_think_that_s15_is_a_vile_pretender_a_friend_to_the_flatterer_and_the_hypocrite = 2674
str_well_s15_is_not_like_you_ill_say_that_much = 2675
str_s15_long_may_he_live = 2676
str_he_is_my_liege_that_is_all_that_i_will_say_on_this_matter = 2677
str_that_you_are_the_rightful_heir_to_the_throne_of_calradia = 2678
str_that_s14_is_the_rightful_ruler_of_calradia = 2679
str_that_s14_will_rule_this_land_justly = 2680
str_that_s14_will_protect_our_rights_as_nobles = 2681
str_that_s14_will_unify_this_land_and_end_this_war = 2682
str_that_s14_will_reward_me_with_a_fief = 2683
str_he = 2684
str_king = 2685
str_she = 2686
str_queen = 2687
str_khan = 2688
str_i = 2689
str_according_to_the_ancient_law_and_custom_of_the_calradians_s45_should_be_s47 = 2690
str_because_s44_is_the_rightful_s47_of_the_s46 = 2691
str_you_speak_of_claims_and_legalities_yet_to_others_you_talk_of_bringing_peace_by_force = 2692
str_you_speak_of_bringing_peace_by_force_yet_to_others_you_make_legal_claims = 2693
str_you_speak_to_some_of_upholding_the_rights_of_the_commons_yet_you_speak_to_others_of_uphold_the_rights_of_nobles_what_if_those_rights_are_in_conflict = 2694
str_you_speak_to_me_of_upholding_my_rights_as_a_lord_but_to_others_you_talk_of_upholding_the_rights_of_all_commons_what_if_those_rights_come_into_conflict = 2695
str_a_claim_should_be_strong_indeed_before_one_starts_talking_about_it = 2696
str_a_king_should_prove_his_valor_beyond_any_doubt_before_he_starts_talking_about_a_claim_to_the_throne = 2697
str_you_must_prove_yourself_a_great_warrior_before_men_will_follow_you_as_king = 2698
str_a_claim_to_the_throne_should_be_strong_indeed_before_one_presses_it = 2699
str_indeed_but_a_man_must_also_prove_himself_a_great_warrior_before_men_will_follow_you_as_king = 2700
str_my_pigherd_can_declare_himself_king_if_he_takes_he_fancy_i_think_you_need_to_break_a_few_more_heads_on_tbe_battlefield_before_men_will_follow_you = 2701
str_if_you_do_not_wish_to_die_on_a_scaffold_like_so_many_failed_pretenders_before_you_i_would_suggest_that_you_to_build_your_claim_on_stronger_foundations_so_that_men_will_follow_you = 2702
str_if_you_do_not_wish_to_die_on_a_scaffold_like_so_many_failed_pretenders_before_you_i_would_advise_you_prove_yourself_on_the_field_of_battle_so_that_men_will_follow_you = 2703
str_talk_is_for_heralds_and_lawyers_real_kings_prove_themselves_with_their_swords = 2704
str_i_were_you_i_would_try_to_prove_myself_a_bit_more_before_i_went_about_pressing_my_claim = 2705
str_trump_check_random_reg4_skill_reg3 = 2706
str_s12_s43 = 2707
str_indeed_please_continue = 2708
str_me = 2709
str_preliminary_result_for_political_=_reg4 = 2710
str_i_worry_about_those_with_whom_you_have_chosen_to_surround_yourself = 2711
str_there_are_some_outstanding_matters_between_me_and_some_of_your_vassals_ = 2712
str_result_for_political_=_reg41 = 2713
str_my_liege_has_his_faults_but_i_dont_care_for_your_toadies = 2714
str_i_think_youre_a_good_man_but_im_worried_that_you_might_be_pushed_in_the_wrong_direction_by_some_of_those_around_you = 2715
str_i_am_loathe_to_fight_alongside_you_so_long_as_you_take_under_your_wing_varlots_and_base_men = 2716
str_ill_be_honest__with_some_of_those_who_follow_you_i_think_id_be_more_comfortable_fighting_against_you_than_with_you = 2717
str_i_say_that_you_can_judge_a_man_by_the_company_he_keeps_and_you_have_surrounded_yourself_with_vipers_and_vultures = 2718
str_you_know_that_i_have_always_had_a_problem_with_some_of_our_companions = 2719
str_politically_i_would_be_a_better_position_in_the_court_of_my_current_liege_than_in_yours = 2720
str_i_am_more_comfortable_with_you_and_your_companions_than_with_my_current_liege = 2721
str_militarily_youre_in_no_position_to_protect_me_should_i_be_attacked_id_be_reluctant_to_join_you_until_you_could = 2722
str_militarily_when_i_consider_the_lay_of_the_land_i_realize_that_to_pledge_myself_to_you_now_would_endanger_my_faithful_retainers_and_my_family = 2723
str_militarily_youre_in_no_position_to_come_to_my_help_if_someone_attacked_me_i_dont_mind_a_good_fight_but_i_like_to_have_a_chance_of_winning = 2724
str_militarily_you_would_have_me_join_you_only_to_find_myself_isolated_amid_a_sea_of_enemies = 2725
str_militarily_youre_in_no_position_to_come_to_my_help_if_someone_attacked_me_youd_let_me_be_cut_down_like_a_dog_id_bet = 2726
str_militarily_i_wouldnt_be_any_safer_if_i_joined_you = 2727
str_militarily_i_might_be_safer_if_i_joined_you = 2728
str_finally_there_is_a_cost_to_ones_reputation_to_change_sides_in_this_case_the_cost_would_be_very_high = 2729
str_finally_there_is_a_cost_to_ones_reputation_to_change_sides_in_this_case_the_cost_would_be_significant = 2730
str_finally_there_is_a_cost_to_ones_reputation_to_change_sides_in_this_case_however_many_men_would_understand = 2731
str_chance_of_success_=_reg1 = 2732
str_random_=_reg3 = 2733
str_i_will_not_have_it_be_said_about_me_that_i_am_a_traitor_that_is_my_final_decision_i_have_nothing_more_to_say_on_this_matter = 2734
str_i_am_pledged_to_defend_s14_i_am_sorry_though_we_may_meet_on_the_battlefield_i_hope_that_we_will_still_be_friends = 2735
str_i_really_cannot_bring_myself_to_renounce_s14_i_am_sorry_please_lets_not_talk_about_this_any_more = 2736
str_however_i_have_decided_that_i_must_remain_loyal_to_s14_i_am_sorry = 2737
str_however_i_will_not_let_you_lead_me_into_treason_do_not_talk_to_me_of_this_again = 2738
str_its_not_good_to_get_a_reputation_as_one_who_abandons_his_liege_that_is_my_decision_let_us_speak_no_more_of_this_matter = 2739
str_ive_decided_to_stick_with_s14_i_dont_want_to_talk_about_this_matter_any_more = 2740
str_lord_pledges_to_s4 = 2741
str_lord_recruitment_provokes_home_faction = 2742
str_error__wrong_quest_type = 2743
str_you_are_challenging_me_to_a_duel_how_droll_as_you_wish_playername_it_will_be_good_sport_to_bash_your_head_in = 2744
str_call_me_coward_very_well_you_leave_me_no_choice = 2745
str_reg3_hours = 2746
str_hour = 2747
str_however_circumstances_have_changed_since_we_made_that_decision_and_i_may_reconsider_shortly_s16 = 2748
str_i_wish_to_marry_your_s11_s10_i_ask_for_your_blessing = 2749
str_i_wish_to_marry_your_s11_s10_i_ask_for_your_help = 2750
str_you_plan_to_marry_s3_at_a_feast_hosted_by_s4_in_s5_you_should_be_notifed_of_the_feast_as_soon_as_it_is_held = 2751
str_your_s11_ = 2752
str_i_ask_again_may = 2753
str_may = 2754
str_very_well_as_far_as_im_concerned_i_suppose_she_can_see_most_anyone_she_likes__within_reason_of_course = 2755
str_very_well_an_alliance_with_you_could_be_valuable_go_chat_with_her_and_see_if_you_can_get_her_to_take_a_fancy_to_you_if_she_doesnt_and_if_we_still_want_to_conclude_this_business_then_i_can_make_her_see_reason = 2756
str_you_have_my_blessing_to_pay_suit_to_her__so_long_as_your_intentions_are_honorable_of_course_depending_on_how_things_proceed_between_you_two_we_may_have_more_to_discuss_at_a_later_date = 2757
str_war_damage_inflicted_reg3_suffered_reg4_ratio_reg5 = 2758
str_error__did_not_calculate_war_progress_string_properly = 2759
str_the_war_has_barely_begun_so_and_it_is_too_early_to_say_who_is_winning_and_who_is_losing = 2760
str_we_have_been_hitting_them_very_hard_and_giving_them_little_chance_to_recover = 2761
str_the_fighting_has_been_hard_but_we_have_definitely_been_getting_the_better_of_them = 2762
str_they_have_been_hitting_us_very_hard_and_causing_great_suffering = 2763
str_the_fighting_has_been_hard_and_i_am_afraid_that_we_have_been_having_the_worst_of_it = 2764
str_both_sides_have_suffered_in_the_fighting = 2765
str_no_clear_winner_has_yet_emerged_in_the_fighting_but_i_think_we_are_getting_the_better_of_them = 2766
str_no_clear_winner_has_yet_emerged_in_the_fighting_but_i_fear_they_may_be_getting_the_better_of_us = 2767
str_no_clear_winner_has_yet_emerged_in_the_fighting = 2768
str_s9_s14 = 2769
str_there_is_no_campaign_currently_in_progress = 2770
str_we_are_assembling_the_army = 2771
str_we_aim_to_take_the_fortress_of_s8 = 2772
str_we_are_on_a_raid_and_are_now_targeting_s8 = 2773
str_we_are_trying_to_seek_out_and_defeat_s8 = 2774
str_we_are_riding_to_the_defense_of_s8 = 2775
str_we_are_gathering_for_a_feast_at_s8 = 2776
str__however_that_may_change_shortly_s14 = 2777
str_it_is_our_custom_to_seal_any_such_alliances_with_marriage_and_in_fact_we_have_been_looking_for_a_suitable_groom_for_my_s11_s14 = 2778
str_once_again_ = 2779
str_cheat__marriage_proposal = 2780
str_you_plan_to_marry_s4_as_you_have_no_family_in_calradia_he_will_organize_the_wedding_feast = 2781
str_s43_just_so_you_know_if_you_attack_me_you_will_be_in_violation_of_the_truce_you_signed_with_the_s34 = 2782
str_very_well__you_are_now_my_liege_as_well_as_my_husband = 2783
str_i_thank_you_reg39my_ladylord = 2784
str_now_some_might_say_that_women_have_no_business_leading_mercenary_companies_but_i_suspect_that_you_would_prove_them_wrong_what_do_you_say = 2785
str_what_do_you_say_to_entering_the_service_of_s9_as_a_mercenary_captain_i_have_no_doubt_that_you_would_be_up_to_the_task = 2786
str_s9_asked_you_to_rescue_s13_who_is_prisoner_at_s24 = 2787
str_s9_asked_you_to_attack_a_village_or_some_caravans_as_to_provoke_a_war_with_s13 = 2788
str_s9_asked_you_to_catch_the_three_groups_of_runaway_serfs_and_bring_them_back_to_s4_alive_and_breathing_he_said_that_all_three_groups_are_heading_towards_s3 = 2789
str_error__player_not_logged_as_groom = 2790
str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit = 2791
str_hello_playername = 2792
str_ah_my_gentle_playername_how_much_good_it_does_my_heart_to_see_you_again = 2793
str_playername__i_am_so_glad_to_see_you_again_i_must_say_i_do_envy_your_freedom_to_ride_out_and_experience_the_world = 2794
str_playername__i_am_so_glad_to_see_you_i_trust_that_you_have_been_behaving_honorably_since_last_we_met = 2795
str_playername__i_am_so_glad_that_you_were_able_to_come = 2796
str_i_do_enjoy_speaking_to_you_but_i_am_sure_you_understand_that_our_people_cluck_their_tongues_at_a_woman_to_spend_too_long_conversing_with_a_man_outside_her_family__although_the_heavens_know_its_never_the_man_who_is_held_to_blame_ = 2797
str_as_much_as_i_enjoy_speaking_to_you_i_do_not_care_to_be_gossiped_about_by_others_who_might_lack_my_grace_and_beauty_ = 2798
str_i_do_so_enjoy_speaking_to_you_but_as_a_daughter_of_one_of_the_great_families_of_this_land_i_must_set_an_example_of_propriety_ = 2799
str_i_do_so_enjoy_speaking_to_you_but_as_a_daughter_of_good_family_i_must_protect_my_reputation_ = 2800
str_although_it_is_kind_of_you_to_pay_me_such_attentions_i_suspect_that_you_might_find_other_ladies_who_may_be_more_inclined_to_return_your_affection = 2801
str_as_flattered_as_i_am_by_your_attentions_perhaps_you_should_seek_out_another_lady_of_somewhat_shall_we_say_different_tastes = 2802
str_as_flattered_as_i_am_by_your_attentions_i_am_a_daughter_of_good_family_and_must_be_aware_of_my_reputation_it_is_not_seemly_that_i_converse_too_much_at_one_time_with_one_man_i_am_sure_you_understand_now_if_you_will_excuse_me = 2803
str_very_well__i_will_let_you_choose_the_time = 2804
str_good_i_am_glad_that_you_have_abandoned_the_notion_of_pushing_me_into_marriage_before_i_was_ready = 2805
str_rival_found_s4_reg0_relation = 2806
str_i_am = 2807
str_s12 = 2808
str_s12_s11_to_s14 = 2809
str_s12 = 2810
str_s12_i_am_here_for_the_feast = 2811
str_another_tournament_dedication_oh_i_suppose_it_is_always_flattering = 2812
str_do_you_why_what_a_most_gallant_thing_to_say = 2813
str_hmm_i_cannot_say_that_i_altogether_approve_of_such_frivolity_but_i_must_confess_myself_a_bit_flattered = 2814
str_why_thank_you_you_are_most_kind_to_do_so = 2815
str_you_are_most_courteous_and_courtesy_is_a_fine_virtue_ = 2816
str_hmm_youre_a_bold_one_but_i_like_that_ = 2817
str_ah_well_they_all_say_that_but_no_matter_a_compliment_well_delivered_is_at_least_a_good_start_ = 2818
str_oh_do_you_mean_that_such_a_kind_thing_to_say = 2819
str_you_are_a_most_gallant_young_man_ = 2820
str__do_come_and_see_me_again_soon = 2821
str_you_intend_to_ask_s12_for_permission_to_marry_s15 = 2822
str_you_intend_to_ask_s12_to_pressure_s10_to_marry_you = 2823
str_do_be_careful_i_am_so_much_endebted_to_you_for_this = 2824
str_go_then__we_shall_see_which_of_you_triumphs = 2825
str_sigh_i_will_never_truly_understand_men_and_their_rash_actions = 2826
str_you_intend_to_challenge_s13_to_force_him_to_relinquish_his_suit_of_s11 = 2827
str_farewell = 2828
str_farewell_playername = 2829
str___we_believe_that_there_is_money_to_be_made_selling_ = 2830
str_s14s15_ = 2831
str__we_carry_a_selection_of_goods_although_the_difference_in_prices_for_each_is_not_so_great_we_hope_to_make_a_profit_off_of_the_whole = 2832
str_s14and_other_goods = 2833
str__have_you_not_signed_a_truce_with_our_lord = 2834
str_parole = 2835
str_normal = 2836
str_s51 = 2837
str__meanwhile_s51_reg2areis_being_held_in_the_castle_but_reg2havehas_made_pledges_not_to_escape_and_reg2areis_being_held_in_more_comfortable_quarters = 2838
str_you_may_be_aware_my_lord_of_the_quarrel_between_s4_and_s5_which_is_damaging_the_unity_of_this_realm_and_sapping_your_authority_if_you_could_persuade_the_lords_to_reconcile_it_would_boost_your_own_standing_however_in_taking_this_on_you_run_the_risk_of_one_the_lords_deciding_that_you_have_taken_the_rivals_side = 2839
str_you_may_be_aware_my_lord_of_the_quarrel_between_s4_and_s5_which_is_damaging_the_unity_of_this_realm_and_sapping_your_authority_if_you_could_persuade_the_lords_to_reconcile_i_imagine_that_s7_would_be_most_pleased_however_in_taking_this_on_you_run_the_risk_of_one_the_lords_deciding_that_you_have_taken_the_rivals_side = 2840
str__of_course_the_land_is_currently_at_peace_so_you_may_have_better_luck_in_other_realms = 2841
str_here = 2842
str_over = 2843
str_s8_in_s12 = 2844
str__has_put_together_a_bounty_on_some_bandits_who_have_been_attacking_travellers_in_the_area = 2845
str__is_looking_for_a_way_to_avoid_an_impending_war = 2846
str__may_need_help_rescuing_an_imprisoned_family_member = 2847
str__has_been_asking_around_for_someone_who_might_want_work_id_watch_yourself_with_him_though = 2848
str_town = 2849
str_castle = 2850
str__but_he_is_holding_there_as_a_prisoner_at_dungeon_of_s13 = 2851
str_log_entry_type_reg4_for_s4_total_entries_reg5 = 2852
str_error__reputation_type_for_s9_not_within_range = 2853
str_they_say_that_s9_is_a_most_conventional_maiden__devoted_to_her_family_of_a_kind_and_gentle_temperament_a_lady_in_all_her_way = 2854
str_they_say_that_s9_is_a_bit_of_a_romantic_a_dreamer__of_a_gentle_temperament_yet_unpredictable_she_is_likely_to_be_led_by_her_passions_and_will_be_trouble_for_her_family_ill_wager = 2855
str_they_say_that_s9_is_determined_to_marry_well_and_make_her_mark_in_the_world_she_may_be_a_tremendous_asset_for_her_husband__provided_he_can_satisfy_her_ambition = 2856
str_they_say_that_s9_loves_to_hunt_and_ride_maybe_she_wishes_she_were_a_man_whoever_she_marries_will_have_a_tough_job_keeping_the_upper_hand_i_would_say = 2857
str_they_say_that_s9_is_a_lady_of_the_highest_moral_standards_very_admirable_very_admirable__and_very_hard_to_please_ill_warrant = 2858
str_s9_is_now_betrothed_to_s11_soon_we_believe_there_shall_be_a_wedding = 2859
str_i_have_not_heard_any_news_about_her = 2860
str_searching_for_rumors_for_s9 = 2861
str_they_say_that_s9_has_shown_favor_to_s11_perhaps_it_will_not_be_long_until_they_are_betrothed__if_her_family_permits = 2862
str_they_say_that_s9_has_been_forced_by_her_family_into_betrothal_with_s11 = 2863
str_they_say_that_s9_has_agreed_to_s11s_suit_and_the_two_are_now_betrothed = 2864
str_they_say_that_s9_under_pressure_from_her_family_has_agreed_to_betrothal_with_s11 = 2865
str_they_say_that_s9_has_refused_s11s_suit = 2866
str_they_say_that_s11_has_tired_of_pursuing_s9 = 2867
str_they_say_that_s9s_family_has_forced_her_to_renounce_s11_whom_she_much_loved = 2868
str_they_say_that_s9_has_run_away_with_s11_causing_her_family_much_grievance = 2869
str_they_say_that_s9_and_s11_have_wed = 2870
str_they_say_that_s9_was_recently_visited_by_s11_who_knows_where_that_might_lead = 2871
str_there_is_not_much_to_tell_but_it_is_still_early_in_the_season = 2872
str_error_lady_selected_=_s9 = 2873
str_s12there_is_a_feast_of_the_s3_in_progress_at_s4_but_it_has_been_going_on_for_a_couple_of_days_and_is_about_to_end_ = 2874
str_s12there_is_a_feast_of_the_s3_in_progress_at_s4_which_should_last_for_at_least_another_day_ = 2875
str_s12there_is_a_feast_of_the_s3_in_progress_at_s4_which_has_only_just_begun_ = 2876
str_not_at_this_time_no = 2877
str_s12the_great_lords_bring_their_daughters_and_sisters_to_these_occasions_to_see_and_be_seen_so_they_represent_an_excellent_opportunity_to_make_a_ladys_acquaintance = 2878
str_you_will_not_be_disappointed_sirmadam_you_will_not_find_better_warriors_in_all_calradia = 2879
str_your_excellency = 2880
str_s10_and_s11 = 2881
str_your_loyal_subjects = 2882
str_loyal_subjects_of_s10 = 2883
str_the = 2884
str_we = 2885
str_track_down_s7_and_defeat_him_defusing_calls_for_war_within_the_s11 = 2886
str_track_down_the_s9_who_attacked_travellers_near_s8_then_report_back_to_the_town = 2887
str_fire_time__reg0_cur_time__reg1 = 2888
str_fire_set_up_time_at_city_reg0_is_reg1 = 2889
str_our_power__reg3__enemy_power__reg4 = 2890
str_do_you_wish_to_award_it_to_one_of_your_vassals = 2891
str_who_do_you_wish_to_give_it_to = 2892
str_sire_my_lady_we_have_taken_s1_s2 = 2893
str_s12i_want_to_have_s1_for_myself = 2894
str_fiefs_s0 = 2895
str_reserved_001 = 2896
str_production_setting_buy_from_market = 2897
str_production_setting_buy_from_inventory = 2898
str_production_setting_produce_to_inventory = 2899
str_production_setting_produce_to_market = 2900
str_feast_quest_expired = 2901
str_whereabouts_unknown = 2902
str_mulberry_groves = 2903
str_olive_groves = 2904
str_acres_flax = 2905
str_enterprise_enemy_realm = 2906
str_intrigue_success_chance = 2907
str_you_intend_to_denounce_s14_to_s13_on_behalf_of_s12 = 2908
str_you_intend_to_denounce_s14_to_his_face_on_behalf_of_s14 = 2909
str_you_intend_to_bring_gift_for_s14 = 2910
str_we_will_gather_the_army_but_not_ride_until_we_have_an_objective = 2911
str_we_shall_lay_siege_to_an_easy_fortress_to_capture = 2912
str_we_shall_strike_at_the_heart_of_our_foe_and_seize_the_fortress_of_s14 = 2913
str_we_shall_take_the_fortress_of_s14_which_appears_easily_defensible = 2914
str_we_shall_cut_a_fiery_trail_through_their_richest_lands_to_draw_them_out_to_battle = 2915
str_strategy_criticism_rash = 2916
str_strategy_criticism_cautious = 2917
str_tavernkeeper_invalid_quest = 2918
str_faction_title_male_player = 2919
str_faction_title_male_1 = 2920
str_faction_title_male_2 = 2921
str_faction_title_male_3 = 2922
str_faction_title_male_4 = 2923
str_faction_title_male_5 = 2924
str_faction_title_male_6 = 2925
str_faction_title_female_player = 2926
str_faction_title_female_1 = 2927
str_faction_title_female_2 = 2928
str_faction_title_female_3 = 2929
str_faction_title_female_4 = 2930
str_faction_title_female_5 = 2931
str_faction_title_female_6 = 2932
str_name_kingdom_text = 2933
str_default_kingdom_name = 2934
str_lord_defects_ordinary = 2935
str_lord_defects_player = 2936
str_lord_defects_player_faction = 2937
str_lord_indicted_player_faction = 2938
str_lord_indicted_dialog_approach = 2939
str_lord_indicted_dialog_approach_yes = 2940
str_lord_indicted_dialog_approach_no = 2941
str_lord_indicted_dialog_rejected = 2942
str__has_been_worried_about_bandits_establishing_a_hideout_near_his_home = 2943
str_bandit_lair_quest_description = 2944
str_bandit_hideout_preattack = 2945
str_bandit_hideout_failure = 2946
str_bandit_hideout_success = 2947
str_bandit_approach_defile = 2948
str_bandit_approach_swamp = 2949
str_bandit_approach_thickets = 2950
str_bandit_approach_cliffs = 2951
str_bandit_approach_cove = 2952
str_political_explanation_lord_lacks_center = 2953
str_political_explanation_lord_took_center = 2954
str_political_explanation_most_deserving_friend = 2955
str_political_explanation_most_deserving_in_faction = 2956
str_political_explanation_self = 2957
str_political_explanation_marshal = 2958
str_prisoner_at_large = 2959
str_quick_battle_scene_1 = 2960
str_quick_battle_scene_2 = 2961
str_quick_battle_scene_3 = 2962
str_quick_battle_scene_4 = 2963
str_quick_battle_scene_5 = 2964
str_quick_battle_troop_1 = 2965
str_quick_battle_troop_2 = 2966
str_quick_battle_troop_3 = 2967
str_quick_battle_troop_4 = 2968
str_quick_battle_troop_5 = 2969
str_quick_battle_troop_6 = 2970
str_quick_battle_troop_7 = 2971
str_quick_battle_troop_8 = 2972
str_quick_battle_troop_9 = 2973
str_quick_battle_troop_10 = 2974
str_quick_battle_troop_11 = 2975
str_quick_battle_troops_end = 2976
str_tutorial_training_ground_intro_message = 2977
str_map_basic = 2978
str_game_type_basic = 2979
str_battle = 2980
str_siege_offense = 2981
str_siege_defense = 2982
str_character = 2983
str_biography = 2984
str_player = 2985
str_enemy = 2986
str_faction = 2987
str_army_composition = 2988
str_army_size = 2989
str_reg0_percent = 2990
str_reg0_men = 2991
str_start = 2992
str_i_need_to_raise_some_men_before_attempting_anything_else = 2993
str_we_are_currently_at_peace = 2994
str_the_marshalship = 2995
str_you = 2996
str_myself = 2997
str_my_friend_s15 = 2998
str_custom_battle = 2999
str_comment_intro_liege_affiliated_to_player = 3000
str_s21_the_s8_declared_war_out_of_personal_enmity = 3001
str_s21_the_s8_declared_war_in_response_to_border_provocations = 3002
str_s21_the_s8_declared_war_to_curb_the_other_realms_power = 3003
str_s21_the_s8_declared_war_to_regain_lost_territory = 3004
str__family_ = 3005
str_we_are_conducting_recce = 3006
str__family_ = 3007
str_s49_s12_s11_end = 3008
str_center_party_not_active = 3009
str_center_is_friendly = 3010
str_center_is_already_besieged = 3011
str_center_is_looted_or_raided_already = 3012
str_center_marshal_does_not_want_to_attack_innocents = 3013
str_center_we_have_already_committed_too_much_time_to_our_present_siege_to_move_elsewhere = 3014
str_center_we_are_already_here_we_should_at_least_loot_the_village = 3015
str_center_far_away_we_can_reconnoiter_but_will_delay_decision_until_we_get_close = 3016
str_center_far_away_our_cautious_marshal_does_not_wish_to_reconnoiter = 3017
str_center_far_away_even_for_our_aggressive_marshal_to_reconnoiter = 3018
str_center_far_away_reason = 3019
str_center_closer_but_this_is_not_enought = 3020
str_center_protected_by_enemy_army_aggressive = 3021
str_center_protected_by_enemy_army_cautious = 3022
str_center_cautious_marshal_believes_center_too_difficult_to_capture = 3023
str_center_even_aggressive_marshal_believes_center_too_difficult_to_capture = 3024
str_center_value_outweighed_by_difficulty_of_capture = 3025
str_center_value_justifies_the_difficulty_of_capture = 3026
str_center_is_indefensible = 3027
str_we_are_waiting_for_selection_of_marshal = 3028
str_best_to_attack_the_enemy_lands = 3029
str_we_believe_the_fortress_will_be_worth_the_effort_to_take_it = 3030
str_we_will_gather_to_defend_the_beleaguered_fortress = 3031
str_the_enemy_temporarily_has_the_field = 3032
str_center_has_not_been_scouted = 3033
str_we_have_assembled_some_vassals = 3034
str_we_are_waiting_here_for_vassals = 3035
str_we_are_travelling_to_s11_for_vassals = 3036
str_center_strength_not_scouted = 3037
str_center_strength_strongly_defended = 3038
str_center_strength_moderately_defended = 3039
str_center_strength_weakly_defended = 3040
str_center_distant_from_concentration = 3041
str_plus = 3042
str_minus = 3043
str_tutorial_training_ground_warning_no_weapon = 3044
str_tutorial_training_ground_warning_shield = 3045
str_tutorial_training_ground_warning_melee_with_parry = 3046
str_tutorial_training_ground_warning_melee = 3047
str_tutorial_training_ground_attack_training = 3048
str_tutorial_training_ground_attack_training_down = 3049
str_tutorial_training_ground_attack_training_up = 3050
str_tutorial_training_ground_attack_training_left = 3051
str_tutorial_training_ground_attack_training_right = 3052
str_tutorial_training_ground_parry_training = 3053
str_tutorial_training_ground_chamber_training = 3054
str_tutorial_training_ground_archer_training = 3055
str_tutorial_training_ground_ammo_refill = 3056
str_tutorial_training_ground_archer_text_1 = 3057
str_tutorial_training_ground_archer_text_2 = 3058
str_tutorial_training_ground_archer_text_3 = 3059
str_tutorial_training_ground_archer_text_4 = 3060
str_tutorial_training_ground_archer_text_5 = 3061
str_tutorial_training_ground_horseman_text_1 = 3062
str_tutorial_training_ground_horseman_text_2 = 3063
str_tutorial_training_ground_horseman_text_3 = 3064
str_tutorial_training_ground_horseman_text_4 = 3065
str_tutorial_training_ground_horseman_text_5 = 3066
str_tutorial_training_ground_horseman_text_6 = 3067
str_the_great_lords_of_your_kingdom_plan_to_gather_at_your_hall_in_s10_for_a_feast = 3068
str_your_previous_court_some_time_ago = 3069
str_awaiting_the_capture_of_a_fortress_which_can_serve_as_your_court = 3070
str_but_if_this_goes_badly = 3071
str_i_realize_that_you_are_on_good_terms_with_s4_but_we_ask_you_to_do_this_for_the_good_of_the_realm = 3072
str_i_realize_that_you_are_on_good_terms_with_s4_but_the_blow_will_hurt_him_more = 3073
str_killed_bandit_at_alley_fight = 3074
str_wounded_by_bandit_at_alley_fight = 3075
str_cannot_leave_now = 3076
str_press_tab_to_exit_from_town = 3077
str_find_the_lair_near_s9_and_free_the_brother_of_the_prominent_s10_merchant = 3078
str_please_sir_my_lady_go_find_some_volunteers_i_do_not_know_how_much_time_we_have = 3079
str_you_need_more_men_sir_my_lady = 3080
str_good_you_have_enough_men = 3081
str_do_not_waste_time_go_and_learn_where_my_brother_is = 3082
str_start_up_quest_message_1 = 3083
str_start_up_quest_message_2 = 3084
str_start_up_quest_message_3 = 3085
str_start_up_first_quest = 3086
str_reason_1 = 3087
str_reason_2 = 3088
str_reason_3 = 3089
str_reason_4 = 3090
str_reason_5 = 3091
str_reason_6 = 3092
str_reason_7 = 3093
str_reason_8 = 3094
str_reason_9 = 3095
str_has_decided_that_an_attack_on_ = 3096
str_this_would_be_better_worth_the_effort = 3097
str_has_decided_to_defend_ = 3098
str_before_going_offensive_we_should_protect_our_lands_if_there_is_any_threat_so_this_can_be_reason_marshall_choosed_defending_s4 = 3099
str_are_you_all_right = 3100
str_you_are_awake = 3101
str_save_town_from_bandits = 3102
str_you_fought_well_at_town_fight_survived = 3103
str_you_fought_normal_at_town_fight_survived = 3104
str_you_fought_bad_at_town_fight_survived = 3105
str_you_fought_well_at_town_fight = 3106
str_you_wounded_at_town_fight = 3107
str_you_fought_well_at_town_fight_survived_answer = 3108
str_you_fought_normal_at_town_fight_survived_answer = 3109
str_you_fought_bad_at_town_fight_survived_answer = 3110
str_you_fought_well_at_town_fight_answer = 3111
str_you_wounded_at_town_fight_answer = 3112
str_unfortunately_reg0_civilians_wounded_during_fight_more = 3113
str_unfortunately_reg0_civilians_wounded_during_fight = 3114
str_also_one_another_good_news_is_any_civilians_did_not_wounded_during_fight = 3115
str_merchant_and_you_call_some_townsmen_and_guards_to_get_ready_and_you_get_out_from_tavern = 3116
str_town_fight_ended_you_and_citizens_cleaned_town_from_bandits = 3117
str_town_fight_ended_you_and_citizens_cleaned_town_from_bandits_you_wounded = 3118
str_journey_to_reyvadin = 3119
str_journey_to_praven = 3120
str_journey_to_jelkala = 3121
str_journey_to_sargoth = 3122
str_journey_to_tulga = 3123
str_journey_to_shariz = 3124
str_lost_tavern_duel_ordinary = 3125
str_lost_tavern_duel_assassin = 3126
str_lost_startup_hideout_attack = 3127
str_reg1_blank_s3 = 3128
str_as_you_no_longer_maintain_an_independent_kingdom_you_no_longer_maintain_a_court = 3129
str_rents_from_s0 = 3130
str_tariffs_from_s0 = 3131
str_general_quarrel = 3132
str_the_steppes = 3133
str_the_deserts = 3134
str_the_tundra = 3135
str_the_forests = 3136
str_the_highlands = 3137
str_the_coast = 3138
str_my_lady_not_sufficient_chemistry = 3139
str_my_lady_engaged_to_another = 3140
str_attempting_to_rejoin_party = 3141
str_separated_from_party = 3142
str_whereabouts_unknown = 3143
str_none_yet_gathered = 3144
str_betrothed = 3145
str_leading_party = 3146
str_court_disbanded = 3147
str_i_am_not_accompanying_the_marshal_because_will_be_reappointment = 3148
str_persuasion_opportunity = 3149
str_marshal_warning = 3150
str_follow_army_quest_brief_2 = 3151
str_greetings_playername__it_is_good_to_see_you_i_hope_that_you_have_had_success_in_your_efforts_to_make_your_name_in_the_world = 3152
str_minister_advice_select_fief = 3153
str_minister_advice_select_fief_wait = 3154
str_minister_advice_fief_leading_vassal = 3155
str_unassigned_center = 3156
str_s43_also_you_should_know_that_an_unprovoked_assault_is_declaration_of_war = 3157
str_missing_after_battle = 3158
str_retrieve_garrison_warning = 3159
str_s12s15_declared_war_to_control_calradia = 3160
str_offer_gift_description = 3161
str_resolve_dispute_description = 3162
str_feast_wedding_opportunity = 3163
str_s21_the_s8_declared_war_as_part_of_a_bid_to_conquer_all_calradia = 3164
str_master_vinter = 3165
str_s54_has_left_the_realm = 3166
str_enterprise_s5_at_s0 = 3167
str_bread_site = 3168
str_ale_site = 3169
str_oil_site = 3170
str_wine_site = 3171
str_tool_site = 3172
str_leather_site = 3173
str_linen_site = 3174
str_wool_cloth_site = 3175
str_velvet_site = 3176
str_under_sequestration = 3177
str_describe_secondary_input = 3178
str_profit = 3179
str_loss = 3180
str_server_name_s0 = 3181
str_map_name_s0 = 3182
str_game_type_s0 = 3183
str_remaining_time_s0reg0_s1reg1 = 3184
str_you_are_a_lord_lady_of_s8_s9 = 3185
str_you_are_king_queen_of_s8_s9 = 3186
str_for_s4 = 3187
str_cancel_fiancee_quest = 3188
str_a_duel_request_is_sent_to_s0 = 3189
str_s0_offers_a_duel_with_you = 3190
str_your_duel_with_s0_is_cancelled = 3191
str_a_duel_between_you_and_s0_will_start_in_3_seconds = 3192
str_you_have_lost_a_duel = 3193
str_you_have_won_a_duel = 3194
str_server_s0 = 3195
str_disallow_ranged_weapons = 3196
str_ranged_weapons_are_disallowed = 3197
str_ranged_weapons_are_allowed = 3198
str_duel_starts_in_reg0_seconds = 3199
| Python |
# -*- coding: cp1254 -*-
from header_common import *
from header_dialogs import *
from header_operations import *
from header_parties import *
from header_item_modifiers import *
from header_skills import *
from header_triggers import *
from ID_troops import *
from ID_party_templates import *
from module_constants import *
####################################################################################################################
# During a dialog, the dialog lines are scanned from top to bottom.
# If the dialog-line is spoken by the player, all the matching lines are displayed for the player to pick from.
# If the dialog-line is spoken by another, the first (top-most) matching line is selected.
#
# Each dialog line contains the following fields:
# 1) Dialogue partner: This should match the person player is talking to.
# Usually this is a troop-id.
# You can also use a party-template-id by appending '|party_tpl' to this field.
# Use the constant 'anyone' if you'd like the line to match anybody.
# Appending '|plyr' to this field means that the actual line is spoken by the player
# Appending '|other(troop_id)' means that this line is spoken by a third person on the scene.
# (You must make sure that this third person is present on the scene)
#
# 2) Starting dialog-state:
# During a dialog there's always an active Dialog-state.
# A dialog-line's starting dialog state must be the same as the active dialog state, for the line to be a possible candidate.
# If the dialog is started by meeting a party on the map, initially, the active dialog state is "start"
# If the dialog is started by speaking to an NPC in a town, initially, the active dialog state is "start"
# If the dialog is started by helping a party defeat another party, initially, the active dialog state is "party_relieved"
# If the dialog is started by liberating a prisoner, initially, the active dialog state is "prisoner_liberated"
# If the dialog is started by defeating a party led by a hero, initially, the active dialog state is "enemy_defeated"
# If the dialog is started by a trigger, initially, the active dialog state is "event_triggered"
# 3) Conditions block (list): This must be a valid operation block. See header_operations.py for reference.
# 4) Dialog Text (string):
# 5) Ending dialog-state:
# If a dialog line is picked, the active dialog-state will become the picked line's ending dialog-state.
# 6) Consequences block (list): This must be a valid operation block. See header_operations.py for reference.
# 7) Voice-over (string): sound filename for the voice over. Leave here empty for no voice over
####################################################################################################################
dialogs = [
[anyone ,"start", [(store_conversation_troop, "$g_talk_troop"),
(store_conversation_agent, "$g_talk_agent"),
(store_troop_faction, "$g_talk_troop_faction", "$g_talk_troop"),
# (troop_get_slot, "$g_talk_troop_relation", "$g_talk_troop", slot_troop_player_relation),
(call_script, "script_troop_get_player_relation", "$g_talk_troop"),
(assign, "$g_talk_troop_relation", reg0),
#This may be different way to handle persuasion, which might be a little more transparent to the player in its effects
#Persuasion will affect the player's relation with the other character -- but only for 1 on 1 conversations
(store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
(assign, "$g_talk_troop_effective_relation", "$g_talk_troop_relation"),
(val_add, "$g_talk_troop_effective_relation", ":persuasion"),
(try_begin),
(gt, "$g_talk_troop_effective_relation", 0),
(store_add, ":persuasion_modifier", 10, ":persuasion"),
(val_mul, "$g_talk_troop_effective_relation", ":persuasion_modifier"),
(val_div, "$g_talk_troop_effective_relation", 10),
(else_try),
(lt, "$g_talk_troop_effective_relation", 0),
(store_sub, ":persuasion_modifier", 20, ":persuasion"),
(val_mul, "$g_talk_troop_effective_relation", ":persuasion_modifier"),
(val_div, "$g_talk_troop_effective_relation", 20),
(try_end),
(val_clamp, "$g_talk_troop_effective_relation", -100, 101),
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg3, "$g_talk_troop_effective_relation"),
(display_message, "str_test_effective_relation_=_reg3"),
(try_end),
(try_begin),
(this_or_next|is_between, "$g_talk_troop", village_elders_begin, village_elders_end),
(is_between, "$g_talk_troop", mayors_begin, mayors_end),
(party_get_slot, "$g_talk_troop_relation", "$current_town", slot_center_player_relation),
(try_end),
(store_relation, "$g_talk_troop_faction_relation", "$g_talk_troop_faction", "fac_player_faction"),
(assign, "$g_talk_troop_party", "$g_encountered_party"),
(try_begin),
(troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
(troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
(try_end),
# (assign, "$g_talk_troop_kingdom_relation", 0),
# (try_begin),
# (gt, "$players_kingdom", 0),
# (store_relation, "$g_talk_troop_kingdom_relation", "$g_talk_troop_faction", "$players_kingdom"),
# (try_end),
(store_current_hours, "$g_current_hours"),
(troop_get_slot, "$g_talk_troop_last_talk_time", "$g_talk_troop", slot_troop_last_talk_time),
(troop_set_slot, "$g_talk_troop", slot_troop_last_talk_time, "$g_current_hours"),
(store_sub, "$g_time_since_last_talk","$g_current_hours","$g_talk_troop_last_talk_time"),
(troop_get_slot, "$g_talk_troop_met", "$g_talk_troop", slot_troop_met),
(val_min, "$g_talk_troop_met", 1), #the global variable goes no higher than one
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 0),
(troop_set_slot, "$g_talk_troop", slot_troop_met, 1),
#Possible later activations of notes
(try_begin),
(is_between, "$g_talk_troop", kingdom_ladies_begin, kingdom_ladies_end),
(try_end),
(try_end),
(try_begin),
# (this_or_next|eq, "$talk_context", tc_party_encounter),
# (this_or_next|eq, "$talk_context", tc_castle_commander),
(call_script, "script_party_calculate_strength", "p_collective_enemy",0),
(assign, "$g_enemy_strength", reg0),
(call_script, "script_party_calculate_strength", "p_main_party",0),
(assign, "$g_ally_strength", reg0),
(store_mul, "$g_strength_ratio", "$g_ally_strength", 100),
(assign, ":enemy_strength", "$g_enemy_strength"), #these two lines added to avoid div by zero error
(val_max, ":enemy_strength", 1),
(val_div, "$g_strength_ratio", ":enemy_strength"),
(try_end),
(assign, "$g_comment_found", 0),
(assign, "$g_comment_has_rejoinder", 0),
(assign, "$g_romantic_comment_made", 0),
(assign, "$skip_lord_assumes_argument", 0), #a lord pre-empts a player's issue, ie, when the player is conducting a rebellion
(assign, "$bypass_female_vassal_explanation", 0),
(assign, "$g_done_wedding_comment", 0),
# (assign, "$g_time_to_spare", 0),
(try_begin),
(troop_is_hero, "$g_talk_troop"),
(talk_info_show, 1),
(call_script, "script_setup_talk_info"),
(try_end),
(assign, "$g_last_comment_copied_to_s42", 0),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(call_script, "script_get_relevant_comment_to_s42"),
(assign, "$g_comment_found", reg0),
(try_end),
(troop_get_type, reg65, "$g_talk_troop"),
(try_begin),
(faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader,"$g_talk_troop"),
(str_store_string,s64,"@{reg65?my Lady:my Lord}"), #bug fix
(str_store_string,s65,"@{reg65?my Lady:my Lord}"),
(str_store_string,s66,"@{reg65?My Lady:My Lord}"),
(str_store_string,s67,"@{reg65?My Lady:My Lord}"), #bug fix
(else_try),
(str_store_string,s64,"@{reg65?madame:sir}"), #bug fix
(str_store_string,s65,"@{reg65?madame:sir}"),
(str_store_string,s66,"@{reg65?Madame:Sir}"),
(str_store_string,s67,"@{reg65?Madame:Sir}"), #bug fix
(try_end),
(try_begin),
(gt, "$cheat_mode", 0),
(assign, reg4, "$talk_context"),
(display_message, "@{!}DEBUG -- Talk context: {reg4}"),
(try_end),
(try_begin),
(gt, "$cheat_mode", 0),
(assign, reg4, "$g_time_since_last_talk"),
(display_message, "@{!}DEBUG -- Time since last talk: {reg4}"),
(try_end),
(try_begin),
(eq, "$cheat_mode", 0),
(store_partner_quest, ":quest"),
(ge, ":quest", 0),
(str_store_quest_name, s4, ":quest"),
(try_end),
(eq, 1, 0)],
"{!}Warning: This line is never displayed. It is just for storing conversation variables.", "close_window", []],
[anyone ,"member_chat", [
(store_conversation_troop, "$g_talk_troop"),
(try_begin),
(is_between, "$g_talk_troop", companions_begin, companions_end),
(talk_info_show, 1),
(call_script, "script_setup_talk_info_companions"),
(else_try),
(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(talk_info_show, 1),
(call_script, "script_setup_talk_info"),
(try_end),
(troop_get_type, reg65, "$g_talk_troop"),
(troop_get_type, reg65, "$g_talk_troop"),
(try_begin),
(faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader,"$g_talk_troop"),
(str_store_string,s64,"@{reg65?my Lady:my Lord}"), #bug fix
(str_store_string,s65,"@{reg65?my Lady:my Lord}"),
(str_store_string,s66,"@{reg65?My Lady:My Lord}"),
(else_try),
(str_store_string,s64,"@{reg65?madame:sir}"), #bug fix
(str_store_string,s65,"@{reg65?madame:sir}"),
(str_store_string,s66,"@{reg65?Madame:Sir}"),
(try_end),
(store_current_hours, "$g_current_hours"),
(troop_set_slot, "$g_talk_troop", slot_troop_last_talk_time, "$g_current_hours"),
(eq, 1, 0)],
"{!}Warning: This line is never displayed. It is just for storing conversation variables.", "close_window", []],
[anyone ,"event_triggered", [(store_conversation_troop, "$g_talk_troop"),
(try_begin),
(is_between, "$g_talk_troop", companions_begin, companions_end),
(talk_info_show, 1),
(call_script, "script_setup_talk_info_companions"),
(try_end),
(troop_get_type, reg65, "$g_talk_troop"),
(try_begin),
(faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader,"$g_talk_troop"),
(str_store_string,s64,"@{reg65?my Lady:my Lord}"), #bug fix
(str_store_string,s65,"@{reg65?my Lady:my Lord}"),
(str_store_string,s66,"@{reg65?My Lady:My Lord}"),
(else_try),
(str_store_string,s64,"@{reg65?madame:sir}"), #bug fix
(str_store_string,s65,"@{reg65?madame:sir}"),
(str_store_string,s66,"@{reg65?Madame:Sir}"),
(try_end),
(eq, 1, 0)],
"{!}Warning: This line is never displayed. It is just for storing conversation variables.", "close_window", []],
[anyone, "event_triggered",
[
(eq, "$talk_context", tc_give_center_to_fief),
(assign, ":there_are_vassals", 0),
(assign, ":end_cond", active_npcs_end),
(try_for_range, ":troop_no", active_npcs_begin, ":end_cond"),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(neq, "trp_player", ":troop_no"),
(store_troop_faction, ":faction_no", ":troop_no"),
(eq, ":faction_no", "fac_player_supporters_faction"),
(val_add, ":there_are_vassals", 1),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(gt, ":there_are_vassals", 0),
(str_store_string, s2, "str_do_you_wish_to_award_it_to_one_of_your_vassals"),
(else_try),
(str_store_string, s2, "str_who_do_you_wish_to_give_it_to"),
(try_end),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
(str_store_string, s5, "str_sire_my_lady_we_have_taken_s1_s2"),
],
"{!}{s5}", "award_fief_to_vassal",
[]],
[anyone|plyr, "award_fief_to_vassal",
[
(is_between, "$g_player_court", centers_begin, centers_end),
(store_faction_of_party, ":player_court_faction", "$g_player_court"),
(eq, ":player_court_faction", "fac_player_supporters_faction"),
],
"I wish to defer the appointment of a lord, until I take the counsel of my subjects", "award_fief_to_vassal_defer",
[
]],
[anyone, "award_fief_to_vassal_defer",
[
],
"As you wish, {sire/my lady}. You may decide this matter at a later date.", "close_window",
[
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, -1),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
(try_end),
(call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", -1, 0), #-1 for the faction lord in this script is used exclusively in this context
#It is only used because script_give_center_to_faction does not reset the town lord if fac_player_supporters_faction is the attacker
(assign, "$g_center_taken_by_player_faction", -1),
#new start
(try_begin),
(eq, "$g_next_menu", "mnu_castle_taken"),
(jump_to_menu, "$g_next_menu"),
(try_end),
#new end
]],
[anyone|plyr|repeat_for_troops,"award_fief_to_vassal",
[
(store_repeat_object, ":troop_no"),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(neq, "trp_player", ":troop_no"),
(store_troop_faction, ":faction_no", ":troop_no"),
(eq, ":faction_no", "fac_player_supporters_faction"),
(str_store_troop_name, s11, ":troop_no"),
(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", ":troop_no"),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
(str_store_string, s12, "str__promised_fief"),
(else_try),
(str_clear, s12),
(try_end),
(try_begin),
(eq, reg0, 0),
(str_store_string, s1, "str_no_fiefss12"),
(else_try),
(str_store_string, s1, "str_fiefs_s0s12"),
(try_end),
],
"{!}{s11} {s1}.", "award_fief_to_vassal_2",[(store_repeat_object, "$temp")]],
[anyone|plyr, "award_fief_to_vassal",
[
(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "trp_player"),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
(try_begin),
(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(str_store_string, s12, "str_please_s65_"),
(else_try),
(str_clear, s12),
(try_end),
(assign, ":there_are_vassals", 0),
(assign, ":end_cond", active_npcs_end),
(try_for_range, ":troop_no", active_npcs_begin, ":end_cond"),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(neq, "trp_player", ":troop_no"),
(store_troop_faction, ":faction_no", ":troop_no"),
(eq, ":faction_no", "fac_player_supporters_faction"),
(val_add, ":there_are_vassals", 1),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(gt, ":there_are_vassals", 0),
(str_store_string, s2, "str_fiefs_s0"),
(else_try),
(str_clear, s2),
(try_end),
(str_store_string, s5, "str_s12i_want_to_have_s1_for_myself"),
],
"{!}{s5}", "award_fief_to_vassal_2",
[
(assign, "$temp", "trp_player"),
]],
[anyone, "award_fief_to_vassal_2",
[
],
"As you wish, {sire/my lady}. {reg6?I:{reg7?You:{s11}}} will be the new {reg3?lady:lord} of {s1}.", "close_window",
[
(assign, ":new_owner", "$temp"),
(call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", ":new_owner", 0),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
(try_end),
(assign, reg6, 0),
(assign, reg7, 0),
(try_begin),
(eq, ":new_owner", "$g_talk_troop"),
(assign, reg6, 1),
(else_try),
(eq, ":new_owner", "trp_player"),
(assign, reg7, 1),
(else_try),
(str_store_troop_name, s11, ":new_owner"),
(try_end),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
(troop_get_type, reg3, ":new_owner"),
(assign, "$g_center_taken_by_player_faction", -1),
#new start
(try_begin),
(eq, "$g_next_menu", "mnu_castle_taken"),
(jump_to_menu, "$g_next_menu"),
(try_end),
#new end
]],
# Awarding fiefs in rebellion...
[anyone, "event_triggered",
[
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
(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_rebellion",
[]],
[anyone|plyr|repeat_for_troops, "center_captured_rebellion",
[
(store_repeat_object, ":troop_no"),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(neq, "$g_talk_troop", ":troop_no"),
(neq, "trp_player", ":troop_no"),
(store_troop_faction, ":faction_no", ":troop_no"),
(eq, ":faction_no", "fac_player_supporters_faction"),
(str_store_troop_name, s11, ":troop_no"),
(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", ":troop_no"),
(try_begin),
(eq, reg0, 0),
(str_store_string, s1, "@(no fiefs)"),
(else_try),
(str_store_string, s1, "@(fiefs: {s0})"),
(try_end),
],
"{s11}. {s1}", "center_captured_rebellion_2",
[
(store_repeat_object, "$temp"),
]],
[anyone|plyr, "center_captured_rebellion",
[
(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "trp_player"),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
],
"Please {s65}, I want to have {s1} for myself. (fiefs: {s0})", "center_captured_rebellion_2",
[
(assign, "$temp", "trp_player"),
]],
[anyone|plyr, "center_captured_rebellion",
[
(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "$g_talk_troop"),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
],
"{s66}, you should have {s1} for yourself. (fiefs: {s0})", "center_captured_rebellion_2",
[
(assign, "$temp", "$g_talk_troop"),
]],
[anyone, "center_captured_rebellion_2",
[
# (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
# (ge, "$g_center_taken_by_player_faction", 0),
],
"Hmmm. All right, {playername}. I value your counsel highly. {reg6?I:{reg7?You:{s11}}} will be the new {reg3?lady:lord} of {s1}.", "close_window",
[
(assign, ":new_owner", "$temp"),
(call_script, "script_calculate_troop_score_for_center", ":new_owner", "$g_center_taken_by_player_faction"),
(assign, ":new_owner_score", reg0),
(assign, ":total_negative_effect"),
(try_for_range, ":cur_troop", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":cur_faction", ":cur_troop"),
(eq, ":cur_faction", "fac_player_supporters_faction"),
(neq, ":cur_troop", ":new_owner"),
(neg|troop_slot_eq, ":cur_troop", slot_troop_stance_on_faction_issue, ":new_owner"),
(call_script, "script_troop_get_relation_with_troop", ":cur_troop", ":new_owner"),
(lt, reg0, 25),
(call_script, "script_calculate_troop_score_for_center", ":cur_troop", "$g_center_taken_by_player_faction"),
(assign, ":cur_troop_score", reg0),
(gt, ":cur_troop_score", ":new_owner_score"),
(store_sub, ":difference", ":cur_troop_score", ":new_owner_score"),
(store_random_in_range, ":random_dif", 0, ":difference"),
(val_div, ":random_dif", 1000),
(gt, ":random_dif", 0),
(val_add, ":total_negative_effect", ":random_dif"),
(val_mul, ":random_dif", -1),
(call_script, "script_change_player_relation_with_troop", ":cur_troop", ":random_dif"),
(try_end),
(val_mul, ":total_negative_effect", 2),
(val_div, ":total_negative_effect", 3),
(val_add, ":total_negative_effect", 5),
(try_begin),
(neq, ":new_owner", "trp_player"),
(val_min, ":total_negative_effect", 30),
(call_script, "script_change_player_relation_with_troop", ":new_owner", ":total_negative_effect"),
(try_end),
(call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", ":new_owner", 0),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
(try_end),
(assign, reg6, 0),
(assign, reg7, 0),
(try_begin),
(eq, ":new_owner", "$g_talk_troop"),
(assign, reg6, 1),
(else_try),
(eq, ":new_owner", "trp_player"),
(assign, reg7, 1),
(else_try),
(str_store_troop_name, s11, ":new_owner"),
(try_end),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
(troop_get_type, reg3, ":new_owner"),
(assign, "$g_center_taken_by_player_faction", -1),
#new start
(try_begin),
(eq, "$g_next_menu", "mnu_castle_taken"),
(jump_to_menu, "$g_next_menu"),
(try_end),
#new end
]],
#TUTORIAL START
[anyone, "start",
[
(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
(eq, "$g_tutorial_training_ground_conversation_state", 0),
(eq, "$g_tutorial_fighter_talk_before", 0)],
"Hello there. We are polishing off our combat skills here with a bit of sparring practice.\
You look like you could use a bit of training. Why don't you join us, and we can show you a few tricks.\
And if you need explanation of any combat concepts, just ask, and I will do my best to fill you in.", "fighter_talk",
[
(try_begin),
(eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
(assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
(tutorial_message, -1), #remove tutorial intro immediately before a conversation
(try_end),
(assign, "$g_tutorial_fighter_talk_before", 1)]],
[anyone, "start",
[(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
(eq, "$g_tutorial_training_ground_conversation_state", 0)],
"What do you want to practice?", "fighter_talk", []],
[anyone, "fighter_pretalk", [],
"Tell me what kind of practice you want.", "fighter_talk", []],
[anyone|plyr, "fighter_talk",
[],
"I want to practice attacking.", "fighter_talk_train_attack", []],
[anyone|plyr, "fighter_talk",
[],
"I want to practice blocking with my weapon.", "fighter_talk_train_parry", []],
[anyone|plyr, "fighter_talk",
[],
"Let's do some sparring practice.", "fighter_talk_train_combat", []],
[anyone|plyr, "fighter_talk",
[(eq,1,0)],
"{!}TODO: Let's train chamber blocking.", "fighter_talk_train_chamber", []],
[anyone|plyr, "fighter_talk",
[],
"[Leave]", "close_window", []],
[anyone, "fighter_talk_train_attack",
[
(get_player_agent_no, ":player_agent"),
(agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
],
"All right. There are four principle directions for attacking. These are overhead swing, right swing, left swing and thrust.\
Now, I will tell you which direction to attack from and you must try to do the correct attack.\
^^(Move your mouse while you press the left mouse button to specify attack direction. For example, to execute an overhead attack, move the mouse up at the instant you press the left mouse button.\
The icons on your screen will help you do the correct action.)" , "fighter_talk_train_attack_2",
[]],
[anyone|plyr, "fighter_talk_train_attack_2", [],
"Let's begin then. I am ready.", "close_window",
[
(assign, "$g_tutorial_training_ground_melee_trainer_attack", "$g_talk_troop"),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
(assign, "$g_tutorial_training_ground_current_score", 0),
(assign, "$g_tutorial_training_ground_current_score_2", 0),
(assign, "$g_tutorial_update_mouse_presentation", 0),
]],
[anyone|plyr, "fighter_talk_train_attack_2", [],
"Actually I want to do something else.", "fighter_pretalk", []],
[anyone, "fighter_talk_train_attack",
[(str_store_string, s3, "str_tutorial_training_ground_warning_no_weapon")],
"{!}{s3}", "close_window",
[]],
[anyone, "fighter_talk_train_parry",
[
(get_player_agent_no, ":player_agent"),
(agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
],
"Unlike a shield, blocking with a weapon can only stop attacks coming from one direction.\
For example if you block up, you'll deflect overhead attacks, but you can still be hit by side swings or thrust attacks.\
^^(You must press and hold down the right mouse button to block.)", "fighter_talk_train_parry_2", [ ]],
[anyone, "fighter_talk_train_parry_2", [],
"I'll now attack you with different types of strokes, and I will wait until you do the correct block before attacking.\
Try to do the correct block as soon as you can.\
^^(This practice is easy to do with the 'automatic block direction' setting which is the default.\
If you go to the Options menu and change defend direction control to 'mouse movement' or 'keyboard', you'll need to manually choose block direction. This is much more challenging, but makes the game much more interesting.\
This practice can be very useful if you use manual blocking.)", "fighter_talk_train_parry_3",
[]],
[anyone|plyr, "fighter_talk_train_parry_3", [],
"Let's begin then. I am ready.", "close_window",
[
(assign, "$g_tutorial_training_ground_melee_trainer_parry", "$g_talk_troop"),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
(assign, "$g_tutorial_training_ground_current_score", 0),
]],
[anyone|plyr, "fighter_talk_train_parry_3", [],
"Actually I want to do something else.", "fighter_pretalk", []],
[anyone, "fighter_talk_train_parry",
[(str_store_string, s3, "str_tutorial_training_ground_warning_no_weapon")],
"{!}{s3}", "close_window",
[]],
[anyone, "fighter_talk_train_chamber",
[
(get_player_agent_no, ":player_agent"),
(agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
],
"{!}TODO: OK.", "close_window",
[
(assign, "$g_tutorial_training_ground_melee_trainer_chamber", "$g_talk_troop"),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
(assign, "$g_tutorial_training_ground_current_score", 0),
]],
[anyone, "fighter_talk_train_chamber",
[(str_store_string, s3, "str_tutorial_training_ground_warning_no_weapon")],
"{!}{s3}", "close_window",
[]],
[anyone, "fighter_talk_train_combat",
[
(get_player_agent_no, ":player_agent"),
(agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
],
"Sparring is an excellent way to prepare for actual combat.\
We'll fight each other with non-lethal weapons now, until one of us falls to the ground.\
You can get some bruises of course, but better that than being cut down in the real thing.", "fighter_talk_train_combat_2",
[]],
[anyone|plyr, "fighter_talk_train_combat_2", [],
"Let's begin then. I am ready.", "close_window", [
(assign, "$g_tutorial_training_ground_melee_trainer_combat", "$g_talk_troop"),
(assign, "$g_tutorial_training_ground_melee_state", 0),
(assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
]],
[anyone|plyr, "fighter_talk_train_combat_2", [],
"Actually I want to do something else.", "fighter_pretalk", []],
[anyone, "fighter_talk_train_combat",
[(str_store_string, s3, "str_tutorial_training_ground_warning_no_weapon")],
"{!}{s3}", "close_window",
[]],
[anyone, "start",
[(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
(eq, "$g_tutorial_training_ground_conversation_state", 1)], #parry complete
"Good. You were able to block my attacks successfully. You may repeat this practice and try to get faster each time, until you are confident of your defense skills. Do you want to have another go?", "fighter_parry_try_again",
[
(assign, "$g_tutorial_training_ground_conversation_state", 0),
]],
[anyone, "start",
[(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
(eq, "$g_tutorial_training_ground_conversation_state", 2)], #player knocked down in parry
"Well that didn't go too well, did it? (Remember, you must press and hold down the right mouse button to keep your block effective.) Do you want to try again?", "fighter_parry_try_again",
[
(assign, "$g_tutorial_training_ground_conversation_state", 0),
]],
[anyone|plyr, "fighter_parry_try_again",
[],
"Yes. Let's try again.", "fighter_talk_train_parry", []],
[anyone|plyr, "fighter_parry_try_again",
[],
"No, I think I am done for now.", "fighter_talk_leave_parry", []],
[anyone, "start",
[(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
(eq, "$g_tutorial_training_ground_conversation_state", 3)], #trainer knocked down in parry
"Hey! We are doing a blocking practice, mate! You are supposed to block my attacks, not attack me back.", "fighter_parry_warn",
[
(assign, "$g_tutorial_training_ground_conversation_state", 0),
]],
[anyone|plyr, "fighter_parry_warn",
[],
"I am sorry. Let's try once again.", "fighter_talk_train_parry", []],
[anyone|plyr, "fighter_parry_warn",
[],
"Sorry. I must leave this practice now.", "fighter_talk_leave_parry", []],
[anyone, "fighter_talk_leave_parry",
[],
"All right. As you wish.", "close_window", []],
[anyone, "start",
[(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
(eq, "$g_tutorial_training_ground_conversation_state", 4)], #player knocked down in combat
"Well that didn't go too well, did it? Don't feel bad, and try not to do same mistakes next time. Do you want to have a go again?", "fighter_combat_try_again",
[
(assign, "$g_tutorial_training_ground_conversation_state", 0),
]],
[anyone|plyr, "fighter_combat_try_again",
[],
"Yes. Let's do another round.", "fighter_talk_train_combat", []],
[anyone|plyr, "fighter_combat_try_again",
[],
"No. That was enough for me.", "fighter_talk_leave_combat", []],
[anyone, "fighter_talk_leave_combat",
[],
"Well, all right. Talk to me again if you change your mind.", "close_window", []],
[anyone, "start",
[(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
(eq, "$g_tutorial_training_ground_conversation_state", 5)], #trainer knocked down in combat
"Hey, that was good sparring. You defeated me, but next time I'll be more careful. Do you want to have a go again?", "fighter_combat_try_again",
[
(assign, "$g_tutorial_training_ground_conversation_state", 0),
]],
# [anyone, "start",
# [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
# (eq, "$g_tutorial_training_ground_conversation_state", 6)], #chamber complete
# "{!}TODO: Congratulations. Anything else?", "fighter_talk",
# [
# (assign, "$g_tutorial_training_ground_conversation_state", 0),
# ]],
# [anyone, "start",
# [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
# (eq, "$g_tutorial_training_ground_conversation_state", 7)], #player knocked down in chamber
# "{!}TODO: Want to try again?", "fighter_chamber_try_again",
# [
# (assign, "$g_tutorial_training_ground_conversation_state", 0),
# ]],
# [anyone|plyr, "fighter_chamber_try_again",
# [],
# "{!}TODO: OK let's try again.", "fighter_talk_train_chamber", []],
# [anyone|plyr, "fighter_chamber_try_again",
# [],
# "TODO: No, let's leave it there.", "fighter_talk_leave_chamber", []],
# [anyone, "fighter_talk_leave_chamber",
# [],
# "{!}TODO: OK. Bye.", "close_window", []],
[anyone, "start",
[(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
(eq, "$g_tutorial_training_ground_conversation_state", 8)], #trainer knocked down in chamber
"{!}TODO: What are you doing? Don't attack me except while chambering!", "fighter_chamber_warn",
[
(assign, "$g_tutorial_training_ground_conversation_state", 0),
]],
[anyone, "start",
[(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
(eq, "$g_tutorial_training_ground_conversation_state", 9)], #attack complete
"Very good. You have learned how to attack from any direction you want. If you like we can try this again or move to a different exercise.", "fighter_talk",
[
(assign, "$g_tutorial_training_ground_conversation_state", 0),
]],
[anyone|plyr, "fighter_chamber_warn",
[],
"{!}TODO: Sorry, let's try once again.", "fighter_talk_train_chamber", []],
[anyone|plyr, "fighter_chamber_warn",
[],
"{!}TODO: Sorry. I want to leave the exercise.", "fighter_talk_leave_chamber", []],
[trp_tutorial_archer_1|auto_proceed, "start",
[],
"{!}.", "tutorial_troop_default",
[]],
[trp_tutorial_master_archer, "start",
[
(eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 1),
],
"Not bad. Not bad at all! You seem to have grasped the basics of archery. Now, try to do the same thing with a crossbow.\
Take the crossbow and the bolts over there and shoot those three targets. The crossbow is much easier to shoot with compared with the bow,\
but you need to reload it after each shot.", "archer_challenge_2", []],
[trp_tutorial_master_archer, "start",
[
(eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 2),
],
"Good. You didn't have too much difficulty using the crossbow either. Next you will learn to use throwing weapons.\
Pick up the javelins you see over there and try to hit those three targets. ",
"archer_challenge_2", []],
[trp_tutorial_master_archer, "start",
[
(eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 3),
],
"Well, with that you have recevied the basic skills to use all three types of ranged weapons. The rest will come with practice. Train each and every day, and in time you will be as good as the best marksmen in Calradia.",
"ranged_end", []],
[trp_tutorial_master_archer, "ranged_end", [],
"Now, you can go talk with the melee fighters or the horsemanship trainer if you haven't already done so. They can teach you important skills too.",
"close_window", []],
[trp_tutorial_master_archer, "start",
[
(try_begin),
(eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
(assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
(tutorial_message, -1), #remove tutorial intro immediately before a conversation
(try_end),
],
"Good day to you, young fellow. I spend my days teaching about ranged weapons to anyone that is willing to learn.\
If you need a tutor, let me know and I'll teach you how to use the bow, the crossbow and the javelin.", "archer_talk",
[]],
[anyone|plyr, "archer_talk",
[
(eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
],
"Yes, show me how to use ranged weapons.", "archer_challenge", []],
# [anyone|plyr, "archer_talk",
# [
# (gt, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
# ],
# "{!}TODO: I want to move to the next stage.", "archer_challenge", []],
[anyone|plyr, "archer_talk",
[],
"No, not now.", "close_window", []],
[trp_tutorial_master_archer, "archer_challenge",
[
(eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
],
"All right. Your first training will be in bowmanship. The bow is a difficult weapon to master. But once you are sufficiently good at it, you can shoot quickly and with great power.\
Go pick up the bow and arrows you see over there now and shoot those targets.", "archer_challenge_2",
[]],
# [trp_tutorial_master_archer, "archer_challenge",
# [
# (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 1),
# ],
# "{!}TODO: Make 3 shots with crossbow.", "archer_challenge_2",
# []],
# [trp_tutorial_master_archer, "archer_challenge",
# [],
# "{!}TODO: Make 3 shots with javelin.", "archer_challenge_2",
# []],
[anyone|plyr, "archer_challenge_2",
[],
"All right. I am ready.", "close_window",
[
(assign, "$g_tutorial_training_ground_archer_trainer_state", 1),
(try_begin),
(eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
(assign, "$g_tutorial_training_ground_archer_trainer_item_1", "itm_practice_bow"),
(assign, "$g_tutorial_training_ground_archer_trainer_item_2", "itm_practice_arrows"),
(else_try),
(eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 1),
(assign, "$g_tutorial_training_ground_archer_trainer_item_1", "itm_practice_crossbow"),
(assign, "$g_tutorial_training_ground_archer_trainer_item_2", "itm_practice_bolts"),
(else_try),
(assign, "$g_tutorial_training_ground_archer_trainer_item_1", "itm_practice_javelin"),
(assign, "$g_tutorial_training_ground_archer_trainer_item_2", -1),
(try_end),
]],
[anyone|plyr, "archer_challenge_2",
[],
"Just a minute. I want to do something else first.", "close_window",
[]],
[trp_tutorial_master_horseman, "start",
[
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 1),
],
"I hope you enjoyed the ride. Now we move on to something a bit more difficult. Grab the lance you see over there and ride around the course hitting each target at least once.",
"horseman_melee_challenge_2", []],
[trp_tutorial_master_horseman, "start",
[
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 2),
],
"Good! You have been able to hit all targets on horseback. That's no easy feat for a starter. Your next challange will be using a bow and arrows to shoot at the archery targets by the road. You need to put an arrow to each target to consider yourself successful.",
"horseman_melee_challenge_2", []],
[trp_tutorial_master_horseman, "start",
[
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 3),
],
"Very good. You were able to shoot all targets from horseback. Keep riding and practicing each day and in time you will be an expert horseman.", "horsemanship_end",
[
]],
[trp_tutorial_master_horseman, "horsemanship_end",
[
],
"Now, you can go talk with the melee fighters or the archery trainer if you haven't already done so. You need to learn everything you can to be prepared when you have to defend yourself.", "close_window",
[]],
[trp_tutorial_master_horseman, "start",
[
(try_begin),
(eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
(assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
(tutorial_message, -1), #remove tutorial intro immediately before a conversation
(try_end),
],
"Good day! I have come here for some riding practice, but my old bones are aching badly so I decided to give myself a rest today.\
If you would like to practice your horsemanship, you can take my horse here. The exercise would be good for her.", "horseman_talk",
[]],
[anyone|plyr, "horseman_talk",
[],
"Yes, I would like to practice riding.", "horseman_challenge", []],
[anyone|plyr, "horseman_talk",
[],
"Uhm. Maybe later.", "close_window", []],
# [trp_tutorial_master_horseman, "horseman_challenge",
# [
# (eq, "$g_tutorial_training_ground_player_continue_without_basics", 0),
# (this_or_next|eq, "$g_tutorial_training_ground_melee_trainer_attack_completed", 0),
# (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
# ],
# "Hmm. Do you know how to use your weapons? You'd better learn to use those on foot before you start to train using them on horseback.", "horseman_ask",
# []],
# [anyone|plyr, "horseman_ask",
# [],
# "Yes, I know ", "horseman_challenge",
# [
# (assign, "$g_tutorial_training_ground_player_continue_without_basics", 1),
# ]],
# [anyone|plyr, "horseman_ask",
# [],
# "{!}TODO: No", "horseman_ask_2",
# []],
# [trp_tutorial_master_horseman, "horseman_ask_2",
# [],
# "{!}TODO: Come back later then.", "close_window",
# []],
[trp_tutorial_master_horseman, "horseman_challenge",
[
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 0),
],
"Good. Now, I will give you a few exercises that'll teach you riding and horseback weapon use.\
Your first assignment is simple. Just take your horse for a ride around the course.\
Go as slow or as fast as you like.\
Come back when you feel confident as a rider and I'll give you some tougher exercises.", "horseman_melee_challenge_2",
[]],
[anyone|plyr, "horseman_melee_challenge_2",
[],
"All right. I am ready.", "close_window",
[
(assign, "$g_tutorial_training_ground_horseman_trainer_state", 1),
(try_begin),
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 0),
(assign, "$g_tutorial_training_ground_horseman_trainer_item_1", -1),
(assign, "$g_tutorial_training_ground_horseman_trainer_item_2", -1),
(else_try),
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 1),
(assign, "$g_tutorial_training_ground_horseman_trainer_item_1", "itm_arena_lance"),
(assign, "$g_tutorial_training_ground_horseman_trainer_item_2", -1),
(else_try),
(assign, "$g_tutorial_training_ground_horseman_trainer_item_1", "itm_practice_bow_2"),
(assign, "$g_tutorial_training_ground_horseman_trainer_item_2", "itm_practice_arrows_2"),
(try_end),
]],
[anyone|plyr, "horseman_melee_challenge_2",
[],
"Just a minute. I need to do something else first.", "close_window", []],
[trp_tutorial_rider_1|auto_proceed, "start",
[],
"{!}Warning: This line is never displayed.", "tutorial_troop_default",
[]],
[trp_tutorial_rider_2|auto_proceed, "start",
[],
"{!}Warning: This line is never displayed.", "tutorial_troop_default",
[]],
[anyone, "tutorial_troop_default",
[
(try_begin),
(eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
(assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
(tutorial_message, -1), #remove tutorial intro immediately before a conversation
(try_end),
],
"Hey, I am trying to practice here. Go, talk with the archery trainer if you need guidance about ranged weapons.", "close_window", []],
#PRISON BREAK START
[anyone,"start",
[
(eq, "$talk_context", tc_prison_break),
(troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
(troop_slot_ge, "$g_talk_troop", slot_troop_mission_participation, mp_stay_out),
],
"Is there a change of plans?", "lord_prison_break_confirm_3",[]],
[anyone,"start",
[
(eq, "$talk_context", tc_prison_break),
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg0, "$g_talk_troop"),
(assign, reg1, "$g_encountered_party"),
(troop_get_slot, reg2, "$g_talk_troop", slot_troop_prisoner_of_party),
(display_message, "@{!}g_talk_troop = {reg0} , g_encountered_party = {reg1} , slot value = {reg2}"),
(try_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
],
"What's going on?", "lord_prison_break",[]],
#TAVERN DRUNK DIALOGS
[anyone, "start",
[
(eq, "$g_talk_troop", "trp_belligerent_drunk"),
],
"What are you looking at?", "drunk_response",
[
(try_begin),
(eq, "$g_main_attacker_agent", 0),
(call_script, "script_activate_tavern_attackers"),
(try_end),
(mission_disable_talk),
]],
[anyone, "start",
[
(eq, "$g_talk_troop", "trp_hired_assassin"),
],
"Are you looking at me?", "drunk_response",
[
(try_begin),
(eq, "$g_main_attacker_agent", 0),
(call_script, "script_activate_tavern_attackers"),
(try_end),
(mission_disable_talk),
]],
[anyone, "start",
[
(eq, "$g_talk_troop", "trp_hired_assassin"),
(eq,1,0),
],
"{!}Added to match dialog ids with translations.", "close_window",
[]],
[anyone, "start", [
(is_between, "$g_talk_troop", tavernkeepers_begin, tavernkeepers_end),
(gt, "$g_main_attacker_agent", 0),
(neg|agent_is_alive, "$g_main_attacker_agent"),
(try_begin),
(neg|agent_is_alive, "$g_main_attacker_agent"),
(agent_get_troop_id, ":type", "$g_main_attacker_agent"),
(eq, ":type", "trp_hired_assassin"),
(str_store_string, s9, "str_strange_that_one_didnt_seem_like_your_ordenary_troublemaker_he_didnt_drink_all_that_much__he_just_stood_there_quietly_and_watched_the_door_you_may_wish_to_consider_whether_you_have_any_enemies_who_know_you_are_in_town_a_pity_that_blood_had_to_be_spilled_in_my_establishment"),
(assign, "$g_main_attacker_agent", 0),
(troop_add_gold, "trp_player", 50),
(troop_add_item, "trp_player", "itm_sword_viking_1", 0),
(else_try),
#(display_message, "str_wielded_item_reg3"),
(lt, "$g_attacker_drawn_weapon", "itm_tutorial_spear"),
(str_store_string, s9, "str_you_never_let_him_draw_his_weapon_still_it_looked_like_he_was_going_to_kill_you_take_his_sword_and_purse_i_suppose_he_was_trouble_but_its_not_good_for_an_establishment_to_get_a_name_as_a_place_where_men_are_killed"),
(assign, "$g_main_attacker_agent", 0),
(troop_add_gold, "trp_player", 50),
(troop_add_item, "trp_player", "itm_sword_viking_1", 0),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -1),
(else_try),
(neg|agent_is_alive, "$g_main_attacker_agent"),
(str_store_string, s9, "str_well_id_say_that_he_started_it_that_entitles_you_to_his_sword_and_purse_i_suppose_have_a_drink_on_the_house_as_i_daresay_youve_saved_a_patron_or_two_a_broken_skull_still_i_hope_he_still_has_a_pulse_its_not_good_for_an_establishment_to_get_a_name_as_a_place_where_men_are_killed"),
(assign, "$g_main_attacker_agent", 0),
(troop_add_gold, "trp_player", 50),
(troop_add_item, "trp_player", "itm_sword_viking_1", 0),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
(try_end),
(troop_set_slot, "trp_hired_assassin", slot_troop_cur_center, -1),
],
"{!}{s9}", "player_duel_response", [
]],
[anyone, "start", [
(is_between, "$g_talk_troop", tavernkeepers_begin, tavernkeepers_end),
(gt, "$g_main_attacker_agent", 0),
(try_begin),
(get_player_agent_no, ":player_agent"),
(agent_get_wielded_item, ":wielded_item", ":player_agent", 0),
(is_between, ":wielded_item", "itm_darts", "itm_torch"),
(neq, ":wielded_item", "itm_javelin_melee"),
(neq, ":wielded_item", "itm_throwing_spear_melee"),
(neq, ":wielded_item", "itm_jarid_melee"),
(neq, ":wielded_item", "itm_light_throwing_axes_melee"),
(neq, ":wielded_item", "itm_throwing_axes_melee"),
(neq, ":wielded_item", "itm_heavy_throwing_axes_melee"),
(str_store_string, s9, "str_stop_no_shooting_no_shooting"),
(assign, ":default_item", -1),
(troop_get_inventory_capacity, ":end_cond", "trp_player"),
(try_for_range, ":i_slot", 0, ":end_cond"),
(troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
(is_between, ":item_id", weapons_begin, weapons_end),
(neg|is_between, ":item_id", ranged_weapons_begin, ranged_weapons_end),
(assign, ":default_item", ":item_id"),
(assign, ":end_cond", 0), #break
(try_end),
(agent_set_wielded_item, ":player_agent", ":default_item"),
(else_try),
(str_store_string, s9, "str_em_ill_stay_out_of_this"),
(try_end),
],
"{!}{s9}", "close_window", [
]],
[anyone|plyr, "player_duel_response", [],
"Such a waste...", "close_window", [
]],
[anyone|plyr, "player_duel_response", [],
"Better him than me", "close_window", [
]],
[anyone|plyr, "drunk_response", [],
"I'm not sure... Some sort of animal, clearly", "drunk_fight_start", [
]],
[anyone|plyr, "drunk_response", [],
"Excuse me -- please accept my apologies", "drunk_fight_start", [
]],
[anyone, "drunk_fight_start", [],
"I'll wipe that smirk right off your face!", "close_window", [
(troop_set_slot, "trp_belligerent_drunk", slot_troop_cur_center, 0),
]],
[anyone|plyr, "drunk_response",
[
(troop_slot_ge, "trp_player", slot_troop_renown, 150),
],
"Do you have any idea who I am?", "drunk_player_high_renown", [
]],
[anyone, "drunk_player_high_renown", [
(eq, "$g_talk_troop", "trp_hired_assassin"),
],
"Do I care?", "drunk_fight_start", [
]],
[anyone, "drunk_player_high_renown", [],
"Emmm... Actually... Yes, yes, I do know who you are, {sir/madame}. Please forgive me, your grace -- it must be the drink. I'll be leaving, now...", "drunk_player_high_renown", [
]],
[anyone|plyr, "drunk_player_high_renown", [],
"Why, if you want a fight, you shall have one!", "drunk_fight_start", [
]],
[anyone|plyr, "drunk_player_high_renown", [],
"I thought as much. Now, remove yourself from here", "close_window",
[
(assign, "$drunks_dont_pick_fights", 1),
(troop_set_slot, "trp_belligerent_drunk", slot_troop_cur_center, 0),
(call_script, "script_deactivate_tavern_attackers"),
(assign, "$g_belligerent_drunk_leaving", "$g_main_attacker_agent"),
(mission_enable_talk),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_get_position, pos4, ":agent"),
(agent_set_scripted_destination, ":agent", pos4),
(try_end),
(entry_point_get_position, pos1, 0),
(agent_set_scripted_destination, "$g_main_attacker_agent", pos1),
(assign, "$g_main_attacker_agent", 0),
]],
[anyone, "start",
[
(eq, "$g_talk_troop", "trp_fight_promoter"),
],
"You look like a {fellow/lady} who can take a few hard knocks -- and deal them out, too. I have a business proposition for you.", "fistfight_response", [
]],
[anyone|plyr, "fistfight_response", [],
"How's that?", "fistfight_response_2", [
]],
[anyone, "fistfight_response_2", [
],
"Good -- I'm glad you're interested. Here's the plan... It's a little complicated, so listen well. ", "fistfight_response_2a", [
]],
[anyone, "fistfight_response_2a", [
],
"You and this other fellow will start up a fight here. No weapons, no armor -- I'll sit back and take bets, and split the profits with the winner. If we make a loss, then I'll cover it. You've got nothing to lose -- except a bit of blood, of course.", "fistfight_response_3", [
]],
[anyone, "fistfight_response_3", [
],
"However, we can't organize this like one of those nice arena bouts, where everyone places their bets beforehand. People will walk in, drawn by the noise, and put a denar or two on whichever one of your two they think is winning. I'll give 'em even odds -- anything else is going to be too tricky for someone who's already on his third flagon of ale.", "fistfight_response_4", [
]],
[anyone, "fistfight_response_4", [
],
"So, as you can see, the trick is to stretch things out for as long as possible where it looks like you're losing, and people bet against you -- and then come back fast, and win, before the betting can turn. The best way to make money is for you to be battered almost to the floor, and then jump back off your feet and take the other guy down. However, you have to win in the end in order for me, and you, to make money. ", "fistfight_response_4a", [
]],
[anyone, "fistfight_response_4a", [
],
"Also, you can't stretch the fight out too long, or people will suspect a fix. So, one of you has to take a punch every so often. I don't care whose blood is spilled, but there has to be some blood.", "fistfight_response_5", [
]],
[anyone, "fistfight_response_5", [
],
"And one other thing -- my mate, your opponent, he doesn't take to well to complexity. So he's just going to come straight at you. It's up to you to supply the artistry.", "fistfight_response_5a", [
]],
[anyone, "fistfight_response_5a", [
],
"So, what do you think?", "fistfight_response_confirm", [
]],
[anyone|plyr, "fistfight_response_confirm", [
],
"{!}[Yes -- not yet implemented]", "close_window", [
]],
[anyone|plyr, "fistfight_response_confirm", [
],
"I have better things to do", "close_window", [
]],
[trp_ramun_the_slave_trader, "start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 0),
], "Good day to you, {young man/lassie}.", "ramun_introduce_1",[]],
[trp_ramun_the_slave_trader|plyr, "ramun_introduce_1", [], "Forgive me, you look like a trader, but I see none of your merchandise.", "ramun_introduce_2",[
(troop_set_slot, "$g_talk_troop", slot_troop_met_previously, 1),
]],
[trp_ramun_the_slave_trader|plyr, "ramun_introduce_1", [], "Never mind.", "close_window",[]],
[trp_ramun_the_slave_trader, "ramun_introduce_2", [], "A trader? Oh, aye, I certainly am that.\
My merchandise is a bit different from most, however. It has to be fed and watered twice a day and tries to run away if I turn my back.", "ramun_introduce_3",[]],
[trp_ramun_the_slave_trader|plyr, "ramun_introduce_3", [], "Livestock?", "ramun_introduce_4",[]],
[trp_ramun_the_slave_trader, "ramun_introduce_4", [], "Close enough. I like to call myself the man who keeps every boat on this ocean moving.\
Boats are driven by oars, you see, and oars need men to pull them or they stop. That's where I come in.", "ramun_introduce_5",[]],
[trp_ramun_the_slave_trader|plyr, "ramun_introduce_5", [], "Galley slaves.", "ramun_introduce_6",[]],
[trp_ramun_the_slave_trader, "ramun_introduce_6", [], "Now you're catching on! A trading port like this couldn't survive without them.\
The ships lose a few hands on every voyage, so there's always a high demand. The captains come to me and they pay well.", "ramun_introduce_7",[]],
[trp_ramun_the_slave_trader|plyr, "ramun_introduce_7", [], "Where do the slaves come from?", "ramun_introduce_8",[]],
[trp_ramun_the_slave_trader, "ramun_introduce_8", [], "Mostly I deal in convicted criminals bought from the authorities.\
Others are prisoners of war from various nations, brought to me because I offer the best prices.\
However, on occasion I'll buy from privateers and other . . . 'individuals'. You can't be picky about your suppliers in this line of work.\
You wouldn't happen to have any prisoners with you, would you?", "ramun_introduce_9",[]],
[trp_ramun_the_slave_trader|plyr, "ramun_introduce_9", [], "Me? ", "ramun_introduce_10",[]],
[trp_ramun_the_slave_trader, "ramun_introduce_10", [], "Why not? If you intend to set foot outside this town,\
you're going to cross swords with someone sooner or later. And, God willing, you'll come out on top.\
Why not make some extra money off the whole thing? Take them alive, bring them back to me, and I'll pay you fifty denars for each head.\
Don't much care who they are or where they come from.", "ramun_introduce_11",[]],
[trp_ramun_the_slave_trader|plyr, "ramun_introduce_11", [], "Hmm. I'll think about it.", "ramun_introduce_12",[]],
[trp_ramun_the_slave_trader, "ramun_introduce_12", [], "Do think about it!\
There's a lot of silver to be made, no mistake. More than enough for the both of us.", "close_window",[]],
[trp_ramun_the_slave_trader,"start", [], "Hello, {playername}.", "ramun_talk",[]],
[trp_ramun_the_slave_trader,"ramun_pre_talk", [], "Anything else?", "ramun_talk",[]],
[trp_ramun_the_slave_trader|plyr,"ramun_talk",
[[store_num_regular_prisoners,reg(0)],[ge,reg(0),1]],
"I've brought you some prisoners, Ramun. Would you like a look?", "ramun_sell_prisoners",[]],
[trp_ramun_the_slave_trader,"ramun_sell_prisoners", [],
"Let me see what you have...", "ramun_sell_prisoners_2",
[[change_screen_trade_prisoners]]],
[trp_ramun_the_slave_trader, "ramun_sell_prisoners_2", [], "A pleasure doing business with you.", "close_window",[]],
[trp_ramun_the_slave_trader|plyr,"ramun_talk", [(neg|troop_slot_ge,"$g_talk_troop",slot_troop_met_previously,1)], "How do I take somebody as prisoner?", "ramun_ask_about_capturing",[]],
[trp_ramun_the_slave_trader|plyr,"ramun_talk", [(troop_slot_ge,"$g_talk_troop", slot_troop_met_previously, 1)], "Can you tell me again about capturing prisoners?", "ramun_ask_about_capturing",[(troop_set_slot,"$g_talk_troop", slot_troop_met_previously, 2)]],
[trp_ramun_the_slave_trader,"ramun_ask_about_capturing", [(neg|troop_slot_ge,"$g_talk_troop",slot_troop_met_previously,1)],
"You're new to this, aren't you? Let me explain it in simple terms.\
The basic rule of taking someone prisoner is knocking him down with a blunt weapon, like a mace or a club,\
rather than cutting him open with a sword. That way he goes to sleep for a little while rather than bleeding to death, you see?\
I'm assuming you have a blunt weapon with you . . .", "ramun_have_blunt_weapon",[]],
[trp_ramun_the_slave_trader|plyr,"ramun_have_blunt_weapon", [],
"Of course.", "ramun_have_blunt_weapon_yes",[]],
[trp_ramun_the_slave_trader|plyr,"ramun_have_blunt_weapon", [],
"As a matter of fact, I don't.", "ramun_have_blunt_weapon_no",[]],
[trp_ramun_the_slave_trader,"ramun_have_blunt_weapon_yes", [],
"Good. Then all you need to do is beat the bugger down with your weapon, and when the fighting's over you clap him in irons.\
It's a bit different for nobles and such, they tend to be protected enough that it won't matter what kind of weapon you use,\
but your average rabble-rouser will bleed like a stuck pig if you get him with something sharp. I don't have many requirements in my merchandise,\
but I do insist they be breathing when I buy them.", "ramun_ask_about_capturing_2",[]],
[trp_ramun_the_slave_trader,"ramun_have_blunt_weapon_no", [],
"No? Heh, well, this must be your lucky day. I've got an old club lying around that I was going to throw away.\
It a bit battered, but still good enough bash someone until he stops moving.\
Here, have it.","ramun_have_blunt_weapon_no_2",[(troop_add_item, "trp_player","itm_club",imod_cracked)]],
[trp_ramun_the_slave_trader|plyr,"ramun_have_blunt_weapon_no_2", [],
"Thanks, Ramun. Perhaps I may try my hand at it.", "ramun_have_blunt_weapon_yes",[]],
[trp_ramun_the_slave_trader,"ramun_ask_about_capturing", [],
"Alright, I'll try and expain it again in simple terms. The basic rule of taking someone prisoner is knocking him down with a blunt weapon, like a mace or a club,\
rather than cutting him open with a sword. That way he goes to sleep for a little while rather than bleeding to death, you see?\
It's a bit different for nobles and such, they tend to be protected enough that it won't matter what kind of weapon you use,\
but your average rabble-rouser will bleed like a stuck pig if you get him with something sharp.", "ramun_ask_about_capturing_2",[]],
[trp_ramun_the_slave_trader|plyr,"ramun_ask_about_capturing_2", [], "Alright, I think I understand. Anything else?", "ramun_ask_about_capturing_3",[]],
[trp_ramun_the_slave_trader,"ramun_ask_about_capturing_3", [],
"Well, it's not as simple as all that. Blunt weapons don't do as much damage as sharp ones, so they won't bring your enemies down as quickly.\
And trust me, given the chance, most of the scum you run across would just as soon kill you as look at you, so don't expect any courtesy when you pull out a club instead of a sword.\
Moreover, having to drag prisoners to and fro will slow down your party, which is why some people simply set their prisoners free after the fighting's done.\
It's madness. How could anyone turn down all that silver, eh?", "ramun_ask_about_capturing_4",[]],
[trp_ramun_the_slave_trader|plyr,"ramun_ask_about_capturing_4", [],
"Is that everything?", "ramun_ask_about_capturing_5",[]],
[trp_ramun_the_slave_trader,"ramun_ask_about_capturing_5", [],
"Just one final thing. Managing prisoners safely is not an easy thing to do, you could call it a skill in itself.\
If you want to capture a lot of prisoners, you should try and learn the tricks of it yourself,\
or you won't be able to hang on to a single man you catch.", "ramun_ask_about_capturing_7",[]],
[trp_ramun_the_slave_trader|plyr,"ramun_ask_about_capturing_7", [],
"Thanks, I'll keep it in mind.", "ramun_pre_talk",[]],
[trp_ramun_the_slave_trader|plyr,"ramun_talk", [], "I'd better be going.", "ramun_leave",[]],
[trp_ramun_the_slave_trader,"ramun_leave", [], "Remember, any prisoners you've got, bring them to me. I'll pay you good silver for every one.", "close_window",[]],
[trp_nurse_for_lady, "start", [
# (eq, "$talk_context", tc_garden),
], "I humbly request that your lordship keeps his hands where I can see them.", "close_window",[]],
## [trp_tutorial_trainer, "start", [(eq, "$tutorial_1_state", 1),], "TODO: Watch me.", "tutorial_1_1_1",[]],
## [trp_tutorial_trainer, "tutorial_1_1_1", [], "TODO: This is up.", "tutorial_1_1_2",[(agent_set_attack_action, "$g_talk_agent", 3),]],
## [trp_tutorial_trainer, "tutorial_1_1_2", [], "TODO: This is left.", "tutorial_1_1_3",[(agent_set_attack_action, "$g_talk_agent", 2),]],
## [trp_tutorial_trainer, "tutorial_1_1_3", [], "TODO: This is right.", "tutorial_1_1_4",[(agent_set_attack_action, "$g_talk_agent", 1),]],
## [trp_tutorial_trainer|plyr, "tutorial_1_1_4", [], "TODO: OK.", "close_window",[]],
#old tutorial is below
## [trp_tutorial_trainer,"start", [(eq, "$tutorial_quest_award_taken", 1),], "I think you have trained enough. Perhaps you should go to Zendar for the next step of your adventure.", "close_window",[]],
## [trp_tutorial_trainer,"start", [(store_character_level, ":player_level", "trp_player"),(gt, ":player_level", 1)], "I think you have trained enough. Perhaps you should go to Zendar for the next step of your adventure.", "close_window",[]],
## [trp_tutorial_trainer,"start", [(eq, "$tutorial_quest_taken", 0),], "Greetings stranger. What's your name?", "tutorial1_1",[]],
## [trp_tutorial_trainer|plyr, "tutorial1_1", [], "Greetings sir, it's {playername}.", "tutorial1_2", []],
## [trp_tutorial_trainer, "tutorial1_2", [], "Well {playername}, this place you see is the training ground. Locals come here to practice their combat skills. Since you are here you may have a go as well.", "tutorial1_3", []],
## [trp_tutorial_trainer|plyr, "tutorial1_3", [], "I'd like that very much sir. Thank you.", "tutorial1_4", []],
## [trp_tutorial_trainer, "tutorial1_4", [], "You will learn the basics of weapons and riding a horse here.\
## First you'll begin with melee weapons. Then you'll enter an archery range to test your skills. And finally you'll see a horse waiting for you.\
## I advise you to train in all these 3 areas. But you can skip some of them, it's up to you.", "tutorial1_6", []],
## [trp_tutorial_trainer, "tutorial1_6", [], "Tell you what, if you destroy at least 10 dummies while training, I will give you my old knife as a reward. It's a little rusty but it's a good blade.", "tutorial1_7", []],
## [trp_tutorial_trainer|plyr, "tutorial1_7", [], "Sounds nice, I'm ready for training.", "tutorial1_9", []],
## [trp_tutorial_trainer, "tutorial1_9", [], "Good. Return to me when you have earned your reward.", "close_window", [(eq, "$tutorial_quest_taken", 0),
## (str_store_troop_name, 1, "trp_tutorial_trainer"),
## (str_store_party_name, 2, "p_training_ground"),
## (setup_quest_giver, "qst_destroy_dummies", "str_given_by_s1_at_s2"),
## (str_store_string, s2, "@Trainer ordered you to destroy 10 dummies in the training camp."),
## (call_script, "script_start_quest", "qst_destroy_dummies", "$g_talk_troop"),
## (assign, "$tutorial_quest_taken", 1)]],
##
## [trp_tutorial_trainer,"start", [(eq, "$tutorial_quest_taken", 1),
## (eq, "$tutorial_quest_succeeded", 1),], "Well done {playername}. Now you earned this knife. There you go.", "tutorial2_1",[]],
## [trp_tutorial_trainer|plyr, "tutorial2_1", [], "Thank you master.", "close_window", [(call_script, "script_end_quest", "qst_destroy_dummies"),(assign, "$tutorial_quest_award_taken", 1),(add_xp_to_troop, 100, "trp_player"),(troop_add_item, "trp_player","itm_knife",imod_chipped),]],
##
## [trp_tutorial_trainer,"start", [(eq, "$tutorial_quest_taken", 1),
## (eq, "$tutorial_quest_succeeded", 1),], "Greetings {playername}. Feel free to train with the targets.", "tutorial2_1",[]],
##
## [trp_tutorial_trainer,"start", [(eq, "$tutorial_quest_taken", 1),
## (eq, "$tutorial_quest_succeeded", 0),], "I don't see 10 dummies on the floor from here. You haven't earned your reward yet.", "tutorial3_1",[]],
## [trp_tutorial_trainer|plyr, "tutorial3_1", [], "Alright alright, I was just tired and wanted to talk to you while resting.", "tutorial3_2", []],
## [trp_tutorial_trainer, "tutorial3_2", [], "Less talk, more work.", "close_window", []],
## [party_tpl|pt_peasant,"start", [(eq,"$talk_context",tc_party_encounter)], "Greetings traveller.", "peasant_talk_1",[(play_sound,"snd_encounter_farmers")]],
## [party_tpl|pt_peasant|plyr,"peasant_talk_1", [[eq,"$quest_accepted_zendar_looters"]], "Greetings to you too.", "close_window",[(assign, "$g_leave_encounter",1)]],
## [party_tpl|pt_peasant|plyr,"peasant_talk_1", [[neq,"$quest_accepted_zendar_looters"],[eq,"$peasant_misunderstanding_said"]], "I have been charged with hunting down outlaws in this area...", "peasant_talk_2",[[assign,"$peasant_misunderstanding_said",1]]],
## [party_tpl|pt_peasant|plyr,"peasant_talk_1", [[neq,"$quest_accepted_zendar_looters"],[neq,"$peasant_misunderstanding_said"]], "Greetings. I am hunting outlaws. Have you seen any around here?", "peasant_talk_2b",[]],
## [party_tpl|pt_peasant,"peasant_talk_2", [], "I swear to God {sir/madam}. I am not an outlaw... I am just a simple peasant. I am taking my goods to the market, see.", "peasant_talk_3",[]],
## [party_tpl|pt_peasant|plyr,"peasant_talk_3", [], "I was just going to ask if you saw any outlaws around here.", "peasant_talk_4",[]],
## [party_tpl|pt_peasant,"peasant_talk_4", [], "Oh... phew... yes, outlaws are everywhere. They are making life miserable for us.\
## I pray to God you will kill them all.", "close_window",[(assign, "$g_leave_encounter",1)]],
## [party_tpl|pt_peasant,"peasant_talk_2b", [], "Outlaws? They are everywhere. They are making life miserable for us.\
## I pray to God you will kill them all.", "close_window",[(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_manhunters,"start", [(eq,"$talk_context",tc_party_encounter)], "Hey, you there! You seen any outlaws around here?", "manhunter_talk_b",[]],
[party_tpl|pt_manhunters|plyr,"manhunter_talk_b", [], "Yes, they went this way about an hour ago.", "manhunter_talk_b1",[]],
[party_tpl|pt_manhunters,"manhunter_talk_b1", [], "I knew it! Come on, lads, lets go get these bastards! Thanks a lot, friend.", "close_window",[(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_manhunters|plyr,"manhunter_talk_b", [], "No, haven't seen any outlaws lately.", "manhunter_talk_b2",[]],
[party_tpl|pt_manhunters,"manhunter_talk_b2", [], "Bah. They're holed up in this country like rats, but we'll smoke them out yet. Sooner or later.", "close_window",[(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_looters|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker),], "{!}Warning: This line should never be displayed.", "looters_1",[
(str_store_string, s11, "@It's your money or your life, {mate/girlie}. No sudden moves or we'll run you through."),
(str_store_string, s12, "@Lucky for you, you caught me in a good mood. Give us all your coin and I might just let you live."),
(str_store_string, s13, "@This a robbery, eh? I givin' you one chance to hand over everythin' you got, or me and my mates'll kill you. Understand?"),
(store_random_in_range, ":random", 11, 14),
(str_store_string_reg, s4, ":random"),
(play_sound, "snd_encounter_looters")
]],
[party_tpl|pt_looters,"looters_1", [], "{s4}", "looters_2",[]],
[party_tpl|pt_looters|plyr,"looters_2", [[store_character_level,reg(1),"trp_player"],[lt,reg(1),4]], "I'm not afraid of you lot. Fight me if you dare!", "close_window",
[[encounter_attack]]],
[party_tpl|pt_looters|plyr,"looters_2", [[store_character_level,reg(1),"trp_player"],[ge,reg(1),4]], "You'll have nothing of mine but cold steel, scum.", "close_window",
[[encounter_attack]]],
[party_tpl|pt_village_farmers,"start", [(eq,"$talk_context",tc_party_encounter),
(agent_play_sound, "$g_talk_agent", "snd_encounter_farmers"),
],
" My {lord/lady}, we're only poor farmers from the village of {s11}. {reg1?We are taking our products to the market at {s12}.:We are returning from the market at {s12} back to our village.}", "village_farmer_talk",
[(party_get_slot, ":target_center", "$g_encountered_party", slot_party_ai_object),
(party_get_slot, ":home_center", "$g_encountered_party", slot_party_home_center),
(party_get_slot, ":market_town", ":home_center", slot_village_market_town),
(str_store_party_name, s11, ":home_center"),
(str_store_party_name, s12, ":market_town"),
(assign, reg1, 1),
(try_begin),
(party_slot_eq, ":target_center", slot_party_type, spt_village),
(assign, reg1, 0),
(try_end),
]],
[anyone|plyr,"village_farmer_talk",
[(check_quest_active, "qst_track_down_bandits"),
(neg|check_quest_succeeded, "qst_track_down_bandits"),
], "I am hunting a group of bandits with the following description... Have you seen them?", "farmer_bandit_information",[]],
[anyone,"farmer_bandit_information", [
(call_script, "script_get_manhunt_information_to_s15", "qst_track_down_bandits"),
], "{s15}", "village_farmer_talk",[]],
[anyone|plyr,"village_farmer_talk",
[
(store_faction_of_party, ":faction_of_villager", "$g_encountered_party"),
(neq, ":faction_of_villager", "$players_kingdom"),
(neq, ":faction_of_villager", "fac_player_supporters_faction"),
],
"We'll see how poor you are after I take what you've got!", "close_window",
[(party_get_slot, ":home_center", "$g_encountered_party", slot_party_home_center),
(party_get_slot, ":market_town", ":home_center", slot_village_market_town),
(party_get_slot, ":village_owner", ":home_center", slot_town_lord),
(call_script, "script_change_player_relation_with_center", ":home_center", -4),
(call_script, "script_change_player_relation_with_center", ":market_town", -2),
(call_script, "script_change_player_relation_with_troop", ":village_owner", -2),
(call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
(store_relation,":rel", "$g_encountered_party_faction","fac_player_supporters_faction"),
(try_begin),
(gt, ":rel", 0),
(val_sub, ":rel", 5),
(try_end),
(val_sub, ":rel", 3),
(call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", ":rel"),
(assign,"$encountered_party_hostile",1),
(assign,"$encountered_party_friendly",0),
]],
[anyone|plyr,"village_farmer_talk", [], "Carry on, then. Farewell.", "close_window",[(assign, "$g_leave_encounter",1)]],
### COMPANIONS
[anyone,"start", [(gt,"$g_talk_troop", 0),
(eq, "$g_talk_troop", "$g_player_minister"),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop")],
"I am at your service, {sire/my lady}", "minister_issues",[]],
[anyone,"start", [(eq,"$g_talk_troop", "trp_temporary_minister"),
(neq, "$g_talk_troop", "$g_player_minister")],
"It has been an honor to serve you, {sire/my lady}", "close_window",[]],
[anyone,"start", [(troop_slot_eq,"$g_talk_troop", slot_troop_occupation, slto_player_companion),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle),
(party_get_num_companion_stacks, ":num_stacks", "$g_encountered_party"),
(ge, ":num_stacks", 1),
(party_stack_get_troop_id, ":castle_leader", "$g_encountered_party", 0),
(eq, ":castle_leader", "$g_talk_troop"),
(eq, "$talk_context", 0)],
"Yes, {playername}? What can I do for you?", "member_castellan_talk",[]],
[anyone,"member_castellan_pretalk", [], "Anything else?", "member_castellan_talk",[]],
[anyone|plyr,"member_castellan_talk", [],
"I want to review the castle garrison.", "member_review_castle_garrison",[]],
[anyone,"member_review_castle_garrison", [], "Of course. Here are our lists, let me know of any changes you require...", "member_castellan_pretalk",[(change_screen_exchange_members,0)]],
[anyone|plyr,"member_castellan_talk", [],
"Let me see your equipment.", "member_review_castellan_equipment",[]],
[anyone,"member_review_castellan_equipment", [], "Very well, it's all here...", "member_castellan_pretalk",[(change_screen_equip_other)]],
[anyone|plyr,"member_castellan_talk", [],
"I want you to abandon the castle and join my party.", "member_castellan_join",[]],
[anyone,"member_castellan_join", [(party_can_join_party,"$g_encountered_party","p_main_party")],
"I've grown quite fond of the place... But if it is your wish, {playername}, I'll come with you.", "close_window", [
(assign, "$g_move_heroes", 1),
(call_script, "script_party_add_party", "p_main_party", "$g_encountered_party"),
(party_clear, "$g_encountered_party"),
]],
[anyone,"member_castellan_join", [],
"And where would we sleep? You're dragging a whole army with you, {playername}, there's no more room for all of us.", "member_castellan_pretalk",[]],
[anyone|plyr,"member_castellan_talk", [], "[Leave]", "close_window",[]],
[anyone,"start", [(troop_slot_eq,"$g_talk_troop", slot_troop_occupation, slto_player_companion),
(neg|main_party_has_troop,"$g_talk_troop"),
(eq, "$talk_context", tc_party_encounter)],
"Do you want me to rejoin you?", "member_wilderness_talk",[]],
[anyone,"start", [(neg|main_party_has_troop,"$g_talk_troop"),(eq, "$g_encountered_party", "p_four_ways_inn")], "Do you want me to rejoin you?", "member_inn_talk",[]],
# [anyone,"member_separate_inn", [], "I don't know what you will do without me, but you are the boss. I'll wait for you at the Four Ways inn.", "close_window",
# [anyone,"member_separate_inn", [], "All right then. I'll meet you at the four ways inn. Good luck.", "close_window",
# [(remove_member_from_party,"$g_talk_troop", "p_main_party"),(add_troop_to_site, "$g_talk_troop", "scn_four_ways_inn", borcha_inn_entry)]],
#Quest heroes member chats
[trp_kidnapped_girl,"member_chat", [], "Are we home yet?", "kidnapped_girl_chat_1",[]],
[trp_kidnapped_girl|plyr,"kidnapped_girl_chat_1", [], "Not yet.", "kidnapped_girl_chat_2",[]],
[trp_kidnapped_girl,"kidnapped_girl_chat_2", [], "I can't wait to get back. I've missed my family so much, I'd give anything to see them again.", "close_window",[]],
[anyone,"member_chat",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
], "{playername}, when do you think we can reach our destination?", "member_lady_1",[]],
[anyone|plyr, "member_lady_1", [], "We still have a long way ahead of us.", "member_lady_2a", []],
[anyone|plyr, "member_lady_1", [], "Very soon. We're almost there.", "member_lady_2b", []],
[anyone ,"member_lady_2a", [], "Ah, I am going to enjoy the road for a while longer then. I won't complain.\
I find riding out in the open so much more pleasant than sitting in the castle all day.\
You know, I envy you. You can live like this all the time.", "close_window", []],
[anyone ,"member_lady_2b", [], "That's good news. Not that I don't like your company, but I did miss my little luxuries.\
Still I am sorry that I'll leave you soon. You must promise me, you'll come visit me when you can.", "close_window", []],
[anyone ,"member_chat", [(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),],
"Greetings, {playername}, my first and foremost vassal. I await your counsel.", "supported_pretender_talk", []],
[anyone ,"supported_pretender_pretalk", [],
"Anything else?", "supported_pretender_talk", []],
[anyone|plyr,"supported_pretender_talk", [],
"What do you think about our progress so far?", "pretender_progress",[]],
[anyone,"pretender_progress", [
(assign, reg11, 0),(assign, reg13, 0),(assign, reg14, 0),(assign, reg15, 0),
(assign, reg21, 0),(assign, reg23, 0),(assign, reg24, 0),(assign, reg25, 0),
(try_for_range, ":troop_no", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":troop_faction", ":troop_no"),
(try_begin),
(eq, ":troop_faction", "fac_player_supporters_faction"),
(neq, ":troop_no", "trp_player"),
(neq, ":troop_no", "$supported_pretender"),
(val_add, reg11, 1),
(else_try),
(eq, ":troop_faction", "$supported_pretender_old_faction"),
(neg|faction_slot_eq, "$supported_pretender_old_faction", slot_faction_leader, ":troop_no"),
(val_add, reg21, 1),
(try_end),
(try_end),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(try_begin),
(eq, ":center_faction", "fac_player_supporters_faction"),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(val_add, reg13, 1),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(val_add, reg14, 1),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(val_add, reg15, 1),
(try_end),
(else_try),
(eq, ":center_faction", "$supported_pretender_old_faction"),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(val_add, reg23, 1),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(val_add, reg24, 1),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_village),
(val_add, reg25, 1),
(try_end),
(try_end),
(try_end),
(store_add, reg19, reg13, reg14),
(val_add, reg19, reg15),
(store_add, reg29, reg23, reg24),
(val_add, reg29, reg25),
(store_add, ":our_score", reg13, reg14),
(val_add, ":our_score", reg11),
(store_add, ":their_score", reg23, reg24),
(val_add, ":their_score", reg21),
(store_add, ":total_score", ":our_score", ":their_score"),
(val_mul, ":our_score", 100),
(store_div, ":our_ratio", ":our_score", ":total_score"),
(try_begin),
(lt, ":our_ratio", 10),
(str_store_string, s30, "@we have made very little progress so far"),
(else_try),
(lt, ":our_ratio", 30),
(str_store_string, s30, "@we have suceeded in gaining some ground, but we still have a long way to go"),
(else_try),
(lt, ":our_ratio", 50),
(str_store_string, s30, "@we have become a significant force, and we have an even chance of victory"),
(else_try),
(lt, ":our_ratio", 75),
(str_store_string, s30, "@we are winning the war, but our enemies are still holding on."),
(else_try),
(str_store_string, s30, "@we are on the verge of victory. The remaining enemies pose no threat, but we still need to hunt them down."),
(try_end),
(faction_get_slot, ":enemy_king", "$supported_pretender_old_faction", slot_faction_leader),
(str_store_troop_name, s9, ":enemy_king"),
],
"{reg11?We have {reg11} lords on our side:We have no lord with us yet},\
whereas {reg21?{s9} still has {reg21} lords supporting him:{s9} has no loyal lords left}.\
{reg19?We control {reg13?{reg13} towns:} {reg14?{reg14} castles:} {reg15?and {reg15} villages:}:We don't control any settlements},\
while {reg29?they have {reg23?{reg23} towns:} {reg24?{reg24} castles:} {reg25?and {reg25} villages:}:they have no remaining settlements}.\
Overall, {s30}.", "pretender_progress_2",[]],
[anyone|plyr,"pretender_progress_2", [],
"Then, we must keep fighting and rally our supporters!", "supported_pretender_pretalk",[]],
[anyone|plyr,"pretender_progress_2", [],
"It seems this rebellion is not going anywhere. We must give up.", "pretender_quit_rebel_confirm",[]],
[anyone,"pretender_quit_rebel_confirm", [],
"{playername}, you can't abandon me now. Are you serious?", "pretender_quit_rebel_confirm_2",[]],
[anyone|plyr,"pretender_quit_rebel_confirm_2", [],
"Indeed, I am. I can't support you any longer.", "pretender_quit_rebel_confirm_3",[]],
[anyone|plyr,"pretender_quit_rebel_confirm_2", [],
"I was jesting. I will fight for you until we succeed.", "supported_pretender_pretalk",[]],
[anyone,"pretender_quit_rebel_confirm_3", [],
"Are you absolutely sure? I will never forgive you if you abandon my cause.", "pretender_quit_rebel_confirm_4",[]],
[anyone|plyr,"pretender_quit_rebel_confirm_4", [],
"I am sure.", "pretender_quit_rebel",[]],
[anyone|plyr,"pretender_quit_rebel_confirm_4", [],
"Let me think about this some more.", "supported_pretender_pretalk",[]],
[anyone,"pretender_quit_rebel", [],
"So be it. Then my cause is lost. There is only one thing to do for me now. I will go from Calradia and never come back. With me gone, you may try to make your peace with {s4}.", "close_window",
[
(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
(faction_get_slot, ":original_faction_leader", ":original_faction", slot_faction_leader),
(str_store_troop_name, s4, ":original_faction_leader"),
(try_for_range, ":cur_troop", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(neq, "$supported_pretender", ":cur_troop"),
(store_troop_faction, ":cur_faction", ":cur_troop"),
(eq, ":cur_faction", "fac_player_supporters_faction"),
(call_script, "script_change_troop_faction", ":cur_troop", ":original_faction"),
(try_end),
(troop_set_faction, "$g_talk_troop", "fac_neutral"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(assign, ":has_center", 0),
(try_for_range, ":cur_center", centers_begin, centers_end),
(store_faction_of_party, ":cur_faction", ":cur_center"),
(eq, ":cur_faction", "fac_player_supporters_faction"),
(assign, ":has_center", 1),
(neg|party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(call_script, "script_give_center_to_lord", ":cur_center", "trp_player", 0),
(try_end),
(party_remove_members, "p_main_party", "$supported_pretender", 1),
(faction_set_slot, ":original_faction", slot_faction_has_rebellion_chance, 0),
(assign, "$supported_pretender", 0),
(try_begin), #Still has center
(eq, ":has_center", 1),
(faction_set_color, "fac_player_supporters_faction", 0xFF0000),
(try_begin), #added to prevent no minister if player gives up rebellion
(eq, "$g_player_minister", 0),
(assign, "$g_player_minister", "trp_temporary_minister"),
(try_end),
(else_try), #No center
(call_script, "script_deactivate_player_faction"),
(try_end),
(call_script, "script_change_player_honor", -20),
(call_script, "script_fail_quest", "qst_rebel_against_kingdom"),
(call_script, "script_end_quest", "qst_rebel_against_kingdom"),
]],
[anyone|plyr,"supported_pretender_talk", [],
"{reg65?My lady:My lord}, would you allow me to check out your equipment?", "supported_pretender_equip",[]],
[anyone,"supported_pretender_equip", [], "Very well, it's all here...", "supported_pretender_pretalk",[
(change_screen_equip_other),
]],
[anyone|plyr,"supported_pretender_talk", [], "If it would please you, can you tell me about your skills?", "pretneder_view_char_requested",[]],
[anyone,"pretneder_view_char_requested", [], "Well, all right.", "supported_pretender_pretalk",[(change_screen_view_character)]],
[anyone|plyr,"supported_pretender_talk", [
(assign, ":center_found", 0),
(try_for_range, ":fief_to_grant", centers_begin, centers_end),
(store_faction_of_party, ":fief_faction", ":fief_to_grant"),
(eq, ":fief_faction", "fac_player_supporters_faction"),
(party_slot_eq, ":fief_to_grant", slot_town_lord, -1),
(assign, ":center_found", 1),
(try_end),
(eq, ":center_found", 1),
],
"I suggest that you decide who should hold a fief that does not have a lord.", "supported_pretender_grant_fief",[]],
[anyone,"supported_pretender_grant_fief", [
],
"Which fief did you have in mind?", "supported_pretender_grant_fief_select",[]],
[anyone|plyr|repeat_for_parties,"supported_pretender_grant_fief_select", [
(store_repeat_object, ":fief_to_grant"),
(is_between, ":fief_to_grant", centers_begin, centers_end),
(store_faction_of_party, ":fief_faction", ":fief_to_grant"),
(eq, ":fief_faction", "fac_player_supporters_faction"),
(party_slot_eq, ":fief_to_grant", slot_town_lord, -1),
(str_store_party_name, s4, ":fief_to_grant"),
],
"{s4}", "supported_pretender_grant_fief_choose_recipient",[
(store_repeat_object, "$g_center_taken_by_player_faction"),
]],
[anyone,"supported_pretender_grant_fief_choose_recipient", [
],
"And who should receive it?", "center_captured_rebellion",[
(str_store_party_name, s4, "$g_center_taken_by_player_faction"),
]],
[anyone|plyr,"supported_pretender_grant_fief_select", [
],
"Never mind.", "supported_pretender_pretalk",[]],
[anyone|plyr,"supported_pretender_talk", [],
"Let us keep going, {reg65?my lady:sir}.", "close_window",[]],
[anyone,"do_member_trade", [], "Anything else?", "member_talk",[]],
[anyone,"member_pretalk", [], "Anything else?", "member_talk",[]],
[anyone,"member_chat",
[
(store_conversation_troop,"$g_talk_troop"),
(troop_is_hero,"$g_talk_troop"),
(troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
(str_store_string, s5, ":honorific"),
], "Yes, {s5}?", "member_talk",
[
(try_begin),
(is_between, "$g_talk_troop", companions_begin, companions_end),
(unlock_achievement, ACHIEVEMENT_TALKING_HELPS),
(try_end),
]],
[anyone|plyr,"member_talk", [
(is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
], "As marshal, I wish you to send a message to the vassals of the realm", "member_direct_campaign",[]],
[anyone|plyr,"member_talk", [],
"Let me see your equipment.", "member_trade",[]],
[anyone,"member_trade", [], "Very well, it's all here...", "do_member_trade",[
# (change_screen_trade)
(change_screen_equip_other),
]],
[anyone,"do_member_trade", [], "Anything else?", "member_talk",[]],
[anyone|plyr,"member_talk", [], "What can you tell me about your skills?", "view_member_char_requested",[]],
[anyone,"view_member_char_requested", [], "All right, let me tell you...", "do_member_view_char",[(change_screen_view_character)]],
[anyone|plyr,"member_talk", [], "We need to separate for a while.", "member_separate",[
(call_script, "script_npc_morale", "$g_talk_troop"),
(assign, "$npc_quit_morale", reg0),
]],
[anyone,"member_separate", [
(gt, "$npc_quit_morale", 30),
], "Oh really? Well, I'm not just going to wait around here. I'm going to go to the towns to look for other work. Is that what you want?", "member_separate_confirm",
[]],
[anyone,"member_separate", [
], "Well, actually, there was something I needed to tell you.", "companion_quitting",
[
(assign, "$player_can_refuse_npc_quitting", 0),
(assign, "$player_can_persuade_npc", 0),
]],
[anyone|plyr,"member_separate_confirm", [], "That's right. We need to part ways.", "member_separate_yes",[]],
[anyone|plyr,"member_separate_confirm", [], "No, I'd rather have you at my side.", "do_member_trade",[]],
[anyone,"member_separate_yes", [
], "Well. I'll be off, then. Look me up if you need me.", "close_window",
[
(troop_set_slot, "$g_talk_troop", slot_troop_occupation, 0),
(troop_set_slot, "$g_talk_troop", slot_troop_playerparty_history, pp_history_dismissed),
(remove_member_from_party, "$g_talk_troop"),
]],
[anyone|plyr,"member_talk", [], "I'd like to ask you something.", "member_question",[]],
[anyone|plyr,"member_talk", [], "Never mind.", "close_window",[]],
[anyone,"member_question", [], "Very well. What did you want to ask?", "member_question_2",[]],
[anyone|plyr,"member_question_2", [], "How do you feel about the way things are going in this company?", "member_morale",[]],
[anyone|plyr,"member_question_2", [], "Tell me your story again.", "member_background_recap",[]],
[anyone|plyr,"member_question_2", [
(troop_slot_eq, "$g_talk_troop", slot_troop_kingsupport_state, 0),
], "I suppose you know that I aspire to be {king/queen} of this land?", "member_kingsupport_1",[]],
[anyone|plyr,"member_question_2", [
], "Do you have any connections that we could use to our advantage?", "member_intelgathering_1",[]],
[anyone|plyr,"member_question_2", [
(faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
], "Would you be interested in holding a fief?", "member_fief_grant_1",[]],
[anyone,"member_morale", [
(call_script, "script_npc_morale", "$g_talk_troop"),
], "{s21}", "do_member_trade",[]],
[anyone,"member_background_recap", [
(troop_get_slot, ":first_met", "$g_talk_troop", slot_troop_first_encountered),
(str_store_party_name, 20, ":first_met"),
(troop_get_slot, ":home", "$g_talk_troop", slot_troop_home),
(str_store_party_name, 21, ":home"),
(troop_get_slot, ":recap", "$g_talk_troop", slot_troop_home_recap),
(str_store_string, 5, ":recap"),
], "{s5}", "member_background_recap_2",[]],
[anyone,"member_background_recap_2", [
(str_clear, 19),
(troop_get_slot, ":background", "$g_talk_troop", slot_troop_backstory_b),
(str_store_string, 5, ":background"),
], "{s5}", "member_background_recap_3",[]],
[anyone,"member_background_recap_3", [
], "Then shortly after, I joined up with you.", "do_member_trade",[]],
[anyone,"do_member_view_char", [], "Anything else?", "member_talk",[]],
[anyone,"member_kingsupport_1", [
(troop_get_slot, ":morality_grievances", "$g_talk_troop", slot_troop_morality_penalties),
(gt, ":morality_grievances", 10),
], "Um... Yes. I had heard.", "do_member_trade",[]],
[anyone,"member_kingsupport_1", [
(store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
(store_add, ":string", "str_npc1_kingsupport_1", ":npc_no"),
# (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_1),
(str_store_string, s21, ":string"),
], "{s21}", "member_kingsupport_1a",[]],
[anyone|plyr,"member_kingsupport_1a", [
], "Would you then support my cause?", "member_kingsupport_2",[]],
[anyone|plyr,"member_kingsupport_1a", [
], "Very good. I shall keep that in mind.", "do_member_trade",[]],
[anyone,"member_kingsupport_2", [
(assign, ":companion_already_on_mission", -1),
(try_for_range, ":companion", companions_begin, companions_end),
(troop_slot_eq, ":companion", slot_troop_occupation, slto_player_companion),
(troop_get_slot, ":days_on_mission", ":companion", slot_troop_days_on_mission),
(gt, ":days_on_mission", 17),
(neg|main_party_has_troop, ":companion"),
(assign, ":companion_already_on_mission", ":companion"),
(try_end),
(gt, ":companion_already_on_mission", -1),
(troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
(str_store_string, s21, ":honorific"),
(str_store_troop_name, s22, ":companion_already_on_mission"),
], "I would, {s21}. Moreover, I have a proposal on how I might help you attain your throne. But you recently sent {s22} off on a similar mission. Perhaps we should wait for a couple of weeks to avoid drawing too much attention to ourselves.", "do_member_trade",[]],
[anyone,"member_kingsupport_2", [
(store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
(store_add, ":string", "str_npc1_kingsupport_2", ":npc_no"),
# (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_2),
(str_store_string, s21, ":string"),
], "{s21}", "member_kingsupport_2a",[]],
[anyone|plyr,"member_kingsupport_2a", [
(store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
(store_add, ":string", "str_npc1_kingsupport_2a", ":npc_no"),
# (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_2a),
(str_store_string, s21, ":string"),
], "{s21}", "member_kingsupport_3",[]],
[anyone|plyr,"member_kingsupport_2a", [
(store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
(store_add, ":string", "str_npc1_kingsupport_2b", ":npc_no"),
# (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_2b),
(str_store_string, s21, ":string"),
], "{s21}", "do_member_trade",[]],
[anyone,"member_kingsupport_3", [
(store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
(store_add, ":string", "str_npc1_kingsupport_3", ":npc_no"),
# (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_3),
(str_store_string, s21, ":string"),
], "{s21}", "member_kingsupport_3a",[]],
[anyone|plyr,"member_kingsupport_3a", [
], "Very good. You do that", "member_kingsupport_4",[
]],
[anyone|plyr,"member_kingsupport_3a", [
], "On second thought, stay with me for a while", "do_member_trade",[]],
[anyone,"member_kingsupport_4", [
(troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 21),
(troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_kingsupport),
(remove_member_from_party, "$g_talk_troop", "p_main_party"),
(troop_get_slot, ":string", "$g_talk_troop", slot_troop_honorific),
(str_store_string, s21, ":string"),
], "Farewell then, {s21}, for a little while", "close_window",[]],
[anyone,"member_intelgathering_1", [
(troop_get_slot, ":town_with_contacts", "$g_talk_troop", slot_troop_town_with_contacts),
(str_store_party_name, s17, ":town_with_contacts"),
(store_faction_of_party, ":contact_town_faction", ":town_with_contacts"),
(str_store_faction_name, s18, ":contact_town_faction"),
(store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
(store_add, ":connections_string", "str_npc1_intel_mission", ":npc_no"),
(str_store_string, s21, ":connections_string"),
], "{s21}", "member_intelgathering_3",[]],
[anyone,"member_intelgathering_3", [ #change back to member_intelgathering_2 if this will be used
(eq, 1, 0),
], "Of course, as few people should know of this as possible. If you want to collect the information, or pull me out, then don't send a messenger. Come and get me yourself -- even if that means you have to sneak through the gates.", "member_intelgathering_3",[]],
[anyone|plyr,"member_intelgathering_3", [
], "Splendid idea -- you do that.", "member_intelgathering_4",[]],
[anyone|plyr,"member_intelgathering_3", [
], "Actually, hold off for now.", "do_member_trade",[]],
[anyone,"member_intelgathering_4", [
(troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 5),
(troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_gather_intel),
(remove_member_from_party, "$g_talk_troop", "p_main_party"),
(troop_get_slot, ":string", "$g_talk_troop", slot_troop_honorific),
(str_store_string, s21, ":string"),
], "Good. I should be ready to report in about five days. Farewell then, {s21}, for a little while.", "close_window",[]],
[anyone|auto_proceed, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(eq, "$talk_context", tc_town_talk),
],
"{!}.", "merchant_quest_4_start",
[
]],
[anyone, "merchant_quest_4_start",
[
],
"It's time, lads! Up and at them!", "close_window",
[
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":agent_troop_id", ":agent_no"),
(ge, ":agent_troop_id", "trp_looter"),
(le, ":agent_troop_id", "trp_desert_bandit"),
(agent_set_team, ":agent_no", 1),
(try_end),
(get_player_agent_no, ":player_agent"),
(assign, ":minimum_distance", 1000),
(try_for_agents, ":agent_id_1"),
(neq, ":agent_id_1", ":player_agent"),
(agent_get_team, ":agent_team_1", ":agent_id_1"),
(eq, ":agent_team_1", 0),
(agent_get_position, pos0, ":agent_id_1"),
(try_for_agents, ":agent_id_2"),
(agent_get_team, ":agent_team_2", ":agent_id_2"),
(eq, ":agent_team_2", 1),
(agent_get_position, pos1, ":agent_id_2"),
(get_distance_between_positions, ":dist", pos0, pos1),
(le, ":dist", ":minimum_distance"),
(assign, ":minimum_distance", ":dist"),
(copy_position, pos2, pos1),
(try_end),
(agent_set_scripted_destination, ":agent_id_1", pos2, 0),
(agent_set_speed_limit, ":agent_id_1", 10),
(try_end),
]],
[anyone, "start",
[
(is_between, "$g_talk_troop", "trp_relative_of_merchant", "trp_relative_of_merchants_end"),
(try_begin),
(check_quest_active, "qst_save_relative_of_merchant"),
(call_script, "script_succeed_quest", "qst_save_relative_of_merchant"),
(try_end),
(str_store_party_name, s9, "$g_starting_town"),
(assign, "$relative_of_merchant_is_found", 1),
],
"Thank you! Thank you, {sir/my lady}, for rescuing me from those fiends. Did my brother in {s9} put you onto their track?", "relative_saved_1a",
[
]],
[anyone|plyr, "relative_saved_1a",
[],
"Yes. I told him that I would find you. I advise you to return to your family as quickly as you can -- and be careful on the road.", "close_window",
[
]],
[anyone, "start",
[
(is_between, "$g_talk_troop", "trp_sea_raider_leader", "trp_bandit_leaders_end"),
(eq,"$talk_context",tc_hero_defeated),
],
"Ay! Spare me! Spare my life! Let me go, and I'll go far away from here, and learn an honest trade, and you'll never hear of me again!", "bandit_leader_1a",
[]],
[anyone|plyr, "bandit_leader_1a",
[
(is_between, "$g_talk_troop", "trp_sea_raider_leader", "trp_bandit_leaders_end"),
],
"I'll spare your life -- but in exchange, I want information. Either you or your mates kidnapped the brother of a prominent merchant in town. Tell me where you're hiding him, and give me your word that you'll stop troubling the people of these parts, and you can go free.", "bandit_leader_1b",
[]],
[anyone,"start",
[
(eq,"$talk_context",tc_party_encounter),
(is_between, "$g_talk_troop", "trp_sea_raider_leader", "trp_bandit_leaders_end"),
],
"What do you want?", "looter_leader_1",
[]],
[anyone|plyr,"looter_leader_1",
[
(store_faction_of_party, ":starting_town_faction", "$g_starting_town"),
(try_begin),
(eq, ":starting_town_faction", "fac_kingdom_1"),
(assign, ":troop_of_merchant", "trp_swadian_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_2"),
(assign, ":troop_of_merchant", "trp_vaegir_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_3"),
(assign, ":troop_of_merchant", "trp_khergit_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_4"),
(assign, ":troop_of_merchant", "trp_nord_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_5"),
(assign, ":troop_of_merchant", "trp_rhodok_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_6"),
(assign, ":troop_of_merchant", "trp_sarranid_merchant"),
(try_end),
(str_store_troop_name, s9, ":troop_of_merchant"),
],
"I've been looking for you. Tell me where you keep your prisoners, and I'll let you go.", "looter_leader_2",
[]],
[anyone|plyr,"looter_leader_1",
[],
"Nothing. We'll leave you in peace.", "close_window",
[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"looter_leader_2",
[],
"Hah! Those prisoners are only going free if you pay their ransom. Did you bring any silver?", "looter_leader_3",
[]],
[anyone|plyr,"looter_leader_3",
[],
"No, but I brought steel.", "close_window",
[]],
[anyone, "bandit_leader_1b",
[
(is_between, "$g_talk_troop", "trp_sea_raider_leader", "trp_bandit_leaders_end"),
(assign, ":possible_villages", 0),
(try_for_range, ":village_no", villages_begin, villages_end),
(party_slot_eq, ":village_no", slot_village_bound_center, "$g_starting_town"),
(val_add, ":possible_villages", 1),
(try_end),
(store_random_in_range, ":random_village", 0, ":possible_villages"),
(val_add, ":random_village", 1),
(try_for_range, ":village_no", villages_begin, villages_end),
(party_slot_eq, ":village_no", slot_village_bound_center, "$g_starting_town"),
(val_sub, ":random_village", 1),
(eq, ":random_village", 0),
(assign, "$lair_neighboor_village", ":village_no"),
(try_end),
(str_store_party_name_link, s9, "$lair_neighboor_village"),
(set_spawn_radius, 4),
(spawn_around_party, "$lair_neighboor_village", "pt_looter_lair"),
(party_set_flags, reg0, pf_always_visible, 1),
],
"Oh bless you, {sir/my lady}. Bless you. We've done the lad no harm. We've been keeping him in our hideout near {s9}. I'll describe the area nearby in detail, so there's no mistaking it...", "close_window",
[
(call_script, "script_succeed_quest", "qst_learn_where_merchant_brother_is"),
(call_script, "script_end_quest", "qst_learn_where_merchant_brother_is"),
(store_faction_of_party, ":starting_town_faction", "$g_starting_town"),
(try_begin),
(eq, ":starting_town_faction", "fac_kingdom_1"),
(assign, ":troop_of_merchant", "trp_swadian_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_2"),
(assign, ":troop_of_merchant", "trp_vaegir_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_3"),
(assign, ":troop_of_merchant", "trp_khergit_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_4"),
(assign, ":troop_of_merchant", "trp_nord_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_5"),
(assign, ":troop_of_merchant", "trp_rhodok_merchant"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_6"),
(assign, ":troop_of_merchant", "trp_sarranid_merchant"),
(try_end),
(str_store_troop_name, s10, ":troop_of_merchant"),
(str_store_string, s2, "str_find_the_lair_near_s9_and_free_the_brother_of_the_prominent_s10_merchant"),
(call_script, "script_start_quest", "qst_save_relative_of_merchant", ":troop_of_merchant"),
]],
[anyone,"start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(check_quest_active, "qst_rescue_prisoner"),
(check_quest_succeeded, "qst_rescue_prisoner"),
(quest_slot_eq, "qst_rescue_prisoner", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":cur_lord", "qst_rescue_prisoner", slot_quest_target_troop),
(call_script, "script_troop_get_family_relation_to_troop", ":cur_lord", "$g_talk_troop"),
],
"{playername}, you saved him! Thank you ever so much for rescuing my {s11}.\
Please, take this as some small repayment for your noble deed.", "rescue_prisoner_succeed_2",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
(add_xp_as_reward, 2000),
(call_script, "script_troop_add_gold", "trp_player", 1500),
(call_script, "script_end_quest", "qst_rescue_prisoner"),
]],#rescuerescue
[anyone|plyr,"rescue_prisoner_succeed_2", [], "Always an honour to serve, {s65}.", "lord_pretalk",[]],
#Quest 0 - Alley talk
[anyone|auto_proceed, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(eq, "$talk_context", tc_back_alley),
(eq, "$talked_with_merchant", 0),
],
"{!}.", "start_up_quest_1_next",
[]],
[anyone, "start_up_quest_1_next",
[],
"Are you all right? Well.... I guess you're alive, at any rate. I'm not sure that we can say the same for the other fellow. That's one less thief to trouble our streets at night, although Heaven knows he won't be the last.... Anyway, maybe you can help me with something. Let's talk more inside. Out here, we don't know who's listening", "close_window",
[
(assign, "$talked_with_merchant", 1),
(mission_disable_talk),
]],
#Quest 1 - Repeating dialog sentence
[anyone|auto_proceed, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(eq, "$talk_context", tc_tavern_talk),
(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(assign, ":total_party_size", reg0),
(assign, ":continue", 0),
(try_begin),
(check_quest_active, "qst_collect_men"),
(neg|check_quest_succeeded, "qst_collect_men"),
(le, ":total_party_size", 5),
(try_begin),
(le, ":total_party_size", 1),
(str_store_string, s11, "str_please_sir_my_lady_go_find_some_volunteers_i_do_not_know_how_much_time_we_have"),
(else_try),
(str_store_string, s11, "str_you_need_more_men_sir_my_lady"),
(try_end),
(assign, ":continue", 1),
(else_try),
(check_quest_active, "qst_learn_where_merchant_brother_is"),
(neg|check_quest_succeeded, "qst_learn_where_merchant_brother_is"),
(str_store_string, s11, "str_do_not_waste_time_go_and_learn_where_my_brother_is"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
],
"{!}.", "start_up_quest_2_next",
[]],
[anyone, "start_up_quest_2_next",
[],
"{!}{s11}", "close_window",
[]],
#Quest 2 - First dialog sentence
[anyone, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(eq, "$talk_context", tc_tavern_talk),
(check_quest_active, "qst_collect_men"),
(neg|check_quest_succeeded, "qst_duel_for_lady"),
(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(ge, reg0, 6),
(str_store_party_name, s9, "$current_town"),
],
"Splendid work. You have hired enough men to take on the bandits. Now -- travellers entering {s9} have told us that there is a small group of robbers lurking on the outside of town. I suspect that they are all from the same band, the one that took my brother. Hunt them down and defeat them, and make them disclose the location of their lair!", "merchant_quest_2a",
[
(call_script, "script_succeed_quest", "qst_collect_men"),
(call_script, "script_end_quest", "qst_collect_men"),
]],
#Quest 3 - First dialog sentence/Repeating dialog sentence
[anyone, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(eq, "$talk_context", tc_tavern_talk),
(check_quest_active, "qst_save_relative_of_merchant"),
(neg|check_quest_succeeded, "qst_save_relative_of_merchant"),
(str_store_party_name, s9, "$current_town"),
],
"So, you've found out where they hid my brother? Splendid work. I flatter myself that I'm a fine judge of character, and you look to be a {man/woman} who can get things done. Now, go out and save his unworthy hide!", "merchant_quest_3a",
[
]],
#Quest 3 - All succeeded - First dialog sentence
[anyone, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(eq, "$talk_context", tc_tavern_talk),
(check_quest_active, "qst_save_relative_of_merchant"),
(check_quest_succeeded, "qst_save_relative_of_merchant"),
],
"Well... My brother is home safe. I'm not sure what to do with him -- maybe pack him off to a university outside Calradia. That way, if he gets knocked on the head in a street brawl, no one can say it's my fault. But that's not your problem. Here's the rest of your reward. It was well-earned.", "merchant_quest_3b",
[
(call_script, "script_finish_quest", "qst_save_relative_of_merchant", 100),
(troop_add_gold, "trp_player", 200),
]],
[anyone|plyr, "merchant_quest_3b", #was startup
[
],
"The money is most welcome, and I am glad to have been of service", "merchant_quest_4a",
[
]],
[anyone, "merchant_quest_4a", #was startup
[
],
"Good! Now... Are you interested in making some more?", "merchant_quest_4b",
[
]],
[anyone|plyr, "merchant_quest_4b",
[
],
"Possibly. What do you need?", "merchant_quest_4b1",
[
]],
[anyone, "merchant_quest_4b1",
[],
"Remember how I told you that the bandits had an ally inside the walls? I think I know who it is -- the captain of the watch, no less. Some months ago this captain, seeing the amount of profit we merchants were making from trade across the frontiers, decided to borrow some money to sponsor a caravan. Unfortunately, like many who are new to commerce, he failed to realize that great profit only comes with great risk. So he sank all his money into the most expensive commodities, and of course his caravan was captured and looted, and he lost everything.", "merchant_quest_4b2",
[]],
[anyone, "merchant_quest_4b2",
[],
"As a consequence, it seems, our captain turned to villainy to recoup his fortune. I supposed I'd do the same if, the Heavens forbid, I ever faced indebtedness and ruination. Now, any watch captain worth his salary will have a few thieves and robbers on his payroll, to inform on the rest, but our captain decides to employ these bastards wholesale. He brings them into the town, lets them do as they will, and takes a share of their take. You've heard of poachers turning gamekeepers? Well, in the unfortunate land of Calradia, sometimes gamekeepers will turn poacher. Luckily, there's are still a few brave, honest souls in the watch who've told me how he works.", "merchant_quest_4b3",
[]],
[anyone, "merchant_quest_4b3",
[
(faction_get_slot, ":local_ruler", "$g_encountered_party_faction", slot_faction_leader),
(str_store_troop_name, s4, ":local_ruler"),
],
"Now -- here's my plan. I could bring this to the attention of {s4}, lord of the city, but that would mean an inquiry, my word against the captain's, and witnesses can be bought and evidence destroyed, or maybe the whole thing will be forgotten if the enemy comes across the border again, and all I'll get for my trouble is a knife in the ribs. In time of war, you see, a king's eye wanders far from his domain, and his subjects suffer. So I've got another idea. I've got a small group of townsfolk together, some men in my employ and some others who've lost relatives to these bandits, and we'll storm the captain's home and bring him in chains before {s4}, hopefully with a few captured bandits to explain how things stack up.", "merchant_quest_4b4",
[]],
[anyone, "merchant_quest_4b4",
[
],
"All I need now is someone to lead my little army into battle -- and I can't think of anyone better than you. So, what do you say?", "merchant_quest_4b5",
[
]],
[anyone|plyr, "merchant_quest_4b5",
[
],
"How do I know that you're telling me the truth?", "merchant_quest_4b6",
[
]],
[anyone, "merchant_quest_4b6",
[
(str_store_party_name, s4, "$g_encountered_party"),
],
"Oh, well, I suppose it's possible that I found a dozen bandits who were willing to give their lives to give a passing stranger a false impression of life in old {s4}... Well, I guess you can't really know if my word is good, but I reckon you've learned by now that my money is good, and there's another 100 denars, or maybe a bit more, that's waiting for you if you'll do me this last little favor. So what do you say?", "merchant_quest_4b7",
[
]],
[anyone|plyr, "merchant_quest_4b7",
[
],
"All right. I'll lead your men.", "merchant_quest_4b8",
[
]],
[anyone|plyr, "merchant_quest_4b7",
[
],
"I'm sorry. This is too much, too fast. I need time to think.", "merchant_quest_4_decline",
[
]],
[anyone, "merchant_quest_4b8",
[
],
"Splendid. It's been a long time since I staked so much on a single throw of the dice, and frankly I find it exhilarating. My men are ready to move on your word. Are you ready?", "merchant_quest_4b9",
[
]],
[anyone|plyr, "merchant_quest_4b9",
[
],
"Yes. Give them the sign.", "merchant_quest_4_accept",
[
]],
[anyone|plyr, "merchant_quest_4b9",
[
],
"Not now. I will need to rest before I can fight again.", "merchant_quest_4_decline",
[
]],
[anyone, "merchant_quest_4_accept",
[
],
"Good! Now -- strike hard, strike fast, and the captain and his henchmen won't know what hit them. May the heavens be with you!", "close_window",
[
(assign, "$current_startup_quest_phase", 3),
(jump_to_menu, "mnu_start_phase_3"),
(finish_mission),
]],
[anyone, "merchant_quest_4_decline", #was startup
[
],
"Right. I can keep my men standing by. If you let this go too long, then I suppose that I shall have to finish this affair without you, but I would be most pleased if you could be part of it as well. For now, take what time you need.", "close_window",
[]],
#QUEST 2 - Learning where prominent's brother is.
[anyone|plyr, "merchant_quest_2a",
[
],
"Very well. I shall hunt for bandits.", "close_window",
[
(str_store_party_name, s9, "$current_town"),
(str_store_string, s2, "str_start_up_quest_message_2"),
(call_script, "script_start_quest", "qst_learn_where_merchant_brother_is", "$g_talk_troop"),
(set_spawn_radius, 2),
(spawn_around_party, "$current_town", "pt_leaded_looters"),
(assign, ":spawned_bandits", reg0),
(party_get_position, pos0, "$current_town"),
(party_set_ai_behavior, ":spawned_bandits", ai_bhvr_patrol_location),
(party_set_ai_patrol_radius, ":spawned_bandits", 3),
(party_set_ai_target_position, ":spawned_bandits", pos0),
]],
[anyone|plyr, "merchant_quest_2a",
[
],
"Why don't you come with us?", "merchant_quest_2a_whynotcome",
[
]],
[anyone, "merchant_quest_2a_whynotcome",
[
],
"Because I'm paying you to go take care of it. That's the short answer. The long answer is that I've got some leads to follow up here in town, and I have just as much chance of getting knocked on my head as you, if that's what you're asking. But I respect your question. Now, what do you say?", "merchant_quest_2a",
[
]],
[anyone|plyr, "merchant_quest_2a",
[
],
"I cannot deal with this matter at this time.", "close_window",
[
]],
#Quest 3 - Saving merchant's brother.
[anyone|plyr, "merchant_quest_3a",
[
],
"Very well. I go now to attack the bandits in their lair, and find your brother.", "close_window",
[
#no need to below three lines anymore, this quest is auto starting after player learn where bandits are hiding merchant's brother.
#(str_store_party_name, s9, "$lair_neighboor_village"),
#(str_store_string, s2, "str_start_up_quest_message_3"),
#(call_script, "script_start_quest", "qst_save_relative_of_merchant", "$g_talk_troop"),
]],
[anyone|plyr, "merchant_quest_3a",
[
],
"I cannot deal with this matter at this time.", "close_window",
[
#think about placing end_quest here. Because it is auto-starting. If player do not want this quest he/she should have a way to avoid it.
]],
[anyone, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(this_or_next|eq, "$talk_context", tc_tavern_talk),
(neq, "$dialog_with_merchant_ended", 0),
(assign, ":continue", 0),
(try_begin),
(neg|check_quest_succeeded, "qst_collect_men"),
(neg|check_quest_active, "qst_collect_men"),
(assign, ":continue", 1),
(else_try),
(neg|check_quest_active, "qst_collect_men"),
(neg|check_quest_succeeded, "qst_learn_where_merchant_brother_is"),
(neg|check_quest_active, "qst_learn_where_merchant_brother_is"),
(assign, ":continue", 1),
(else_try),
(neg|check_quest_active, "qst_collect_men"),
(neg|check_quest_active, "qst_learn_where_merchant_brother_is"),
(neg|check_quest_succeeded, "qst_save_relative_of_merchant"),
(neg|check_quest_active, "qst_save_relative_of_merchant"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
],
"You may do as you wish, {sir/my lady}, but I am disappointed. You would do well to reconsider. I am a rich men, and would show you my gratitude in coin.", "merchant_quest_persuasion",
[
]],
[anyone|auto_proceed, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(this_or_next|eq, "$talk_context", tc_tavern_talk),
(neq, "$dialog_with_merchant_ended", 0),
(check_quest_finished, "qst_save_relative_of_merchant"),
(neg|check_quest_succeeded, "qst_save_town_from_bandits"),
(neg|check_quest_active, "qst_save_town_from_bandits"),
],
"{!}.", "merchant_quest_4b4",
[
]],
[anyone|plyr, "merchant_quest_persuasion",
[
(neg|check_quest_finished, "qst_collect_men"),
(neg|check_quest_active, "qst_collect_men"),
],
"You make a persuasive case. I will help you.", "merchant_quest_1_prologue_3",
[
]],
[anyone|plyr, "merchant_quest_persuasion",
[
(check_quest_finished, "qst_collect_men"),
(neg|check_quest_finished, "qst_learn_where_merchant_brother_is"),
(neg|check_quest_active, "qst_learn_where_merchant_brother_is"),
],
"You make a persuasive case. I will help you.", "merchant_quest_2",
[
]],
[anyone|plyr, "merchant_quest_persuasion",
[
(check_quest_finished, "qst_collect_men"),
(check_quest_finished, "qst_learn_where_merchant_brother_is"),
(neg|check_quest_finished, "qst_save_relative_of_merchant"),
(neg|check_quest_active, "qst_save_relative_of_merchant"),
],
"You make a persuasive case. I will help you.", "merchant_quest_3",
[
]],
[anyone|plyr, "merchant_quest_persuasion",
[
(check_quest_finished, "qst_collect_men"),
(check_quest_finished, "qst_learn_where_merchant_brother_is"),
(check_quest_finished, "qst_save_relative_of_merchant"),
(neg|check_quest_finished, "qst_save_town_from_bandits"),
(neg|check_quest_active, "qst_save_town_from_bandits"),
],
"You make a persuasive case. I will help you.", "merchant_quest_4b8",
[
]],
[anyone|plyr, "merchant_quest_persuasion",
[
],
"As I say, I have more important business elsewhere.", "close_window",
[
]],
[anyone, "merchant_quest_2",
[
],
"Now -- go find and defeat that group of bandits.", "merchant_quest_2a",
[
]],
[anyone, "merchant_quest_3",
[
],
"Now -- go attack that bandit hideout, get my brother back, and show those brigands what happens to those who threaten my household.", "merchant_quest_3a",
[
]],
[anyone, "start",
[
(is_between, "$g_talk_troop", "trp_relative_of_merchant", "trp_relative_of_merchant"),
],
"Oh -- thank the heavens... Thank the heavens... Am I safe?", "close_screen",
[]],
[anyone,"start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(eq, "$g_do_one_more_meeting_with_merchant", 1),
(faction_get_slot, ":faction_leader", "$g_encountered_party_faction", slot_faction_leader),
(str_store_troop_name, s5, ":faction_leader"),
],
"Ah... {playername}. Things didn't go quite so well as I had hoped. {s5} couldn't quite find it in him to overlook my little breach of the peace. Oh, he's grateful enough that I got rid of his crooked captain -- a guard who'll let in bandits will let in an enemy army, if the price is right -- but he can't exactly have me running around here as a lasting reminder of his failure to take care of things himself.", "merchant_closing_statement_2",
[]],
[anyone|plyr,"merchant_closing_statement_2",
[],
"That hardly seems fair...", "merchant_closing_statement_3",
[]],
[anyone,"merchant_closing_statement_3",
[],
"Fair? This is Calradia, {my boy/my lady}! Kings do what they will, and the rest of us do as they must. He didn't string me up, and instead gave me time to sell my properties -- even put in a word with the other merchants that they best pay me a fair price, too. That's gracious enough, as kings go -- but he's a weak king, as they all are here, and weak kings must always look to their authority first, and justice second. I suppose I'd do the same, in his shoes.", "merchant_closing_statement_4",
[]],
[anyone,"merchant_closing_statement_4",
[],
"Anyway, I wouldn't go rubbing your part in this affair in {s5}'s face -- but he's taken note of you, and decided that you're not worth hanging, and that's something to which I'll raise a glass any day of the week. He might even have work for you, further down the road. Or, you can sell your sword to one of his competitors. Anyway, I hope you've learned a bit about what it will take to stay alive in this troubled land, and I suspect that the money you've earned won't go to waste. Good luck.", "close_window",
[
(assign, "$g_do_one_more_meeting_with_merchant", 2),
]],
[anyone|auto_proceed, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(check_quest_finished, "qst_save_town_from_bandits"),
(eq, "$g_do_one_more_meeting_with_merchant", 2),
],
"{!}.", "merchant_quests_last_word",
[]],
[anyone,"merchant_quests_last_word",
[
],
"I am preparing to leave town in a short while. It's been an honor to know you. Good luck.", "close_window",
[
]],
[anyone|plyr, "member_intel_liaison", [],
"What have you discovered?", "member_intel_liaison_results", []],
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(eq, "$talk_context", tc_tavern_talk),
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_gather_intel)],
"Greetings, stranger.", "member_intel_liaison", []],
[anyone|plyr, "member_intel_liaison", [
],
"What have you discovered?", "member_intel_liaison_results", []],
[anyone|plyr, "member_intel_liaison", [],
"It's time to pull you out. Let's leave town separately, but join me soon after", "close_window", [
(assign, "$npc_to_rejoin_party", "$g_talk_troop"),
]],
[anyone|plyr, "member_intel_liaison", [],
"You're doing good work. Stay here for a little longer", "close_window", []],
[anyone, "member_intel_liaison_results", [
(store_faction_of_party, ":town_faction", "$g_encountered_party"),
(call_script, "script_update_faction_political_notes", ":town_faction"),
(assign, ":instability_index", reg0),
(val_add, ":instability_index", reg0),
(val_add, ":instability_index", reg1),
(try_for_range, ":lord", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":lord", slot_troop_occupation, slto_kingdom_hero),
(store_faction_of_troop, ":lord_faction", ":lord"),
(eq, ":lord_faction", ":town_faction"),
(call_script, "script_update_troop_political_notes", ":lord"),
(try_end),
(str_store_faction_name, s12, ":town_faction"),
(try_begin),
(gt, ":instability_index", 60),
(str_store_string, s11, "str_the_s12_is_a_labyrinth_of_rivalries_and_grudges_lords_ignore_their_lieges_summons_and_many_are_ripe_to_defect"),
(else_try),
(is_between, ":instability_index", 40, 60),
(str_store_string, s11, "str_the_s12_is_shaky_many_lords_do_not_cooperate_with_each_other_and_some_might_be_tempted_to_defect_to_a_liege_that_they_consider_more_worthy"),
(else_try),
(is_between, ":instability_index", 20, 40),
(str_store_string, s11, "str_the_s12_is_fairly_solid_some_lords_bear_enmities_for_each_other_but_they_tend_to_stand_together_against_outside_enemies"),
(else_try),
(lt, ":instability_index", 20),
(str_store_string, s11, "str_the_s12_is_a_rock_of_stability_politically_speaking_whatever_the_lords_may_think_of_each_other_they_fight_as_one_against_the_common_foe"),
(try_end),
],
"{s11} I notice that you have been keeping some notes about individual lords. I have annotated those with my findings.", "member_intel_liaison", []],
[anyone,"member_fief_grant_1", [
], "Which fief did you have in mind?", "member_fief_grant_2",[]],
[anyone|plyr|repeat_for_parties,"member_fief_grant_2", [
(store_repeat_object, ":center"),
(is_between, ":center", centers_begin, centers_end),
(neq, ":center", "$g_player_court"),
(store_faction_of_party, ":center_faction", ":center"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(neg|party_slot_ge, ":center", slot_town_lord, active_npcs_begin), #ie, owned by player or unassigned
(str_store_party_name, s11, ":center"),
], "{s11}", "member_fief_grant_3",[
(store_repeat_object, "$temp"),
]],
[anyone|plyr, "member_fief_grant_2", [
], "Never mind -- there is no fief I can offer.", "do_member_trade",[
]],
[anyone,"member_fief_grant_3", [
], "{s5}", "close_window",[
(call_script, "script_npc_morale", "$g_talk_troop"),
(assign, ":npc_morale", reg0),
(remove_member_from_party, "$g_talk_troop", "p_main_party"),
(try_begin),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(assign, ":banner_offset", banners_end_offset),
(val_sub, ":banner_offset", 1),
(val_sub, ":banner_offset", "$g_companions_banner_id"),
(store_add, ":banner_id", banner_scene_props_begin, ":banner_offset"),
(troop_set_slot, "$g_talk_troop", slot_troop_banner_scene_prop, ":banner_id"),
(val_add, "$g_companions_banner_id", 1),
(troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(try_end),
(troop_set_faction, "$g_talk_troop", "fac_player_supporters_faction"),
(call_script, "script_give_center_to_lord", "$temp", "$g_talk_troop", 0),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$temp"),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
(try_end),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_troop_original_faction, 0),
(party_get_slot, ":fief_culture", "$temp", slot_center_original_faction),
(troop_set_slot, "$g_talk_troop", slot_troop_original_faction, ":fief_culture"),
(try_end),
(store_character_level, ":renown", "$g_talk_troop"),
(val_mul, ":renown", 15),
(val_max, ":renown", 200),
(troop_set_slot, "$g_talk_troop", slot_troop_renown, ":renown"),
(troop_set_slot, "$g_talk_troop", slot_troop_wealth, 2500), #represents accumulated loot
# (troop_set_slot, "$g_talk_troop", slot_troop_readiness_to_join_army, 100),
# (troop_set_slot, "$g_talk_troop", slot_troop_readiness_to_follow_orders, 100),
(str_store_troop_name_plural, s12, "$g_talk_troop"),
(troop_get_type, ":is_female", "$g_talk_troop"),
(try_begin),
(eq, "$g_talk_troop", "trp_npc10"),
(str_store_string, s14, "str_tribune_s12"),
(else_try),
(eq, ":is_female", 1),
(str_store_string, s14, "str_lady_s12"),
(else_try),
(str_store_string, s14, "str_lord_s12"),
(try_end),
(troop_set_name, "$g_talk_troop", s14),
(unlock_achievement, ACHIEVEMENT_I_DUB_THEE),
(call_script, "script_check_concilio_calradi_achievement"),
(try_begin),
(troop_add_item, "$g_talk_troop", "itm_saddle_horse", 0),
(troop_add_item, "$g_talk_troop", "itm_courser", 0),
(troop_add_item, "$g_talk_troop", "itm_courtly_outfit",0),
(troop_add_item, "$g_talk_troop", "itm_heraldic_mail_with_tabard",0),
(troop_add_item, "$g_talk_troop", "itm_red_gambeson",0),
(troop_add_item, "$g_talk_troop", "itm_sword_medieval_c",0),
(troop_add_item, "$g_talk_troop", "itm_tab_shield_kite_cav_b",0),
(troop_add_item, "$g_talk_troop", "itm_light_lance",0),
(try_end),
(troop_equip_items, "$g_talk_troop"),
(store_div, ":relation_boost", ":npc_morale", 3),
# (val_add, ":relation_boost", 10),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":relation_boost"),
(str_store_party_name, s17, "$temp"),
(store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
(store_add, ":speech", "str_npc1_fief_acceptance", ":npc_no"),
# (troop_get_slot, ":speech", "$g_talk_troop", slot_troop_fief_acceptance_string),
(str_store_string, s5, ":speech"),
]],
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(this_or_next|eq, "$talk_context", tc_tavern_talk),
(eq, "$talk_context", tc_court_talk),
(main_party_has_troop, "$g_talk_troop")],
"Let's leave whenever you are ready.", "close_window", []],
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
(troop_slot_eq, "$g_talk_troop", slot_troop_turned_down_twice, 1),
],
"Please do not waste any more of my time today, {sir/madame}. Perhaps we shall meet again in our travels.", "close_window", [
]],
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
(eq, "$g_talk_troop_met", 0),
(troop_get_slot, ":intro", "$g_talk_troop", slot_troop_intro),
(str_store_string, 5, ":intro"),
(str_store_party_name, 20, "$g_encountered_party"),
],
"{s5}", "companion_recruit_intro_response", [
(troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "$g_encountered_party"),
]],
[anyone|plyr, "companion_recruit_intro_response", [
(troop_get_slot, ":intro_response", "$g_talk_troop", slot_troop_intro_response_1),
(str_store_string, 6, ":intro_response")
], "{s6}", "companion_recruit_backstory_a", []],
[anyone|plyr, "companion_recruit_intro_response", [
(troop_get_slot, ":intro_response", "$g_talk_troop", slot_troop_intro_response_2),
(str_store_string, 7, ":intro_response")
], "{s7}", "close_window", [
]],
[anyone, "companion_recruit_backstory_a", [(troop_get_slot, ":backstory_a", "$g_talk_troop", slot_troop_backstory_a),
(str_store_string, 5, ":backstory_a"),
(str_store_string, 19, "str_here_plus_space"),
(str_store_party_name, 20, "$g_encountered_party"),
],
"{s5}", "companion_recruit_backstory_b", []],
[anyone, "companion_recruit_backstory_b", [(troop_get_slot, ":backstory_b", "$g_talk_troop", slot_troop_backstory_b),
(str_store_string, 5, ":backstory_b"),
(str_store_party_name, 20, "$g_encountered_party"),
],
"{s5}", "companion_recruit_backstory_c", []],
[anyone, "companion_recruit_backstory_c", [(troop_get_slot, ":backstory_c", "$g_talk_troop", slot_troop_backstory_c),
(str_store_string, 5, ":backstory_c"),
],
"{s5}", "companion_recruit_backstory_response", []],
[anyone|plyr, "companion_recruit_backstory_response", [
(troop_get_slot, ":backstory_response", "$g_talk_troop", slot_troop_backstory_response_1),
(str_store_string, 6, ":backstory_response")
], "{s6}", "companion_recruit_signup", []],
[anyone|plyr, "companion_recruit_backstory_response", [
(troop_get_slot, ":backstory_response", "$g_talk_troop", slot_troop_backstory_response_2),
(str_store_string, 7, ":backstory_response")
], "{s7}", "close_window", [
]],
[anyone, "companion_recruit_signup", [(troop_get_slot, ":signup", "$g_talk_troop", slot_troop_signup),
(str_store_string, 5, ":signup"),
(str_store_party_name, 20, "$g_encountered_party"),
],
"{s5}", "companion_recruit_signup_b", []],
[anyone, "companion_recruit_signup_b", [
(troop_get_slot, ":signup", "$g_talk_troop", slot_troop_signup_2),
(troop_get_slot, reg3, "$g_talk_troop", slot_troop_payment_request),#
(str_store_string, 5, ":signup"),
(str_store_party_name, 20, "$g_encountered_party"),
],
"{s5}", "companion_recruit_signup_response", []],
[anyone|plyr, "companion_recruit_signup_response", [(neg|hero_can_join, "p_main_party"),], "Unfortunately, I can't take on any more hands in my party right now.", "close_window", [
]],
[anyone|plyr, "companion_recruit_signup_response", [
(hero_can_join, "p_main_party"),
(troop_get_slot, ":signup_response", "$g_talk_troop", slot_troop_signup_response_1),
(str_store_string, 6, ":signup_response")
], "{s6}", "companion_recruit_payment", []],
[anyone|plyr, "companion_recruit_signup_response", [
(hero_can_join, "p_main_party"),
(troop_get_slot, ":signup_response", "$g_talk_troop", slot_troop_signup_response_2),
(str_store_string, 7, ":signup_response")
], "{s7}", "close_window", [
]],
[anyone|auto_proceed, "companion_recruit_payment", [
(troop_slot_eq, "$g_talk_troop", slot_troop_payment_request, 0),
],
".", "companion_recruit_signup_confirm", []],
[anyone, "companion_recruit_payment", [
(store_sub, ":npc_offset", "$g_talk_troop", "trp_npc1"),
(store_add, ":dialog_line", "str_npc1_payment", ":npc_offset"),
(str_store_string, s5, ":dialog_line"),
(troop_get_slot, reg3, "$g_talk_troop", slot_troop_payment_request),
(str_store_party_name, s20, "$g_encountered_party"),
],
"{s5}", "companion_recruit_payment_response", []],
[anyone|plyr, "companion_recruit_payment_response", [
(hero_can_join, "p_main_party"),
(troop_get_slot, ":amount_requested", "$g_talk_troop", slot_troop_payment_request),#
(store_troop_gold, ":gold", "trp_player"),#
(ge, ":gold", ":amount_requested"),#
(assign, reg3, ":amount_requested"),
(store_sub, ":npc_offset", "$g_talk_troop", "trp_npc1"),
(store_add, ":dialog_line", "str_npc1_payment_response", ":npc_offset"),
(str_store_string, s6, ":dialog_line"),
], "{s6}", "companion_recruit_signup_confirm", [
(troop_get_slot, ":amount_requested", "$g_talk_troop", slot_troop_payment_request),#
(gt, ":amount_requested", 0),#
(troop_remove_gold, "trp_player", ":amount_requested"), #
(troop_set_slot, "$g_talk_troop", slot_troop_payment_request, 0),#
]],
[anyone|plyr, "companion_recruit_payment_response", [
(troop_get_slot, ":signup_response", "$g_talk_troop", slot_troop_signup_response_2),
(str_store_string, s7, ":signup_response")
], "Sorry. I can't afford that at the moment.", "close_window", [
]],
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
(troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 1),
(troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, 0),
],
"We meet again.", "companion_recruit_meet_again", [
(troop_set_slot, "$g_talk_troop", slot_troop_turned_down_twice, 1),
]],
[anyone|plyr, "companion_recruit_meet_again", [
], "So... What have you been doing since our last encounter?", "companion_recruit_backstory_delayed", []],
[anyone|plyr, "companion_recruit_meet_again", [
], "Good day to you.", "close_window", [
]],
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
(troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 0),
(troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, 0),
],
"Yes?", "companion_recruit_secondchance", [
(troop_set_slot, "$g_talk_troop", slot_troop_turned_down_twice, 1),
]],
[anyone|plyr, "companion_recruit_secondchance", [
], "My apologies if I was rude, earlier. What was your story again?", "companion_recruit_backstory_b", []],
[anyone|plyr, "companion_recruit_secondchance", [
], "Never mind.", "close_window", [
]],
[anyone, "companion_recruit_backstory_delayed",
[(troop_get_slot, ":backstory_delayed", "$g_talk_troop", slot_troop_backstory_delayed),
(str_store_string, 5, ":backstory_delayed")
],
"{s5}", "companion_recruit_backstory_delayed_response", []],
[anyone|plyr, "companion_recruit_backstory_delayed_response", [
], "I might be able to use you in my company.", "companion_recruit_signup_b", [
]],
[anyone|plyr, "companion_recruit_backstory_delayed_response", [
], "I'll let you know if I hear of anything.", "close_window", [
]],
[anyone, "companion_recruit_signup_confirm", [], "Good! Give me a few moments to prepare and I'll be ready to move.", "close_window",
[(call_script, "script_recruit_troop_as_companion", "$g_talk_troop")]],
### Rehire dialogues
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_indeterminate),
(troop_get_slot, ":prison_center", "$g_talk_troop", slot_troop_prisoner_of_party),
(lt, ":prison_center", centers_begin),
],
"My offer to rejoin you still stands, if you'll have me.", "companion_rehire", []],
### If the companion and the player were separated in battle
[anyone, "start",
[
(is_between, "$g_talk_troop", companions_begin, companions_end),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_scattered),
(this_or_next|eq, "$talk_context", tc_hero_freed),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(neq, "$talk_context", tc_prison_break),
(assign, ":battle_fate", "str_battle_fate_1"),
(store_random_in_range, ":fate_roll", 0, 5),
(val_add, ":battle_fate", ":fate_roll"),
(str_store_string, s6, ":battle_fate"),
(troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
(str_store_string, s5, ":honorific"),
],
"It is good to see you alive, {s5}! {s6}, and I did not know whether you had been captured, or slain, or got away. I've been roaming around since then, looking for you. Shall I get my gear together and rejoin your company?","companion_rehire",
[
(troop_set_slot, "$g_talk_troop", slot_troop_playerparty_history, pp_history_indeterminate),
(troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, -1),
]],
[anyone|plyr,"start",
[
(is_between, "$g_talk_troop", companions_begin, companions_end),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_scattered),
(troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(neq, "$talk_context", tc_prison_break),
(assign, ":battle_fate", "str_battle_fate_1"),
(store_random_in_range, ":fate_roll", 0, 5),
(val_add, ":battle_fate", ":fate_roll"),
(str_store_string, s6, ":battle_fate"),
(troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
(str_store_string, s5, ":honorific"),
],
"I've come to break you out of here.", "companion_prison_break_chains",[]],
[anyone,"companion_prison_break_chains", [],
"Thank the heavens you came! However, I'm not going anywhere with these chains on my legs. You'll need to get the key away from the guard somehow.", "close_window",[]],
### If the player and the companion parted on bad terms
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
(troop_slot_eq, "$g_talk_troop", slot_troop_turned_down_twice, 0),
(troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_quit),
(troop_get_slot, ":speech", "$g_talk_troop", slot_troop_rehire_speech),
(str_store_string, 5, ":speech"),
],
"{s5}", "companion_rehire", [
(troop_set_slot, "$g_talk_troop", slot_troop_playerparty_history, pp_history_indeterminate),
]],
###If the player and the companion parted on good terms
[anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
(troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_dismissed),
(troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
(str_store_string, 21, ":honorific"),
(troop_get_slot, ":speech", "$g_talk_troop", slot_troop_backstory_delayed),
(str_store_string, 5, ":speech"),
],
"It is good to see you, {s21}! To tell you the truth, I had hoped to run into you.",
"companion_was_dismissed", [
(troop_set_slot, "$g_talk_troop", slot_troop_playerparty_history, pp_history_indeterminate),
]],
[anyone, "companion_was_dismissed", [
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":speech", "$g_talk_troop", slot_troop_backstory_delayed),
(str_store_string, 5, ":speech"),
],
"{s5}. Would you want me to rejoin your company?", "companion_rehire", [
]],
[anyone|plyr, "companion_rehire",
[
(hero_can_join, "p_main_party"),
], "Welcome back, my friend!", "companion_recruit_signup_confirm", []],
[anyone|plyr, "companion_rehire",
[],
"Sorry, I can't take on anyone else right now.", "companion_rehire_refused", []],
[anyone, "companion_rehire_refused", [], "Well... Look me up if you change your mind, eh?", "close_window",
[
(troop_get_slot, ":current_town_no", "$g_talk_troop", slot_troop_cur_center),
(try_begin),
(neg|is_between, ":current_town_no", towns_begin, towns_end),
(store_random_in_range, ":town_no", towns_begin, towns_end),
(troop_set_slot, "$g_talk_troop", slot_troop_cur_center, ":town_no"),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg1, ":current_town_no"),
(str_store_party_name, s7, ":town_no"),
(display_message, "@{!}current town was {reg1}, now moved to {s7}"),
(try_end),
(try_end),
]],
#Default dialog added - for rehire
[anyone, "start", [
(is_between, "$g_talk_troop", companions_begin, companions_end),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":prison_center", "$g_talk_troop", slot_troop_prisoner_of_party),
(lt, ":prison_center", centers_begin),
], "So... Do you want me back yet?", "companion_rehire",
[]],
#Ministerial issues
[anyone, "minister_issues",
[
(check_quest_active, "qst_consult_with_minister"),
(eq, "$g_minister_notification_quest", "qst_resolve_dispute"),
(setup_quest_text,"qst_resolve_dispute"),
(quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop),
(str_store_troop_name, s11, ":lord_1"),
(quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
(str_store_troop_name, s12, ":lord_2"),
(str_store_string, s2, "str_resolve_the_dispute_between_s11_and_s12"),
(call_script, "script_start_quest", "qst_resolve_dispute", -1),
(quest_set_slot, "qst_resolve_dispute", slot_quest_expiration_days, 30),
(quest_set_slot, "qst_resolve_dispute", slot_quest_giver_troop, "$g_player_minister"),
(quest_set_slot, "qst_resolve_dispute", slot_quest_target_state, 0),
(quest_set_slot, "qst_resolve_dispute", slot_quest_object_state, 0),
(quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop), #this block just to check if the slots work
(str_store_troop_name, s11, ":lord_1"),
(quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
(str_store_troop_name, s12, ":lord_2"),
],
"There is a matter which needs your attention. The quarrel between {s11} and {s12} has esclatated to a point where it has become unseemly. If you do intervene, you risk offending one of the lords. However, if you do nothing, you risk appearing weak. Such are the burdens of kingship, {sire/my lady}.", "minister_pretalk",
[
(call_script, "script_end_quest", "qst_consult_with_minister"),
]],
[anyone, "minister_issues",
[
(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"),
(neg|party_slot_ge, ":center_no", slot_town_lord, 0),
(assign, "$g_center_taken_by_player_faction", ":center_no"),
(try_end),
(is_between, "$g_center_taken_by_player_faction", centers_begin, centers_end),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
],
"{s1} currently does not have a lord. You may wish to keep it this way, as lords will sometimes gravitate towards lieges who have land to offer, but for the time being, no one is collecting any of its rents.", "minister_talk",
[]],
[anyone, "minister_issues",
[
(neg|is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
],
"At this point, there are no particularly urgent matters which need your attention. I should point out though, sire, that I am not very skilled in the ways of politics, and that I am anxious to return to private life. If you wish to issue any but the most basic directives, I suggest appointing a trusted companion in my stead. In the meantime, is there anything you wish done?", "minister_talk",[]],
[anyone, "minister_issues",
[
(eq, 1, 0),
],
"{!}[Should not appear - there to prevent error related to center_captured_lord_advice]", "center_captured_lord_advice",[]],
[anyone, "minister_issues",
[
(lt, "$player_right_to_rule", 30),
],
"If I may offer you a world of advice, my {lord/lady}, it seems that your right to rule as an independent monarch is not sufficiently recognized, and this may bring us problems further down the road. It may be advisable to find another kingdom with whom you have shared interests and seek its recognition, to establish yourself as an equal with Calradia's other kings.", "minister_talk",[]],
[anyone, "minister_issues",
[],
"At this point, there are no particularly urgent matters which need your attention. Is there anything you wish done?", "minister_talk",[]],
[anyone, "minister_pretalk",
[],
"Is there anything you wish done?", "minister_talk",
[]],
[anyone|plyr,"minister_talk",
[
(is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
],
"Do you have any ideas to strengthen our kingdom's unity?", "combined_political_quests",[
(call_script, "script_get_political_quest", "$g_talk_troop"),
(assign, "$political_quest_found", reg0),
(assign, "$political_quest_target_troop", reg1),
(assign, "$political_quest_object_troop", reg2),
]],
[anyone|plyr,"minister_talk",
[
(assign, "$political_quest_to_cancel", -1),
(try_begin),
(check_quest_active, "qst_offer_gift"),
(quest_slot_eq, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
(assign, "$political_quest_to_cancel", "qst_offer_gift"),
(str_store_string, s10, "str_offer_gift_description"),
(else_try),
(check_quest_active, "qst_resolve_dispute"),
(quest_slot_eq, "qst_resolve_dispute", slot_quest_giver_troop, "$g_talk_troop"),
(assign, "$political_quest_to_cancel", "qst_resolve_dispute"),
(str_store_string, s10, "str_resolve_dispute_description"),
(try_end),
(gt, "$political_quest_to_cancel", 0),
],
"Let's abandon our plan to {s10}.", "minister_cancel_political_quest",[
]],
[anyone,"minister_cancel_political_quest",
[],
"Are you sure you want to drop that idea?", "minister_cancel_political_quest_confirm",[
]],
[anyone|plyr,"minister_cancel_political_quest_confirm",
[],
"Yes, I am sure. Let's abandon that idea.", "minister_pretalk",[
(call_script, "script_abort_quest", "$political_quest_to_cancel", 1),
]],
[anyone|plyr,"minister_cancel_political_quest_confirm",
[],
"Actually, never mind.", "minister_pretalk",[
]],
[anyone|plyr, "minister_talk",
[
(is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
],
"I wish to dispatch an emissary.", "minister_diplomatic_kingdoms",
[]],
[anyone|plyr, "minister_talk",
[
(is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
],
"I wish to indict a disloyal vassal for treason.", "minister_indict",
[]],
[anyone|plyr, "minister_talk",
[
(faction_get_slot, ":current_marshal", "$players_kingdom", slot_faction_marshall),
(ge, ":current_marshal", 0),
(try_begin),
(gt, ":current_marshal", 0),
(str_store_troop_name, s4, ":current_marshal"),
(else_try),
(str_store_string, s4, "str_myself"),
(try_end),
],
"I wish to replace {s4} as marshal.", "minister_change_marshal",
[]],
[anyone|plyr, "minister_talk",
[
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, -1),
],
"I wish to appoint a new marshal.", "minister_change_marshal",
[]],
[anyone, "minister_change_marshal",
[
(store_current_hours, ":hours"),
(val_sub, ":hours", "$g_player_faction_last_marshal_appointment"),
(lt, ":hours", 48),
],
"You have just made such an appointment, {sire/my lady}. If you countermand your decree so soon, there will be great confusion. We will need to wait a few days.", "minister_pretalk",
[]],
[anyone|plyr, "minister_talk",
[
(neg|is_between, "$g_player_minister", active_npcs_begin, active_npcs_end),
],
"I wish for you to retire as minister.", "minister_replace",
[]],
[anyone|plyr, "minister_talk",
[
(is_between, "$g_player_minister", active_npcs_begin, active_npcs_end),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
],
"I wish you to rejoin my party.", "minister_replace",
[]],
[anyone|plyr, "minister_talk",
[
(is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
],
"I wish you to grant one of my vassals a fief.", "minister_grant_fief",
[]],
[anyone|plyr, "minister_talk",
[
(is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
(assign, ":fief_found", -1),
(try_for_range, ":center", centers_begin, centers_end),
(eq, ":fief_found", -1),
(store_faction_of_party, ":center_faction", ":center"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":town_lord", ":center", slot_town_lord),
(try_begin),
(ge, ":town_lord", active_npcs_begin),
(store_faction_of_troop, ":town_lord_faction", ":town_lord"),
(neq, ":town_lord_faction", "fac_player_supporters_faction"),
(assign, ":town_lord", -1),
(try_end),
(lt, ":town_lord", 0),
(assign, ":fief_found", ":center"),
(try_end),
(gt, ":fief_found", -1),
(str_store_party_name, s4, ":fief_found"),
],
"I wish to make myself lord of {s4}.", "minister_grant_self_fief",
[]],
[anyone, "minister_grant_self_fief",
[
],
"As you wish. You shall be lord of {s4}.", "minister_pretalk",
[
(assign, ":fief_found", -1),
(try_for_range, ":center", centers_begin, centers_end),
(eq, ":fief_found", -1),
(store_faction_of_party, ":center_faction", ":center"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":town_lord", ":center", slot_town_lord),
(try_begin),
(ge, ":town_lord", active_npcs_begin),
(store_faction_of_troop, ":town_lord_faction", ":town_lord"),
(neq, ":town_lord_faction", "fac_player_supporters_faction"),
(assign, ":town_lord", -1),
(try_end),
(lt, ":town_lord", 0),
(assign, ":fief_found", ":center"),
(try_end),
(call_script, "script_give_center_to_lord", ":fief_found", "trp_player", 0),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, ":fief_found"),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
(try_end),
(str_store_party_name, s4, ":fief_found"),
]],
[anyone|plyr, "minister_talk",
[],
"That is all for now.", "close_window",
[]],
[anyone, "minister_change_marshal",
[],
"Who should be the new marshal?", "minister_change_marshal_choose",
[]],
[anyone|plyr, "minister_change_marshal_choose",
[],
"I shall be marshal", "minister_pretalk",
[
(call_script, "script_appoint_faction_marshall", "fac_player_supporters_faction", "trp_player"),
(store_current_hours, ":hours"),
(assign, "$g_recalculate_ais", 1),
(assign, "$g_player_faction_last_marshal_appointment", ":hours"),
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_political_issue, 1),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_political_issue, 0),
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":active_npc_faction", ":active_npc"),
(eq, ":active_npc_faction", "fac_player_supporters_faction"),
(troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
(try_end),
(try_end),
]],
[anyone|plyr, "minister_change_marshal_choose",
[],
"For a short while, we should have no marshal", "minister_pretalk",
[
(call_script, "script_appoint_faction_marshall", "fac_player_supporters_faction", -1),
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_political_issue, 1),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_political_issue, 0),
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":active_npc_faction", ":active_npc"),
(eq, ":active_npc_faction", "fac_player_supporters_faction"),
(troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
(try_end),
(try_end),
(assign, "$g_recalculate_ais", 1),
]],
[anyone|plyr|repeat_for_troops, "minister_change_marshal_choose",
[
(store_repeat_object, ":lord"),
(is_between, ":lord", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":lord", slot_troop_occupation, slto_kingdom_hero),
(store_faction_of_troop, ":lord_faction", ":lord"),
(eq, ":lord_faction", "fac_player_supporters_faction"),
(str_store_troop_name, s4, ":lord"),
],
"{s4}", "minister_pretalk",
[
(store_repeat_object, ":lord"),
(call_script, "script_appoint_faction_marshall", "fac_player_supporters_faction", ":lord"),
(store_current_hours, ":hours"),
(assign, "$g_player_faction_last_marshal_appointment", ":hours"),
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_political_issue, 1),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_political_issue, 0),
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":active_npc_faction", ":active_npc"),
(eq, ":active_npc_faction", "fac_player_supporters_faction"),
(troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
(try_end),
(try_end),
(assign, "$g_recalculate_ais", 1),
]],
[anyone|plyr, "minister_change_marshal_choose",
[],
"Never mind", "minister_pretalk",
[]],
[anyone, "minister_diplomatic_kingdoms",
[
(assign, ":companion_found", 0),
(try_for_range, ":emissary", companions_begin, companions_end),
(main_party_has_troop, ":emissary"),
(assign, ":companion_found", 1),
(try_end),
(eq, ":companion_found", 1),
],
"To whom do you wish to send this emissary?", "minister_diplomatic_kingdoms_select",
[]],
[anyone, "minister_diplomatic_kingdoms",
[
],
"Unfortunately, there is no one to send right now.", "minister_pretalk",
[]],
[anyone, "minister_diplomatic_kingdoms",
[],
"To whom do you wish to send this emissary?", "minister_diplomatic_kingdoms_select",
[]],
[anyone|plyr|repeat_for_factions, "minister_diplomatic_kingdoms_select",
[
(store_repeat_object, ":faction_no"),
(is_between, ":faction_no", kingdoms_begin, kingdoms_end),
(neq, ":faction_no", "fac_player_supporters_faction"),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(faction_get_slot, ":leader_no", ":faction_no", slot_faction_leader),
(str_store_troop_name, s10, ":leader_no"),
(str_store_faction_name, s11, ":faction_no"),
(str_clear, s14),
#Has/has not recognized us a monarch
],
"{s10} of the {s11}{s14}", "minister_diplomatic_initiative_type",
[
(store_repeat_object, "$g_faction_selected"),
]],
[anyone|plyr, "minister_diplomatic_kingdoms_select",
[],
"Never mind", "minister_pretalk",
[]],
[anyone, "minister_diplomatic_initiative_type",
[],
"What do you wish to tell him?", "minister_diplomatic_initiative_type_select",
[]],
[anyone|plyr, "minister_diplomatic_initiative_type_select",
[(store_relation, ":relation", "fac_player_supporters_faction", "$g_faction_selected"),
(lt, ":relation", 0),],
"That our two kingdoms should enter into truce.", "minister_diplomatic_emissary",
[(assign, "$g_initiative_selected", npc_mission_peace_request)]],
[anyone|plyr, "minister_diplomatic_initiative_type_select",
[],
"That I wish to put myself under his protection, as his vassal.", "minister_diplomatic_emissary",
[(assign, "$g_initiative_selected", npc_mission_pledge_vassal)]],
[anyone|plyr, "minister_diplomatic_initiative_type_select",
[(store_relation, ":relation", "fac_player_supporters_faction", "$g_faction_selected"),
(faction_slot_eq, "$g_faction_selected", slot_faction_recognized_player, 0),
(ge, ":relation", 0),],
"That I wish to express my goodwill, as one monarch to another.", "minister_diplomatic_emissary",
[(assign, "$g_initiative_selected", npc_mission_seek_recognition),]],
[anyone|plyr, "minister_diplomatic_initiative_type_select",
[(store_relation, ":relation", "fac_player_supporters_faction", "$g_faction_selected"),
(ge, ":relation", 0),],
"That I declare war upon him.", "minister_declare_war",
[]],
[anyone|plyr, "minister_diplomatic_initiative_type_select",[], "Never mind", "close_window",[]],
[anyone, "minister_declare_war",
[(try_begin),
(call_script, "script_diplomacy_faction_get_diplomatic_status_with_faction", "fac_player_supporters_faction", "$g_faction_selected"),
(eq, reg0, 1),
(str_store_string, s12, "str_in_doing_so_you_will_be_in_violation_of_your_truce_is_that_what_you_want"),
(else_try),
(call_script, "script_diplomacy_faction_get_diplomatic_status_with_faction", "fac_player_supporters_faction", "$g_faction_selected"),
(neq, reg0, -1),
(str_store_string, s12, "str_if_you_attack_without_provocation_some_of_your_vassals_may_consider_you_to_be_too_warlike_is_that_what_you_want"),
(else_try),
(str_store_string, s12, "str_our_men_are_ready_to_ride_forth_at_your_bidding_are_you_sure_this_is_what_you_want"),
(try_end),
], "{s12}", "minister_declare_war_confirm",
[]],
[anyone|plyr, "minister_declare_war_confirm",
[(str_store_faction_name, s12, "$g_faction_selected"),
],
"It is. I wish to make war on {s12}.", "minister_declare_war_confirm_yes",
[
(call_script, "script_diplomacy_start_war_between_kingdoms", "fac_player_supporters_faction", "$g_faction_selected", 1),
]],
[anyone|plyr, "minister_declare_war_confirm",
[(str_store_faction_name, s12, "$g_faction_selected"),
],
"Hmm. Perhaps not.", "minister_pretalk",
[
]],
[anyone, "minister_declare_war_confirm_yes",
[(str_store_faction_name, s12, "$g_faction_selected"),
],
"As you command. We are now at war with the {s12}. May the heavens grant us victory.", "minister_pretalk",
[
]],
[anyone, "minister_diplomatic_emissary",
[], "Who shall be your emissary? You should choose one whom you trust, but who is also persuasive -- one who can negotiate without giving offense.", "minister_emissary_select",
[]],
[anyone|plyr|repeat_for_troops, "minister_emissary_select",[
(store_repeat_object, ":emissary"),
(main_party_has_troop, ":emissary"),
(is_between, ":emissary", companions_begin, companions_end),
(troop_slot_eq, ":emissary", slot_troop_prisoner_of_party, -1),
(is_between, ":emissary", active_npcs_begin, active_npcs_end),
(str_store_troop_name, s11, ":emissary"),
], "{s11}", "minister_emissary_dispatch",[
(store_repeat_object, "$g_emissary_selected"),
]],
[anyone|plyr, "minister_emissary_select",[
], "Actually, I can't think of anyone.", "minister_pretalk",[]],
[anyone, "minister_emissary_dispatch",
[
(str_store_troop_name, s11, "$g_emissary_selected"),
(str_store_faction_name, s12, "$g_faction_selected"),
(try_begin),
(eq, "$g_initiative_selected", npc_mission_seek_recognition),
(str_store_string, s14, "str_seek_recognition"),
(else_try),
(eq, "$g_initiative_selected", npc_mission_pledge_vassal),
(str_store_string, s14, "str_seek_vassalhood"),
(else_try),
(eq, "$g_initiative_selected", npc_mission_peace_request),
(str_store_string, s14, "str_seek_a_truce"),
(try_end),
], "Very well -- I shall send {s11} to the {s12} to {s14}.", "minister_diplomatic_dispatch_confirm",[]],
[anyone|plyr, "minister_diplomatic_dispatch_confirm",[], "Yes, do that", "minister_pretalk",[
(troop_set_slot, "$g_emissary_selected", slot_troop_days_on_mission, 3),
(troop_set_slot, "$g_emissary_selected", slot_troop_current_mission, "$g_initiative_selected"),
(troop_set_slot, "$g_emissary_selected", slot_troop_mission_object, "$g_faction_selected"),
(remove_member_from_party, "$g_emissary_selected", "p_main_party"),
]],
[anyone|plyr, "minister_diplomatic_dispatch_confirm",[], "Actually, hold off on that", "minister_pretalk",[]],
[anyone, "minister_replace",
[], "Very good. Whom will you appoint in my stead?", "minister_replace_select",
[]],
[anyone|plyr|repeat_for_troops, "minister_replace_select",
[
(store_repeat_object, ":troop_no"),
(is_between, ":troop_no", companions_begin, companions_end),
(main_party_has_troop, ":troop_no"),
(troop_slot_eq, ":troop_no", slot_troop_prisoner_of_party, -1),
(str_store_troop_name, s4, ":troop_no"),
], "{s4}", "minister_replace_confirm",
[
(store_repeat_object, "$g_player_minister"),
]],
[anyone|plyr, "minister_replace_select",
[
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(gt, ":spouse", 0),
(troop_get_type, ":is_female", ":spouse"),
(neg|troop_slot_eq, ":spouse", slot_troop_occupation, slto_kingdom_hero),
(eq, ":is_female", 1),
(str_store_troop_name, s4, ":spouse"),
(neq, ":spouse", "$g_talk_troop"),
], "My wife, {s4}.", "minister_replace_confirm", #husband disabled, as he's an active lord
[
(troop_get_slot, "$g_player_minister", "trp_player", slot_troop_spouse),
]],
[anyone|plyr, "minister_replace_select",
[], "Actually, hold off on that.", "minister_pretalk",
[]],
[anyone, "minister_replace_confirm",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_player_companion),
], "Very good. {s9} is your new minister. I shall make ready to rejoin you.", "close_window",
[
(str_store_troop_name, s9, "$g_player_minister"),
(party_add_members, "p_main_party", "$g_talk_troop", 1),
(assign, "$g_leave_encounter", 1),
(try_begin),
(main_party_has_troop, "$g_player_minister"),
(party_remove_members, "p_main_party", "$g_player_minister", 1),
(try_end),
(try_for_range, ":minister_quest", all_quests_begin, all_quests_end),
(quest_slot_eq, ":minister_quest", slot_quest_giver_troop, "$g_talk_troop"),
(call_script, "script_abort_quest", ":minister_quest", 0),
(try_end),
]],
[anyone, "minister_replace_confirm",
[
], "Very good. {s9} is your new minister. It has been an honor to serve you.", "close_window",
[
(str_store_troop_name, s9, "$g_player_minister"),
(try_begin),
(main_party_has_troop, "$g_player_minister"),
(party_remove_members, "p_main_party", "$g_player_minister", 1),
(try_end),
]],
[anyone, "minister_grant_fief",
[
(faction_get_slot, ":fief_on_agenda", "$players_kingdom", slot_faction_political_issue),
(str_clear, s12),
(try_begin),
(is_between, ":fief_on_agenda", centers_begin, centers_end),
(str_store_party_name, s4, ":fief_on_agenda"),
(str_store_string, s12, "str_minister_advice_select_fief"),
(else_try),
(eq, ":fief_on_agenda", 1),
(str_store_string, s12, "str_minister_advice_select_fief_wait"),
(try_end),
],
"Which of your fiefs did you wish to grant?{s12}", "minister_grant_fief_select",
[]],
[anyone|plyr|repeat_for_parties, "minister_grant_fief_select",
[
(store_repeat_object, ":center_no"),
(is_between, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(neq, ":center_no", "$g_player_court"),
(party_get_slot, ":town_lord", ":center_no", slot_town_lord),
(try_begin),
(ge, ":town_lord", active_npcs_begin),
(store_faction_of_troop, ":town_lord_faction", ":town_lord"),
(neq, ":town_lord_faction", "fac_player_supporters_faction"),
(assign, ":town_lord", -1),
(try_end),
(le, ":town_lord", 0),
(str_store_party_name, s1, ":center_no"),
(str_clear, s12),
(try_begin),
(party_slot_eq, ":center_no", slot_town_lord, -1),
(str_store_string, s12, "str_unassigned_center"),
(try_end),
],"{s1}{s12}", "minister_grant_fief_select_recipient",
[
(store_repeat_object, "$fief_selected"),
]],
[anyone|plyr, "minister_grant_fief_select",
[
],"Never mind", "minister_pretalk",
[]],
[anyone, "minister_grant_fief_select_recipient",
[
(str_clear, s12),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$fief_selected"),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(troop_set_slot, ":active_npc", slot_troop_temp_slot, 0),
(try_end),
(assign, ":popular_favorite", -1),
(assign, ":votes_for_popular_favorite", 0),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":active_npc_faction", ":active_npc"),
(eq, ":active_npc_faction", "fac_player_supporters_faction"),
(troop_get_slot, ":selected_npc", ":active_npc", slot_troop_stance_on_faction_issue),
(ge, ":selected_npc", 0),
(troop_get_slot, ":votes_accumulated", ":selected_npc", slot_troop_temp_slot),
(val_add, ":votes_accumulated", 1),
(troop_set_slot, ":selected_npc", slot_troop_temp_slot, ":votes_accumulated"),
(gt, ":votes_accumulated", ":votes_for_popular_favorite"),
(assign, ":votes_for_popular_favorite", ":votes_accumulated"),
(assign, ":popular_favorite", ":selected_npc"),
(try_end),
(is_between, ":popular_favorite", active_npcs_begin, active_npcs_end),
(str_store_troop_name, s4, ":popular_favorite"),
(assign, reg4, ":votes_for_popular_favorite"),
(str_store_string, s12, "str_minister_advice_fief_leading_vassal"),
(try_end),
],"And who will you choose to receive the fief?{s12}", "minister_grant_fief_select_recipient_choice",
[]],
[anyone|plyr|repeat_for_troops, "minister_grant_fief_select_recipient_choice",
[
(store_repeat_object, ":troop_no"),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(is_between, ":troop_no", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", "fac_player_supporters_faction"),
(str_store_troop_name, s1, ":troop_no"),
],"{s1}", "minister_grant_fief_complete",
[
(store_repeat_object, "$lord_selected"),
]],
[anyone|plyr, "minister_grant_fief_select_recipient_choice",
[
],"Never mind", "minister_pretalk",
[]],
[anyone, "minister_grant_fief_complete",
[
],"Very well - {s2} shall receive {s1}.", "minister_pretalk",
[
(call_script, "script_give_center_to_lord", "$fief_selected", "$lord_selected", 0),
(str_store_party_name, s1, "$fief_selected"),
(str_store_troop_name, s2, "$lord_selected"),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$fief_selected"),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
(try_end),
(call_script, "script_add_log_entry", logent_castle_given_to_lord_by_player, "trp_player", "$fief_selected", "$lord_selected", "$g_encountered_party_faction"),
]],
[anyone, "minister_indict",
[], "Grim news, {sire/my lady}. Who do you believe is planning to betray you?", "minister_indict_select",
[]],
[anyone|plyr|repeat_for_troops, "minister_indict_select",
[
(store_repeat_object, ":troop_no"),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(store_faction_of_troop, ":faction", ":troop_no"),
(eq, ":faction", "fac_player_supporters_faction"),
(str_store_troop_name, s11, ":troop_no"),
], "{s11}", "minister_indict_confirm",
[
(store_repeat_object, "$lord_selected"),
]],
[anyone|plyr, "minister_indict_select",
[], "Never mind.", "minister_pretalk",
[]],
[anyone, "minister_indict_confirm",
[
(str_store_troop_name, s4, "$lord_selected"),
(troop_get_type, reg4, "$lord_selected"),
], "Think carefully on this, {sire/my lady}. If you indict {s4} for treason unjustly, you may find that others become nervous about serving you. On the other hand, if you truly believe that {reg4?she:he} is about to betray you, then perhaps it is best to move first, to secure control of {reg4?her:his} fortresses.", "minister_indict_confirm_answer",
[]],
[anyone|plyr, "minister_indict_confirm_answer",[], "I have thought long enough. Issue the indictment!", "minister_indict_conclude",[]],
[anyone|plyr, "minister_indict_confirm_answer",[], "Perhaps I should wait a little while longer..", "minister_pretalk",[]],
[anyone, "minister_indict_conclude",
[], "It has been sent, {sire/my lady}.", "minister_pretalk",
[
(call_script, "script_indict_lord_for_treason", "$lord_selected", "fac_player_supporters_faction"),
]],
[anyone|plyr|repeat_for_troops, "center_captured_lord_advice",
[
(store_repeat_object, ":troop_no"),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(neq, "$g_talk_troop", ":troop_no"),
(neq, "trp_player", ":troop_no"),
(store_troop_faction, ":faction_no", ":troop_no"),
(eq, ":faction_no", "fac_player_supporters_faction"),
(str_store_troop_name, s11, ":troop_no"),
(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", ":troop_no"),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
(str_store_string, s12, "str__promised_fief"),
(else_try),
(str_clear, s12),
(try_end),
(try_begin),
(eq, reg0, 0),
(str_store_string, s1, "str_no_fiefss12"),
(else_try),
(str_store_string, s1, "str_fiefs_s0s12"),
(try_end),
],
"{s11}. {s1}", "center_captured_lord_advice_2",
[
(store_repeat_object, "$temp"),
]],
[anyone|plyr, "center_captured_lord_advice",
[
(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "trp_player"),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
(try_begin),
(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(str_store_string, s12, "str_please_s65_"),
(else_try),
(str_clear, s12),
(try_end),
],
"{s12}I want to have {s1} for myself. (fiefs: {s0})", "center_captured_lord_advice_2",
[
(assign, "$temp", "trp_player"),
]],
[anyone|plyr, "center_captured_lord_advice",
[
(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "$g_talk_troop"),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
],
"{s66}, you should have {s1} for yourself. (fiefs: {s0})", "center_captured_lord_advice_2",
[
(assign, "$temp", "$g_talk_troop"),
]],
[anyone, "center_captured_lord_advice_2",
[
(eq, "$g_talk_troop", "$g_player_minister"),
],
"As you wish, {sire/my lady}. {reg6?I:{reg7?You:{s11}}} will be the new {reg3?lady:lord} of {s1}.", "minister_issues",
[
(assign, ":new_owner", "$temp"),
(call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", ":new_owner", 0),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
(try_end),
(try_begin),
(neq, ":new_owner", "trp_player"),
(try_for_range, ":unused", 0, 4),
(call_script, "script_cf_reinforce_party", "$g_center_taken_by_player_faction"),
(try_end),
(try_end),
(assign, reg6, 0),
(assign, reg7, 0),
(try_begin),
(eq, ":new_owner", "$g_talk_troop"),
(assign, reg6, 1),
(else_try),
(eq, ":new_owner", "trp_player"),
(assign, reg7, 1),
(else_try),
(str_store_troop_name, s11, ":new_owner"),
(try_end),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
(troop_get_type, reg3, ":new_owner"),
(assign, "$g_center_taken_by_player_faction", -1),
]],
[anyone, "center_captured_lord_advice_2",
[
],
"Hmmm. All right, {playername}. I value your counsel highly. {reg6?I:{reg7?You:{s11}}} will be the new {reg3?lady:lord} of {s1}.", "close_window",
[
(assign, ":new_owner", "$temp"),
(troop_set_slot, ":new_owner", slot_lord_recruitment_argument, 0),
(call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", ":new_owner", 0),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
(try_end),
(try_begin),
(neq, ":new_owner", "trp_player"),
(try_for_range, ":unused", 0, 4),
(call_script, "script_cf_reinforce_party", "$g_center_taken_by_player_faction"),
(try_end),
(try_end),
(assign, reg6, 0),
(assign, reg7, 0),
(try_begin),
(eq, ":new_owner", "$g_talk_troop"),
(assign, reg6, 1),
(else_try),
(eq, ":new_owner", "trp_player"),
(assign, reg7, 1),
(else_try),
(str_store_troop_name, s11, ":new_owner"),
(try_end),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
(troop_get_type, reg3, ":new_owner"),
(assign, "$g_center_taken_by_player_faction", -1),
]],
[anyone, "event_triggered", [
(eq, "$g_infinite_camping", 0),
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_is_quitting"),
(troop_get_slot, ":honorific", "$map_talk_troop", slot_troop_honorific),
(str_store_string, 5, ":honorific")],
"Excuse me {s5} -- there is something I need to tell you.", "companion_quitting", [
(assign, "$npc_is_quitting", 0),
(assign, "$player_can_persuade_npc", 1),
(assign, "$player_can_refuse_npc_quitting", 1),
]],
### This is also where the dialogue jumps if the player initiates quitting dialogue and the companion has low morale
[anyone, "companion_quitting", [
(store_conversation_troop, "$map_talk_troop"),
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_retirement_speech),
(str_store_string, 5, ":speech")
],
"{s5}", "companion_quitting_2", [
]],
## The companion explains his/her reasons for quitting
[anyone, "companion_quitting_2", [
(call_script, "script_npc_morale", "$map_talk_troop"),
],
"To tell you the truth, {s21}", "companion_quitting_response", [
]],
[anyone|plyr, "companion_quitting_response", [
], "Very well. You be off, then.", "companion_quitting_yes", [
]],
[anyone|plyr, "companion_quitting_response", [
(eq, "$player_can_persuade_npc", 1),
], "Perhaps I can persuade you to change your mind.", "companion_quitting_persuasion", [
(assign, "$player_can_persuade_npc", 0),
]],
[anyone, "companion_quitting_persuasion", [
(store_random_in_range, ":random", -2, 13),
(store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
(le, ":random", ":persuasion"),
],
"Hm. When you put it like that, I suppose I can stay a while longer, see if things improve.", "close_window",
[
(troop_get_slot, ":morality_penalties", "$map_talk_troop", slot_troop_morality_penalties),
(val_div, ":morality_penalties", 2),
(troop_set_slot, "$map_talk_troop", slot_troop_morality_penalties, ":morality_penalties"),
(troop_get_slot, ":personalityclash_penalties", "$map_talk_troop", slot_troop_personalityclash_penalties),
(val_div, ":personalityclash_penalties", 2),
(troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_penalties, ":personalityclash_penalties"),
]],
[anyone, "companion_quitting_persuasion", [
],
"I'm sorry, but I don't see your point. I am leaving whether you like it or not.", "companion_quitting_response",
[
]],
[anyone|plyr, "companion_quitting_response", [
(eq, 1, 0),
(eq, "$player_can_refuse_npc_quitting", 1),
], "We hang deserters in this company.", "companion_quitting_no", [
]],
[anyone, "companion_quitting_no", [],
"Oh... Right... Do you mean that?", "companion_quitting_no_confirm", [
]],
[anyone|plyr, "companion_quitting_no_confirm", [],
"Absolutely. You either leave this company by my command, or are carried out on your shield.", "companion_quitting_no_confirmed", [
]],
[anyone|plyr, "companion_quitting_no_confirm", [],
"No, actually I don't mean that. You are free to leave.", "companion_quitting_yes", [
]],
[anyone, "companion_quitting_yes", [
],
"Then this is goodbye. Perhaps I'll see you around, {playername}.", "close_window", [
(troop_set_slot, "$map_talk_troop", slot_troop_playerparty_history, pp_history_quit),
(call_script, "script_retire_companion", "$map_talk_troop", 100),
]],
[anyone, "companion_quitting_no_confirmed", [
],
"Hm. I suppose I'm staying, then.", "close_window", [
]],
#Morality objections
[anyone, "event_triggered", [
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_with_grievance"),
(eq, "$npc_map_talk_context", slot_troop_morality_state),
(try_begin),
(eq, "$npc_grievance_slot", slot_troop_morality_state),
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_morality_speech),
(else_try),
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_2ary_morality_speech),
(try_end),
(str_store_string, 21, "$npc_grievance_string"),
(str_store_string, 5, ":speech"),
],
"{s5}", "companion_objection_response", [
(assign, "$npc_with_grievance", 0),
]],
[anyone|plyr, "companion_objection_response", [
(eq, "$npc_praise_not_complaint", 1),
], "Thanks, I appreciate your support.", "close_window", [
(troop_set_slot, "$map_talk_troop", "$npc_grievance_slot", tms_acknowledged),
]],
[anyone|plyr, "companion_objection_response", [
(eq, "$npc_praise_not_complaint", 0),
], "Hopefully it won't happen again.", "close_window", [
(troop_set_slot, "$map_talk_troop", "$npc_grievance_slot", tms_acknowledged),
]],
[anyone|plyr, "companion_objection_response", [
(eq, "$npc_praise_not_complaint", 0),
], "Your objection is noted. Now fall back in line.", "close_window", [
(troop_set_slot, "$map_talk_troop", "$npc_grievance_slot", tms_dismissed),
(troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_morality_penalties),
(val_add, ":grievance", 10),
(troop_set_slot, "$map_talk_troop", slot_troop_morality_penalties, ":grievance"),
]],
## [anyone|plyr, "companion_objection_response", [
## ], "I prefer my followers to keep their opinions to themselves.", "close_window", [
## (troop_set_slot, "$map_talk_troop", "$npc_grievance_slot", tms_dismissed),
## (troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_morality_penalties),
## (val_add, ":grievance", 10),
## (troop_set_slot, "$map_talk_troop", slot_troop_morality_penalties, ":grievance"),
## (assign, "$disable_npc_complaints", 1),
## ]],
# Personality clash 2 objections
[anyone, "event_triggered", [
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_with_personality_clash_2"),
(eq, "$npc_map_talk_context", slot_troop_personalityclash2_state),
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalityclash2_speech),
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
(str_store_troop_name, 11, ":object"),
(str_store_string, 5, ":speech"),
],
"{s5}", "companion_personalityclash2_b", [
(assign, "$npc_with_personality_clash_2", 0),
(troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_personalityclash_penalties),
(val_add, ":grievance", 5),
(troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_penalties, ":grievance"),
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
(call_script, "script_troop_change_relation_with_troop", "$map_talk_troop", ":object", -15),
]],
[anyone, "companion_personalityclash2_b", [
], "{s5}", "companion_personalityclash2_response", [
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalityclash2_speech_b),
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
(str_store_troop_name, 11, ":object"),
(str_store_string, 5, ":speech"),
]],
[anyone|plyr, "companion_personalityclash2_response", [
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
(str_store_troop_name, s11, ":object"),
(troop_get_type, reg11, ":object"),
], "{s11} is a valuable member of this company. I don't want you picking any more fights with {reg11?her:him}.", "close_window", [
(troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, pclash_penalty_to_self),
]],
[anyone|plyr, "companion_personalityclash2_response", [
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
(str_store_troop_name, s11, ":object"),
(troop_get_type, reg11, ":object"),
], "Tell {s11} you have my support in this, and {reg11?she:he} should hold {reg11?her:his} tongue.", "close_window", [
(troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, pclash_penalty_to_other),
]],
[anyone|plyr, "companion_personalityclash2_response", [
], "I don't have time for your petty dispute. Do not bother me with this again.", "close_window", [
(troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, pclash_penalty_to_both),
]],
## [anyone|plyr, "companion_personalityclash2_response", [
## ], "Your grievance is noted. Now fall back in line.", "close_window", [
## (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, 1),
## ]],
## [anyone|plyr, "companion_personalityclash2_response", [
## ], "I prefer my followers to keep their opinions to themselves.", "close_window", [
## (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, 1),
## (assign, "$disable_npc_complaints", 1),
## ]],
# Personality clash objections
[anyone, "event_triggered", [
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_with_personality_clash"),
(eq, "$npc_map_talk_context", slot_troop_personalityclash_state),
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalityclash_speech),
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
(str_store_troop_name, 11, ":object"),
(str_store_string, 5, ":speech"),
],
"{s5}", "companion_personalityclash_b", [
(assign, "$npc_with_personality_clash", 0),
(troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_personalityclash_penalties),
(val_add, ":grievance", 5),
(troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_penalties, ":grievance"),
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
(call_script, "script_troop_change_relation_with_troop", "$map_talk_troop", ":object", -15),
]],
[anyone, "companion_personalityclash_b", [
], "{s5}", "companion_personalityclash_response", [
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalityclash_speech_b),
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
(str_store_troop_name, 11, ":object"),
(str_store_string, 5, ":speech"),
]],
[anyone|plyr, "companion_personalityclash_response", [
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
(str_store_troop_name, s11, ":object"),
(troop_get_type, reg11, ":object"),
], "{s11} is a capable member of this company. I don't want you picking any more fights with {reg11?her:him}.", "close_window", [
(troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, pclash_penalty_to_self),
]],
[anyone|plyr, "companion_personalityclash_response", [
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
(str_store_troop_name, s11, ":object"),
(troop_get_type, reg11, ":object"),
], "Tell {s11} you have my support in this, and {reg11?she:he} should hold {reg11?her:his} tongue.", "close_window", [
(troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, pclash_penalty_to_other),
]],
[anyone|plyr, "companion_personalityclash_response", [
], "I don't have time for your petty dispute. Do not bother me with this again.", "close_window", [
(troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, pclash_penalty_to_both),
]],
## [anyone|plyr, "companion_personalityclash_response", [
## ], "Your grievance is noted. Now fall back in line.", "close_window", [
## (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, 1),
## ]],
## [anyone|plyr, "companion_personalityclash_response", [
## ], "I prefer my followers to keep their opinions to themselves.", "close_window", [
## (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, 1),
## (assign, "$disable_npc_complaints", 1),
## ]],
# Personality match
[anyone, "event_triggered", [
(eq, "$npc_map_talk_context", slot_troop_personalitymatch_state),
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_with_personality_match"),
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalitymatch_speech),
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalitymatch_object),
(str_store_troop_name, 11, ":object"),
(str_store_string, 5, ":speech"),
],
"{s5}", "companion_personalitymatch_b", [
(assign, "$npc_with_personality_match", 0),
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalitymatch_object),
(call_script, "script_troop_change_relation_with_troop", "$map_talk_troop", ":object", 15),
]],
[anyone, "companion_personalitymatch_b", [
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalitymatch_speech_b),
(troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalitymatch_object),
(str_store_troop_name, 11, ":object"),
(str_store_string, 5, ":speech"),
],
"{s5}", "companion_personalitymatch_response", [
]],
[anyone|plyr, "companion_personalitymatch_response", [
], "Very good.", "close_window", [
(troop_set_slot, "$map_talk_troop", slot_troop_personalitymatch_state, 1),
]],
## [anyone|plyr, "companion_personalitymatch_response", [
## ], "I prefer my followers to keep their opinions to themselves.", "close_window", [
## (troop_set_slot, "$map_talk_troop", slot_troop_personalitymatch_state, 1),
## (assign, "$disable_npc_complaints", 1),
## ]],
[anyone, "event_triggered", [
(eq, "$npc_map_talk_context", slot_troop_woman_to_woman_string),
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(store_sub, ":npc_no", "$map_talk_troop", "trp_npc1"),
(store_add, ":speech", "str_npc1_woman_to_woman", ":npc_no"),
# (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_woman_to_woman_string),
(str_store_string, s5, ":speech"),
],
"{s5}", "companion_sisterly_advice", [
(troop_set_slot, "$map_talk_troop", slot_troop_woman_to_woman_string, -1),
(assign, "$npc_with_sisterly_advice", 0),
]],
[anyone|plyr, "companion_sisterly_advice", [
], "Thank you.", "close_window", [
]],
[anyone|plyr, "companion_sisterly_advice", [
], "I would prefer not to discuss such things.", "close_window", [
(assign, "$disable_sisterly_advice", 1),
]],
[anyone, "event_triggered", [
(eq, "$g_infinite_camping", 0),
(eq, "$npc_map_talk_context", slot_troop_home),
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_home_intro),
(str_store_string, s5, ":speech"),
],
"{s5}", "companion_home_description", [
(troop_set_slot, "$map_talk_troop", slot_troop_home_speech_delivered, 1),
]],
[anyone|plyr, "companion_home_description", [
], "Tell me more.", "companion_home_description_2", [
]],
[anyone|plyr, "companion_home_description", [
], "We don't have time to chat just now.", "close_window", [
]],
[anyone|plyr, "companion_home_description", [
], "I prefer my companions not to bother me with such trivialities.", "close_window", [
(assign, "$disable_local_histories", 1),
]],
[anyone, "companion_home_description_2", [
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_home_description),
(str_store_string, 5, ":speech"),
], "{s5}", "companion_home_description_3", [
]],
[anyone, "companion_home_description_3", [
(troop_get_slot, ":speech", "$map_talk_troop", slot_troop_home_description_2),
(str_store_string, 5, ":speech"),
], "{s5}", "close_window", [
]],
[anyone,"event_triggered", [
(eq, "$talk_context", tc_rebel_thanks),
(store_conversation_troop, "$g_talk_troop"),
(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(troop_get_slot, ":old_faction", "$g_talk_troop", slot_troop_original_faction),
(str_store_faction_name, s3, ":old_faction"),
(str_store_string, s6, "@{playername}, when we started our long walk, few people had the courage to support me.\
And fewer still would be willing to put their lives at risk for my cause.\
But you didn't hesitate for a moment in throwing yourself at my enemies.\
We have gone through a lot together, and there were times I came close to losing all hope.\
But with God's help, we prevailed. It is now time for me to leave your company and take what's rightfully mine.\
From now on, I will carry out the great responsibility of ruling {s3}.\
There still lie many challanges ahead and I count on your help in overcoming those.\
And of course, you will always remain as my foremost vassal."),
],
"{s6}", "rebel_thanks_answer",
[
(unlock_achievement, ACHIEVEMENT_KINGMAKER),
(call_script, "script_end_quest", "qst_rebel_against_kingdom"),
]],
[anyone|plyr,"rebel_thanks_answer", [], "It was an honour to fight for your cause, {reg65?madame:my lord}.", "rebel_thanks_answer_2", []],
[anyone|plyr,"rebel_thanks_answer", [], "You will always have my loyal support, {reg65?my lady:sir}.", "rebel_thanks_answer_2", []],
[anyone,"rebel_thanks_answer_2", [], "I will miss living this life of adventure with you, but my duties await me. So... farewell for now, {playername}.\
I hope I'll see you again soon.", "close_window", []],
[anyone, "event_triggered", [
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_with_political_grievance"),
(eq, "$npc_map_talk_context", slot_troop_kingsupport_objection_state),
(store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
(store_add, ":string", "str_npc1_kingsupport_objection", ":npc_no"),
# (troop_get_slot, ":string", "$map_talk_troop", slot_troop_kingsupport_objection_string),
(str_store_string, 21, ":string"),
],
"{s21}", "companion_political_grievance_response", [
(assign, "$npc_with_political_grievance", 0),
(troop_set_slot, "$map_talk_troop", slot_troop_kingsupport_objection_state, 2),
]],
[anyone|plyr, "companion_political_grievance_response", [
# (eq, "$npc_praise_not_complaint", 0),
], "Your opinion is noted.", "close_window", [
(troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_morality_penalties),
(val_add, ":grievance", 25),
(troop_set_slot, "$map_talk_troop", slot_troop_morality_penalties, ":grievance"),
]],
[anyone, "event_triggered", [
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_to_rejoin_party"),
(neg|main_party_has_troop, "$map_talk_troop"),
(troop_slot_eq, "$map_talk_troop", slot_troop_current_mission, npc_mission_rejoin_when_possible),
(troop_slot_eq, "$map_talk_troop", slot_troop_occupation, slto_player_companion),
(troop_get_slot, ":string", "$map_talk_troop", slot_troop_honorific),
(str_store_string, 21, ":string"),
],
"Greetings, {s21}. Are you ready for me to rejoin you?" ,
"companion_rejoin_response",
[
(assign, "$npc_to_rejoin_party", 0),
]],
[anyone, "event_triggered", [
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_to_rejoin_party"),
# (eq, "$npc_map_talk_context", slot_troop_days_on_mission),
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_kingsupport),
(troop_get_slot, ":string", "$map_talk_troop", slot_troop_honorific),
(str_store_string, 21, ":string"),
],
"Well, {s21}, at last I've found you. I've been out spreading the word about your claim, and am now ready to rejoin the company.", "companion_rejoin_response", [
(assign, "$npc_to_rejoin_party", 0),
(call_script, "script_change_player_right_to_rule", 3),
(troop_set_slot, "$g_talk_troop", slot_troop_kingsupport_state, 1),
(try_begin),
(is_between, "$player_right_to_rule", 10, 15),
(call_script, "script_add_log_entry", logent_player_claims_throne_1, "trp_player", 0, 0, 0),
(else_try),
(is_between, "$player_right_to_rule", 20, 25),
(call_script, "script_add_log_entry", logent_player_claims_throne_2, "trp_player", 0, 0, 0),
(try_end),
]],
[anyone, "event_triggered", [
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_to_rejoin_party"),
# (eq, "$npc_map_talk_context", slot_troop_days_on_mission),
(troop_slot_eq, "$map_talk_troop", slot_troop_current_mission, npc_mission_gather_intel),
(troop_get_slot, ":string", "$map_talk_troop", slot_troop_honorific),
(str_store_string, 21, ":string"),
(troop_get_slot, ":town_with_contacts", "$map_talk_troop", slot_troop_town_with_contacts),
(store_faction_of_party, ":town_faction", ":town_with_contacts"),
(call_script, "script_update_faction_political_notes", ":town_faction"),
(assign, ":instability_index", reg0),
(val_add, ":instability_index", reg0),
(val_add, ":instability_index", reg1),
(str_store_faction_name, s12, ":town_faction"),
(try_begin),
(ge, ":instability_index", 60),
(str_store_string, s11, "str_the_s12_is_a_labyrinth_of_rivalries_and_grudges_lords_ignore_their_lieges_summons_and_many_are_ripe_to_defect"),
(else_try),
(ge, ":instability_index", 40),
(str_store_string, s11, "str_the_s12_is_shaky_many_lords_do_not_cooperate_with_each_other_and_some_might_be_tempted_to_defect_to_a_liege_that_they_consider_more_worthy"),
(else_try),
(ge, ":instability_index", 20),
(str_store_string, s11, "str_the_s12_is_fairly_solid_some_lords_bear_enmities_for_each_other_but_they_tend_to_stand_together_against_outside_enemies"),
(else_try),
(str_store_string, s11, "str_the_s12_is_a_rock_of_stability_politically_speaking_whatever_the_lords_may_think_of_each_other_they_fight_as_one_against_the_common_foe"),
(try_end),
(try_for_range, ":lord", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":lord", slot_troop_occupation, slto_kingdom_hero),
(store_faction_of_troop, ":lord_faction", ":lord"),
(eq, ":lord_faction", ":town_faction"),
(call_script, "script_update_troop_political_notes", ":lord"),
(try_end),
],
"Well, {s21}, at last I've found you. {s11}. The rest of my report I submit to you in writing.", "companion_rejoin_response", [
]],
[anyone, "event_triggered", [
(store_conversation_troop, "$map_talk_troop"),
(is_between, "$map_talk_troop", companions_begin, companions_end),
(eq, "$map_talk_troop", "$npc_to_rejoin_party"),
# (eq, "$npc_map_talk_context", slot_troop_days_on_mission),
(troop_get_slot, ":mission", "$g_talk_troop", slot_troop_current_mission),
(this_or_next|eq, ":mission", npc_mission_peace_request),
(this_or_next|eq, ":mission", npc_mission_pledge_vassal),
(this_or_next|eq, ":mission", npc_mission_test_waters),
(this_or_next|eq, ":mission", npc_mission_non_aggression),
(eq, ":mission", npc_mission_seek_recognition),
(troop_get_slot, ":string", "$map_talk_troop", slot_troop_honorific),
(str_store_string, 21, ":string"),
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(str_store_faction_name, s31, ":mission_object"),
(call_script, "script_npc_decision_checklist_peace_or_war", ":mission_object", "fac_player_supporters_faction", "$g_talk_troop"),
(assign, "$g_mission_result", reg0),
],
"Well, {s21}, at last I've found you. I have returned from my mission to {s31}. In general, I would say, {s14}.","companion_embassy_results", [
]],
[anyone, "companion_embassy_results", [
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_seek_recognition),
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(this_or_next|ge, "$g_mission_result", 2),
(faction_slot_eq, ":mission_object", slot_faction_recognized_player, 1),
(is_between, "$g_player_court", centers_begin, centers_end),
(faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
(str_store_troop_name, s12, ":emissary_object"),
(neg|party_slot_eq, "$g_player_court", slot_center_original_faction, ":mission_object"),
(str_store_party_name, s4, "$g_player_court"),
],
"In this letter, {s12} addresses you as {Lord/Lady} of {s4}, which implies some sort of recognition that you are a sovereign and independent monarch.","companion_rejoin_response", [
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(try_begin),
(faction_slot_eq, ":mission_object", slot_faction_recognized_player, 0),
(faction_set_slot, ":mission_object", slot_faction_recognized_player, 1),
(call_script, "script_change_player_right_to_rule", 10),
(try_end),
]],
[anyone, "companion_embassy_results", [
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_seek_recognition),
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
(str_store_troop_name, s12, ":emissary_object"),
],
"In his letter, {s12} merely refers to you as {playername}, omitting any title. This does not constitute recognition of your right to rule.","companion_rejoin_response", [
]],
[anyone, "companion_embassy_results", [
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_peace_request),
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(faction_slot_ge, ":mission_object", slot_faction_truce_days_with_factions_begin, 1),
(faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
(str_store_troop_name, s12, ":emissary_object"),
],
"{s12} says that your current truce should suffice.","companion_rejoin_response", [
]],
[anyone, "companion_embassy_results", [
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_peace_request),
(ge, "$g_mission_result", 1),
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
(str_store_troop_name, s12, ":emissary_object"),
],
"{s12} says that he is willing to consider a truce of forty days.","companion_truce_confirm", [
]],
[anyone, "companion_embassy_results", [
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_peace_request),
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
(str_store_troop_name, s12, ":emissary_object"),
],
"{s12} says that he is unwilling to conclude a peace.","companion_rejoin_response", [
]],
[anyone|plyr, "companion_truce_confirm", [
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(str_store_faction_name, s4, ":mission_object"),
],
"Very well - let this truce with the {s4} be concluded.","companion_rejoin_response", [
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(call_script, "script_diplomacy_start_peace_between_kingdoms", ":mission_object", "$players_kingdom", 1),
(str_store_faction_name, s4, ":mission_object"),
]],
[anyone|plyr, "companion_truce_confirm", [],
"On second thought, perhaps this is currently not in our interests.","companion_rejoin_response", [
]],
[anyone, "companion_embassy_results", [
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_pledge_vassal),
# (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(this_or_next|check_quest_active, "qst_join_faction"),
(is_between, "$players_kingdom", npc_kingdoms_begin, npc_kingdoms_end),
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
(str_store_troop_name, s12, ":emissary_object"),
],
"{s12} says that you are already pledged to another ruler.","companion_rejoin_response", [
]],
[anyone, "companion_embassy_results", [
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_pledge_vassal),
# (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(lt, "$g_mission_result", -2),
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
(str_store_troop_name, s12, ":emissary_object"),
],
"{s12} says that he does not believe that you would honor your obligations as a vassal, and suspects that your offer is just a ploy.","companion_rejoin_response", [
]],
[anyone, "companion_embassy_results", [
(troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_pledge_vassal),
(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
(faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
(str_store_troop_name, s12, ":emissary_object"),
],
"{s12} says that he accepts your offer of vassalage. He will give you 30 days to seek him out, in which time he will refrain from making war on you.","vassalage_offer_confirm", [
]],
[anyone|plyr, "vassalage_offer_confirm", [],
"Tell him that I accept his terms...", "companion_rejoin_response", [
(troop_get_slot, "$g_invite_faction", "$g_talk_troop", slot_troop_mission_object),
(faction_get_slot, "$g_invite_faction_lord", "$g_invite_faction", slot_faction_leader),
(str_store_troop_name,s1,"$g_invite_faction_lord"),
(setup_quest_text,"qst_join_faction"),
(str_store_troop_name_link, s3, "$g_invite_faction_lord"),
(str_store_faction_name_link, s4, "$g_invite_faction"),
(quest_set_slot, "qst_join_faction", slot_quest_giver_troop, "$g_invite_faction_lord"),
(quest_set_slot, "qst_join_faction", slot_quest_expiration_days, 30),
(try_begin),
(store_relation, ":relation", "$g_invite_faction", "fac_player_supporters_faction"),
(lt, ":relation", 0),
(call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_invite_faction", "fac_player_supporters_faction", 0),
(quest_set_slot, "qst_join_faction", slot_quest_failure_consequence, 1),
(try_end),
(str_store_string, s2, "@Find and speak with {s3} of {s4} to give him your oath of homage."),
(call_script, "script_start_quest", "qst_join_faction", "$g_invite_faction_lord"),
(call_script, "script_report_quest_troop_positions", "qst_join_faction", "$g_invite_faction_lord", 3),
]],
[anyone|plyr, "companion_rejoin_response", [
(hero_can_join, "p_main_party"),
(neg|main_party_has_troop, "$map_talk_troop"),
], "Welcome back, friend!", "close_window", [
(party_add_members, "p_main_party", "$map_talk_troop", 1),
(assign, "$npc_to_rejoin_party", 0),
(troop_set_slot, "$map_talk_troop", slot_troop_current_mission, 0),
(troop_set_slot, "$map_talk_troop", slot_troop_days_on_mission, 0),
]],
[anyone|plyr, "companion_rejoin_response", [
], "Unfortunately, I cannot take you back just yet.", "companion_rejoin_refused", [
(troop_set_slot, "$map_talk_troop", slot_troop_current_mission, npc_mission_rejoin_when_possible),
(troop_set_slot, "$map_talk_troop", slot_troop_days_on_mission, 0),
(assign, "$npc_to_rejoin_party", 0),
]],
[anyone, "companion_rejoin_refused", [
], "As you wish. I will take care of some business, and try again in a few days.", "close_window", [
]],
[anyone, "event_triggered", [
(is_between, "$g_talk_troop", companions_begin, companions_end),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(neg|main_party_has_troop, "$g_talk_troop"),
],
"Would you have me rejoin you?", "companion_rejoin_response", [
(assign, "$map_talk_troop", "$g_talk_troop"),
]],
#caravan merchants
[anyone, "event_triggered",
[(eq, "$caravan_escort_state",1),
(eq, "$g_encountered_party","$caravan_escort_party_id"),
(le, "$talk_context",tc_party_encounter),
(store_distance_to_party_from_party, reg0, "$caravan_escort_destination_town", "$caravan_escort_party_id"),
(lt, reg0, 5),
(str_store_party_name, s3, "$caravan_escort_destination_town"),
(assign, reg3, "$caravan_escort_agreed_reward"),
],
"There! I can see the walls of {s3} in the distance. We've made it safely.\
Here, take this purse of {reg3} denars, as I promised. I hope we can travel together again someday.", "close_window",
[
(assign,"$caravan_escort_state",0),
(call_script, "script_troop_add_gold", "trp_player", "$caravan_escort_agreed_reward"),
(assign,reg(4), "$caravan_escort_agreed_reward"),
(val_mul,reg(4), 1),
(add_xp_as_reward,reg(4)),
(assign, "$g_leave_encounter",1),
]],
[anyone, "event_triggered", [
],
"{!}Sorry -- just talking to myself [ERROR- {s51}]", "close_window", [
]],
#KINGDOM LORD DIALOGS BEGINS HERE
#FEMALE PLAYER CHACTER WEDDING (also go to the feast, 'lift a glass' speeches for npc lords)
#Feast not yet organized
[anyone, "start", [
(lt, "$talk_context", tc_siege_commander),
(check_quest_active, "qst_wed_betrothed_female"),
(quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(store_current_hours, ":hours_since_betrothal"),
(troop_get_slot, ":betrothal_time", "$g_talk_troop", slot_troop_betrothal_time),
(val_sub, ":hours_since_betrothal", ":betrothal_time"),
(lt, ":hours_since_betrothal", 720), #30 days
(str_clear, s12),
(try_begin),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
(str_store_string, s12, "@ We will of course need to wait until the realm is no longer on campaign."),
(try_end),
],
"My lady, I look forward to our marriage, as soon as there is an opportunity to hold a proper feast.{s12}", "lord_start", [
]],
#Feast, but not at the venue
[anyone, "start", [
(lt, "$talk_context", tc_siege_commander),
(check_quest_active, "qst_wed_betrothed_female"),
(quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(faction_get_slot, ":feast_venue", "$g_talk_troop_faction", slot_faction_ai_object),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_holding_center),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_object, ":feast_venue"),
(neq, ":feast_venue", "$g_encountered_party"),
(str_store_party_name, s4, ":feast_venue"),
],
"My lady, if you wish to marry, we can proceed to the feast at {s4} to exchange vows before the lords of the realm.", "lord_start", [
]],
#Over a month, and heading to a center
[anyone, "start", [
(lt, "$talk_context", tc_siege_commander),
(check_quest_active, "qst_wed_betrothed_female"),
(quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
(store_current_hours, ":hours_since_betrothal"),
(troop_get_slot, ":betrothal_time", "$g_talk_troop", slot_troop_betrothal_time),
(val_sub, ":hours_since_betrothal", ":betrothal_time"),
(ge, ":hours_since_betrothal", 720), #30 days
(party_get_attached_to, ":attached", "$g_talk_troop_party"),
(neg|is_between, ":attached", walled_centers_begin, walled_centers_end),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_holding_center),
(party_get_slot, ":object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s4, ":object"),
],
"My lady, I grow tired of waiting for the lords of this realm to assemble. Come with me to {s4} exchange our vows.", "lord_start", [
]],
#Over a month, but not in a center
[anyone, "start", [
(lt, "$talk_context", tc_siege_commander),
(check_quest_active, "qst_wed_betrothed_female"),
(quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
(store_current_hours, ":hours_since_betrothal"),
(troop_get_slot, ":betrothal_time", "$g_talk_troop", slot_troop_betrothal_time),
(val_sub, ":hours_since_betrothal", ":betrothal_time"),
(ge, ":hours_since_betrothal", 0), #30 days
(party_get_attached_to, ":attached", "$g_talk_troop_party"),
(neg|is_between, ":attached", walled_centers_begin, walled_centers_end),
],
"My lady, I grow tired of waiting for the lords of this realm to assemble. Perhaps we should take the first opportunity to marry, in any great hall that is open to us.", "lord_start", [
]],
[anyone, "start", [
(lt, "$talk_context", tc_siege_commander),
(check_quest_active, "qst_wed_betrothed_female"),
(quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
(this_or_next|neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
],
"My lady, I have grown tired of waiting. Let us proceed with the vows immediately.", "lord_groom_vows", [
]],
[anyone, "start", [
(lt, "$talk_context", tc_siege_commander),
(check_quest_active, "qst_wed_betrothed_female"),
(quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
],
"My lady, my eyes rejoice to see you. We may proceed with the vows.", "lord_groom_vows", [
]],
[anyone, "lord_groom_vows", [
],
"My lady, with this assembly as my witness, I vow to take you as my wife, to honor, cherish, and protect you. My the heavens bless us with health, prosperity, and children.", "female_pc_marriage_vow", [
]],
[anyone|plyr, "female_pc_marriage_vow", [
],
"I vow to take you as my husband.", "lord_groom_wedding_complete", [
(call_script, "script_courtship_event_bride_marry_groom", "trp_player", "$g_talk_troop", 0),
(call_script, "script_end_quest", "qst_wed_betrothed_female"),
]],
[anyone|plyr, "female_pc_marriage_vow", [
],
"Wait -- I need to think about this.", "close_window", [
(assign, "$g_leave_encounter", 1),
]],
[anyone, "lord_groom_wedding_complete", [
],
"We are now husband and wife. Let the festivities commence!", "close_window",
[]],
# KINGDOM LORD DUEL OUTCOMES
[anyone,"start",
[(eq, "$talk_context", tc_after_duel),
(check_quest_active, "qst_denounce_lord"),
(check_quest_succeeded, "qst_denounce_lord"),
(quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_talk_troop"),
],
"Very well. You've made your point. I have nothing more to say.", "close_window", [
(call_script, "script_change_troop_renown", "trp_player", 10),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"start",
[(eq, "$talk_context", tc_after_duel),
(check_quest_active, "qst_denounce_lord"),
(check_quest_failed, "qst_denounce_lord"),
(quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_talk_troop"),
],
"Well, {sir/my lady}! Please, do not trouble yourself to rise from the ground, as I would simply have to knock you down again. I shall take your silence as an apology. Good day to you.", "close_window", [
(call_script, "script_change_troop_renown", "trp_player", -10),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"start",
[(eq, "$talk_context", tc_after_duel),
(assign, "$temp", 0),
(try_begin),
(check_quest_active, "qst_duel_avenge_insult"),
(check_quest_succeeded, "qst_duel_avenge_insult"),
(quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_talk_troop"),
(assign, "$temp", 1),
(else_try),
(check_quest_active, "qst_duel_for_lady"),
(check_quest_succeeded, "qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_talk_troop"),
(assign, "$temp", 2),
(try_end),
(gt, "$temp", 0),
],
"Very well. You've made your point. I retract what I said. I hope you have obtained satisfaction.", "close_window", [
(try_begin),
(eq, "$temp", 1),
(call_script, "script_change_troop_renown", "trp_player", 10),
(call_script, "script_end_quest", "qst_duel_avenge_insult"),
(try_end),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"start",
[(eq, "$talk_context", tc_after_duel),
(assign, "$temp", 0),
(try_begin),
(check_quest_active, "qst_duel_avenge_insult"),
(check_quest_failed, "qst_duel_avenge_insult"),
(quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_talk_troop"),
(assign, "$temp", 1),
(else_try),
(check_quest_active, "qst_duel_for_lady"),
(check_quest_failed, "qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_talk_troop"),
(assign, "$temp", 2),
(try_end),
(gt, "$temp", 0),
],
"Hah! Not so gallant now, are we? Now trouble me no more.", "close_window", [
(try_begin),
(eq, "$temp", 1),
(call_script, "script_change_troop_renown", "trp_player", -10),
(call_script, "script_end_quest", "qst_duel_avenge_insult"),
(try_end),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"start",
[(eq, "$talk_context", tc_after_duel),
(check_quest_active, "qst_duel_courtship_rival"),
(check_quest_succeeded, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_talk_troop"),
(quest_get_slot, ":duel_object", "qst_duel_courtship_rival", slot_quest_giver_troop),
(str_store_troop_name, s10, ":duel_object"),
],
"Very well -- you have won. Let all those present today witness that you have defeated me, and I shall abandon my suit of {s10}. Are you satisfied, you heartless bastard?", "close_window", [
(quest_get_slot, ":duel_object", "qst_duel_courtship_rival", slot_quest_giver_troop),
(call_script, "script_courtship_event_lady_break_relation_with_suitor", ":duel_object", "$g_talk_troop"),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"start",
[(eq, "$talk_context", tc_after_duel),
(check_quest_active, "qst_duel_courtship_rival"),
(check_quest_failed, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_talk_troop"),
(quest_get_slot, ":duel_object", "qst_duel_courtship_rival", slot_quest_giver_troop),
(str_store_troop_name, s10, ":duel_object"),
],
"Get up. Let all those present today witness that I have defeated you, and you are now bound to relinquish your suit of the {s10}. I will permit you one final visit, to make your farewells. After that, if you persist in attempting to see her, everyone shall know that you are a man of scant honor.", "close_window", [
(assign, "$g_leave_encounter", 1),
]],
[anyone,"start", [(eq, "$talk_context", tc_castle_commander)],
"What do you want?", "player_siege_castle_commander_1", []],
[anyone|plyr,"player_siege_castle_commander_1", [],
"Surrender! Your situation is hopeless!", "player_siege_ask_surrender", []],
[anyone|plyr,"player_siege_castle_commander_1", [], "Nothing. I'll leave you now.", "close_window", []],
[anyone,"player_siege_ask_surrender", [(lt, "$g_enemy_strength", 100), (store_mul,":required_str","$g_enemy_strength",5),(ge, "$g_ally_strength", ":required_str")],
"Perhaps... Do you give your word of honour that we'll be treated well?", "player_siege_ask_surrender_treatment", []],
[anyone,"player_siege_ask_surrender", [(lt, "$g_enemy_strength", 200), (store_mul,":required_str","$g_enemy_strength",3),(ge, "$g_ally_strength", ":required_str")],
"We are ready to leave this castle to you and march away if you give me your word of honour that you'll let us leave unmolested.", "player_siege_ask_leave_unmolested", []],
[anyone,"player_siege_ask_surrender", [],
"Surrender? Hah! We can hold these walls until we all die of old age.", "close_window", []],
[anyone|plyr,"player_siege_ask_surrender_treatment", [],
"I give you nothing. Surrender now or prepare to die!", "player_siege_ask_surrender_treatment_reject", []],
[anyone,"player_siege_ask_surrender_treatment_reject", [],
"Bastard. We will fight you to the last man!", "close_window", []],
[anyone|plyr,"player_siege_ask_surrender_treatment", [],
"You will be ransomed and your soldiers will live. I give you my word.", "player_siege_ask_surrender_treatment_accept", []],
[anyone,"player_siege_ask_surrender_treatment_accept", [],
"Very well then. Under those terms, I offer you my surrender.", "close_window", [(assign,"$g_enemy_surrenders",1)]],
[anyone|plyr,"player_siege_ask_leave_unmolested", [],
"You have my word. You will not come under attack if you leave the castle.", "player_siege_ask_leave_unmolested_accept", []],
[anyone,"player_siege_ask_leave_unmolested_accept", [],
"Very well. Then we leave this castle to you. You have won this day. But we'll meet again.", "close_window", [(assign,"$g_castle_left_to_player",1)]],
[anyone|plyr,"player_siege_ask_leave_unmolested", [],
"Unacceptable. I want prisoners.", "player_siege_ask_leave_unmolested_reject", []],
[anyone,"player_siege_ask_leave_unmolested_reject", [],
"Then we will defend this castle to the death, and this parley is done. Farewell.", "close_window", []],
#Prison break
[anyone|plyr,"lord_prison_break", [],
"I've come to get you out of here", "lord_prison_break_confirm",
[]],
[anyone|plyr,"lord_prison_break", [],
"Never mind -- just stay quiet", "close_window",
[
(troop_set_slot, "$g_talk_troop", slot_troop_mission_participation, mp_stay_out),
(assign, "$g_reset_mission_participation", 1),
]],
[anyone,"lord_prison_break_confirm", [],
"Thank the heavens! I don't know how long I could have lasted in here", "lord_prison_break_confirm_2",
[]],
[anyone,"lord_prison_break_confirm_2", [],
"But wait -- how will we escape? We'll be rushed by the garrison the moment we step out that door. I can help you hold them off -- but I'll tell you now, they have fed me nothing but watery porridge and a few scraps, and I'm not as strong as I could be.", "lord_prison_break_confirm_3",
[]],
[anyone|plyr,"lord_prison_break_confirm_3", [],
"You keep well behind me, and try to stay out of the fighting.", "lord_prison_break_confirm_4",
[
(troop_set_slot, "$g_talk_troop", slot_troop_mission_participation, mp_prison_break_stand_back),
(assign, "$g_reset_mission_participation", 1),
(agent_set_team, "$g_talk_agent", 0),
]],
[anyone|plyr,"lord_prison_break_confirm_3", [],
"I'll need you to grab a weapon and help me, despite your weakness.", "lord_prison_break_confirm_4",
[
(troop_set_slot, "$g_talk_troop", slot_troop_mission_participation, mp_prison_break_fight),
(assign, "$g_reset_mission_participation", 1),
(agent_set_team, "$g_talk_agent", 0),
]],
[anyone|plyr,"lord_prison_break_confirm_3", [],
"Actually, don't get involved in this.", "close_window",
[
(troop_set_slot, "$g_talk_troop", slot_troop_mission_participation, mp_stay_out),
(assign, "$g_reset_mission_participation", 1),
]],
[anyone,"lord_prison_break_confirm_4", [
(str_clear, s14),
(try_for_range, ":other_prisoner", active_npcs_begin, kingdom_ladies_end),
(troop_slot_eq, ":other_prisoner", slot_troop_prisoner_of_party, "$g_encountered_party"),
(neq, ":other_prisoner", "$g_talk_troop"),
(assign, ":granted_parole", 0),
(try_begin),
(call_script, "script_cf_prisoner_offered_parole", ":other_prisoner"),
(assign, ":granted_parole", 1),
(try_end),
(eq, ":granted_parole", 0),
(troop_slot_eq, ":other_prisoner", slot_troop_mission_participation, 0),
(str_store_troop_name, s15, ":other_prisoner"),
(troop_get_type, reg4, ":other_prisoner"),
(str_store_string, s14, "str__s15_is_also_being_held_here_and_you_may_wish_to_see_if_reg4shehe_will_join_us"),
(try_end),
],
"Let's go!{s14}", "close_window",
[]],
#After battle texts
[anyone,"start", [
(eq, "$talk_context", tc_hero_freed),
(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero)],
"I am in your debt for freeing me, friend.", "freed_lord_answer",
[
(try_begin),
(check_quest_active, "qst_rescue_lord_by_replace"),
(quest_slot_eq, "qst_rescue_lord_by_replace", slot_quest_target_troop, "$g_talk_troop"),
(call_script, "script_succeed_quest", "qst_rescue_lord_by_replace"),
(assign, "$do_not_cancel_quest", 1),
(try_end),
(try_begin),
(check_quest_active, "qst_rescue_prisoner"),
(quest_slot_eq, "qst_rescue_prisoner", slot_quest_target_troop, "$g_talk_troop"),
(call_script, "script_succeed_quest", "qst_rescue_prisoner"),
(assign, "$do_not_cancel_quest", 1),
(try_end),
(call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
(assign, "$do_not_cancel_quest", 0),
]],
[anyone|plyr,"freed_lord_answer", [(lt, "$g_talk_troop_faction_relation", 0)],
"You're not going anywhere, 'friend'. You're my prisoner now.", "freed_lord_answer_1",
[#(troop_set_slot, "$g_talk_troop", slot_troop_is_prisoner, 1),
(troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, "p_main_party"),
(party_force_add_prisoners, "p_main_party", "$g_talk_troop", 1),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
(call_script, "script_change_player_relation_with_faction_ex", "$g_talk_troop_faction", -2),
(call_script, "script_event_hero_taken_prisoner_by_player", "$g_talk_troop"),
]],#take prisoner
[anyone,"freed_lord_answer_1", [],
"I'll have your head on a pike for this, you bastard! Someday!", "close_window", []],
[anyone|plyr,"freed_lord_answer", [
],
"You are free to go wherever you want, sir.", "freed_lord_answer_2",
[(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 7),
(call_script, "script_change_player_honor", 2),
# (troop_get_slot, ":cur_rank", "$g_talk_troop", slot_troop_kingdom_rank),
# (val_mul, ":cur_rank", 1),
(call_script, "script_change_player_relation_with_faction_ex", "$g_talk_troop_faction", 2)]],
[anyone,"freed_lord_answer_2", [],
"Thank you, good {sire/lady}. I never forget someone who's done me a good turn.", "close_window",
[
(assign, "$g_leave_encounter", 1), #Not sure why this is necessary
]],
## [anyone|plyr,"freed_lord_answer", [(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"), #he is not a faction leader!
## (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
## (eq, reg0, 0), #he has no castles or towns
## (hero_can_join)],
## "I need capable men like you. Would you like to join me?", "knight_offer_join",
## []],
##
## [anyone,"freed_lord_answer_3", [(store_random_in_range, ":random_no",0,2),(eq, ":random_no", 0)],
## "Alright I will join you.", "close_window",
## [
### (troop_set_slot, "$g_talk_troop", slot_troop_is_player_companion, 1),
## (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_player_companion),
## (store_conversation_troop, ":cur_troop_id"),
## (party_add_members, "p_main_party", ":cur_troop_id", 1),#join hero
## ]],
##
## [anyone,"freed_lord_answer_3", [],
## "No, I want to go on my own.", "close_window", []],
#Troop commentary changes begin
[anyone,"start", [(eq,"$talk_context",tc_hero_defeated),
(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero)],
"{s43}", "defeat_lord_answer",
[(troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_surrender_offer_default"),
]],
[anyone|plyr,"defeat_lord_answer", [],
"You are my prisoner now.", "defeat_lord_answer_1",
[
#(troop_set_slot, "$g_talk_troop", slot_troop_is_prisoner, 1),
(troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, "p_main_party"),
(party_force_add_prisoners, "p_main_party", "$g_talk_troop", 1),#take prisoner
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
(call_script, "script_change_player_relation_with_faction_ex", "$g_talk_troop_faction", -3),
(call_script, "script_event_hero_taken_prisoner_by_player", "$g_talk_troop"),
(call_script, "script_add_log_entry", logent_lord_captured_by_player, "trp_player", -1, "$g_talk_troop", "$g_talk_troop_faction"),
]],
[anyone,"defeat_lord_answer_1", [],
"I am at your mercy.", "close_window", []],
[anyone|plyr,"defeat_lord_answer", [],
"You have fought well. You are free to go.", "defeat_lord_answer_2",
[(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
(call_script, "script_change_player_honor", 3),
(call_script, "script_add_log_entry", logent_lord_defeated_but_let_go_by_player, "trp_player", -1, "$g_talk_troop", "$g_talk_troop_faction")]],
[anyone,"defeat_lord_answer_2", [],
"{s43}", "close_window", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_prisoner_released_default"),
]],
#Troop commentary changes end
#Troop commentaries changes begin
[anyone,"start", [(eq,"$talk_context",tc_party_encounter),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(lt,"$g_encountered_party_relation",0),
(encountered_party_is_attacker),
(eq, "$g_talk_troop_met", 1), ],
"{playername}!", "party_encounter_lord_hostile_attacker", [
]],
[anyone,"start", [(eq,"$talk_context",tc_party_encounter),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(lt,"$g_encountered_party_relation",0),
(encountered_party_is_attacker), ],
"Halt!", "party_encounter_lord_hostile_attacker", [
]],
[anyone,"party_encounter_lord_hostile_attacker", [
(gt, "$g_comment_found", 0),
],
"{s42}", "party_encounter_lord_hostile_attacker", [
(try_begin),
(neq, "$log_comment_relation_change", 0),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", "$log_comment_relation_change"),
(try_end),
(assign, "$g_comment_found", 0),
]],
#Troop commentaries changes end
[anyone,"party_encounter_lord_hostile_attacker", [
],
"{s43}", "party_encounter_lord_hostile_attacker_2",
[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_surrender_demand_default"),
]],
[anyone|plyr,"party_encounter_lord_hostile_attacker_2", [
],
"We will fight you to the end!", "close_window", []],
[anyone|plyr,"party_encounter_lord_hostile_attacker_2", [
(is_between, "$g_talk_troop", active_npcs_begin, active_npcs_end),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
],
"Stay your hand! There is something I must tell you in private.", "lord_recruit_1_relation", []],
[anyone|plyr,"party_encounter_lord_hostile_attacker_2", [
],
"Is there no way to avoid this battle? I don't want to fight with you.", "party_encounter_offer_dont_fight", []],
#TODO: Add a verification step.
[anyone|plyr,"party_encounter_lord_hostile_attacker_2", [
],
"Don't attack! We surrender.", "close_window", [(assign,"$g_player_surrenders",1)]],
[anyone, "party_encounter_offer_dont_fight", [(gt, "$g_talk_troop_effective_relation", 30),
#TODO: Add adition conditions, lord personalities, battle advantage, etc...
],
"I owe you a favor, don't I. Well... all right then. I will let you go just this once.", "close_window", [
(call_script, "script_change_player_relation_with_troop","$g_talk_troop", -7),
(store_current_hours,":protected_until"),
(val_add, ":protected_until", 72),
(party_set_slot,"$g_encountered_party",slot_party_ignore_player_until,":protected_until"),
(party_ignore_player, "$g_encountered_party", 72),
(assign, "$g_leave_encounter",1)
]],
[anyone, "party_encounter_offer_dont_fight", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_declines_negotiation_offer_default"),
],
"{s43}", "close_window", []],
## [anyone,"start", [(eq,"$talk_context",tc_party_encounter),
## (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
## (lt,"$g_encountered_party_relation",0),
## (neg|encountered_party_is_attacker),
## ],
## "What do you want?", "party_encounter_lord_hostile_defender",
## []],
# [anyone|plyr,"party_encounter_lord_hostile_defender", [],
# "Nothing. We'll leave you in peace.", "close_window", [(assign, "$g_leave_encounter",1)]],
#Betrayal texts should go here
## [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
## (troop_slot_eq,"$g_talk_troop",slot_troop_last_quest_betrayed, 1),
## (troop_slot_eq,"$g_talk_troop",slot_troop_last_quest, "qst_deliver_message_to_lover"),
## (le,"$talk_context",tc_siege_commander),
## ],
## "I had trusted that letter to you, thinking you were a {man/lady} of honor, and you handed it directly to the girl's father.\
## I should have known you were not to be trusted. Anyway, I have learned my lesson and I won't make that mistake again.", "close_window",
## [(call_script, "script_clear_last_quest", "$g_talk_troop")]],
#Lord to be recruited
[anyone ,"start",
[
(eq, "$g_talk_troop_faction", "fac_player_supporters_faction"),
(is_between, "$g_talk_troop", active_npcs_begin, active_npcs_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_inactive),
(neq, "$g_talk_troop", "$g_player_minister"),
(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
(faction_get_slot, ":original_faction_leader", ":original_faction", slot_faction_leader),
(str_store_troop_name, s10, ":original_faction_leader"),
(str_store_string, s9, "str_lord_indicted_dialog_approach"),
],
#Greetings, {my lord/my lady}. You may have heard of my ill treatment at the hands of {s10}. You have a reputation as one who treats {his/her} vassals well, and if you will have me, I would be honored to pledge myself as your vassal.
"{s9}", "lord_requests_recruitment", []],
[anyone|plyr ,"lord_requests_recruitment",
[
(str_store_string, s9, "str_lord_indicted_dialog_approach_yes"),
], #And I would be honored to accept your pledge.
"{s9}", "close_window", [
(troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
#This should be enough, scriptwise, but if there is a string somewhere to confirm the pledge, I should link
]],
[anyone|plyr ,"lord_requests_recruitment",
[
(str_store_string, s9, "str_lord_indicted_dialog_approach_no"),
], #I'm sorry. Your service is not required.
"{s9}", "lord_requests_recruitment_refuse", []],
[anyone ,"lord_requests_recruitment_refuse",
[
(str_store_string, s9, "str_lord_indicted_dialog_rejected"),
], #Indeed? Well, perhaps your reputation is misleading. Good day, {my lord/my lady} -- I go to see if another ruler in Calradia is more appreciative of my talents.
"{s9}", "close_window", [
#Seek alternative liege
(assign, "$g_leave_encounter", 1),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -10),
(call_script, "script_lord_find_alternative_faction", "$g_talk_troop"),
(assign, ":new_faction", reg0),
(try_begin),
(is_between, ":new_faction", kingdoms_begin, kingdoms_end),
(troop_get_slot, ":old_faction", "$g_talk_troop", slot_troop_original_faction),
(str_store_troop_name, s1, "$g_talk_troop"),
(str_store_faction_name, s2, ":new_faction"),
(str_store_faction_name, s3, ":old_faction"),
(call_script, "script_change_troop_faction", "$g_talk_troop", ":new_faction"),
(troop_get_type, reg4, "$g_talk_troop"),
(display_message, "str_lord_defects_ordinary"),
(else_try),
(call_script, "script_change_troop_faction", "$g_talk_troop", "fac_outlaws"),
(try_end),
]],
#Rebellion changes begin
[anyone ,"start",
[
(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(eq, "$g_talk_troop", "$supported_pretender"),
],
"I await your counsel, {playername}.", "supported_pretender_talk", [
]],
[anyone ,"start",
[
(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(assign, "$pretender_told_story", 0),
(eq, "$g_talk_troop_met", 0),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
],
"Do I know you?.", "pretender_intro_1", []],
[anyone|plyr ,"pretender_intro_1", [], "My name is {playername}. At your service.", "pretender_intro_2", []],
[anyone|plyr ,"pretender_intro_1", [], "I am {playername}. Perhaps you have heard of my exploits.", "pretender_intro_2", []],
[anyone ,"pretender_intro_2", [(troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction),
(val_sub, ":rebellion_string", "fac_kingdom_1"),
(val_add, ":rebellion_string", "str_swadian_rebellion_pretender_intro"),
(str_store_string, 48, ":rebellion_string"),],
"{s48}", "pretender_intro_3", []],
[anyone|plyr ,"pretender_intro_3", [(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
(str_store_faction_name, s12, ":original_faction"),
(faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
(str_store_troop_name, s11, ":original_ruler"),],
"I thought {s12} was ruled by {s11}?", "pretender_rebellion_cause_1", [
(troop_set_slot, "$g_talk_troop", slot_troop_discussed_rebellion, 1)
]],
[anyone ,"start",
[
(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
],
"Greetings, {playername}", "pretender_start", [(assign, "$pretender_told_story", 0)]],
[anyone|plyr ,"pretender_start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
(eq, "$pretender_told_story", 0)
],
"What was your story again, {reg65?my lady:sir}?", "pretender_rebellion_cause_prelim", [
]],
[anyone,"pretender_rebellion_cause_prelim", [],
"I shall tell you.", "pretender_rebellion_cause_1", [
]],
[anyone,"pretender_rebellion_cause_1", [],
"{s48}", "pretender_rebellion_cause_2", [
(assign, "$pretender_told_story", 1),
(troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction),
(val_sub, ":rebellion_string", "fac_kingdom_1"),
(val_add, ":rebellion_string", "str_swadian_rebellion_pretender_story_1"),
(str_store_string, 48, ":rebellion_string"),
]],
[anyone,"pretender_rebellion_cause_2", [],
"{s48}", "pretender_rebellion_cause_3", [
(troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction),
(val_sub, ":rebellion_string", "fac_kingdom_1"),
(val_add, ":rebellion_string", "str_swadian_rebellion_pretender_story_2"),
(str_store_string, 48, ":rebellion_string"),
]],
[anyone,"pretender_rebellion_cause_3", [],
"{s48}", "pretender_start", [
(troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction),
(val_sub, ":rebellion_string", "fac_kingdom_1"),
(val_add, ":rebellion_string", "str_swadian_rebellion_pretender_story_3"),
(str_store_string, 48, ":rebellion_string"),
]],
[anyone|plyr ,"pretender_start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
],
"I want to take up your cause and help you reclaim your throne!", "pretender_discuss_rebellion_1", [
]],
[anyone|plyr ,"pretender_start", [
],
"I must leave now.", "pretender_end", [
]],
[anyone ,"pretender_discuss_rebellion_1", [(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
(faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
(str_store_troop_name, s11, ":original_ruler")],
"Are you sure you will be up to the task, {playername}? Reclaiming my throne will be no simple matter.\
The lords of our realm have all sworn oaths of homage to {s11}.\
Such oaths to a usurper are of course invalid, and we can expect some of the lords to side with us, but it will be a very tough and challenging struggle ahead.", "pretender_discuss_rebellion_2a", []],
[anyone ,"pretender_discuss_rebellion_2a",[
(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
(faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
(str_store_troop_name, s12, ":original_ruler"),
(call_script, "script_evaluate_realm_stability", ":original_faction"),
(assign, ":instability_index", reg0),
(val_add, ":instability_index", reg0),
(val_add, ":instability_index", reg1),
(try_begin),
(gt, ":instability_index", 60),
(str_store_string, s11, "str_one_thing_in_our_favor_is_that_s12s_grip_is_very_shaky_he_rules_over_a_labyrinth_of_rivalries_and_grudges_lords_often_fail_to_cooperate_and_many_would_happily_seek_a_better_liege"),
(else_try),
(is_between, ":instability_index", 40, 60),
(str_store_string, s11, "str_thankfully_s12s_grip_is_fairly_shaky_many_lords_do_not_cooperate_with_each_other_and_some_might_be_tempted_to_seek_a_better_liege"),
(else_try),
(is_between, ":instability_index", 20, 40),
(str_store_string, s11, "str_unfortunately_s12s_grip_is_fairly_strong_until_we_can_shake_it_we_may_have_to_look_long_and_hard_for_allies"),
(else_try),
(lt, ":instability_index", 20),
(str_store_string, s11, "str_unfortunately_s12s_grip_is_very_strong_unless_we_can_loosen_it_it_may_be_difficult_to_find_allies"),
(try_end),
],
"{s11}", "pretender_discuss_rebellion_2", []],
[anyone|plyr ,"pretender_discuss_rebellion_2", [], "I am ready for this struggle.", "pretender_discuss_rebellion_3", []],
[anyone|plyr ,"pretender_discuss_rebellion_2", [], "You are right. Perhaps, I should think about this some more.", "pretender_end", []],
[anyone ,"pretender_discuss_rebellion_3", [(this_or_next|neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
(neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(neg|troop_slot_ge, "trp_player",slot_troop_renown, 200),
(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
(faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
(str_store_troop_name, s11, ":original_ruler")],
"I have no doubt that your support for my cause is heartfelt, {playername}, and I am grateful to you for it.\
But I don't think we have much of a chance of success.\
If you can gain renown in the battlefield and make a name for yourself as a great commander, then our friends would not hesitate to join our cause,\
and our enemies would be wary to take up arms against us. When that time comes, I will come with you gladly.\
But until that time, it will be wiser not to openly challange the usurper, {s11}.", "close_window", []],
[anyone ,"pretender_discuss_rebellion_3", [(this_or_next|neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
(neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(gt, "$supported_pretender", 0),
(str_store_troop_name, s17, "$supported_pretender")],
"Haven't you already taken up the cause of {s17}?\
You must have a very strong sense of justice, indeed.\
But no, thank you. I will not be part of your game.", "close_window", []],
[anyone ,"pretender_discuss_rebellion_3", [(this_or_next|neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
(neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(gt, "$players_kingdom", 0),
(neq, "$players_kingdom", "fac_player_supporters_faction"),
(neq, "$players_kingdom", "fac_player_faction"),
(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
(neq, "$players_kingdom", ":original_faction"),
(eq, "$player_has_homage", 1),
(str_store_faction_name, s16, "$players_kingdom"),
(faction_get_slot, ":player_ruler", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s15, ":player_ruler"),
(str_store_faction_name, s17, ":original_faction"),
],
"{playername}, you are already oath-bound to serve {s15}.\
As such, I cannot allow you to take up my cause, and let my enemies claim that I am but a mere puppet of {s16}.\
No, if I am to have the throne of {s17}, I must do it due to the righteousness of my cause and the support of my subjects alone.\
If you want to help me, you must first free yourself of your oath to {s15}.", "close_window", []],
[anyone ,"pretender_discuss_rebellion_3", [(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player")],
"You are a monarch in your own right, {sir/my lady}. If you were to back me, I would be merely your puppet.", "close_window", []],
[anyone ,"pretender_discuss_rebellion_3", [(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
(str_store_faction_name, s12, ":original_faction"),
(faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
(str_store_troop_name, s11, ":original_ruler")],
"You are a capable warrior, {playername}, and I am sure with your renown as a commander, and my righteous cause, the nobles and the good people of {s12} will flock to our support.\
The time is ripe for us to act! I will come with you, and together, we will topple the usurper {s11} and take the throne from his bloodied hands.\
But first, you must give me your oath of homage and accept me as your liege {reg65?lady:lord}.", "pretender_rebellion_ready", []],
[anyone|plyr ,"pretender_rebellion_ready", [
(troop_get_type, reg3, "$g_talk_troop"),
],
"I am ready to pledge myself to your cause, {reg3?my lady:sir}.", "lord_give_oath_2", [
]],
[anyone|plyr ,"pretender_rebellion_ready", [
],
"Let us bide our time a little longer.", "pretender_end", [
]],
[anyone ,"lord_give_conclude_2", [(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
],
"Forward, then! Our first task is to take hold of a fortress and persuade other lords to join us. You lead the way!", "close_window", [
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 50), #should be higher
(faction_set_slot, "$g_talk_troop_faction", slot_faction_state, sfs_active),
## (faction_set_slot, "$g_talk_troop_faction", slot_faction_ai_state, sfai_nascent_rebellion),
(party_force_add_members, "p_main_party", "$supported_pretender", 1),
(troop_set_slot, "$supported_pretender", slot_troop_cur_center, 0),
(troop_set_auto_equip, "$supported_pretender",0),
(str_store_troop_name_link, s6, "$supported_pretender"),
(display_message, "@{s6} has joined your party."),
# (faction_get_slot, ":location", "$g_talk_troop_faction", slot_faction_inactive_leader_location),
# (faction_set_slot, "$g_talk_troop_faction", slot_faction_inactive_leader_location, 0),
# (call_script, "script_create_kingdom_hero_party", "$g_talk_troop", ":location"),
# (party_set_slot, "$pout_party", slot_party_commander_party, "p_main_party"),
# (call_script, "script_party_decide_next_ai_state_under_command", "$pout_party"),
# (store_current_hours, ":follow_until_time"),
# (store_add, ":follow_period", 60, "$g_talk_troop_relation"),
# (val_div, ":follow_period", 2),
# (val_add, ":follow_until_time", ":follow_period"),
# (party_set_slot, "$pout_party", slot_party_follow_player_until_time, ":follow_until_time"),
# (party_set_slot, "$pout_party", slot_party_following_player, 1),
# (assign, ":rebellion_target", "$supported_pretender_old_faction"),
(store_relation, ":reln", "$supported_pretender_old_faction", "fac_player_supporters_faction"),
(val_min, ":reln", -50),
(call_script, "script_set_player_relation_with_faction", "$supported_pretender_old_faction", ":reln"),
(faction_get_slot, ":adjective_string", "$supported_pretender_old_faction", slot_faction_adjective),
(str_store_string, s1, ":adjective_string"),
(faction_set_name, "fac_player_supporters_faction", "@{s1} Rebels"),
(faction_set_color, "fac_player_supporters_faction", 0xFF0000),
## Let us handle relation with other kingdoms later.
## (try_for_range, ":existing_kingdom", kingdoms_begin, kingdoms_end),
## (store_relation, ":relation", ":existing_kingdom", ":rebellion_target"),
## (store_sub, ":relation_w_rebels", 0, ":relation"),
## (store_relation, ":player_relation", ":existing_kingdom", "fac_player_supporters_faction"),
## (val_div, ":player_relation", 3),
## (val_add, ":relation_w_rebels", ":player_relation"),
## #WARNING: Never use set_relation!
## (set_relation, ":existing_kingdom", "$g_talk_troop_faction", ":relation_w_rebels"),
## (try_end),
# we have alrady joined.
## (str_store_faction_name, 4, "$g_talk_troop_faction"),
## (display_message, "@Player joins {s4}"),
## (call_script, "script_player_join_faction", "$g_talk_troop_faction"),
(call_script, "script_update_all_notes"),
]],
[anyone ,"pretender_end", [
],
"Farewell for now, then.", "close_window", [
]],
# Events....
# Choose friend.
#Post 0907 changes begin
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(neq, "$g_talk_troop_met", 0),
(gt, "$g_time_since_last_talk", 24),
(gt, "$g_talk_troop_relation", -10),
(store_random_in_range, ":random_num", 0, 100),
(lt, ":random_num", 30),
(eq,"$talk_context",tc_town_talk),
(call_script, "script_cf_troop_get_random_enemy_troop_with_occupation", "$g_talk_troop", slto_kingdom_hero),
(assign, ":other_lord",reg0),
(troop_get_slot, ":other_lord_relation", ":other_lord", slot_troop_player_relation),
(ge, ":other_lord_relation", 20),
(str_store_troop_name, s6, ":other_lord"),
(assign, "$temp", ":other_lord"),
],
"I heard that you have befriended that {s43} called {s6}.\
Believe me, you can't trust that man.\
You should end your dealings with him.", "lord_event_choose_friend", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
]],
[anyone|plyr ,"lord_event_choose_friend", [], "I assure you, {s65}, I am no friend of {s6}.", "lord_event_choose_friend_renounce", [
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
(call_script, "script_change_player_relation_with_troop","$temp",-10),
]],
[anyone ,"lord_event_choose_friend_renounce", [], "Glad news, {playername}. I would fear for your safety otherwise.\
If you do encounter {s6}, be on your guard and don't believe a word.", "lord_pretalk", []],
[anyone|plyr ,"lord_event_choose_friend", [], "{s6} is an honourable man, you've no right to speak of him thus.", "lord_event_choose_friend_defend", [
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-10),
(call_script, "script_change_player_relation_with_troop","$temp",5),
]],
[anyone ,"lord_event_choose_friend_defend", [], "As you like, {playername}.\
A fool you might be, but a loyal fool at the least. {s6}'s loyalty may not be so steadfast, however...", "lord_pretalk", []],
#Post 0907 changes end
[anyone|plyr ,"lord_event_choose_friend", [], "I don't want to be involved in your quarrel with {s6}.", "lord_event_choose_friend_neutral", [
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-2),
(call_script, "script_change_player_relation_with_troop","$temp",-3),
]],
[anyone ,"lord_event_choose_friend_neutral", [], "Hmph. As you wish, {playername}.\
Just remember that a {man/woman} needs friends in this world, and you'll never make any if you never stand with anyone.", "lord_pretalk", []],
#Meeting.
[anyone ,"start", [(troop_slot_eq, "$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
],
"Yes, my wife?", "lord_start",
[]],
[anyone ,"start", [(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(le,"$talk_context",tc_siege_commander),
],
"Yes, {sire/my lady}?", "lord_start",
[]],
[anyone ,"start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(le,"$talk_context",tc_siege_commander),
],
"It is good to see you, old friend", "lord_start",
[]],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(check_quest_active, "qst_join_faction"),
(eq, "$g_invite_faction_lord", "$g_talk_troop"),
(eq, "$players_kingdom", "fac_player_supporters_faction"),
],
#TODO: change conversations according to relation.
"Well, {playername}. I am willing to forgive your impudence in proclaiming yourself {king/queen}, and will welcome you into my realm with full honor, as one of my vassals. Shall we proceed to the oath of allegiance?", "lord_invite_player_monarch_1",
[]],
[anyone|plyr ,"lord_invite_player_monarch_1", [], "Yes... my lord.", "lord_invite_2", []],
[anyone|plyr ,"lord_invite_player_monarch_1", [], "No. That oath sticks in my throat.", "lord_enter_service_reject", []],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(check_quest_active, "qst_join_faction"),
(eq, "$g_invite_faction_lord", "$g_talk_troop"),
(try_begin),
(gt, "$g_invite_offered_center", 0),
(store_faction_of_party, ":offered_center_faction", "$g_invite_offered_center"),
(neq, ":offered_center_faction", "$g_talk_troop_faction"),
(call_script, "script_get_poorest_village_of_faction", "$g_talk_troop_faction"),
(assign, "$g_invite_offered_center", reg0),
(try_end),
],
#TODO: change conversations according to relation.
"{playername}, I've been expecting you. Word has reached my ears of your exploits.\
Why, I keep hearing such tales of prowess and bravery that my mind was quickly made up.\
I knew that I had found someone worthy of becoming my vassal.", "lord_invite_1",
[]],
[anyone|plyr ,"lord_invite_1", [], "Thank you, {s65}, you honour me with your offer.", "lord_invite_2", []],
[anyone|plyr ,"lord_invite_1", [], "It is good to have my true value recognised.", "lord_invite_2", []],
[anyone ,"lord_invite_2", [], "Aye. Let us dispense with the formalities, {playername}; are you ready to swear homage to me?", "lord_invite_3", []],
[anyone|plyr ,"lord_invite_3", [], "Yes, {s65}.", "lord_give_oath_2", []],
[anyone|plyr ,"lord_invite_3", [], "No, {s65}. I cannot serve you right now.", "lord_enter_service_reject", []],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_met, 2),
(gt, "$g_talk_troop_relation", 10),
(gt, "$g_time_since_last_talk", 3),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 1),
(troop_slot_eq, "trp_player", slot_troop_spouse, -1),
(troop_slot_eq, "trp_player", slot_troop_betrothed, -1),
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
(troop_slot_eq, "$g_talk_troop", slot_troop_betrothed, -1),
(call_script, "script_npc_decision_checklist_marry_female_pc", "$g_talk_troop"),
(ge, reg0, 1),
],
"My lady, I have been giving much thought to our recent conversation. It is time for me to ask. Would you do me the honor of becoming my wife?", "lord_female_pc_marriage_proposal", [
]],
[anyone|plyr ,"lord_female_pc_marriage_proposal", [], "Yes. I would.", "lord_marriage_proposal_female_pc_next_step", []],
[anyone|plyr ,"lord_female_pc_marriage_proposal", [], "Let me think about this some more.", "lord_female_pc_marriage_proposal_postponed", []],
[anyone|plyr ,"lord_female_pc_marriage_proposal", [], "No. I have decided that it would not be appropriate", "lord_female_pc_marriage_proposal_rejected", []],
[anyone ,"lord_female_pc_marriage_proposal_postponed", [], "Of course, my lady. Take all the time you need.", "lord_start", []],
[anyone ,"lord_female_pc_marriage_proposal_rejected", [], "Do you mean to reject my suit outright, my lady?", "lord_female_pc_marriage_proposal_rejected_confirm", []],
[anyone|plyr ,"lord_female_pc_marriage_proposal_rejected_confirm", [], "Yes. I do.", "lord_female_pc_marriage_proposal_rejected_confirm_yes", []],
[anyone|plyr ,"lord_female_pc_marriage_proposal_rejected_confirm", [], "No, you misunderstand. I just need some more time to think", "lord_female_pc_marriage_proposal_postponed", []],
[anyone ,"lord_female_pc_marriage_proposal_rejected_confirm_yes", [
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
], "Well, in that case, let me tell you something -- with those harsh words, you have removed the scales from my eyes. I would agree that it would not be appropriate for me to marry one such as you. Good day, my lady.", "close_window", [
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -20),
(troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
(assign, "$g_leave_encounter", 1),
]],
[anyone ,"lord_female_pc_marriage_proposal_rejected_confirm_yes", [], "Such is your right, my lady. If you ever wished to reconsider, I would be overwhelmed with joy.", "close_window", [
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -5),
(troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
(assign, "$g_leave_encounter", 1),
]],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_met, 2),
(gt, "$g_time_since_last_talk", 24),
(gt, "$g_talk_troop_relation", 0),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 1),
(troop_slot_eq, "trp_player", slot_troop_spouse, -1),
(troop_slot_eq, "trp_player", slot_troop_betrothed, -1),
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
(troop_slot_eq, "$g_talk_troop", slot_troop_betrothed, -1),
],
"My lady, it brings my heart great joy to see you again...", "lord_start", [
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 2),
]],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_met, 2),
(gt, "$g_talk_troop_relation", 0),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 1),
],
"My lady, I am always your humble servant", "lord_start", [
]],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(neq, "$g_talk_troop_met", 0),
(gt, "$g_time_since_last_talk", 24),
(gt, "$g_talk_troop_relation", 50),
(gt, "$g_talk_troop_faction_relation", 10),
(le,"$talk_context",tc_siege_commander),
],
"If it isn't my brave champion, {playername}...", "lord_start", []],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(neq, "$g_talk_troop_met", 0),
(gt, "$g_time_since_last_talk", 24),
(gt, "$g_talk_troop_relation", 10),
(le,"$talk_context",tc_siege_commander),
],
"Good to see you again {playername}...", "lord_start", []],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(neq, "$g_talk_troop_met", 0),
(gt, "$g_time_since_last_talk", 24),
# (lt, "$g_talk_troop_faction_relation", 0),
(le,"$talk_context",tc_siege_commander),
],
"We meet again, {playername}...", "lord_start", []],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(eq, "$g_talk_troop_met", 0),
(ge, "$g_talk_troop_faction_relation", 0),
(le,"$talk_context",tc_siege_commander),
],
"Do I know you?", "lord_meet_neutral", []],
[anyone|plyr ,"lord_meet_neutral", [], "I am {playername}.", "lord_intro", []],
[anyone|plyr ,"lord_meet_neutral", [], "My name is {playername}. At your service sir.", "lord_intro", []],
[anyone ,"lord_intro", [],
"{s11}", "lord_start", [(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
(str_store_faction_name, s6, "$g_talk_troop_faction"),
(assign, reg4, 0),
(str_store_troop_name, s4, "$g_talk_troop"),
(try_begin),
(eq, ":faction_leader", "$g_talk_troop"),
(str_store_string, s9, "@I am {s4}, the ruler of {s6}", 0),
(else_try),
(str_store_string, s9, "@I am {s4}, a vassal of {s6}", 0),
(try_end),
(assign, ":num_centers", 0),
(str_clear, s8),
(try_for_range_backwards, ":cur_center", centers_begin, centers_end),
(party_slot_eq, ":cur_center", slot_town_lord, "$g_talk_troop"),
(try_begin),
(eq, ":num_centers", 0),
(str_store_party_name, s8, ":cur_center"),
(else_try),
(eq, ":num_centers", 1),
(str_store_party_name, s7, ":cur_center"),
(str_store_string, s8, "@{s7} and {s8}"),
(else_try),
(str_store_party_name, s7, ":cur_center"),
(str_store_string, s8, "@{!}{s7}, {s8}"),
(try_end),
(val_add, ":num_centers", 1),
(try_end),
(assign, reg5, ":num_centers"),
(str_store_string, s11, "@{s9}{reg5? and the lord of {s8}.:.", 0),
]],
# [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
# (eq, "$g_talk_troop_met", 0),
# (ge, "$g_talk_troop_faction_relation", 0),
# (le,"$talk_context",tc_siege_commander),
# ],
# "Who is this then?", "lord_meet_ally", []],
# [anyone|plyr ,"lord_meet_ally", [], "I am {playername} sir. A warrior of {s4}.", "lord_start", []],
# [anyone|plyr ,"lord_meet_ally", [], "I am but a soldier of {s4} sir. My name is {playername}.", "lord_start", []],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(eq, "$g_talk_troop_met", 0),
(lt, "$g_talk_troop_faction_relation", 0),
# (str_store_faction_name, s4, "$players_kingdom"),
(le,"$talk_context",tc_siege_commander),
],
"{s43}", "lord_meet_enemy", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_enemy_meet_default"),
]],
[anyone|plyr ,"lord_meet_enemy", [], "I am {playername}, {s65}.", "lord_intro", []], #A warrior of {s4}.
[anyone|plyr ,"lord_meet_enemy", [], "They know me as {playername}. Mark it down, you shall be hearing of me a lot.", "lord_intro", []],
# [anyone, "lord_meet_enemy_2", [], "{playername} eh? Never heard of you. What do want?", "lord_talk", []],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(le,"$talk_context",tc_siege_commander),
(try_begin),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(lt, "$g_talk_troop_relation", -15),
(str_store_string, s8, "str_playername_come_to_plague_me_some_more_have_you"),
(else_try),
(lt, "$g_talk_troop_relation", -5),
(str_store_string, s8, "str_ah_it_is_you_again"),
(else_try),
(str_store_string, s8, "str_well_playername"),
(try_end),
],
"{s8}", "lord_start",
[]],
[anyone,"lord_start", [(gt, "$g_comment_found", 0), #changed to s32 from s62 because overlaps with setup_talk_info strings
(str_store_string, s1, "$g_last_comment_copied_to_s42"),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_comment_found_s1"),
(try_end),
], "{s42}", "lord_start", [
# (store_current_hours, ":cur_time"),
# (troop_set_slot, "$g_talk_troop", slot_troop_last_comment_time, ":cur_time"),
(try_begin),
(neq, "$log_comment_relation_change", 0),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", "$log_comment_relation_change"),
(try_end),
(assign, "$g_comment_has_rejoinder", 0),
(try_begin),
(gt, "$g_rejoinder_to_last_comment", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_rejoinder_noted"),
(try_end),
(assign, "$g_comment_has_rejoinder", 1),
(try_end),
(assign, "$g_comment_found", 0),
]],
[anyone|auto_proceed,"lord_start",
[
(check_quest_active, "qst_destroy_bandit_lair"),
(check_quest_succeeded, "qst_destroy_bandit_lair"),
(quest_slot_eq, "qst_destroy_bandit_lair", slot_quest_giver_troop, "$g_talk_troop"),
], "{!}.", "lair_quest_intermediate_1",
[
]],
[anyone,"lair_quest_intermediate_1",
[
], "Splendid work, {playername} -- your audacious attack is the talk of the realm. No doubt they, or others like them, will soon be back, but for a short while you have bought this land a small respite. We are most grateful to you.", "lord_pretalk",
[
(quest_get_slot, ":quest_gold_reward", "qst_destroy_bandit_lair", slot_quest_gold_reward),
(call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
(assign, ":xp_reward", ":quest_gold_reward"),
(val_mul, ":xp_reward", 2),
(add_xp_as_reward, ":xp_reward"),
(call_script, "script_change_troop_renown", "trp_player", 3),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 4),
(call_script, "script_end_quest", "qst_destroy_bandit_lair"),
(assign, reg5, ":quest_gold_reward"),
]],
[anyone|auto_proceed,"lord_start",
[
(check_quest_active, "qst_destroy_bandit_lair"),
(check_quest_failed, "qst_destroy_bandit_lair"),
(quest_slot_eq, "qst_destroy_bandit_lair", slot_quest_giver_troop, "$g_talk_troop"),
], "{!}.", "lair_quest_intermediate_2",
[]],
[anyone,"lair_quest_intermediate_2",
[], "Well, {playername}, I guess that at least some of those brigands eluded you -- and of course, it will be the peaceful travellers of this land who will pay the price. Still, it was good of you to try.", "lord_pretalk",
[
(call_script, "script_end_quest", "qst_destroy_bandit_lair"),
]],
[anyone,"lord_start",
[
(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_lend_surgeon"),
(quest_slot_eq, "qst_lend_surgeon", slot_quest_giver_troop, "$g_talk_troop")
], "Your surgeon managed to convince my friend and made the operation. The matter is in God's hands now,, and all we can do is pray for his recovery.\
Anyway, I thank you for lending your surgeon to me {sir/madam}. You have a noble spirit. I will not forget it.", "lord_generic_mission_completed",
[
(call_script, "script_finish_quest", "qst_lend_surgeon", 100),
(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
]],
##### TODO: QUESTS COMMENT OUT BEGIN
##
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_bring_prisoners_to_enemy"),
## (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_current_state, 0),
## (check_quest_succeeded, "qst_bring_prisoners_to_enemy"),
## (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (assign, reg1, ":quest_target_amount")],
## "TODO: You have brought the prisoners and received {reg1} denars. Give me the money now.", "lord_bring_prisoners_complete_2",[]],
##
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_bring_prisoners_to_enemy"),
## (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_current_state, 1),#Some of them were brought only
## (check_quest_succeeded, "qst_bring_prisoners_to_enemy"),
## (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (assign, reg1, ":quest_target_amount")],
## "TODO: You have brought the prisoners but some of them died during your expedition. Give me the full money of {reg1} denars.", "lord_bring_prisoners_complete_2",[]],
##
##
## [anyone|plyr,"lord_bring_prisoners_complete_2", [(store_troop_gold, ":cur_gold", "trp_player"),
## (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (ge, ":cur_gold", ":quest_target_amount")],
## "TODO: Here it is.", "lord_generic_mission_thank", [(quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (troop_remove_gold, "trp_player", ":quest_target_amount"),
## (call_script, "script_finish_quest", "qst_bring_prisoners_to_enemy", 100)]],
##
## [anyone|plyr,"lord_bring_prisoners_complete_2", [(store_troop_gold, ":cur_gold", "trp_player"),
## (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (lt, ":cur_gold", ":quest_target_amount")],
## "TODO: I'm afraid I spent some of it, I don't have that much money with me.", "lord_bring_prisoners_no_money", [(quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (call_script, "script_change_debt_to_troop", "$g_talk_troop", ":quest_target_amount"),#Adding the taken money as a debt
## (call_script, "script_finish_quest", "qst_bring_prisoners_to_enemy", 100)]],
##
## [anyone,"lord_bring_prisoners_no_money", [],
## "TODO: You owe me that money!", "lord_pretalk", []],
##
##
#MALE PLAYER CHARACTER WEDDING
#wedding allowed
[anyone ,"lord_start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(check_quest_active, "qst_wed_betrothed"),
(quest_slot_eq, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":bride", "qst_wed_betrothed", slot_quest_target_troop),
(troop_slot_eq, ":bride", slot_troop_cur_center, "$g_encountered_party"),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
(call_script, "script_troop_get_family_relation_to_troop", ":bride", "$g_talk_troop"),
(str_store_troop_name, s4, ":bride"),
],
"May the heavens witness that I am ready to give you my {s11} {s4}, to have in marriage...", "wedding_ceremony_bride_vow",
[
(quest_get_slot, "$g_player_bride", "qst_wed_betrothed", slot_quest_target_troop),
]],
[anyone, "lord_start", [ (check_quest_active, "qst_wed_betrothed"),
(quest_slot_eq, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":expiration_days", "qst_wed_betrothed", slot_quest_expiration_days),
(lt, ":expiration_days", 362),
(eq, "$g_done_wedding_comment", 0),
(str_clear, s12),
(try_begin),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
(str_store_string, s12, "@ We will of course need to wait until the realm is no longer on campaign."),
(try_end),
],
"It is good to see you, {playername}. We look forward to the wedding, as soon as we can all gather together for the feast.{s12}", "lord_wedding_reschedule",
[
(assign, "$g_done_wedding_comment", 1),
]],
[anyone|plyr, "lord_wedding_reschedule", [],
"It is no problem. I can wait.", "lord_start",
[
]],
[anyone|plyr, "lord_wedding_reschedule", [],
"I have no faith that this wedding will be concluded. Please return my dower.", "lord_return_dower", #add in new dialog
[]],
[anyone, "lord_return_dower", [],
"Well, that is your right, if you indeed have no confidence in our family's commitments. Take your money.", "close_window",
[
(quest_get_slot, ":bride", "qst_wed_betrothed", slot_quest_target_troop),
(fail_quest, "qst_wed_betrothed"),
(call_script, "script_end_quest", "qst_wed_betrothed"),
(troop_set_slot, "trp_player", slot_troop_betrothed, -1),
(troop_set_slot, ":bride", slot_troop_betrothed, -1),
(assign, "$marriage_dowry", 0),
(troop_add_gold, "trp_player", "$marriage_dower"),
(assign, "$marriage_dower", 0),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -3),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_incriminate_loyal_commander"),
(check_quest_succeeded, "qst_incriminate_loyal_commander"),
(quest_get_slot, ":quest_target_troop", "qst_incriminate_loyal_commander", slot_quest_target_troop),
(str_store_troop_name, s3, ":quest_target_troop"),
(quest_get_slot, reg5, "qst_incriminate_loyal_commander", slot_quest_gold_reward),
],
"Hah! Our little plot against {s3} worked perfectly, {playername}.\
The fool has lost one of his most valuable retainers, and we are one step closer to bringing him to his knees.\
Here, this purse contains {reg5} denars, and I wish you to have it. You deserve every copper.\
And, need I remind you, there could be much more to come if you've a mind to earn it...", "lord_generic_mission_completed",[
(call_script, "script_end_quest", "qst_incriminate_loyal_commander"),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
(call_script, "script_change_player_honor", -10),
]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_incriminate_loyal_commander"),
(check_quest_failed, "qst_incriminate_loyal_commander")],
"You werent't able to complete a simple task. I had set up everything.\
The only thing you needed to do was sacrifice a messenger, and we would be celebrating now.\
But no, you were too damned honorable, weren't you?", "close_window",[
(call_script, "script_end_quest", "qst_incriminate_loyal_commander"),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-5),
(call_script, "script_change_player_honor", 3),
]],
#TODO: NO GENERIC MISSION FAILED ANYMORE!!!!
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_meet_spy_in_enemy_town"),
(check_quest_succeeded, "qst_meet_spy_in_enemy_town"),
],
"Have you brought me any news about that task I gave you? You know the one I mean...", "quest_meet_spy_in_enemy_town_completed",
[]],
[anyone|plyr, "quest_meet_spy_in_enemy_town_completed", [],
"I have the reports you wanted right here.", "quest_meet_spy_in_enemy_town_completed_2",[]],
[anyone, "quest_meet_spy_in_enemy_town_completed_2", [],
"Ahh, well done. It's good to have competent {men/people} on my side. Here is the payment I promised you.", "lord_pretalk",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
(add_xp_as_reward, 500),
(quest_get_slot, ":gold", "qst_meet_spy_in_enemy_town", slot_quest_gold_reward),
(call_script, "script_troop_add_gold", "trp_player", ":gold"),
(call_script, "script_end_quest", "qst_meet_spy_in_enemy_town"),
]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_cause_provocation"),
(check_quest_succeeded, "qst_cause_provocation"),
(quest_get_slot, ":quest_target_faction", "qst_cause_provocation", slot_quest_target_faction),
(str_store_faction_name, s13, ":quest_target_faction"),
],
"Brilliant work, {playername}! Whatever you did, the nobles of the {s13} are clamoring for war!\
Soon, the time will come for us to reap the benefits of our hard work, from fields ripe for plunder.\
This war is going to make us rich, mark my words!", "lord_pretalk",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
(try_for_range, ":vassal", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":vassal", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":vassal_fac", ":vassal"),
(eq, ":vassal_fac", "$players_kingdom"),
(neq, ":vassal", "$g_talk_troop"),
(store_random_in_range, ":rel_change", -5, 4),
(call_script, "script_change_player_relation_with_troop", ":vassal", ":rel_change"),
(try_end),
#TODO: Add gold reward notification before the quest is given. 500 gold is not mentioned anywhere.
(call_script, "script_troop_add_gold", "trp_player", 500),
(add_xp_as_reward, 2000),
(call_script, "script_change_player_honor", -5),
(call_script, "script_end_quest", "qst_cause_provocation")
]],
# [anyone,"lord_start", [(store_partner_quest, ":lords_quest"),
# (eq, ":lords_quest", "qst_raid_caravan_to_start_war"),
# (check_quest_failed, "qst_raid_caravan_to_start_war"),
# ],
#"You incompetent buffoon!\
#What in Hell made you think that getting yourself captured while trying to start a war was a good idea?\
#These plans took months to prepare, and now everything's been ruined! I will not forget this, {playername}.\
#Oh, be assured that I will not.", "lord_pretalk",
# [
# (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
# (call_script, "script_end_quest", "qst_raid_caravan_to_start_war")
# ]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_collect_debt"),
(quest_slot_eq, "qst_collect_debt", slot_quest_current_state, 1),
(quest_get_slot, ":target_troop", "qst_collect_debt", slot_quest_target_troop),
(str_store_troop_name, s7, ":target_troop"),
(quest_get_slot, ":total_collected","qst_collect_debt",slot_quest_target_amount),
(store_div, reg3, ":total_collected", 5),
(store_sub, reg4, ":total_collected", reg3)],
"I'm told that you've collected the money owed me from {s7}. Good, it's past time I had it back.\
I believe I promised to give you one-fifth of it all, eh?\
Well, that makes {reg3} denars, so if you give me my share -- that's {reg4} denars -- you can keep the rest.", "lord_collect_debt_completed", []],
[anyone|plyr,"lord_collect_debt_completed", [(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", reg4)],
"Of course, {s65}. {reg4} denars, all here.", "lord_collect_debt_pay",[]],
[anyone,"lord_collect_debt_pay", [],
"I must admit I'm impressed, {playername}. I had lost hope of ever getting this money back.\
Please accept my sincere thanks.", "lord_pretalk",[
(troop_remove_gold, "trp_player", reg4),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop", 2),
(add_xp_as_reward, 100),
(call_script, "script_end_quest", "qst_collect_debt")
]],
[anyone|plyr,"lord_collect_debt_completed", [], "I am afraid I don't have the money with me sir.", "lord_collect_debt_no_pay",[]],
[anyone,"lord_collect_debt_no_pay", [], "Is this a joke?\
I know full well that {s7} gave you the money, and I want every denar owed to me, {sir/madam}.\
As far as I'm concerned, I hold you personally in my debt until I see that silver.", "close_window",[
(call_script, "script_change_debt_to_troop", "$g_talk_troop", reg4),
(call_script, "script_end_quest", "qst_collect_debt"),
(call_script, "script_objectionable_action", tmt_honest, "str_squander_money"),
]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_kill_local_merchant"),
(check_quest_succeeded, "qst_kill_local_merchant"),
(quest_slot_eq, "qst_kill_local_merchant", slot_quest_current_state, 1)],
"I heard you got rid of that poxy merchant that was causing me so much grief.\
I can see you're not afraid to get your hands dirty, eh? I like that in a {man/woman}.\
Here's your reward. Remember, {playername}, stick with me and we'll go a long, long way together.", "close_window",
[ (call_script, "script_troop_add_gold", "trp_player", 600),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",4),
(add_xp_as_reward, 300),
(call_script, "script_end_quest", "qst_kill_local_merchant"),
(call_script, "script_objectionable_action", tmt_humanitarian, "str_murder_merchant"),
(assign, "$g_leave_encounter", 1)]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_kill_local_merchant"),
(check_quest_failed, "qst_kill_local_merchant")],
"Oh, it's you. Enlighten me, how exactly does one lose a simple fight to some poxy, lowborn merchant?\
Truly, if I ever need my guardsmen to take a lesson in how to lay down and die, I'll be sure to come to you.\
Just leave me be, {playername}, I have things to do.", "close_window",
[(call_script, "script_end_quest", "qst_kill_local_merchant"),
(assign, "$g_leave_encounter", 1)]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_kill_local_merchant"),
(check_quest_succeeded, "qst_kill_local_merchant"),
(quest_slot_eq, "qst_kill_local_merchant", slot_quest_current_state, 2)],
"You! Do you have sawdust between your ears? Did you think that when I said to kill the merchant,\
I meant you to have a nice chat with him and then let him go?! What possessed you?", "lord_kill_local_merchant_let_go",[]],
[anyone|plyr,"lord_kill_local_merchant_let_go", [],
"Sir, I made sure he will not act against you.", "lord_kill_local_merchant_let_go_2",[]],
[anyone,"lord_kill_local_merchant_let_go_2", [],
"Piffle. You were supposed to remove him, not give him a sermon and send him on his way.\
He had better do as you say, or you'll both regret it.\
Here, this is half the money I promised you. Don't say a word, {playername}, you're lucky to get even that.\
I have little use for {men/people} who cannot follow orders.", "lord_pretalk",
[(call_script, "script_troop_add_gold", "trp_player", 300),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",2),
(add_xp_as_reward, 500),
(call_script, "script_end_quest", "qst_kill_local_merchant"),
(assign, "$g_leave_encounter", 1)
]],
## [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_hunt_down_raiders"),
## (check_quest_failed, "qst_hunt_down_raiders")],
## "I heard that those raiders you were after have got away. Do you have an explanation?", "quest_hunt_down_raiders_failed",[]],
## [anyone|plyr,"quest_hunt_down_raiders_failed", [], "They were too quick for us my lord. But next time we'll get them", "quest_hunt_down_raiders_failed_2",[]],
## [anyone|plyr,"quest_hunt_down_raiders_failed", [], "They were too strong and well armed my lord. But we'll be ready for them next time.", "quest_hunt_down_raiders_failed_2",[]],
##
## [anyone|plyr,"quest_hunt_down_raiders_failed", [], "Well, it was a long call anyway. Next time do make sure that you are better prepared.",
## "lord_pretalk",[(call_script, "script_end_quest", "qst_hunt_down_raiders")]],
##
##
##
## [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_hunt_down_raiders"),
## (check_quest_succeeded, "qst_hunt_down_raiders")],
## "I heard that you have given those raiders the punishment they deserved. Well done {playername}.\
## ", "lord_generic_mission_completed",[(call_script, "script_finish_quest", "qst_hunt_down_raiders", 100),
## (call_script, "script_change_player_relation_with_troop","$g_talk_troop",3)]],
##
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_defend_nobles_against_peasants"),
## (this_or_next|check_quest_succeeded, "qst_defend_nobles_against_peasants"),
## (check_quest_failed, "qst_defend_nobles_against_peasants"),
## (assign, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
## (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee"),
## (val_add, ":num_saved", ":num_nobles"),
## (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee_woman"),
## (val_add, ":num_saved", ":num_nobles"),
## (assign, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_saved"),
## (eq, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_to_save")],
## "TODO: You have saved all of them. Good boy.", "lord_generic_mission_completed",
## [(party_remove_members, "p_main_party", "trp_noble_refugee", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
## (party_remove_members, "p_main_party", "trp_noble_refugee_woman", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
## (call_script, "script_finish_quest", "qst_defend_nobles_against_peasants", 100)]],
##
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_defend_nobles_against_peasants"),
## (this_or_next|check_quest_succeeded, "qst_defend_nobles_against_peasants"),
## (check_quest_failed, "qst_defend_nobles_against_peasants"),
## (assign, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
## (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee"),
## (val_add, ":num_saved", ":num_nobles"),
## (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee_woman"),
## (val_add, ":num_saved", ":num_nobles"),
## (assign, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_saved"),
## (lt, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_to_save"),
## (gt, "$qst_defend_nobles_against_peasants_num_nobles_saved", 0)],
## "TODO: You have saved some of them. Half good boy.", "lord_capture_conspirators_half_completed",
## [(party_remove_members, "p_main_party", "trp_noble_refugee", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
## (party_remove_members, "p_main_party", "trp_noble_refugee_woman", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
## (assign, ":ratio", 100),
## (val_mul, ":ratio", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
## (val_div, ":ratio", "$qst_defend_nobles_against_peasants_num_nobles_to_save"),
## (call_script, "script_finish_quest", "qst_defend_nobles_against_peasants", ":ratio")]],
##
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_defend_nobles_against_peasants"),
## (this_or_next|check_quest_succeeded, "qst_defend_nobles_against_peasants"),
## (check_quest_failed, "qst_defend_nobles_against_peasants"),
## (assign, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
## (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee"),
## (val_add, ":num_saved", ":num_nobles"),
## (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee_woman"),
## (val_add, ":num_saved", ":num_nobles"),
## (eq, ":num_saved", 0)],
## "TODO: You have saved none of them. Bad boy.", "lord_generic_mission_failed", []],
##
##
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_capture_conspirators"),
## (this_or_next|check_quest_succeeded, "qst_capture_conspirators"),
## (check_quest_failed, "qst_capture_conspirators"),
## (party_count_prisoners_of_type, ":num_conspirators", "p_main_party", "trp_conspirator"),
## (party_count_prisoners_of_type, ":num_conspirator_leaders", "p_main_party", "trp_conspirator_leader"),
## (store_add, ":sum_captured", ":num_conspirators", ":num_conspirator_leaders"),
## (ge, ":sum_captured", "$qst_capture_conspirators_num_troops_to_capture")],
## "TODO: You have captured all of them. Good boy.", "lord_generic_mission_completed",
## [(party_remove_prisoners, "p_main_party", "trp_conspirator_leader", "$qst_capture_conspirators_num_troops_to_capture"),
## (party_remove_prisoners, "p_main_party", "trp_spy_partner", "$qst_capture_conspirators_num_troops_to_capture"),
## (call_script, "script_finish_quest", "qst_capture_conspirators", 100)]],
##
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_capture_conspirators"),
## (this_or_next|check_quest_succeeded, "qst_capture_conspirators"),
## (check_quest_failed, "qst_capture_conspirators"),
## (party_count_prisoners_of_type, ":num_conspirators", "p_main_party", "trp_conspirator"),
## (party_count_prisoners_of_type, ":num_conspirator_leaders", "p_main_party", "trp_conspirator_leader"),
## (store_add, ":sum_captured", ":num_conspirators", ":num_conspirator_leaders"),
## (lt, ":sum_captured", "$qst_capture_conspirators_num_troops_to_capture"),
## (gt, ":sum_captured", 0)],
## "TODO: You have captured some of them. Half good boy.", "lord_capture_conspirators_half_completed",
## [(assign, ":sum_removed", 0),
## (party_remove_prisoners, "p_main_party", "trp_conspirator_leader", "$qst_capture_conspirators_num_troops_to_capture"),
## (val_add, ":sum_removed", reg0),
## (party_remove_prisoners, "p_main_party", "trp_conspirator", "$qst_capture_conspirators_num_troops_to_capture"),
## (val_add, ":sum_removed", reg0),
## (val_mul, ":sum_removed", 100),
## (val_div, ":sum_removed", "$qst_capture_conspirators_num_troops_to_capture"),
## (call_script, "script_finish_quest", "qst_capture_conspirators", ":sum_removed")]],
##
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_capture_conspirators"),
## (this_or_next|check_quest_succeeded, "qst_capture_conspirators"),
## (check_quest_failed, "qst_capture_conspirators"),
## (party_count_prisoners_of_type, ":num_conspirators", "p_main_party", "trp_conspirator"),
## (party_count_prisoners_of_type, ":num_conspirator_leaders", "p_main_party", "trp_conspirator_leader"),
## (store_add, ":sum_captured", ":num_conspirators", ":num_conspirator_leaders"),
## (eq, ":sum_captured", 0)],
## "TODO: You have captured none of them. Bad boy.", "lord_generic_mission_failed", []],
##
## [anyone|plyr,"lord_capture_conspirators_half_completed", [],
## "TODO: That's all I can do.", "lord_pretalk", []],
[anyone,"lord_start", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_follow_spy"),
(eq, "$qst_follow_spy_no_active_parties", 1),
(party_count_prisoners_of_type, ":num_spies", "p_main_party", "trp_spy"),
(party_count_prisoners_of_type, ":num_spy_partners", "p_main_party", "trp_spy_partner"),
(gt, ":num_spies", 0),
(gt, ":num_spy_partners", 0)],
"Beautiful work, {playername}! You captured both the spy and his handler, just as I'd hoped,\
and the pair are now safely ensconced in my dungeon, waiting to be questioned.\
My torturer shall be busy tonight! Anyway, I'm very pleased with your success, {playername}, and I give you\
this purse as a token of my appreciation.", "lord_follow_spy_completed",
[(party_remove_prisoners, "p_main_party", "trp_spy", 1),
(party_remove_prisoners, "p_main_party", "trp_spy_partner", 1),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",4),
(call_script, "script_troop_add_gold", "trp_player", 2000),
(add_xp_as_reward, 4000),
(call_script, "script_end_quest", "qst_follow_spy")]],
[anyone,"lord_start", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_follow_spy"),
(eq, "$qst_follow_spy_no_active_parties", 1),
(party_count_prisoners_of_type, ":num_spies", "p_main_party", "trp_spy"),
(party_count_prisoners_of_type, ":num_spy_partners", "p_main_party", "trp_spy_partner"),
(gt, ":num_spies", 0),
(eq, ":num_spy_partners", 0),],
"Blast and damn you! I wanted TWO prisoners, {playername} -- what you've brought me is one step short of\
useless! I already know everything the spy knows, it was the handler I was after.\
Here, half a job gets you half a reward. Take it and begone.", "lord_follow_spy_half_completed",
[(party_remove_prisoners, "p_main_party", "trp_spy", 1),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-1),
(call_script, "script_troop_add_gold", "trp_player", 1000),
(add_xp_as_reward, 400),
(call_script, "script_end_quest", "qst_follow_spy")]],
[anyone,"lord_start", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_follow_spy"),
(eq, "$qst_follow_spy_no_active_parties", 1),
(party_count_prisoners_of_type, ":num_spies", "p_main_party", "trp_spy"),
(party_count_prisoners_of_type, ":num_spy_partners", "p_main_party", "trp_spy_partner"),
(eq, ":num_spies", 0),
(gt, ":num_spy_partners", 0),
],
"I asked you for two prisoners, {playername}, not one. Two. Still, I suppose you did capture the spy's handler,\
the more important one of the pair. The spy will not dare return here and will prove quite useless to\
whatever master he served. 'Tis better than nothing.\
However, you'll understand if I pay you half the promised reward for what is but half a success.", "lord_follow_spy_half_completed",
[(party_remove_prisoners, "p_main_party", "trp_spy_partner", 1),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
(call_script, "script_troop_add_gold", "trp_player", 1000),
(add_xp_as_reward, 400),
(call_script, "script_end_quest", "qst_follow_spy")]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_follow_spy"),
(eq, "$qst_follow_spy_no_active_parties", 1),
(party_count_prisoners_of_type, ":num_spies", "p_main_party", "trp_spy"),
(party_count_prisoners_of_type, ":num_spy_partners", "p_main_party", "trp_spy_partner"),
(eq, ":num_spies", 0),
(eq, ":num_spy_partners", 0),
],
"Truly, {playername}, you are nothing short of totally incompetent.\
Failing to capture both the spy AND his handler plumbs astonishing new depths of failure.\
Forget any reward I offered you. You've done nothing to earn it.", "lord_follow_spy_failed",
[
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-2),
(call_script, "script_end_quest", "qst_follow_spy"),
]],
[anyone|plyr,"lord_follow_spy_half_completed", [],
"I did my best, {s65}.", "lord_pretalk", []],
[anyone|plyr,"lord_follow_spy_completed", [],
"Thank you, {s65}.", "lord_pretalk", []],
[anyone|plyr,"lord_follow_spy_failed", [],
"Hrm. As you like, {s65}.", "lord_pretalk", []],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_bring_back_runaway_serfs"),
(check_quest_succeeded, "qst_bring_back_runaway_serfs")],
"Splendid work, {playername}. All the serfs are back, properly cowed, and they're busy preparing for the harvest.\
You certainly earned your reward. Here, take it, with my compliments.", "lord_generic_mission_completed",
[(call_script, "script_change_player_relation_with_troop","$g_talk_troop", 2),
(call_script, "script_troop_add_gold", "trp_player", 300),
(add_xp_as_reward, 300),
(call_script, "script_end_quest", "qst_bring_back_runaway_serfs"),
(call_script, "script_objectionable_action", tmt_humanitarian, "str_round_up_serfs"),
]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_bring_back_runaway_serfs"),
(check_quest_failed, "qst_bring_back_runaway_serfs"),],
"{playername}. I have been waiting patiently for my serfs, yet none have returned. Have you an explanation?\
Were you outwitted by simple fieldhands, or are you merely incompetent?\
Or perhaps you are plotting with my enemies, intending to ruin me...", "lord_bring_back_runaway_serfs_failed", []],
[anyone|plyr,"lord_bring_back_runaway_serfs_failed", [],
"Forgive me, {s65}, those serfs were slippery as eels.", "lord_bring_back_runaway_serfs_failed_1a", []],
[anyone|plyr,"lord_bring_back_runaway_serfs_failed", [],
"Perhaps if you had treated them better...", "lord_bring_back_runaway_serfs_failed_1b", []],
[anyone,"lord_bring_back_runaway_serfs_failed_1a", [],
"Hmph, that is hardly an excuse for failure, {playername}.\
Now if you will excuse me, I need to recruit new men to work these fields before we all starve.", "lord_pretalk",
[(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-1),
(call_script, "script_end_quest", "qst_bring_back_runaway_serfs")]],
[anyone,"lord_bring_back_runaway_serfs_failed_1b", [],
"Hah, now you reveal your true colours, traitor! Your words match your actions all too well. I should never have trusted you.", "close_window",
[(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-10),
(quest_get_slot, ":home_village", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(call_script, "script_change_player_relation_with_center",":home_village",6),
(call_script, "script_end_quest", "qst_bring_back_runaway_serfs"),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_bring_back_runaway_serfs"),
(check_quest_concluded, "qst_bring_back_runaway_serfs"),
(assign, reg17, "$qst_bring_back_runaway_serfs_num_parties_returned")],
"You disappoint me, {playername}. There were 3 groups of serfs that I charged you to return. 3. Not {reg17}.\
I suppose the ones who did come back shall have to work twice as hard to make up for those that got away.\
As for your reward, {playername}, I'll only pay you for the serfs you returned, not the ones you let fly.\
Here. Take it, and let this business be done.", "lord_runaway_serf_half_completed",
[(store_mul, ":reward", "$qst_bring_back_runaway_serfs_num_parties_returned", 100),
(val_div, ":reward", 2),
# (store_div, ":relation_boost", "$qst_bring_back_runaway_serfs_num_parties_returned", 1),
# (call_script, "script_change_player_relation_with_troop","$g_talk_troop", ":relation_boost"),
(call_script, "script_troop_add_gold", "trp_player", ":reward"),
(add_xp_as_reward, ":reward"),
(call_script, "script_objectionable_action", tmt_humanitarian, "str_round_up_serfs"),
(call_script, "script_end_quest", "qst_bring_back_runaway_serfs"),
]],
[anyone|plyr,"lord_runaway_serf_half_completed", [],
"Thank you, {s65}. You are indeed generous.", "lord_pretalk", []],
[anyone|plyr,"lord_runaway_serf_half_completed", [],
"Bah, this proved to be a waste of my time.", "lord_pretalk", []],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_deal_with_bandits_at_lords_village"),
(check_quest_succeeded, "qst_deal_with_bandits_at_lords_village")],
"{playername}, I was told that you have crushed the bandits at my village of {s5}. Please know that I am most grateful to you for that.\
Please, let me pay the expenses of your campaign. Here, I hope these {reg14} denars will be adequate.", "lord_deal_with_bandits_completed",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
(store_character_level, ":level", "trp_player"),
(store_mul, ":reward", ":level", 20),
(val_add, ":reward", 300),
(call_script, "script_troop_add_gold", "trp_player", ":reward"),
(add_xp_as_reward, 350),
(call_script, "script_end_quest", "qst_deal_with_bandits_at_lords_village"),
(assign, reg14, ":reward"),
(quest_get_slot, ":village", "qst_deal_with_bandits_at_lords_village", slot_quest_target_center),
(str_store_party_name, s5, ":village"),
]],
[anyone|plyr, "lord_deal_with_bandits_completed", [],
"Not a problem, {s65}.", "lord_pretalk",[]],
[anyone|plyr, "lord_deal_with_bandits_completed", [],
"Glad to be of service.", "lord_pretalk",[]],
[anyone|plyr, "lord_deal_with_bandits_completed", [],
"It was mere child's play.", "lord_pretalk",[]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_deal_with_bandits_at_lords_village"),
(check_quest_concluded, "qst_deal_with_bandits_at_lords_village")],
"Damn it, {playername}. I heard that you were unable to drive off the bandits from my village of {s5}, and thanks to you, my village now lies in ruins.\
Everyone said that you were a capable warrior, but appearently, they were wrong.", "lord_pretalk",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
(call_script, "script_end_quest", "qst_deal_with_bandits_at_lords_village"),
(quest_get_slot, ":village", "qst_deal_with_bandits_at_lords_village", slot_quest_target_center),
(str_store_party_name, s5, ":village"),
]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq, ":lords_quest", "qst_deliver_cattle_to_army"),
(check_quest_succeeded, "qst_deliver_cattle_to_army"),
(quest_get_slot, reg13, "qst_deliver_cattle_to_army", slot_quest_target_amount),
],
"Ah, {playername}. My quartermaster has informed me of your delivery, {reg13} heads of cattle, as I requested. I'm impressed.", "lord_deliver_cattle_to_army_thank",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
(quest_get_slot, ":quest_target_amount", "qst_deliver_cattle_to_army", slot_quest_target_amount),
#TODO: Change reward
(store_mul, ":reward", ":quest_target_amount", 100),
(call_script, "script_troop_add_gold", "trp_player", ":reward"),
(val_div, ":reward", 5),
(add_xp_as_reward, ":reward"),
(call_script, "script_end_quest", "qst_deliver_cattle_to_army"),
#Reactivating follow army quest
(str_store_troop_name_link, s9, "$g_talk_troop"),
(setup_quest_text, "qst_follow_army"),
(str_store_string, s2, "str_follow_army_quest_brief_2"),
(call_script, "script_start_quest", "qst_follow_army", "$g_talk_troop"),
(assign, "$g_player_follow_army_warnings", 0),
]],
[anyone|plyr, "lord_deliver_cattle_to_army_thank", [],
"Not a problem, {s65}.", "lord_pretalk",[]],
[anyone|plyr, "lord_deliver_cattle_to_army_thank", [],
"Glad to be of service.", "lord_pretalk",[]],
[anyone|plyr, "lord_deliver_cattle_to_army_thank", [],
"Mere child's play.", "lord_pretalk",[]],
[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq, ":lords_quest", "qst_scout_waypoints"),
(check_quest_succeeded, "qst_scout_waypoints"),
(str_store_party_name, s13, "$qst_scout_waypoints_wp_1"),
(str_store_party_name, s14, "$qst_scout_waypoints_wp_2"),
(str_store_party_name, s15, "$qst_scout_waypoints_wp_3"),
],
"You make a good scout, {playername}. My runner just brought me your reports of the mission to {s13}, {s14} and {s15}. Well done.", "lord_scout_waypoints_thank",
[
#TODO: Change reward
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
# (call_script, "script_troop_add_gold", "trp_player", 100),
(add_xp_as_reward, 100),
(call_script, "script_end_quest", "qst_scout_waypoints"),
#Reactivating follow army quest
(str_store_troop_name_link, s9, "$g_talk_troop"),
(setup_quest_text, "qst_follow_army"),
(str_store_string, s2, "str_follow_army_quest_brief_2"),
(call_script, "script_start_quest", "qst_follow_army", "$g_talk_troop"),
(assign, "$g_player_follow_army_warnings", 0),
]],
[anyone|plyr, "lord_scout_waypoints_thank", [],
"A simple task, {s65}.", "lord_pretalk",[]],
[anyone|plyr, "lord_scout_waypoints_thank", [],
"Nothing I couldn't handle.", "lord_pretalk",[]],
[anyone|plyr, "lord_scout_waypoints_thank", [],
"My pleasure, {s65}.", "lord_pretalk",[]],
[anyone, "lord_start",
[
(check_quest_active, "qst_follow_army"),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, "$g_talk_troop"),
(eq, "$g_random_army_quest", "qst_deliver_cattle_to_army"),
(quest_get_slot, ":quest_target_amount", "$g_random_army_quest", slot_quest_target_amount),
(assign, reg3, ":quest_target_amount"),
],
"The army's supplies are dwindling too quickly, {playername}. I need you to bring me {reg3} heads of cattle so I can keep the troops fed. I care very little about where you get them, just bring them to me as soon as you can.", "lord_mission_told_deliver_cattle_to_army",
[
]
],
[anyone|plyr,"lord_mission_told_deliver_cattle_to_army", [], "Very well, I can find you some cattle.", "lord_mission_told_deliver_cattle_to_army_accepted",[]],
[anyone|plyr,"lord_mission_told_deliver_cattle_to_army", [], "Sorry, sir, I have other plans.", "lord_mission_told_deliver_cattle_to_army_rejected",[]],
[anyone,"lord_mission_told_deliver_cattle_to_army_accepted", [], "Excellent! You know what to do, {playername}, now get to it. I need that cattle sooner rather than later.", "close_window",
[
(call_script, "script_end_quest", "qst_follow_army"),
(quest_get_slot, ":quest_target_amount", "$g_random_army_quest", slot_quest_target_amount),
(str_store_troop_name_link, s13, "$g_talk_troop"),
(assign, reg3, ":quest_target_amount"),
(setup_quest_text, "$g_random_army_quest"),
(str_store_string, s2, "@{s13} asked you to gather {reg3} heads of cattle and deliver them back to him."),
(call_script, "script_start_quest", "$g_random_army_quest", "$g_talk_troop"),
#TODO: Change this value
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
(assign, "$g_leave_encounter",1),
]],
[anyone, "lord_mission_told_deliver_cattle_to_army_rejected", [], "That . . . is unfortunate, {playername}. I shall have to find someone else who's up to the task. Please go now, I've work to do.", "close_window",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
(assign, "$g_leave_encounter",1),]],
[anyone,"lord_start",[(check_quest_active,"qst_report_to_army"),
(quest_slot_eq, "qst_report_to_army", slot_quest_target_troop, "$g_talk_troop"),
(assign, ":kingdom_at_war", 0),
(try_for_range, ":kingdom", kingdoms_begin, kingdoms_end),
(store_relation, ":relation", ":kingdom", "$players_kingdom"),
(lt, ":relation", 0),
(assign, ":kingdom_at_war", 1),
(try_end),
(eq, ":kingdom_at_war", 0),
],
"Thank you for answering the summons, {playername}. However, as we are now at peace, we do not need your services. You may attend to your other business.", "lord_pretalk",
[
(call_script, "script_end_quest", "qst_report_to_army"),
(quest_set_slot, "qst_report_to_army", slot_quest_giver_troop, "$g_talk_troop"),
#TODO: Change this value
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
]],
[anyone,"lord_start",[
(check_quest_active,"qst_report_to_army"),
(quest_slot_eq, "qst_report_to_army", slot_quest_target_troop, "$g_talk_troop"),
],
"Ah, you have arrived at last, {playername}. We've been expecting you. I hope you have brought with you troops of sufficient number and experience.", "lord_report_to_army_asked",
[]],
[anyone|plyr,"lord_report_to_army_asked", [(quest_get_slot, ":quest_target_amount", "qst_report_to_army", slot_quest_target_amount),
(call_script, "script_party_count_fit_for_battle", "p_main_party"),
(gt, reg0, ":quest_target_amount"), # +1 for player
],
"I have a company of good, hardened soldiers with me. We are ready to join you.", "lord_report_to_army_completed",
[]],
[anyone|plyr,"lord_report_to_army_asked", [],
"I don't have the sufficient number of troops yet. I will need some more time.", "lord_report_to_army_continue",
[]],
[anyone,"lord_report_to_army_completed", [], "Excellent. We'll be moving soon. Now -- you are a {man/warrior} of sound judgement, and we trust that you will do what is necessary to support our campaign. I do not require you to remain close at hand, and I will not count it against you if you believe that your forces would be of better use elsewhere. But if you do choose to remain with me, to support me in battle, that would be appreciated. I may also have additional tasks for you to perform.", "close_window",[
(call_script, "script_end_quest", "qst_report_to_army"),
(quest_set_slot, "qst_report_to_army", slot_quest_giver_troop, "$g_talk_troop"),
#TODO: Change this value
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
#Activating follow army quest
(str_store_troop_name_link, s9, "$g_talk_troop"),
(setup_quest_text, "qst_follow_army"),
(str_store_string, s2, "@{s9} wants you to follow his army until further notice."),
(call_script, "script_start_quest", "qst_follow_army", "$g_talk_troop"),
(assign, "$g_player_follow_army_warnings", 0),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_report_to_army_continue", [], "Then you'd better hurry. We'll be moving out soon against the enemy and I need every able hand we can muster.", "close_window",
[(assign, "$g_leave_encounter",1),
#Must be closed because of not letting player to terminate this quest on the general conversation
]],
[anyone, "lord_start",
[
(check_quest_active, "qst_follow_army"),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "$g_talk_troop"),
(eq, "$g_random_army_quest", "qst_scout_waypoints"),
(str_store_party_name, s13, "$qst_scout_waypoints_wp_1"),
(str_store_party_name, s14, "$qst_scout_waypoints_wp_2"),
(str_store_party_name, s15, "$qst_scout_waypoints_wp_3"),
],
"{playername}, I need a volunteer to scout the area. We're sorely lacking on information,\
and I simply must have a better picture of the situation before we can proceed.\
I want you to go to {s13}, {s14} and {s15} and report back whatever you find.", "lord_mission_told_scout_waypoints",
[
]],
[anyone|plyr, "lord_mission_told_scout_waypoints", [], "You've found your volunteer, sir.", "lord_mission_told_scout_waypoints_accepted",[]],
[anyone|plyr, "lord_mission_told_scout_waypoints", [], "I fear I must decline.", "lord_mission_told_scout_waypoints_rejected",[]],
[anyone,"lord_mission_told_scout_waypoints_accepted", [], "Good {man/lass}! Simply pass near {s13}, {s14} and {s15} and check out what's there. Make a note of anything you find and return to me as soon as possible.", "close_window",
[
(call_script, "script_end_quest", "qst_follow_army"),
(str_store_troop_name_link, s9, "$g_talk_troop"),
(str_store_party_name_link, s13, "$qst_scout_waypoints_wp_1"),
(str_store_party_name_link, s14, "$qst_scout_waypoints_wp_2"),
(str_store_party_name_link, s15, "$qst_scout_waypoints_wp_3"),
(setup_quest_text, "$g_random_army_quest"),
(str_store_string, s2, "@{s9} asked you to scout {s13}, {s14} and {s15}, then report back."),
(call_script, "script_start_quest", "$g_random_army_quest", "$g_talk_troop"),
#TODO: Change this value
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
(assign, "$g_leave_encounter",1),
]],
[anyone,"lord_mission_told_scout_waypoints_rejected", [], "Hm. I'm disappointed, {playername}. Very disappointed. We'll talk later, I need to go and find somebody to scout for us.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
##
## [anyone,"lord_start",[(check_quest_active,"qst_rescue_lady_under_siege"),
## (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_target_troop, "$g_talk_troop"),
## (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_current_state, 1)],
## "I heard that you have rescued my {s7} from the siege of {s5} and brought her to safety.\
## I am in your debt for this {playername}. Thank you.", "lord_generic_mission_completed",
## [(quest_get_slot, ":quest_object_troop", "qst_rescue_lady_under_siege", slot_quest_object_troop),
## (try_begin),
## (troop_slot_eq, "$g_talk_troop", slot_troop_daughter, ":quest_object_troop"),
## (str_store_string, s7, "str_daughter"),
## (else_try),
## (str_store_string, s7, "str_wife"),
## (try_end),
## (remove_member_from_party, ":quest_object_troop"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),#Lord might be in wilderness
## (troop_set_slot, ":quest_object_troop", slot_troop_cur_center, "$g_encountered_party"),
## (try_end),
## (call_script, "script_finish_quest", "qst_rescue_lady_under_siege", 100),
## (call_script, "script_change_player_relation_with_troop","$g_talk_troop", 4),
## ]],
##
##### TODO: QUESTS COMMENT OUT END
[anyone,"lord_generic_mission_thank", [],
"You have been most helpful, {playername}. My thanks.", "lord_generic_mission_completed",[]],
[anyone|plyr,"lord_generic_mission_completed", [],
"It was an honour to serve.", "lord_pretalk",[]],
## [anyone|plyr,"lord_generic_mission_failed", [],
## "I'm sorry I failed you sir. It won't happen again.", "lord_pretalk",
## [(store_partner_quest,":lords_quest"),
## (call_script, "script_finish_quest", ":lords_quest"),
## ]],
[anyone,"lord_start", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":cur_debt", "$g_talk_troop", slot_troop_player_debt),
(gt, ":cur_debt", 0),
(assign, reg1, ":cur_debt")],
"I think you owe me {reg1} denars, {playername}. Do you intend to pay your debt anytime soon?", "lord_pay_debt_2",[]],
[anyone|plyr, "lord_pay_debt_2", [(troop_get_slot, ":cur_debt", "$g_talk_troop", slot_troop_player_debt),
(store_troop_gold, ":cur_gold", "trp_player"),
(le, ":cur_debt", ":cur_gold")],
"That is why I came, {s65}. Here it is, every denar I owe you.", "lord_pay_debt_3_1", [(troop_get_slot, ":cur_debt", "$g_talk_troop", slot_troop_player_debt),
(troop_remove_gold, "trp_player", ":cur_debt"),
(troop_set_slot, "$g_talk_troop", slot_troop_player_debt, 0)]],
[anyone|plyr, "lord_pay_debt_2", [],
"Alas, I don't have sufficient funds, {s65}. But I'll pay you soon enough.", "lord_pay_debt_3_2", []],
[anyone, "lord_pay_debt_3_1", [],
"Ah, excellent. You are a {man/woman} of honour, {playername}. I am satisfied. Your debt to me has been paid in full.", "lord_pretalk", []],
[anyone, "lord_pay_debt_3_2", [],
"Well, don't keep me waiting much longer.", "lord_pretalk", []],
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (is_between,"$g_talk_troop_faction_relation",0,3),
### (eq,"$players_kingdom",0),
## ],
## "Why don't you join us in our cause? You seem to be an able fighter.\
## We need {men/people} like you who will take part in our glory and share the spoils of our victory.", "lord_talk",[]],
#Claim center begin
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (eq,"$g_talk_troop_faction","$players_kingdom"),
## (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
## (call_script, "script_get_number_of_unclaimed_centers_by_player"),
## (gt, reg1, 0),
## (assign, "$center_to_be_claimed", reg1),
## (str_store_party_name, s4, "$center_to_be_claimed"),
## ],
## "I heard that your forces have taken {s4}. I commend you for your victory {playername}.\
## But we need to decide what to do with this new castle now.", "lord_claim_center_begin", []],
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (ge,"$g_talk_troop_faction_relation",0),
## (call_script, "script_get_number_of_unclaimed_centers_by_player"),
## (gt, reg1, 0),
## (assign, "$center_wanted_to_be_bought", reg1),
## (str_store_party_name, s4, "$center_wanted_to_be_bought"),
## (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
## (assign, ":no_of_owned_centers", reg0),
## (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
## (lt, ":no_of_owned_centers", 2),
## (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
## (ge, ":wealth", 6000)],
## "I heard that your forces have taken {s4}. I applaud your victory {playername}, but you know as well as I do that\
## as a person of low rank and status you cannot be permitted to hold that castle for yourself.\
## It is to your benefit to sell it to a Lord like myself who can hold and protect the castle and the surrounding estates.\
## Anyway, I am ready to make you an offer of 5000 denars, should you decide to sell that castle.", "lord_buy_center", []],
##
##
## [anyone|plyr,"lord_buy_center", [],
## "I accept your offer sir. The castle is yours for 5000 denars.", "lord_buy_center_accept", []],
## [anyone|plyr,"lord_buy_center", [],
## "I am afraid I can't accept that offer.", "lord_buy_center_deny", []],
##
## [anyone,"lord_buy_center_accept", [],
## "Excellent, {playername}! You have decided wisely.\
## Why bother yourself with the necessities of keeping a castle while you can leave all those boring details to noble Lords like me?\
## I am sure money will be much more useful to you than a castle would.", "lord_buy_center_accept_2", []],
##
## [anyone|plyr,"lord_buy_center_accept_2", [],
## "One day sir, one day I'll have my own castle.", "lord_buy_center_accept_3", []],
## [anyone|plyr,"lord_buy_center_accept_2", [],
## "Everyone needs money sir. I can take another castle anytime.", "lord_buy_center_accept_3", []],
##
## [anyone,"lord_buy_center_accept_3", [],
## "Of course, of course, {playername}. Then let us conclude our deal. Here's the 5000 denars I offered you.\
## I'll have my clerk handle the necessary details.\
## I guess from now on, {s4} belongs to me. Well, that worked very well for both of us, I guess.", "lord_pretalk",
## [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
## (val_sub, ":wealth", 6000),
## (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
## (call_script, "script_troop_add_gold", "trp_player", 5000),
## (party_set_slot, "$center_wanted_to_be_bought", slot_town_lord, "$g_talk_troop"),
## #Changing center faction
## (party_set_faction, "$center_wanted_to_be_bought", "$g_talk_troop_faction"),
## (set_spawn_radius, 1),
## (spawn_around_party, "$center_wanted_to_be_bought", "pt_old_garrison"),
## (assign, ":new_party", reg0),
## (party_set_ai_behavior, ":new_party", ai_bhvr_attack_party),
## (party_set_ai_object, ":new_party", "p_main_party"),
## (party_set_flags, ":new_party", pf_default_behavior, 0),
## (call_script, "script_party_copy", ":new_party", "$center_wanted_to_be_bought"),
## (party_clear, "$center_wanted_to_be_bought"),
##
## (faction_get_slot, ":reinforcement_template_archers", "$g_talk_troop_faction", slot_faction_reinforcements_archers),
## (faction_get_slot, ":reinforcement_template_infantry", "$g_talk_troop_faction", slot_faction_reinforcements_infantry),
## (party_add_template, "$center_wanted_to_be_bought", ":reinforcement_template_archers"),
## (party_add_template, "$center_wanted_to_be_bought", ":reinforcement_template_infantry"),
## ]],
##
## [anyone,"lord_buy_center_deny", [],
## "As you wish {playername}. But don't forget, the great lords of the country won't like a low born {man/woman} like you holding such an estate without their consent.\
## It is the nature of this world {playername}. Everyone should know their place.", "lord_pretalk", []],
[anyone,"lord_start",[
(eq, "$g_romantic_comment_made", 0),
(ge, "$g_talk_troop_relation", 20),
(troop_slot_ge, "trp_player", slot_troop_renown, 250),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, kingdom_ladies_begin),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 0),
(assign, ":third_party_introduce", 0),
(try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
(troop_slot_eq, ":lady", slot_troop_spouse, -1),
(troop_slot_eq, ":lady", slot_troop_betrothed, -1),
(troop_slot_eq, ":lady", slot_troop_cur_center, "$g_encountered_party"),
(neg|troop_slot_ge, ":lady", slot_troop_met, 4),
(call_script, "script_get_kingdom_lady_social_determinants", ":lady"),
(eq, reg0, "$g_talk_troop"),
(assign, "$marriage_candidate", ":lady"),
(call_script, "script_npc_decision_checklist_male_guardian_assess_suitor", "$g_talk_troop", "trp_player"),
(gt, reg0, 0),
(assign, ":third_party_introduce", ":lady"),
(try_end),
(gt, ":third_party_introduce", 0),
(troop_slot_eq, ":third_party_introduce", slot_troop_met, 0),
(call_script, "script_troop_get_family_relation_to_troop", ":third_party_introduce", "$g_talk_troop"),
(str_store_troop_name, s14, ":third_party_introduce"),
],
"By the way, I hope you get a chance to meet my {s11}, {s14}. ", "lord_start",
[
(troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
(assign, "$g_romantic_comment_made", 1),
]],
[anyone,"lord_start",[
(eq, "$g_romantic_comment_made", 0),
(ge, "$g_talk_troop_relation", 20),
(troop_slot_ge, "trp_player", slot_troop_renown, 250),
(assign, ":third_party_introduce", 0),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, kingdom_ladies_begin),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 0),
(try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
(troop_slot_eq, ":lady", slot_troop_spouse, -1),
(troop_slot_eq, ":lady", slot_troop_betrothed, -1),
(troop_slot_eq, ":lady", slot_troop_cur_center, "$g_encountered_party"),
(neg|troop_slot_ge, ":lady", slot_troop_met, 4),
(call_script, "script_get_kingdom_lady_social_determinants", ":lady"),
(eq, reg0, "$g_talk_troop"),
(assign, "$marriage_candidate", ":lady"),
(call_script, "script_npc_decision_checklist_male_guardian_assess_suitor", "$g_talk_troop", "trp_player"),
(gt, reg0, 0),
(troop_slot_ge, ":lady", slot_troop_met, 1),
(store_current_hours, ":hours"),
(troop_get_slot, ":lady_last_met_hour", ":lady", slot_troop_last_talk_time),
(val_sub, ":hours", ":lady_last_met_hour"),
(ge, ":hours", 24),
(assign, ":third_party_introduce", ":lady"),
(try_end),
(gt, ":third_party_introduce", 0),
(call_script, "script_troop_get_family_relation_to_troop", ":third_party_introduce", "$g_talk_troop"),
(str_store_troop_name, s14, ":third_party_introduce"),
],
"By the way, I am sure that my {s11}, {s14}, would be delighted were you to pay her a visit. She awaits you in her chambers.", "lord_start",
[
(troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
(assign, "$g_romantic_comment_made", 1),
]],
[anyone,"lord_start", [(party_slot_eq, "$g_encountered_party",slot_town_lord, "$g_talk_troop"),#we are talking to Town's Lord.
(ge,"$g_talk_troop_faction_relation",0),
(neq, "$g_ransom_offer_rejected", 1),
(lt, "$g_encountered_party_2", 0), #town is not under siege
(hero_can_join_as_prisoner, "$g_encountered_party"),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 10),#start this conversation with a 10% chance
(party_get_num_prisoner_stacks,":num_prisoner_stacks","p_main_party"),
(assign, "$prisoner_lord_to_buy", -1),
(try_for_range,":i_pris_stack",0,":num_prisoner_stacks"),
(party_prisoner_stack_get_troop_id, ":t_id", "p_main_party", ":i_pris_stack"),
(troop_slot_eq, ":t_id", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":fac", ":t_id"),
(store_relation, ":rel", ":fac", "$g_talk_troop_faction"),
(lt, ":rel", 0),
(assign, "$prisoner_lord_to_buy", ":t_id"),
(try_end),
(gt, "$prisoner_lord_to_buy", 0), #we have a prisoner lord.
(assign, ":continue", 1),
(try_begin),
(check_quest_active, "qst_capture_enemy_hero"),
(store_troop_faction, ":prisoner_faction", "$prisoner_lord_to_buy"),
(quest_slot_eq, "qst_capture_enemy_hero", slot_quest_target_faction, ":prisoner_faction"),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(str_store_troop_name, s3, "$prisoner_lord_to_buy"),
(assign, reg5, "$prisoner_lord_to_buy"),
(call_script, "script_calculate_ransom_amount_for_troop", "$prisoner_lord_to_buy"),
(assign, reg6, reg0),
(val_div, reg6, 2),
(assign, "$temp", reg6),
],
"I heard that you have captured our enemy {s3} and he is with you at the moment.\
I can pay you {reg6} denars for him if you want to get rid of him.\
You can wait for his family to pay his ransom of course, but there is no telling how long that will take, eh?\
", "lord_buy_prisoner", []],
[anyone|plyr,"lord_buy_prisoner", [],
"I accept your offer. I'll leave {s3} to you for {reg6} denars.", "lord_buy_prisoner_accept", []],
[anyone|plyr,"lord_buy_prisoner", [],
"I fear I can't accept your offer.", "lord_buy_prisoner_deny", [(assign, "$g_ransom_offer_rejected", 1),]],
[anyone,"lord_buy_prisoner_accept", [],
"Excellent! Here's your {reg6} denars.\
I'll send some men to take him to our prison with due haste.", "lord_pretalk", [
(remove_troops_from_prisoners, "$prisoner_lord_to_buy", 1),
(call_script, "script_troop_add_gold", "trp_player", "$temp"),
(party_add_prisoners, "$g_encountered_party", "$prisoner_lord_to_buy", 1),
#(troop_set_slot, "$prisoner_lord_to_buy", slot_troop_is_prisoner, 1),
(troop_set_slot, "$prisoner_lord_to_buy", slot_troop_prisoner_of_party, "$g_encountered_party"),
]],
[anyone,"lord_buy_prisoner_deny", [],
"Mmm. As you wish, {playername}, but you'll not get a better offer. Take it from me.", "lord_pretalk", []],
[anyone,"lord_start", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
(check_quest_active, "qst_organize_feast"),
(quest_slot_eq, "qst_organize_feast", slot_quest_target_center, "$g_encountered_party"),
(try_begin),
(eq, "$g_talk_troop_faction", "fac_kingdom_4"),
(str_store_string, s5, "str_flagon_of_mead"),
(else_try),
(store_mod, ":mode", "$g_talk_troop", 2),
(eq, ":mode", 0),
(eq, "$g_talk_troop_faction", "fac_kingdom_3"),
(str_store_string, s5, "str_skin_of_kumis"),
(else_try),
(store_mod, ":mode", "$g_talk_troop", 2),
(eq, ":mode", 0),
(eq, "$g_talk_troop_faction", "fac_kingdom_2"),
(str_store_string, s5, "str_mug_of_kvass"),
(else_try),
(str_store_string, s5, "str_cup_of_wine"),
(try_end),
],
"I lift a {s5} to your health, {playername}! You are most gracious to host us on this occasion. Now, what is it?", "lord_talk",[
(call_script, "script_internal_politics_rate_feast_to_s9", "trp_household_possessions", 120, "$players_kingdom", 0),
(assign, ":quality_of_feast", reg0),
(try_begin),
(ge, ":quality_of_feast", 20),
(ge, "$g_time_since_last_talk", 24),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 1),
(try_end),
]],
[anyone,"lord_start", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
],
"To your health, {sire/your Highness}. Long may you reign. What is your bidding?", "lord_talk",[
(try_begin),
(this_or_next|party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
(party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
(ge, "$g_time_since_last_talk", 24),
(ge, "$g_talk_troop_relation", 0),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 1),
(try_end),
]],
[anyone,"lord_start", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
],
"What is your bidding?", "lord_talk",[]],
[anyone,"lord_start", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
(ge, "$g_encountered_party_relation", 0),
(party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
(neq, "$talk_context", tc_castle_gate),
],
"I wish to welcome you to my hall on this auspicious occasion. Now, what is it?", "lord_talk",[
(try_begin),
(is_between, "$g_talk_troop_relation", 0, 10),
(ge, "$g_time_since_last_talk", 24),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 2),
(try_end),
]],
[anyone,"lord_start", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
(ge, "$g_encountered_party_relation", 0),
(party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
(str_store_troop_name, s4, ":town_lord"),
(neq, "$talk_context", tc_castle_gate),
(try_begin),
(eq, "$g_talk_troop_faction", "fac_kingdom_4"),
(str_store_string, s5, "str_flagon_of_mead"),
(else_try),
(store_mod, ":mode", "$g_talk_troop", 2),
(eq, ":mode", 0),
(eq, "$g_talk_troop_faction", "fac_kingdom_3"),
(str_store_string, s5, "str_skin_of_kumis"),
(else_try),
(store_mod, ":mode", "$g_talk_troop", 2),
(eq, ":mode", 0),
(eq, "$g_talk_troop_faction", "fac_kingdom_2"),
(str_store_string, s5, "str_mug_of_kvass"),
(else_try),
(str_store_string, s5, "str_cup_of_wine"),
(try_end),
],
"Let us lift a {s5} to the health of our host, {s4}. Now, what is it?", "lord_talk",[]],
# [anyone,"lord_start_2", [],
# "Yes?", "lord_talk",[]],
#Player lord_talk responses begin
#Political quests begin
[anyone|plyr,"lord_talk", [
(check_quest_active, "qst_offer_gift"),
(quest_slot_eq, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
(str_store_troop_name, s4, ":target_troop"),
(player_has_item, "itm_furs"),
(player_has_item, "itm_velvet"),
],
"I have the materials for {s4}'s gift.", "offer_gift_quest_complete",[
]],
[anyone,"offer_gift_quest_complete", [
(quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
(troop_get_type, reg4, ":target_troop"),
],
"Ah, let me take those. Hopefully this will mend the quarrel between you two. You may wish to speak to {reg4?her:him}, and see if I had any success.", "close_window",[
(quest_set_slot, "qst_offer_gift", slot_quest_current_state, 2),
(troop_remove_item, "trp_player", "itm_furs"),
(troop_remove_item, "trp_player", "itm_velvet"),
(assign, "$g_leave_encounter", 1),
]],
[anyone|plyr,"lord_talk", [
(check_quest_active, "qst_intrigue_against_lord"),
(neg|check_quest_succeeded, "qst_intrigue_against_lord"),
(neg|check_quest_failed, "qst_intrigue_against_lord"),
(quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop), #was qst_offer_gift
(store_faction_of_troop, ":target_troop_faction", ":target_troop"),
(faction_slot_eq, ":target_troop_faction", slot_faction_leader, "$g_talk_troop"),
],
"My lord -- there is something I wish to tell you in confidence, about one of your vassals.", "intrigue_quest_state_complaint",[
]],
[anyone,"intrigue_quest_state_complaint", [
(assign, ":continue", 1),
(try_begin),
(call_script, "script_cf_troop_can_intrigue", "$g_talk_troop", 1),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
],
"Whatever you have to say, I would ask you to wait until we are alone.", "lord_pretalk",[
]],
[anyone,"intrigue_quest_state_complaint", [
],
"What is it? I value your opinion, although I hope that you are not trying to sew dissension among my vassals? ", "intrigue_quest_state_complaint_plyr",[
(quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
(call_script, "script_troop_get_relation_with_troop", ":target_troop", "$g_talk_troop"),
(assign, reg4, reg0),
(str_store_troop_name, s4, ":target_troop"),
(assign, reg5, "$g_talk_troop_effective_relation"),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_string, s12, "str_intrigue_success_chance"),
(display_message, "str_s12"),
(try_end),
]],
[anyone|plyr,"intrigue_quest_state_complaint_plyr", [
(check_quest_active, "qst_intrigue_against_lord"),
(quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
(str_store_troop_name, s4, ":target_troop"),
(troop_get_slot, ":reputation_string", ":target_troop", slot_lord_reputation_type),
(val_add, ":reputation_string", "str_lord_derogatory_default"),
(str_store_string, s5, ":reputation_string"),
],
"My liege -- {s4} is widely held by your vassals to be {s5}, and a liability to your realm", "lord_intrigue_quest_complaint_stated",[
]],
[anyone|plyr,"intrigue_quest_state_complaint_plyr", [
],
"Actually, my liege, never mind.", "lord_pretalk",[
(call_script, "script_fail_quest", "qst_intrigue_against_lord"),
]],
[anyone,"lord_intrigue_quest_complaint_stated", [
(store_random_in_range, ":random", -50, 50),
(store_add, ":score", "$g_talk_troop_effective_relation", ":random"),
(quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
(call_script, "script_troop_get_relation_with_troop", ":target_troop", "$g_talk_troop"),
(ge, ":score", reg0),
],
"Hmm... This is troubling to hear. Although I do not encourage my vassals to speak ill of each other, I value your opinion. Perhaps I should think twice about granting {s4} any further fiefs or offices...", "lord_pretalk",[
(quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", ":target_troop", -10),
(call_script, "script_succeed_quest", "qst_intrigue_against_lord"),
]],
[anyone,"lord_intrigue_quest_complaint_stated", [
],
"Sew discord among my vassals, will you? With everything else going on, do you think I appreciate my nobles turning on each other like quarreling dogs? Let me ask you this -- did someone put you up this?", "intrigue_quest_state_complaint_failed",[
(call_script, "script_fail_quest", "qst_intrigue_against_lord"),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -5),
]],
[anyone|plyr,"intrigue_quest_state_complaint_failed", [
],
"I stand by my words, my liege.", "intrigue_quest_state_accept_blame",[
(call_script, "script_change_player_honor", 1),
]],
[anyone|plyr,"intrigue_quest_state_complaint_failed", [
(quest_get_slot, ":giver_troop", "qst_intrigue_against_lord", slot_quest_giver_troop),
(quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
(str_store_troop_name, s4, ":giver_troop"),
(str_store_troop_name, s5, ":target_troop"),
],
"Yes, sire -- {s4} put me up to denouncing {s5}!", "intrigue_quest_state_deflect_blame",[
(quest_get_slot, ":giver_troop", "qst_intrigue_against_lord", slot_quest_giver_troop),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", ":giver_troop", -5),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 4),
(call_script, "script_change_player_honor", -2),
]],
[anyone,"intrigue_quest_state_accept_blame", [
],
"Indeed. You may stand by your words, but keep them to yourself. I will not have you undercutting my faithful follower {s4}.", "lord_pretalk",[
]],
[anyone,"intrigue_quest_state_deflect_blame", [
],
"I thought as much. Here's some advice for you, {lad/lassie} -- don't meddle in the quarrels of others. Now, enough of this.", "lord_pretalk",[
]],
[anyone|plyr,"lord_talk", [
(check_quest_active, "qst_denounce_lord"),
(neg|check_quest_succeeded, "qst_denounce_lord"),
(neg|check_quest_failed, "qst_denounce_lord"),
(quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_talk_troop"),
(troop_get_slot, ":reputation_string", "$g_talk_troop", slot_lord_reputation_type),
(val_add, ":reputation_string", "str_lord_derogatory_default"),
(str_store_string, s4, ":reputation_string"),
],
"I want to tell you something -- we have had enough of your {s4} ways", "lord_denounce_1",[
]],
[anyone,"lord_denounce_1", [
],
"I'm sorry... What did you say?", "lord_denounce_2",[
]],
[anyone|plyr,"lord_denounce_2", [
(troop_get_slot, ":reputation_string", "$g_talk_troop", slot_lord_reputation_type),
(val_add, ":reputation_string", "str_lord_derogatory_result"),
(str_store_string, s4, ":reputation_string"),
],
"You heard me. You will {s4}", "lord_denounce_3",[
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -15),
(store_div, ":impact", "$g_talk_troop_relation", 10),
(val_add, ":impact", 1),
(val_max, ":impact", 1),
(val_mul, ":impact", -1),
#Change his respect level, slightly. In the future game, there should be more sophisticated metrics for this
(try_for_range, ":other_lord", active_npcs_begin, active_npcs_end),
(neq, "$g_talk_troop", ":other_lord"),
(store_faction_of_troop, ":other_lord_faction",":other_lord"),
(eq, ":other_lord_faction", "$g_talk_troop_faction"),
(call_script, "script_troop_get_relation_with_troop", ":other_lord", "$g_talk_troop"),
(lt, reg0, 15),
(call_script, "script_troop_change_relation_with_troop", ":other_lord", "$g_talk_troop", ":impact"),
(try_end),
]],
[anyone|plyr,"lord_denounce_2", [
],
"Never mind. You must have misheard me.", "lord_pretalk",[
]],
[anyone,"lord_denounce_3", [
(ge, "$g_talk_troop_relation", 10),
(this_or_next|neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
],
"Why would you say such a thing? To insult me like this, in spite of our friendship -- how much crueler is a knife in my back from an erstwhile friends, than the sword of a sworn foe. I do not know what game you are playing, but I want no part of it. Go away. I do not want to look at you.", "close_window",[
(call_script, "script_succeed_quest", "qst_denounce_lord"),
]],
[anyone,"lord_denounce_3", [
(troop_slot_ge, "trp_player", slot_troop_renown, 300),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
],
"Hmf. Really? Is that your opinion, or did one of my rivals put those words in your mouth? Never mind. I will not play your game. Go away, and take your intrigues with you.", "close_window",[
(call_script, "script_succeed_quest", "qst_denounce_lord"),
]],
[anyone,"lord_denounce_3", [
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
],
"I will not have you shame me in public, {sir/my lady}. Retract your words, or meet me on the duelling ground.", "lord_denounce_4",[
]],
[anyone,"lord_denounce_3", [
],
"Is that so? Well, hear this -- you're a snake, and a knave, and -- if you don't meet me on the duelling ground -- a coward. What say you to that? Do you retract your words, or shall we cross swords?", "lord_denounce_4",[
]],
[anyone|plyr,"lord_denounce_4", [
],
"It would be a pleasure to fight you.", "lord_respond_to_insult_challenge_duel_confirm",[
]],
[anyone|plyr,"lord_denounce_4", [
],
"I spoke rashly. I retract my words.", "lord_denounce_retract",[
(call_script, "script_fail_quest", "qst_denounce_lord"),
]],
[anyone,"lord_denounce_retract", [
],
"I thought as much. Now, be gone from here.", "lord_pretalk",[
]],
[anyone|plyr,"lord_talk", [
(eq, "$g_comment_has_rejoinder", 1),
(assign, "$g_comment_has_rejoinder", 0),
(str_store_string, s9, "$g_rejoinder_to_last_comment"),
],
"{s9}", "lord_respond_to_insult",[
(unlock_achievement, ACHIEVEMENT_SASSY),
]],
#lord recruitment changes begin
[anyone,"lord_pretalk", [
(lt, "$g_encountered_party_relation", 0),
(encountered_party_is_attacker),
],
"But enough talking - yield or fight!", "party_encounter_lord_hostile_attacker_2",[]],
#lord recruitment changes end
[anyone,"lord_pretalk", [],
"Anything else?", "lord_talk",[]],
[anyone,"hero_pretalk", [],
"Anything else?", "lord_talk",[]],
##### TODO: QUESTS COMMENT OUT BEGIN
#lord recruitment changes begin
[anyone|plyr,"lord_talk",[
(check_quest_active, "qst_resolve_dispute"),
(quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop),
(quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
(assign, ":other_lord", 0),
(try_begin),
(eq, ":lord_1", "$g_talk_troop"),
(quest_slot_eq, "qst_resolve_dispute", slot_quest_target_state, 0),
(assign, "$g_other_lord", ":lord_2"),
(assign, ":other_lord", ":lord_2"),
(else_try),
(eq, ":lord_2", "$g_talk_troop"),
(quest_slot_eq, "qst_resolve_dispute", slot_quest_object_state, 0),
(assign, "$g_other_lord", ":lord_1"),
(assign, ":other_lord", ":lord_1"),
(try_end),
(gt, ":other_lord", 0),
(str_store_troop_name, s11, "$g_other_lord"),
],
"I wish to address your quarrel with {s11}", "lord_quarrel_intervention_1",
[]],
[anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(encountered_party_is_attacker),
(neg|is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
],
"Stay your hand! There is something I must say to you in private.", "lord_recruit_1_relation",
[]],
[anyone|plyr,"lord_talk",
[(check_quest_active, "qst_track_down_bandits"),
(neg|check_quest_succeeded, "qst_track_down_bandits"),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 1),
], "I am hunting a group of bandits with the following description... Have you seen them?", "lord_bandit_information",[]],
[anyone,"lord_bandit_information", [
(call_script, "script_get_manhunt_information_to_s15", "qst_track_down_bandits"),
], "{s15}", "lord_pretalk",[]],
[anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, 1),
],
"Who do you think should be made the marshal of our realm?", "lord_internal_politics_cur_stance",
[]],
[anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(faction_get_slot, ":political_issue", "$players_kingdom", slot_faction_political_issue),
(is_between, ":political_issue", centers_begin, centers_end),
(str_store_party_name, s4, ":political_issue"),
],
"Whom do you think should receive the fief of {s4}?", "lord_internal_politics_cur_stance",
[]],
[anyone|plyr,"lord_talk",[(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
(neq, "$g_talk_troop_faction", "$players_kingdom"),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
# (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
(str_store_troop_name, s4, ":faction_leader"),
(str_store_faction_name, s5, "$players_kingdom"),
],
"I need you to renounce your allegiance to {s4} and join the {s5} now, my husband.", "lord_husband_auto_recruit",
[]],
[anyone,"lord_husband_auto_recruit",
[
(is_between, "$g_encountered_party", centers_begin, centers_end),
(neg|party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
],
"Ask me again when we are outside of these walls, my wife.", "lord_pretalk",
[]],
[anyone,"lord_husband_auto_recruit",
[],
"As you wish, my wife.", "close_window",
[
(assign, "$g_leave_encounter", 1),
(call_script, "script_change_troop_faction", "$g_talk_troop", "$players_kingdom"),
(try_begin), #Actually, perhaps do provocation rather than war
(store_relation, ":relation", "$players_kingdom", "$g_talk_troop_faction"),
(ge, ":relation", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_lord_recruitment_provokes_home_faction"),
(try_end),
(call_script, "script_add_log_entry", logent_border_incident_troop_suborns_lord, "trp_player", -1, "$g_talk_troop","$g_talk_troop_faction"),
(store_add, ":slot_provocation_days", "$players_kingdom", slot_faction_provocation_days_with_factions_begin),
(val_sub, ":slot_provocation_days", kingdoms_begin),
(faction_set_slot, "$g_talk_troop_faction", ":slot_provocation_days", 30),
(faction_get_slot, ":other_liege", "$g_talk_troop_faction", slot_faction_leader),
(call_script, "script_troop_change_relation_with_troop", "trp_player", ":other_liege", -3),
(try_end),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
(call_script, "script_change_player_right_to_rule", 5),
(try_end),
]],
[anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
],
"There is a matter which I would like to discuss in private.", "lord_recruit_1_relation",
[]],
[anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(neg|encountered_party_is_attacker),
(neg|is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(neq, "$g_talk_troop_faction", "fac_player_supporters_faction"),
#other requirements
],
"There is something which I would like to discuss with to you in private.", "lord_recruit_1_relation",
[]],
[anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(troop_slot_ge, "$g_talk_troop", slot_troop_intrigue_impatience, 1),
(eq, "$cheat_mode", 1),
#other requirements
],
"CHEAT -- Reset lord decision seed and intrigue impatience", "lord_talk",
[
(troop_set_slot, "$g_talk_troop", slot_troop_intrigue_impatience, 0),
(store_random_in_range, ":random", 0, 9999),
(troop_set_slot, "$g_talk_troop", slot_troop_temp_decision_seed, ":random"),
]],
[anyone|plyr,"lord_talk",[(eq, "$cheat_mode", 1),
],
"CHEAT -- Let's duel (insult)", "lord_respond_to_insult_challenge_duel",
[
]],
#Respond to insult
[anyone,"lord_respond_to_insult", [
(eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_sadistic_admiring"),
], "Hah! I admire a quick tongue. Perhaps some day I shall remove it, with tongs, to admire it at greater leisure, but today, at least, I shall salute your wit and courage.", "lord_pretalk", [
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 5),
(call_script, "script_change_troop_renown", "trp_player", 2),
]],
[anyone,"lord_respond_to_insult", [
(this_or_next|eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_pitiless_admiring"),
(this_or_next|eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_common_upstanding"),
(this_or_next|eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_noble_upstanding"),
(this_or_next|eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_common_martial"),
(eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_badtempered_admiring"),
], "I meant no offense, madame.", "lord_pretalk", [
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -2),
(call_script, "script_change_troop_renown", "trp_player", 2),
]],
[anyone,"lord_respond_to_insult", [
(troop_slot_eq, "$g_talk_troop", slot_troop_leaded_party, "$g_encountered_party"),
(store_party_size_wo_prisoners, ":lord_party_size", "$g_talk_troop_party"),
(store_party_size_wo_prisoners, ":player_party_size", "p_main_party"),
(val_mul, ":player_party_size", 3),
(val_div, ":player_party_size", 2),
(gt, ":lord_party_size", ":player_party_size"),
(neq, "$players_kingdom", "$g_talk_troop_faction"),
], "Are you trying to provoke me? Well, I would have you know that I am under no obligation to duel women, commoners, rebels, or brigands. I could, however, order my men to seize you and horsewhip you. Would you like them to do that?", "lord_respond_to_insult_challenge_battle",
[
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -10),
(call_script, "script_change_troop_renown", "trp_player", 2),
]],
[anyone,"lord_respond_to_insult", [
], "Are you trying to provoke me? Well, I would have you know that I am under no obligation to duel women, commoners, rebels, or brigands. However, in your case, I would be delighted to make an exception. Are you ready for a lesson in deference to your betters, {varlot/girl}?", "lord_respond_to_insult_challenge_duel",
[
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -10),
(call_script, "script_change_troop_renown", "trp_player", 2),
]],
[anyone,"lord_respond_to_insult", [
], "Are you trying to provoke me? Well, I would have you know that I am under no obligation to duel women, commoners, rebels, or brigands. You are lucky that I am in a good mood, because I am perfectly within my rights to order my men to seize you and horsewhip you. Now begone -- I have had enough of you.", "close_window",
[
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -10),
(call_script, "script_change_troop_renown", "trp_player", 2),
(assign, "$g_leave_encounter", 1),
]],
[anyone|plyr,"lord_respond_to_insult_challenge_battle", [
], "I would like to see them try.", "lord_respond_to_insult_challenge_battle_confirm",
[
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -10),
(call_script, "script_change_troop_renown", "trp_player", 3),
]],
[anyone|plyr,"lord_respond_to_insult_challenge_battle", [
], "This is not worth the shedding of blood.", "close_window",
[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_respond_to_insult_challenge_battle_confirm", [
], "Enough of your insolence! At {him/her}, lads!", "close_window",
[
(assign, "$g_private_battle_with_troop", "$g_talk_troop"),
(assign, "$cant_leave_encounter", 1),
(assign, "$encountered_party_friendly", 0),
(jump_to_menu, "mnu_simple_encounter"),
]],
[anyone|plyr,"lord_respond_to_insult_challenge_duel", [
], "I am ready to teach you one.", "lord_respond_to_insult_challenge_duel_confirm",
[
(str_store_troop_name_link, s13, "$g_talk_troop"),
(setup_quest_text, "qst_duel_avenge_insult"),
(str_store_string, s2, "str_you_intend_to_challenge_s13_to_force_him_to_retract_an_insult"),
(call_script, "script_start_quest", "qst_duel_avenge_insult", "$g_talk_troop"),
(quest_set_slot, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_talk_troop"),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -10),
]],
[anyone|plyr,"lord_respond_to_insult_challenge_duel", [
], "This is not worth the shedding of blood.", "close_window",
[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_respond_to_insult_challenge_duel_confirm", [
], "So be it. Defend yourself!", "close_window",
[
(call_script, "script_set_up_duel_with_troop", "$g_talk_troop"),
]],
[anyone,"lord_quarrel_intervention_1", [
(str_store_string, s14, "str_general_quarrel"),
(assign, "$temp", "$g_other_lord"),
(assign, ":specific_quarrel_found", 0),
(store_add, ":log_entries_plus_one", "$num_log_entries", 1),
(try_for_range, ":log_entry_no", 1, ":log_entries_plus_one"),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_ruler_intervenes_in_quarrel),
(troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no", "$temp"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_faction_object", ":log_entry_no", "$g_talk_troop_faction"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_protests_marshall_appointment),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_blames_defeat),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_troop_feels_cheated_by_troop_over_land),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no", "$temp"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lords_quarrel_over_woman),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lords_quarrel_over_woman),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$temp"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(try_end),
(try_begin),
(eq, ":specific_quarrel_found", 0),
(call_script, "script_troop_describes_quarrel_with_troop_to_s14", "$g_talk_troop", "$temp"),
(try_end),
],
"{s14}", "lord_quarrel_intervention_2",
[]],
[anyone|plyr,"lord_quarrel_intervention_2",[],
"Ah, well. It sounds like you're in the right, then.", "lord_quarrel_intervention_3a",
[
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_other_lord", -20),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 10),
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(call_script, "script_add_log_entry", logent_ruler_intervenes_in_quarrel, "trp_player", "$g_other_lord", "$g_talk_troop", "fac_player_supporters_faction"),
(try_end),
(call_script, "script_end_quest", "qst_resolve_dispute"),
]],
[anyone|plyr,"lord_quarrel_intervention_2",[
(faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
],
"Whatever your differences, I want you to settle them.", "lord_quarrel_intervention_3b",
[]],
[anyone|plyr,"lord_quarrel_intervention_2",[
(neg|faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
],
"Could you not be convinced to settle your differences?", "lord_quarrel_intervention_3b",
[]],
[anyone|plyr,"lord_quarrel_intervention_2",[],
"On second thought, I want nothing to do with this.", "lord_pretalk",
[
(call_script, "script_abort_quest", "qst_resolve_dispute", 1),
]],
[anyone,"lord_quarrel_intervention_3a", [
], "I'm glad that you think so.", "lord_pretalk",
[]],
[anyone,"lord_quarrel_intervention_3b", [
(store_random_in_range, ":random", 0, 21),
(le, ":random", "$g_talk_troop_effective_relation"),
(str_store_troop_name, s11, "$g_other_lord"),
], "For the sake of our friendship, I defer to your judgment. I will try to make amends with {s11}.", "lord_quarrel_intervention_4",
[
(try_begin),
(quest_slot_eq, "qst_resolve_dispute", slot_quest_target_troop, "$g_talk_troop"),
(quest_set_slot, "qst_resolve_dispute", slot_quest_target_state, 1),
(else_try),
(quest_slot_eq, "qst_resolve_dispute", slot_quest_object_troop, "$g_talk_troop"),
(quest_set_slot, "qst_resolve_dispute", slot_quest_object_state, 1),
(try_end),
]],
[anyone,"lord_quarrel_intervention_3b", [
#fails reconciliation test
(str_store_troop_name, s11, "$g_other_lord"),
], "I will not reconcile with {s11}. I know my rights.", "lord_pretalk",
[
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -15),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_other_lord", 10),
(try_begin),
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(call_script, "script_add_log_entry", logent_ruler_intervenes_in_quarrel, "trp_player", "$g_talk_troop", "$g_other_lord", "fac_player_supporters_faction"),
(try_end),
(call_script, "script_end_quest", "qst_resolve_dispute"),
]],
[anyone,"lord_quarrel_intervention_4", [
(quest_slot_eq, "qst_resolve_dispute", slot_quest_object_state, 1),
(quest_slot_eq, "qst_resolve_dispute", slot_quest_target_state, 1),
], "Let it be as though our quarrel never occurred.", "lord_pretalk",
[
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "$g_other_lord", 20),
(call_script, "script_succeed_quest", "qst_resolve_dispute"),
(call_script, "script_end_quest", "qst_resolve_dispute"),
(call_script, "script_change_player_honor", 3),
(call_script, "script_change_troop_renown", "trp_player", 25),
(add_xp_as_reward, 500),
]],
[anyone,"lord_quarrel_intervention_4", [
(str_store_troop_name, s11, "$g_other_lord"),
], "I suppose that you should speak to {s11}, and see if he will do the same for me.", "lord_pretalk",
[
]],
[anyone,"lord_internal_politics_cur_stance", [
(troop_slot_eq, "$g_talk_troop", slot_troop_stance_on_faction_issue, "trp_player"),
],
"I had already made up my mind to support you.", "lord_internal_politics_cur_stance_plyr_response",
[
]],
[anyone,"lord_internal_politics_cur_stance", [
(call_script, "script_npc_decision_checklist_take_stand_on_issue", "$g_talk_troop"),
(eq, reg0, -1),
],
"I am unable to decide at this time", "lord_internal_politics_cur_stance_plyr_response",
[
]],
[anyone,"lord_internal_politics_cur_stance", [
],
"I support {s15}. {s10}", "lord_internal_politics_cur_stance_plyr_response",
[
(call_script, "script_npc_decision_checklist_take_stand_on_issue", "$g_talk_troop"),
(assign, ":supported_candidate", reg0),
(assign, ":explainer_string", reg1),
(troop_set_slot, "$g_talk_troop", slot_troop_stance_on_faction_issue, ":supported_candidate"),
(str_store_string, s10, ":explainer_string"),
(try_begin),
(eq, ":supported_candidate", "$g_talk_troop"),
(str_clear, s10),
(try_end),
(call_script, "script_troop_describes_troop_to_s15", "$g_talk_troop", ":supported_candidate"),
]],
[anyone|plyr,"lord_internal_politics_cur_stance_plyr_response", [
(troop_slot_eq, "trp_player", slot_troop_stance_on_faction_issue, -1),
(eq, "$player_has_homage", 1),
],
"Let me tell you whom I support...", "lord_internal_politics_plyr_choose_candidate",
[
]],
[anyone|plyr,"lord_internal_politics_cur_stance_plyr_response", [
(eq, "$cheat_mode", 1),
(eq, "$player_has_homage", 1),
],
"CHEAT -- Reset support", "lord_internal_politics_cur_stance_plyr_response",
[
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
]],
[anyone,"lord_internal_politics_plyr_choose_candidate", [
],
"Whom do you support?", "lord_internal_politics_plyr_choose_candidate_select",
[
]],
[anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
],
"I would like to nominate myself for that honor", "lord_internal_politics_pretalk",
[
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, "trp_player"),
]],
[anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(neq, ":spouse", "$g_talk_troop"),
(is_between, ":spouse", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":spouse", slot_troop_occupation, slto_kingdom_hero),
(store_faction_of_troop, ":spouse_faction", ":spouse"),
(eq, ":spouse_faction", "$players_kingdom"),
(str_store_troop_name, s4, ":spouse"),
],
"I support my husband, {s4}", "lord_internal_politics_pretalk",
[
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, ":spouse"),
]],
[anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
(str_store_troop_name, s4, "$g_talk_troop"),
],
"I would support you, {s4}", "lord_internal_politics_support_acknowledge",
[
]],
[anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
(troop_get_slot, ":talk_troop_choice", "$g_talk_troop", slot_troop_stance_on_faction_issue),
(is_between, ":talk_troop_choice", active_npcs_begin, active_npcs_end),
(str_store_troop_name, s4, ":talk_troop_choice"),
(neq, ":talk_troop_choice", "$g_talk_troop"),
],
"I would support your choice, {s4}", "lord_internal_politics_support_same_acknowledge",
[
]],
[anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
],
"Never mind", "lord_pretalk",
[
]],
[anyone,"lord_internal_politics_support_acknowledge", [
(troop_get_slot, ":supported_candidate", "$g_talk_troop", slot_troop_stance_on_faction_issue),
(neq, "$g_talk_troop", ":supported_candidate"),
],
"That is most gracious of you, but I do not seek the honor, and I decline your support.", "lord_pretalk",
[
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
]],
[anyone,"lord_internal_politics_support_acknowledge", [
(lt, "$g_talk_troop_effective_relation", -5),
],
"I do not trust you, and I do not need your support.", "lord_pretalk",
[
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
]],
[anyone,"lord_internal_politics_support_acknowledge", [
],
"That is most gracious of you", "lord_pretalk",
[
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 3),
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, "$g_talk_troop"),
]],
[anyone,"lord_internal_politics_support_same_acknowledge", [
(lt, "$g_talk_troop_effective_relation", -5),
],
"You may tell him that yourself. I do not trust you, and I will have no part in any game which you are playing.", "lord_pretalk",
[
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
]],
[anyone,"lord_internal_politics_support_same_acknowledge", [
(troop_get_slot, ":talk_troop_choice", "$g_talk_troop", slot_troop_stance_on_faction_issue),
(call_script, "script_troop_get_relation_with_troop", "trp_player", ":talk_troop_choice"),
(lt, reg0, -5),
(str_store_troop_name, s4, ":talk_troop_choice"),
],
"Given your relation with {s4}, I do not think that he would welcome your support.", "lord_pretalk",
[
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
]],
[anyone,"lord_internal_politics_support_same_acknowledge", [
(troop_get_slot, ":talk_troop_choice", "$g_talk_troop", slot_troop_stance_on_faction_issue),
(str_store_troop_name, s4, ":talk_troop_choice"),
],
"I will tell {s4}. He will no doubt be grateful for your support.", "lord_pretalk",
[
(troop_get_slot, ":talk_troop_choice", "$g_talk_troop", slot_troop_stance_on_faction_issue),
(call_script, "script_troop_change_relation_with_troop", "trp_player", ":talk_troop_choice", 2),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, ":talk_troop_choice"),
]],
[anyone|plyr|repeat_for_troops,"lord_internal_politics_plyr_choose_candidate_select", [
(store_repeat_object, ":candidate"),
(eq, 1, 0),
(troop_slot_eq, ":candidate", slot_troop_occupation, slto_kingdom_hero),
(store_faction_of_troop, ":candidate_faction", ":candidate"),
(eq, ":candidate_faction", "$players_kingdom"),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, ":candidate"),
(str_store_troop_name, s4, ":candidate"),
],
"I support {s4}", "lord_internal_politics_pretalk",
[
(store_repeat_object, ":candidate"),
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, ":candidate"),
]],
[anyone,"lord_internal_politics_pretalk", [
],
"Ah. Most interesting.", "lord_internal_politics_cur_stance_plyr_response",
[
]],
[anyone|plyr,"lord_internal_politics_cur_stance_plyr_response", [
(eq, "$player_has_homage" ,1),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_stance_on_faction_issue, "$g_talk_troop"),
(neg|troop_slot_ge, "trp_player", slot_troop_stance_on_faction_issue, active_npcs_begin),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_stance_on_faction_issue, "trp_player"),
],
"Can I convince you to support me instead?", "lord_internal_politics_plyr_request_support",
[
]],
[anyone|plyr,"lord_internal_politics_cur_stance_plyr_response", [
],
"Anyway, enough of politics for the time being.", "lord_pretalk",
[
]],
[anyone,"lord_internal_politics_plyr_request_support", [
(troop_slot_ge, "trp_player", slot_troop_controversy, 25),
(this_or_next|faction_slot_eq, "$players_kingdom", slot_faction_political_issue, 1),
(troop_slot_ge, "trp_player", slot_troop_controversy, 50),
],
"You have engendered too much controversy to be a viable candidate right now. I would advise you to wait a little while before seeking any further honors for yourself.", "lord_pretalk",
[
]],
[anyone,"lord_internal_politics_plyr_request_support", [
(troop_get_slot, ":current_candidate", "$g_talk_troop", slot_troop_stance_on_faction_issue),
(gt, ":current_candidate", 0),
(str_store_troop_name, s4, ":current_candidate"),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":current_candidate"),
(ge, reg0, "$g_talk_troop_effective_relation"),
],
"I am sorry. I would not wish to strain my relationship with {s4}", "lord_pretalk",
[
]],
[anyone,"lord_internal_politics_plyr_request_support", [
(faction_get_slot, ":faction_issue", "$players_kingdom", slot_faction_political_issue),
(is_between, ":faction_issue", centers_begin, centers_end),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(assign, ":total_faction_renown", ":player_renown"),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":active_npc_faction", ":active_npc"),
(eq, ":active_npc_faction", "$players_kingdom"),
(troop_get_slot, ":renown", ":active_npc", slot_troop_renown),
(val_add, ":total_faction_renown", ":renown"),
(try_end),
(assign, ":total_faction_center_value", 0),
(assign, ":center_points_held_by_player", 0),
(try_for_range, ":center", centers_begin, centers_end),
(store_faction_of_party, ":center_faction", ":center"),
(eq, ":center_faction", "$players_kingdom"),
(assign, ":center_value", 1),
(try_begin),
(is_between, ":center", towns_begin, towns_end),
(assign, ":center_value", 2),
(try_end),
(val_add, ":total_faction_center_value", ":center_value"),
(party_slot_eq, ":center", slot_town_lord, "trp_player"),
(val_add, ":center_points_held_by_player", ":center_value"),
(try_end),
(val_max, ":total_faction_center_value", 1),
(val_max, ":center_points_held_by_player", 1),
(store_div, ":average_renown_per_center_point", ":total_faction_renown", ":total_faction_center_value"),
(store_div, ":player_renown_per_center_point", ":player_renown", ":center_points_held_by_player"),
(store_mul, ":threshhold", ":average_renown_per_center_point", 3),
(val_div, ":threshhold", 4),
(lt, ":player_renown_per_center_point", ":threshhold"),
],
"You have already been well-rewarded with fiefs appropriate to your accomplishments, I would say.", "lord_pretalk",
[
]],
[anyone,"lord_internal_politics_plyr_request_support", [
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, 1),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(lt, ":player_renown", 400),
],
"I think you would need to prove yourself further before you are eligible for that position.", "lord_pretalk",
[
]],
#You already have too many holdings
[anyone,"lord_internal_politics_plyr_request_support", [
(lt, "$g_talk_troop_effective_relation", 10),
],
"Hmm... That is too much to ask, given the state of our relationship. ", "lord_pretalk",
[
]],
[anyone,"lord_internal_politics_plyr_request_support", [
],
"I would support you with pleasure. ", "lord_pretalk",
[
(troop_set_slot, "$g_talk_troop", slot_troop_stance_on_faction_issue, "trp_player"),
]],
[anyone,"lord_internal_politics_plyr_request_support", [
],
"{!}[Placeholder - sorry, not yet]", "lord_pretalk",
[
]],
[anyone,"lord_recruit_1_relation", [
(troop_slot_ge, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
],
"I am a bit weary of talking politics. Perhaps at a later date", "lord_pretalk",
[
(troop_get_slot, reg3, "$g_talk_troop", slot_troop_intrigue_impatience),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_intrigue_impatience=_reg3_must_be_less_than_100"),
(try_end),
]],
#lord proximity
[anyone,"lord_recruit_1_relation", [ #can't use the nearby scripts, because it would include the player party
(assign, ":continue", 1),
(try_begin),
(call_script, "script_cf_troop_can_intrigue", "$g_talk_troop", 1),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(str_store_string, s12, "str_youll_have_to_speak_to_me_at_some_other_time_then"),
(try_begin),
(lt,"$g_encountered_party_relation",0),
(encountered_party_is_attacker),
(str_store_string, s12, "str_this_is_no_time_for_words"),
(try_end),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_lord_not_alone"),
(try_end),
],
"{s12}", "lord_pretalk",[]],
[anyone,"lord_recruit_1_relation", [
(is_between, "$supported_pretender", pretenders_begin, pretenders_end),
(troop_slot_eq, "$supported_pretender", slot_troop_original_faction, "$g_talk_troop_faction"),
(troop_get_type, reg3, "$supported_pretender"),
(str_store_troop_name, s16, "$supported_pretender"),
(eq, "$skip_lord_assumes_argument", 0),
],
"You have raised the standard of rebellion on behalf of {s16}. Have you come to plead {reg3?her:his} case?", "lord_recruit_pretender",[
]],
[anyone|plyr,"lord_recruit_pretender", [
],
"I have", "lord_recruit_3_dilemma_1",[
(troop_set_slot, "$g_talk_troop", slot_lord_recruitment_candidate, "$supported_pretender"),
]],
[anyone|plyr,"lord_recruit_pretender", [
],
"No, that's not it. There's another issue I wish to discuss.", "lord_recruit_1_relation",[
(assign, "$skip_lord_assumes_argument", 1),
]],
#relation
[anyone,"lord_recruit_1_relation",
[
(try_begin),
(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(assign, ":willingness_to_intrigue", 20),
(str_store_string, s13, "str_of_course_my_wife"),
(str_store_string, s14, "str_perhaps_not_our_marriage_has_become_a_bit_strained_dont_you_think"),
(str_store_string, s15, "str_why_is_that_my_wife_actually_our_marriage_has_become_such_that_i_prefer_to_have_a_witness_for_all_of_our_converations"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(assign, ":willingness_to_intrigue", 6),
(str_store_string, s13, "str_all_right_then_what_do_you_have_to_say_out_with_it"),
(str_store_string, s14, "str_bah__im_in_no_mood_for_whispering_in_the_corner"),
(str_store_string, s15, "str_bah_i_dont_like_you_that_much_im_not_going_to_go_plot_with_you_in_some_corner"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(assign, ":willingness_to_intrigue", 8),
(str_store_string, s13, "str_well__now_what_do_you_have_to_propose"),
(str_store_string, s14, "str_trying_our_hand_at_intrigue_are_we_i_think_not"),
(str_store_string, s15, "str_hah_i_trust_you_as_a_i_would_a_serpent_i_think_not"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
(assign, ":willingness_to_intrigue", -10),
(str_store_string, s13, "str_i_do_not_like_to_conduct_my_business_in_the_shadows_but_sometimes_it_must_be_done_what_do_you_have_to_say"),
(str_store_string, s14, "str_i_would_prefer_to_conduct_our_affairs_out_in_the_open"),
(str_store_string, s15, "str_do_not_take_this_amiss_but_with_you_i_would_prefer_to_conduct_our_affairs_out_in_the_open"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
(assign, ":willingness_to_intrigue", 4),
(str_store_string, s13, "str_hmm_you_have_piqued_my_interest_what_do_you_have_to_say"),
(str_store_string, s14, "str_em_lets_keep_our_affairs_out_in_the_open_for_the_time_being"),
(str_store_string, s15, "str_em_lets_keep_our_affairs_out_in_the_open_for_the_time_being"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
(assign, ":willingness_to_intrigue", 0),
(str_store_string, s13, "str_thats_sensible__the_world_is_full_of_churls_who_poke_their_noses_into_their_betters_business_now_tell_me_what_it_is_that_you_have_to_say"),
(str_store_string, s14, "str_what_do_you_take_me_for_a_plotter"),
(str_store_string, s15, "str_hah_i_trust_you_as_a_i_would_a_serpent_i_think_not"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
(assign, ":willingness_to_intrigue", -10),
(str_store_string, s13, "str_well_i_normally_like_to_keep_things_out_in_the_open_but_im_sure_someone_like_you_would_not_want_to_talk_in_private_unless_heshe_had_a_good_reason_what_is_it"),
(str_store_string, s14, "str_surely_we_can_discuss_whatever_you_want_to_discuss_out_here_in_the_open_cant_we"),
(str_store_string, s15, "str_surely_we_can_discuss_whatever_you_want_to_discuss_out_here_in_the_open_cant_we"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(assign, ":willingness_to_intrigue", -5),
(str_store_string, s13, "str_im_a_simple__man_not_one_for_intrigue_but_id_guess_that_you_have_something_worthwhile_to_say_what_is_it"),
(str_store_string, s14, "str_forgive_me_but_im_not_one_for_going_off_in_corners_to_plot"),
(str_store_string, s15, "str_please_do_not_take_this_amiss_but_i_do_not_trust_you"),
(else_try),
(troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
(assign, ":willingness_to_intrigue", 10),
(str_store_string, s13, "str_certainly_playername_what_is_it"),
(str_store_string, s14, "str_forgive_me_but_id_prefer_to_keep_our_conversations_in_the_open"),
(str_store_string, s15, "str_please_do_not_take_this_amiss_but_im_not_sure_you_and_i_are_still_on_those_terms"),
(try_end),
(assign, ":continue", 0),
(store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
(try_begin),
(lt, "$g_talk_troop_relation", -5),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_persuasion__relation_less_than_5"),
(try_end),
(str_store_string, s12, "str_s15"),
(else_try),
(store_add, ":score", ":persuasion", "$g_talk_troop_relation"),
(val_add, ":score", ":willingness_to_intrigue"),
(game_get_reduce_campaign_ai, ":reduce_campaign_ai"),
(try_begin),
(eq, ":reduce_campaign_ai", 0), #hard
(val_sub, ":score", 5),
(else_try),
(eq, ":reduce_campaign_ai", 1), #medium
(else_try),
(eq, ":reduce_campaign_ai", 2), #easy
(val_add, ":score", 5),
(try_end),
(lt, ":score", 10),
(str_store_string, s12, "str_s14"),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_persuasion__2__lord_reputation_modifier__relation_less_than_10"),
(try_end),
(str_store_string, s12, "str_s14"),
(else_try),
(str_store_string, s12, "str_s13"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 0),
],
"{s12}", "lord_pretalk",[]],
[anyone,"lord_recruit_1_relation", [],
"{s12}", "lord_recruit_2",[]],
#check for discontent
[anyone|plyr,"lord_recruit_2", [
],
"What do you think, in general terms, about kings, lords, and politics?", "lord_recruit_2_philosophy",[
]],
[anyone|plyr,"lord_recruit_2", [
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
(neq, "$players_kingdom", "fac_player_supporters_faction"),
(troop_get_type, ":type", "$g_talk_troop"),
(eq, ":type", 0),
(faction_get_slot, ":faction_leader", "$g_encountered_party_faction", slot_faction_leader),
(str_store_troop_name, s11, ":faction_leader"),
],
"My husband, I believe that you should rethink you allegiance to {s11}", "lord_spouse_leave_faction",[
]],
[anyone,"lord_spouse_leave_faction", [
(faction_get_slot, ":faction_liege", "$g_talk_troop_faction", slot_faction_leader),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_liege"),
(gt, reg0, 25),
(str_store_troop_name, s9, ":faction_liege"),
],
"{s9} has always been a good liege to me, but I will hear you out. What do you suggest we do?", "lord_spouse_leave_faction_2",[]],
[anyone,"lord_spouse_leave_faction", [
(faction_get_slot, ":faction_liege", "$g_talk_troop_faction", slot_faction_leader),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_liege"),
(gt, reg0, -5),
(str_store_troop_name, s9, ":faction_liege"),
],
"I see no particular reason to abandon {s9}, but I will heed your advice. What do you suggest we do?", "lord_spouse_leave_faction_2",[]],
[anyone,"lord_spouse_leave_faction", [
(faction_get_slot, ":faction_liege", "$g_talk_troop_faction", slot_faction_leader),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_liege"),
(str_store_troop_name, s9, ":faction_liege"),
],
"Yes -- as a liege, {s9} is a great disappointment. What do you suggest we do?", "lord_spouse_leave_faction_2",[]],
# [anyone|plyr,"lord_spouse_leave_faction_2", [
# ],
# "Perhaps we should find another liege", "lord_spouse_leave_faction_other_liege",[]],
[anyone|plyr,"lord_spouse_leave_faction_2", [
],
"I believe you should be king, my husband!", "lord_spouse_leave_faction_husband_king",[]],
[anyone|plyr,"lord_spouse_leave_faction_2", [
],
"I am the rightful queen of Calradia", "lord_spouse_leave_faction_proclaim_queen",[]],
[anyone|plyr,"lord_spouse_leave_faction_2", [
],
"Never mind", "lord_pretalk",[]],
[anyone,"lord_spouse_leave_faction_husband_king", [
(assign, ":lord_has_fortress", 0),
(try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
(this_or_next|party_slot_eq, ":walled_center", slot_town_lord, "trp_player"),
(party_slot_eq, ":walled_center", slot_town_lord, "$g_talk_troop"),
(assign, ":lord_has_fortress", 1),
(try_end),
(eq, ":lord_has_fortress", 0),
],
"Perhaps some day, my wife -- but before I declare myself king, I should like for one of us to hold a fortress which could serve as our court before we declare ourselves publically.",
"lord_pretalk",[]],
[anyone,"lord_spouse_leave_faction_proclaim_queen", [
(assign, ":lord_has_fortress", 0),
(try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
(this_or_next|party_slot_eq, ":walled_center", slot_town_lord, "trp_player"),
(party_slot_eq, ":walled_center", slot_town_lord, "$g_talk_troop"),
(assign, ":lord_has_fortress", 1),
(try_end),
(eq, ":lord_has_fortress", 0),
],
"While I do not contest your claim, my wife, I should like for one of us to hold a fortress which could serve as our court before we declare ourselves publically.", "lord_pretalk",[]],
#Proclaim yourself queen
[anyone,"lord_spouse_leave_faction_proclaim_queen", [
(assign, ":player_has_enough_right", 0),
(try_begin),
(le, "$player_right_to_rule", 5),
(str_store_string, s11, "str_really_well_this_is_the_first_i_have_heard_of_it_unless_you_build_up_support_for_that_claim_you_may_find_it_difficult_to_find_allies_however_whenever_you_see_fit_to_declare_yourself_publically_as_queen_i_should_be_honored_to_be_your_consort"),
(assign, "$player_right_to_rule", 5),
(else_try),
(lt, "$player_right_to_rule", 20),
(str_store_string, s11, "str_yes_i_have_heard_such_talk_while_it_is_good_that_you_are_building_up_your_support_i_do_not_think_that_you_are_quite_ready_to_proclaim_yourself_yet_however_i_will_let_you_be_the_judge_of_that_and_when_you_decide_i_should_be_honored_to_be_your_consort"),
(else_try),
(str_store_string, s11, "str_yes_and_many_others_in_calradia_think_so_as_well_perhaps_it_is_time_that_you_declared_yourself_and_we_shall_ride_forth_together_to_claim_your_throne_i_should_be_honored_to_be_your_consort"),
(assign, ":player_has_enough_right", 1),
(try_end),
(eq, ":player_has_enough_right", 1),
],
"{s11}", "lord_spouse_leave_faction_proclaim_queen_confirm",[]],
[anyone,"lord_spouse_leave_faction_proclaim_queen", [
],
"{s11}", "lord_pretalk",[]],
[anyone|plyr,"lord_spouse_leave_faction_proclaim_queen_confirm", [
],
"I am ready now, my husband. Let us go forth to seek our throne.", "close_window",[
(call_script, "script_activate_player_faction", "trp_player"),
(call_script, "script_change_troop_faction", "$g_talk_troop", "fac_player_supporters_faction"),
(assign, "$g_leave_encounter", 1),
]],
[anyone|plyr,"lord_spouse_leave_faction_proclaim_queen_confirm", [
],
"Perhaps I am not yet ready.", "lord_pretalk",[]],
#Declare husband as pretender
[anyone,"lord_spouse_leave_faction_husband_king", [
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(gt, "$supported_pretender", 0),
(str_store_troop_name, s4, "$supported_pretender"),
],
"Perhaps, but I would need your full support to press that claim. You would want to resolve {s4}'s rebellion before pushing this any further.", "lord_pretalk",[]],
[anyone,"lord_spouse_leave_faction_husband_king", [
(faction_get_slot, ":talk_troop_liege", "$g_talk_troop_faction", slot_faction_leader),
(str_store_troop_name, s4, ":talk_troop_liege"),
],
"Most of the great families of this land have a claim to the throne... Given the recent issues with the succession, I should be as legitimate a king as {s4}. ", "lord_spouse_leave_faction_husband_king_2",[]],
[anyone,"lord_spouse_leave_faction_husband_king_2", [
],
"While king, I will defer to your judgment in the appointment of ministers, the conduct of diplomacy, and other such matters.", "lord_spouse_leave_faction_husband_king_3",[]],
[anyone|plyr,"lord_spouse_leave_faction_husband_king_3", [
],
"Very well, my husband. Let us ride forth to press your claim! ", "close_window",[
(call_script, "script_change_troop_faction", "$g_talk_troop", "fac_player_supporters_faction"),
(call_script, "script_activate_player_faction", "$g_talk_troop"),
(assign, "$g_leave_encounter", 1),
]],
[anyone|plyr,"lord_spouse_leave_faction_husband_king_3", [
],
"Actually, let us bide out time for a bit.", "lord_pretalk",[
]],
[anyone,"lord_recruit_2_philosophy", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_political_philosophy_default"),
],
"{s43} Did you wish to speak of anything else?", "lord_recruit_2",[]],
[anyone|plyr,"lord_recruit_2", [
(troop_slot_eq, "$g_talk_troop", slot_troop_recruitment_random, 0),
(faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),
(neq, "$g_talk_troop", ":leader"),
(neq, "trp_player", ":leader"),
(str_store_troop_name, s15, ":leader"),
],
"How do you feel about {s15}?", "lord_recruit_2_discontent",[
]],
[anyone|plyr,"lord_recruit_2", [
#(troop_slot_ge, "$g_talk_troop", slot_troop_recruitment_candidate, 1),
(troop_slot_ge, "$g_talk_troop", slot_lord_recruitment_argument, 1),
(neq, "$g_talk_troop_faction", "$players_kingdom"),
],
"Do you remember what I had told you earlier?", "lord_recruit_3_a",[
]],
[anyone|plyr|repeat_for_troops,"lord_recruit_2", [
(store_repeat_object, ":troop_no"),
(is_between, ":troop_no", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":faction", ":troop_no"),
(eq, ":faction", "$g_talk_troop_faction"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, ":troop_no"), #yields wrong string
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":troop_no"),
(lt, reg0, -9),
(str_store_troop_name, s16, ":troop_no"),
],
"I have heard that you have quarreled with {s16}", "lord_recruit_quarrel_describe",[
(store_repeat_object, "$temp"),
]],
[anyone,"lord_recruit_quarrel_describe",
[
(assign, ":specific_quarrel_found", 0),
(store_add, ":log_entries_plus_one", "$num_log_entries", 1),
(try_for_range, ":log_entry_no", 1, ":log_entries_plus_one"),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_ruler_intervenes_in_quarrel),
(troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no", "$temp"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_faction_object", ":log_entry_no", "$g_talk_troop_faction"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_protests_marshall_appointment),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_blames_defeat),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_troop_feels_cheated_by_troop_over_land),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no", "$temp"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lords_quarrel_over_woman),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lords_quarrel_over_woman),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$temp"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s14, reg0),
(assign, ":specific_quarrel_found", 1),
(try_end),
(try_begin),
(eq, ":specific_quarrel_found", 0),
(call_script, "script_troop_describes_quarrel_with_troop_to_s14", "$g_talk_troop", "$temp"),
(try_end),
(call_script, "script_add_rumor_string_to_troop_notes", "$g_talk_troop", "$temp", 14),
],
"It is no secret. {s14}", "lord_recruit_2",[
]],
[anyone|plyr,"lord_recruit_2", [
],
"Never mind", "lord_pretalk",[]],
[anyone,"lord_recruit_2_discontent", [
(faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),
(call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":leader"),
(assign, ":result_for_political", reg3),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "@{!}DEBUG : result_for_political is {reg3}"),
(try_end),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":leader"),
(assign, ":liege_relation", reg0),
(str_store_troop_name, s15, ":leader"),
(troop_get_type, reg15, ":leader"),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
(assign, ":intrigue_willingness", -5),
(str_store_string, s12, "str_i_am_disturbed_about_my_lord_s15s_choice_of_companions"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(assign, ":intrigue_willingness", -1),
(str_store_string, s12, "str_well_ill_be_honest_i_feel_that_sometimes_s15_overlooks_my_rights_and_extends_his_protection_to_the_unworthy"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(assign, ":intrigue_willingness", 5),
(str_store_string, s12, "str_heh_one_thing_that_ill_say_about_s15_is_that_he_has_a_ripe_batch_of_bastards_in_his_court"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
(assign, ":intrigue_willingness", -4),
(str_store_string, s12, "str_well_sometimes_i_have_to_say_that_i_question_s15s_judgment_regarding_those_who_he_keeps_in_his_court"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
(assign, ":intrigue_willingness", 1),
(str_store_string, s12, "str_s15_is_a_weak_man_who_too_easily_lends_his_ear_to_evil_council_and_gives_his_protection_to_some_who_have_done_me_wrong"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
(assign, ":intrigue_willingness", 3),
(str_store_string, s12, "str_i_will_confess_that_sometimes_i_worry_about_s15s_judgment_particularly_in_the_matter_of_the_counsel_that_he_keeps"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(assign, ":intrigue_willingness", 5),
(str_store_string, s12, "str_what_do_i_think_i_think_that_s15_is_a_vile_pretender_a_friend_to_the_flatterer_and_the_hypocrite"),
(else_try),
(troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
(assign, ":intrigue_willingness", 5),
(str_store_string, s12, "str_well_s15_is_not_like_you_ill_say_that_much"),
(try_end),
#is there a specific quarrel?
(store_add, ":log_entries_plus_one", "$num_log_entries", 1),
(try_for_range, ":log_entry_no", 1, ":log_entries_plus_one"),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_ruler_intervenes_in_quarrel),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", ":leader"),
(troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s12, reg0),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_protests_marshall_appointment),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no", ":leader"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s12, reg0),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_blames_defeat),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no", ":leader"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s12, reg0),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_troop_feels_cheated_by_troop_over_land),
(troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
(troop_slot_eq, "trp_log_array_faction_object", ":log_entry_no", "$g_talk_troop_faction"),
(call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
(str_store_string, s12, reg0),
(try_end),
(val_mul, ":intrigue_willingness", 2), #-10 to 10
(assign, "$lord_might_open_up", 0),
(try_begin),
(gt, ":result_for_political", 12),
(gt, ":liege_relation", 0),
(str_store_string, s12, "str_s15_long_may_he_live"),
(else_try),
(ge, ":result_for_political", ":intrigue_willingness"),
(str_store_string, s12, "str_he_is_my_liege_that_is_all_that_i_will_say_on_this_matter"),
(assign, "$lord_might_open_up", 1),
(try_end),
(lt, ":result_for_political", ":intrigue_willingness"),
(call_script, "script_add_rumor_string_to_troop_notes", "$g_talk_troop", ":leader", 12),
],
"{s12}", "lord_recruit_2_discontent_b",[
]],
[anyone, "lord_recruit_2_discontent", [
],
"{s12}", "lord_recruit_hesitant", []],
[anyone, "lord_recruit_2_discontent_b", [ ],
"Sometimes, I do worry about the state of the realm.", "lord_recruit_3", []],
[anyone|plyr,"lord_recruit_hesitant",
[
(eq, "$lord_might_open_up", 1),
],
"Can't I persuade you to say a little more?", "lord_recruit_hesitant_persuade",[
]],
[anyone|plyr,"lord_recruit_hesitant", [],
"Ah. Very good.", "lord_pretalk", []],
[anyone, "lord_recruit_hesitant_persuade",
[
(faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),
(call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":leader"),
(assign, ":result_for_political", reg3),
(store_sub, ":open_up_desire", 12, ":result_for_political"),
(assign, reg3, ":open_up_desire"),
(val_div, ":open_up_desire", 3),
#(store_random_in_range, ":random", -2, ":max_random_value"),
(store_sub, ":max_random_value", 14, ":open_up_desire"),
(troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
(store_mod, ":random", ":temp_ai_seed", ":max_random_value"),
(val_sub, ":random", 2), #random changes between -2 to (14 - (":result_for_political" div 3))
#(val_sub, ":random", 20), #open this line when you want to 100% pass this step and remove again after making tests.
(store_skill_level, ":persuasion_skill", "skl_persuasion", "trp_player"),
(lt, ":random", ":persuasion_skill"),
],
"If you put it that way, I admit that I do sometimes worry about the state of the realm.", "lord_recruit_3", []],
[anyone, "lord_recruit_hesitant_persuade", [
(troop_set_slot, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -1),
],
"You try my patience. I said that I have nothing to say.", "lord_pretalk", []],
[anyone|plyr,"lord_recruit_3", [
],
"Well, I have something to tell you.", "lord_recruit_3_a",[
]],
[anyone|plyr,"lord_recruit_3", [
],
"Well, that's interesting to know. But enough about politics.", "lord_pretalk",[
]],
[anyone, "lord_recruit_3_a", [
(troop_slot_ge, "$g_talk_troop", slot_lord_recruitment_argument, 1),
(troop_get_slot, ":candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(str_store_troop_name, s14, ":candidate"),
(try_begin),
(eq, ":candidate", "trp_player"),
(str_store_string, s14, "@you"),
(try_end),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_claim),
(eq, ":candidate", "trp_player"),
(str_store_string, s12, "str_that_you_are_the_rightful_heir_to_the_throne_of_calradia"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_claim),
(str_store_troop_name, s14, ":candidate"),
(str_store_string, s12, "str_that_s14_is_the_rightful_ruler_of_calradia"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_ruler),
(str_store_string, s12, "str_that_s14_will_rule_this_land_justly"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_lords),
(str_store_string, s12, "str_that_s14_will_protect_our_rights_as_nobles"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_victory),
(str_store_string, s12, "str_that_s14_will_unify_this_land_and_end_this_war"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
(str_store_string, s12, "str_that_s14_will_reward_me_with_a_fief"),
(try_end),
],
"{s12}", "lord_recruit_3_reset_claim", []],
[anyone|plyr, "lord_recruit_3_reset_claim", [ ],
"Yes, that's it.", "lord_recruit_3_claim", [
]],
[anyone|plyr, "lord_recruit_3_reset_claim", [ ],
"Let me phrase that a little differently.", "lord_recruit_3_a_reset", []],
[anyone, "lord_recruit_3_a",
[
#(display_message, "str_prior_arguments"),
#(assign, reg3, "$claim_arguments_made"),
#(display_message, "str_legal_reg3"),
#(assign, reg3, "$ruler_arguments_made"),
#(display_message, "str_just_king_reg3"),
#(assign, reg3, "$victory_arguments_made"),
#(display_message, "str_bring_peace_reg3"),
#(assign, reg3, "$lords_arguments_made"),
#(display_message, "str_only_best_counsel_reg3"),
#(assign, reg3, "$benefit_arguments_made"),
#(display_message, "str_reward_lords_reg3"),
],
"Yes?", "lord_recruit_3_b", []],
[anyone, "lord_recruit_3_a_reset", [],
"Yes?", "lord_recruit_3_b", []],
[anyone|plyr, "lord_recruit_3_b", [
(faction_get_slot, ":players_liege", "$players_kingdom", slot_faction_leader),
(eq, ":players_liege", "trp_player"),
],
"I ask for your support for the throne of Calradia", "lord_recruit_3_why",
[
(troop_set_slot, "$g_talk_troop", slot_lord_recruitment_candidate, "trp_player"),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_troop_recruitment_random, 0),
#(store_random_in_range, ":random", 1, 101), #replaced with below 3 lines to provide a constant history (not changable by save-loads).
(troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
(store_div, ":random", ":temp_ai_seed", 100), #I used div instead of mod to have a different random value, value generated from (mod 100) will be used in next steps. These two values should be non-related.
(val_add, ":random", 1),
(troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, ":random"),
(try_end),
]],
[anyone|plyr, "lord_recruit_3_b", [
(faction_get_slot, ":players_liege", "$players_kingdom", slot_faction_leader),
(neq, ":players_liege", "trp_player"),
(neq, "$players_kingdom", "$g_talk_troop_faction"),
(str_store_troop_name, s45, ":players_liege"),
],
"I ask you to pledge allegiance to my liege, {s45}, as monarch of all Calradia", "lord_recruit_3_why",
[
(faction_get_slot, ":players_liege", "$players_kingdom", slot_faction_leader),
(troop_set_slot, "$g_talk_troop", slot_lord_recruitment_candidate, ":players_liege"),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_troop_recruitment_random, 0),
#(store_random_in_range, ":random", 1, 101), #replaced with below 3 lines to provide a constant history (not changable by save-loads).
(troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
(store_div, ":random", ":temp_ai_seed", 100), #I used div instead of mod to have a different random value, value generated from (mod 100) will be used in next steps. These two values should be non-related.
(val_add, ":random", 1),
(troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, ":random"),
(try_end),
]],
[anyone|plyr, "lord_recruit_3_b", [
],
"Never mind", "lord_pretalk",
[
]],
[anyone, "lord_recruit_3_dilemma_1", [ #explain the political dilemma
(troop_get_slot, ":players_liege", "$g_talk_troop", slot_lord_recruitment_candidate),
(str_store_troop_name, s45, ":players_liege"),
(troop_get_type, reg3, ":players_liege"),
(faction_get_slot, ":current_liege", "$g_talk_troop_faction", slot_faction_leader),
(str_store_troop_name, s46, ":current_liege"),
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_rebellion_dilemma_default"),
], "{s43}", "lord_recruit_3_dilemma_2",
[]],
[anyone, "lord_recruit_3_dilemma_2", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_rebellion_dilemma_2_default"),
], "{s43}", "lord_recruit_3_why",
[]],
[anyone, "lord_recruit_3_why",
[
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_candidate, "trp_player"),
(assign, ":one_fortress_found", 0),
(try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
(this_or_next|party_slot_eq, ":walled_center", slot_town_lord, "$g_talk_troop"),
(party_slot_eq, ":walled_center", slot_town_lord, "trp_player"),
(assign, ":one_fortress_found", 1),
(try_end),
(eq, ":one_fortress_found", 0),
],
"Neither of us has so much as a single fortress to our name. Would you rule your kingdom from an outlaw's den in the woods?", "lord_pretalk",
[
]],
[anyone, "lord_recruit_3_why",
[
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(try_begin),
(eq, ":recruitment_candidate", "trp_player"),
(str_store_string, s44, "@you"),
(else_try),
(str_store_troop_name, s44, ":recruitment_candidate"),
(try_end),
],
"Why should I support {s44}?", "lord_recruit_3_d",
[
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(try_begin),
(troop_get_type, ":is_female", ":recruitment_candidate"),
(str_store_string, s45, "str_he"),
(str_store_string, s47, "str_king"),
(try_begin),
(eq, ":is_female", 1),
(str_store_string, s45, "str_she"),
(str_store_string, s47, "str_queen"),
(try_end),
(try_begin),
(eq, ":recruitment_candidate", "$supported_pretender"),
(eq, "$supported_pretender_old_faction", "fac_kingdom_3"),
(str_store_string, s47, "str_khan"),
(try_end),
(try_begin),
(eq, ":recruitment_candidate", "trp_player"),
(str_store_string, s45, "str_i"),
(try_end),
(try_end),
]],
[anyone|plyr,"lord_recruit_3_d",
[
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(str_store_string, s43, "str_according_to_the_ancient_law_and_custom_of_the_calradians_s45_should_be_s47"),
(try_begin),
(gt, "$supported_pretender", 0),
(eq, ":recruitment_candidate", "$supported_pretender"),
(str_store_faction_name, s46, "$supported_pretender_old_faction"),
(str_store_string, s43, "str_because_s44_is_the_rightful_s47_of_the_s46"),
(try_end),
],
"{s43}", "lord_recruit_3_claim",
[
(troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_claim),
(val_add, "$claim_arguments_made", 1),
(assign, "$opposed_arguments_made", "$victory_arguments_made"),
]],
[anyone|plyr,"lord_recruit_3_d",
[],
"If {s45} were {s47}, {s45} would deal with all men fairly and uphold the rights of the commons.", "lord_recruit_3_claim",
[
(troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_ruler),
(val_add, "$ruler_arguments_made", 1),
(assign, "$opposed_arguments_made", "$lords_arguments_made"),
]],
[anyone|plyr,"lord_recruit_3_d",
[],
"If {s45} were {s47}, {s45} would uphold your ancient rights as a noble of this land.", "lord_recruit_3_claim",
[
(troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_lords),
(val_add, "$lords_arguments_made", 1),
(assign, "$opposed_arguments_made", "$ruler_arguments_made"),
]],
[anyone|plyr,"lord_recruit_3_d",
[],
"Because {s45} can unify Calradia and end this discord.", "lord_recruit_3_claim",
[
(troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_victory),
(val_add, "$victory_arguments_made", 1),
(assign, "$opposed_arguments_made", "$claim_arguments_made"),
]],
[anyone|plyr,"lord_recruit_3_d",
[],
"Because {s45} will reward you with lands.", "lord_recruit_3_claim",[
(troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
(val_add, "$benefit_arguments_made", 1),
]],
[anyone|plyr,"lord_recruit_3_d",
[],
"Never mind", "lord_pretalk",[
(troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, 0),
]],
[anyone,"lord_recruit_3_claim", [
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
(gt, "$opposed_arguments_made", 0),
(troop_get_slot, ":recruitment_random", "$g_talk_troop", slot_troop_recruitment_random),
(store_mul, ":opposed_number", "$opposed_arguments_made", 10),
(val_add, ":opposed_number", ":recruitment_random"),
(gt, ":opposed_number", 100),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_claim),
(str_store_string, s12, "str_you_speak_of_claims_and_legalities_yet_to_others_you_talk_of_bringing_peace_by_force"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_victory),
(str_store_string, s12, "str_you_speak_of_bringing_peace_by_force_yet_to_others_you_make_legal_claims"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_commons),
(str_store_string, s12, "str_you_speak_to_some_of_upholding_the_rights_of_the_commons_yet_you_speak_to_others_of_uphold_the_rights_of_nobles_what_if_those_rights_are_in_conflict"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_lords),
(str_store_string, s12, "str_you_speak_to_me_of_upholding_my_rights_as_a_lord_but_to_others_you_talk_of_upholding_the_rights_of_all_commons_what_if_those_rights_come_into_conflict"),
(try_end),
],
"Do you perhaps tell each person what you think they most want to hear? {s12}", "lord_recruit_3_claim",
[
(assign, "$opposed_arguments_made", -1),
]],
#Is the candidate worthy of being king?
[anyone,"lord_recruit_3_claim", [
(assign, "$g_persuasion_trump_used", 0),
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(assign, ":continue", 0),
(str_store_string, s12, "str_a_claim_should_be_strong_indeed_before_one_starts_talking_about_it"),
(try_begin), #non-player candidates are automatically considered worthy
(neq, ":recruitment_candidate", "trp_player"),
(str_store_string, s12, "str_indeed_please_continue"),
(assign, ":continue", 1),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(str_store_string, s12, "str_a_claim_should_be_strong_indeed_before_one_starts_talking_about_it"),
#(assign, reg0, "$player_right_to_rule"),
#(assign, reg1, ":recruitment_candidate"),
#(troop_get_slot, reg2, ":recruitment_candidate", slot_troop_renown),
#(display_message, "@{!}DEBUG : player_right_to_rule = {reg0}"),
#(display_message, "@{!}DEBUG : recruitment_candidate = {reg1}"),
#(display_message, "@{!}DEBUG : renown = {reg2}"),
(ge, "$player_right_to_rule", 10),
(str_store_string, s12, "str_a_king_should_prove_his_valor_beyond_any_doubt_before_he_starts_talking_about_a_claim_to_the_throne"),
(troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 400),
(assign, ":continue", 1),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
(str_store_string, s12, "str_you_must_prove_yourself_a_great_warrior_before_men_will_follow_you_as_king"),
(troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
(assign, ":continue", 1),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
(str_store_string, s12, "str_a_claim_to_the_throne_should_be_strong_indeed_before_one_presses_it"),
(ge, "$player_right_to_rule", 20),
(str_store_string, s12, "str_indeed_but_a_man_must_also_prove_himself_a_great_warrior_before_men_will_follow_you_as_king"),
(troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
(assign, ":continue", 1),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(str_store_string, s12, "str_my_pigherd_can_declare_himself_king_if_he_takes_he_fancy_i_think_you_need_to_break_a_few_more_heads_on_tbe_battlefield_before_men_will_follow_you"),
(troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
(assign, ":continue", 1),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
(str_store_string, s12, "str_if_you_do_not_wish_to_die_on_a_scaffold_like_so_many_failed_pretenders_before_you_i_would_suggest_that_you_to_build_your_claim_on_stronger_foundations_so_that_men_will_follow_you"),
(ge, "$player_right_to_rule", 10),
(str_store_string, s12, "str_if_you_do_not_wish_to_die_on_a_scaffold_like_so_many_failed_pretenders_before_you_i_would_advise_you_prove_yourself_on_the_field_of_battle_so_that_men_will_follow_you"),
(troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
(assign, ":continue", 1),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(str_store_string, s12, "str_talk_is_for_heralds_and_lawyers_real_kings_prove_themselves_with_their_swords"),
(troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
(assign, ":continue", 1),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
(str_store_string, s12, "str_i_were_you_i_would_try_to_prove_myself_a_bit_more_before_i_went_about_pressing_my_claim"),
(troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 400),
(assign, ":continue", 1),
(try_end),
#Trump to overlook player unworthiness
(str_clear, s14),
(try_begin),
(eq, ":continue", 1),
(str_store_string, s12, "str_indeed_please_continue"),
(else_try),
(eq, ":continue", 0),
(eq, "$g_persuasion_trump_used", 0),
(assign, "$g_persuasion_trump_used", 1),
#persuasion check
(store_skill_level, ":persuasion_skill", "skl_persuasion", "trp_player"),
(troop_get_slot, ":persuasion_random", "$g_talk_troop", slot_troop_recruitment_random),
(try_begin),
(eq, "$cheat_mode", 1),
#(assign, reg3, ":persuasion_skill"),
#(assign, reg4, ":persuasion_random"),
#(display_message, "str_trump_check_random_reg4_skill_reg3"),
(try_end),
(val_mul, ":persuasion_skill", 7),
(ge, ":persuasion_skill", ":persuasion_random"),
(assign, ":continue", 1),
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_changed_my_mind_default"),
(str_store_string, s14, "str_s12_s43"),
(str_store_string, s12, s14),
(try_end),
(eq, ":continue", 1),
],
"{s12}", "lord_recruit_4",[
]],
#the lord refuses. s12 is set by the previous
[anyone,"lord_recruit_3_claim", [
],
"{s12}", "lord_pretalk",[
]],
[anyone|plyr,"lord_recruit_4", [
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(str_store_troop_name, s16, ":recruitment_candidate"),
(try_begin),
(eq, ":recruitment_candidate", "trp_player"),
(str_store_string, s16, "str_me"),
(try_end),
],
"I ask you to pledge your allegiance to {s16}.", "lord_recruit_4_objective_conditions",[]],
[anyone|plyr,"lord_recruit_4", [
(troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, 0),
],
"Never mind.", "lord_pretalk",[]],
[anyone,"lord_recruit_4_objective_conditions", [
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":recruitment_candidate"),
(str_store_string, s33, s14),
(assign, ":result_for_security", reg2),
(assign, ":result_for_political", reg4),
#this will store
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_preliminary_result_for_political_=_reg4"),
(try_end),
# (assign, ":result_for_ideological", reg6),
# (assign, ":result_for_material", reg8),
(assign, ":change_penalty", reg10),
(assign, ":result_for_new_liege", reg0),
(faction_get_slot, ":cur_liege", "$g_talk_troop_faction", slot_faction_leader),
(call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":cur_liege"),
(store_sub, ":result_for_security_comparative", ":result_for_security", reg2),
(store_sub, ":result_for_political_comparative", ":result_for_political", reg4),
# (store_sub, ":result_for_ideological_comparative", ":result_for_ideological", reg6), #to be used if NPC lords ever have different ideologies
# (store_sub, ":result_for_material_comparative", ":result_for_material", reg8), #result for material (meaning, promised new fiefs or bribes) currently disabled
(assign, ":result_for_old_liege", reg0),
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg31, ":result_for_new_liege"),
(assign, reg32, ":result_for_old_liege"),
(display_message, "@{!}DEBUG : result_for_new_liege : {reg31}"),
(display_message, "@{!}DEBUG : result_for_old_liege : {reg32}"),
(try_end),
(store_sub, "$pledge_chance", ":result_for_new_liege", ":result_for_old_liege"),
(val_add, "$pledge_chance", 50),
(val_div, "$pledge_chance", 2),
(try_begin),
(lt, ":result_for_political", 0),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
(str_store_string, s31, "str_i_worry_about_those_with_whom_you_have_chosen_to_surround_yourself" ),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(str_store_string, s31, "str_there_are_some_outstanding_matters_between_me_and_some_of_your_vassals_"),
(try_begin),
(assign, reg41, ":result_for_political"),
(display_message, "str_result_for_political_=_reg41"),
(try_end),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(str_store_string, s31, "str_my_liege_has_his_faults_but_i_dont_care_for_your_toadies"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
(str_store_string, s31, "str_i_think_youre_a_good_man_but_im_worried_that_you_might_be_pushed_in_the_wrong_direction_by_some_of_those_around_you"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
(str_store_string, s31, "str_i_am_loathe_to_fight_alongside_you_so_long_as_you_take_under_your_wing_varlots_and_base_men"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
(str_store_string, s31, "str_ill_be_honest__with_some_of_those_who_follow_you_i_think_id_be_more_comfortable_fighting_against_you_than_with_you"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(str_store_string, s31, "str_i_say_that_you_can_judge_a_man_by_the_company_he_keeps_and_you_have_surrounded_yourself_with_vipers_and_vultures"),
(else_try),
(troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
(str_store_string, s31, "str_you_know_that_i_have_always_had_a_problem_with_some_of_our_companions"),
(try_end),
(else_try),
(lt, ":result_for_political_comparative", 0),
(str_store_string, s31, "str_politically_i_would_be_a_better_position_in_the_court_of_my_current_liege_than_in_yours"),
(else_try),
(str_store_string, s31, "str_i_am_more_comfortable_with_you_and_your_companions_than_with_my_current_liege"),
(try_end),
#end political string
#end
(try_begin),
(lt, ":result_for_security", 10),
(try_begin),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
(troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
(str_store_string, s32, "str_militarily_youre_in_no_position_to_protect_me_should_i_be_attacked_id_be_reluctant_to_join_you_until_you_could"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
(str_store_string, s32, "str_militarily_when_i_consider_the_lay_of_the_land_i_realize_that_to_pledge_myself_to_you_now_would_endanger_my_faithful_retainers_and_my_family"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(str_store_string, s32, "str_militarily_youre_in_no_position_to_come_to_my_help_if_someone_attacked_me_i_dont_mind_a_good_fight_but_i_like_to_have_a_chance_of_winning"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
(str_store_string, s32, "str_militarily_youre_in_no_position_to_come_to_my_help_if_someone_attacked_me_i_dont_mind_a_good_fight_but_i_like_to_have_a_chance_of_winning"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(str_store_string, s32, "str_militarily_you_would_have_me_join_you_only_to_find_myself_isolated_amid_a_sea_of_enemies"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
(str_store_string, s32, "str_militarily_you_would_have_me_join_you_only_to_find_myself_isolated_amid_a_sea_of_enemies"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(str_store_string, s32, "str_militarily_youre_in_no_position_to_come_to_my_help_if_someone_attacked_me_youd_let_me_be_cut_down_like_a_dog_id_bet"),
(try_end),
(else_try),
(lt, ":result_for_security_comparative", 0),
(str_store_string, s32, "str_militarily_i_wouldnt_be_any_safer_if_i_joined_you"),
(else_try),
(str_store_string, s32, "str_militarily_i_might_be_safer_if_i_joined_you"),
(try_end),
(try_begin),
(gt, ":change_penalty", 40),
(str_store_string, s34, "str_finally_there_is_a_cost_to_ones_reputation_to_change_sides_in_this_case_the_cost_would_be_very_high"),
(else_try),
(gt, ":change_penalty", 20),
(str_store_string, s34, "str_finally_there_is_a_cost_to_ones_reputation_to_change_sides_in_this_case_the_cost_would_be_significant"),
(else_try),
(str_store_string, s34, "str_finally_there_is_a_cost_to_ones_reputation_to_change_sides_in_this_case_however_many_men_would_understand"),
(try_end),
],
"Let me think...", "lord_recruit_5_security",[
]],
[anyone,"lord_recruit_5_security", [
],
"{s32}", "lord_recruit_5_political",
[]],
[anyone,"lord_recruit_5_political", [
],
"{s31}", "lord_recruit_5_ideological",
[]],
# [anyone,"lord_recruit_5_material", [
# ],
# "{!}[Anticipated material gains currently not counted]", "lord_recruit_5_ideological",
# []],
[anyone,"lord_recruit_5_ideological", [
],
"{s33}", "lord_recruit_5_change_sides",
[
]],
[anyone,"lord_recruit_5_change_sides", [
],
"{s34}", "lord_recruit_6",
[
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg1, "$pledge_chance"),
(display_message, "str_chance_of_success_=_reg1"),
(try_end),
]],
[anyone|plyr,"lord_recruit_6",[
],
"It is time for you to make a decision.", "lord_recruit_6_reaction",
[
]],
[anyone|plyr,"lord_recruit_6",[
],
"No need to decide anything -- we can speak of this at a later time.", "lord_pretalk",
[
]],
[anyone,"lord_recruit_6_reaction",
[
],
"Very well...", "lord_recruit_7_decision",
[
(troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, 0),
]],
[anyone,"lord_recruit_7_decision",
[
#(store_random_in_range, ":random", 0, 100),
(troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
(store_mod, ":random", ":temp_ai_seed", 100),
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg3, ":random"),
(display_message, "str_random_=_reg3"),
(try_end),
(faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),
(str_store_troop_name, s14, ":leader"),
(assign, ":continue_to_pledge", 0),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
(gt, ":random", "$pledge_chance"),
(str_store_string, s12, "str_i_will_not_have_it_be_said_about_me_that_i_am_a_traitor_that_is_my_final_decision_i_have_nothing_more_to_say_on_this_matter"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(gt, ":random", "$pledge_chance"),
(str_store_string, s12, "str_i_am_pledged_to_defend_s14_i_am_sorry_though_we_may_meet_on_the_battlefield_i_hope_that_we_will_still_be_friends"),
(else_try),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
(troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
(gt, ":random", "$pledge_chance"),
(str_store_string, s12, "str_i_really_cannot_bring_myself_to_renounce_s14_i_am_sorry_please_lets_not_talk_about_this_any_more"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
(gt, ":random", "$pledge_chance"),
(str_store_string, s12, "str_however_i_have_decided_that_i_must_remain_loyal_to_s14_i_am_sorry"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(gt, ":random", "$pledge_chance"),
(str_store_string, s12, "str_however_i_will_not_let_you_lead_me_into_treason_do_not_talk_to_me_of_this_again"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
(gt, ":random", "$pledge_chance"),
(str_store_string, s12, "str_its_not_good_to_get_a_reputation_as_one_who_abandons_his_liege_that_is_my_decision_let_us_speak_no_more_of_this_matter"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(gt, ":random", "$pledge_chance"),
(str_store_string, s12, "str_ive_decided_to_stick_with_s14_i_dont_want_to_talk_about_this_matter_any_more"),
(else_try),
(assign, ":continue_to_pledge", 1),
(try_end),
(eq, ":continue_to_pledge", 0),
],
"{s12}", "lord_pretalk",
[
(troop_set_slot, "$g_talk_troop", slot_troop_intrigue_impatience, 500),
]],
[anyone,"lord_recruit_7_decision",
[
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(str_store_troop_name, s4, ":recruitment_candidate"),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_lord_pledges_to_s4"),
(try_end),
],
"Very well -- I am ready to pledge myself to {s4} as my {reg4?queen:king}.", "lord_recruit_pledge",
[
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(try_begin),
(eq, ":recruitment_candidate", "trp_player"),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),
(call_script, "script_activate_player_faction", "trp_player"),
(try_end),
(assign, "$lord_expects_fief", 0),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
(assign, "$lord_expects_fief", 1),
(try_end),
(call_script, "script_change_troop_faction", "$g_talk_troop", "$players_kingdom"),
(try_begin), #Actually, perhaps do provocation rather than war
(store_relation, ":relation", "$players_kingdom", "$g_talk_troop_faction"),
(ge, ":relation", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_lord_recruitment_provokes_home_faction"),
(try_end),
(call_script, "script_add_log_entry", logent_border_incident_troop_suborns_lord, "trp_player", -1, "$g_talk_troop","$g_talk_troop_faction"),
(store_add, ":slot_provocation_days", "$players_kingdom", slot_faction_provocation_days_with_factions_begin),
(val_sub, ":slot_provocation_days", kingdoms_begin),
(faction_set_slot, "$g_talk_troop_faction", ":slot_provocation_days", 30),
(faction_get_slot, ":other_liege", "$g_talk_troop_faction", slot_faction_leader),
(call_script, "script_troop_change_relation_with_troop", "trp_player", ":other_liege", -3),
(try_end),
(troop_get_type, reg4, ":recruitment_candidate"),
(try_begin),
(eq, ":recruitment_candidate", "trp_player"),
(str_store_string, s4, "@you"),
(call_script, "script_change_player_right_to_rule", 5),
(else_try),
(str_store_troop_name, s4, ":recruitment_candidate"),
(try_end),
]],
[anyone,"lord_recruit_pledge",
[
(eq, "$lord_expects_fief", 1),
],
"Remember. You have promised me a fief. I will hold you to that promise.", "lord_recruit_pledge",
[
(assign, "$lord_expects_fief", 0),
(troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, 0),
(call_script, "script_add_log_entry", logent_liege_promises_fief_to_vassal, "trp_player", 0, "$g_talk_troop", "$players_kingdom"),
(troop_set_slot, "$g_talk_troop", slot_troop_promised_fief, 1),
]],
[anyone,"lord_recruit_pledge",
[
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(eq, ":recruitment_candidate", "trp_player"),
],
"So be it -- I pledge allegiance to you as your faithful vassal. I shall stand at your side to fight your enemies should you need my sword, and uphold your claims and those of your legitimate heirs. I expect in turn that you will protect me and recognize my rights as your vassal.", "lord_recruit_pledge_conclude",
[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_recruit_pledge", [
(troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
(str_store_troop_name, s4, ":recruitment_candidate"),
],
"So be it -- you may inform {s4} that I am now {reg4?her:him} faithful vassal, that I will follow {reg4?her:him} as long as my breath remains, and I will be at {reg4?her:his} side to fight your enemies should you need my sword, and that I uphold your lawful claims and those of your legitimate heirs. In turn, I expect his protection and his recognition of my rights as his vassal.", "lord_recruit_pledge_conclude",
[]],
[anyone,"lord_recruit_pledge_conclude", [
],
"Now... It is a momentous step I have taken. I will take my leave, as I may need some time prepare myself for what comes next.", "close_window",
[]],
#lord recruitment changes end
#POLITICAL QUESTS RESOLUTIONS
[anyone, "lord_start", [
(check_quest_active, "qst_offer_gift"),
(quest_slot_eq, "qst_offer_gift", slot_quest_target_troop, "$g_talk_troop"),
(quest_slot_eq, "qst_offer_gift", slot_quest_current_state, 2),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(store_random_in_range, ":random", 3),
(eq, ":random", 0),
(quest_get_slot, ":giver_troop", "qst_offer_gift", slot_quest_giver_troop),
(str_store_troop_name, s10, ":giver_troop"),
(call_script, "script_troop_get_family_relation_to_troop", ":giver_troop", "$g_talk_troop"),
],
"I received the gift, presented to me through my {s11} {s10}. It was a noble gesture, {sir/my lady}, and I regret that we ever quarreled.", "close_window",
[
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
(store_sub, ":difference", 0, reg0),
(val_add, ":difference", 5),
(val_max, ":difference", 5),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":difference"),
(call_script, "script_end_quest", "qst_offer_gift"),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_start",[
(check_quest_active, "qst_offer_gift"),
(quest_slot_eq, "qst_offer_gift", slot_quest_target_troop, "$g_talk_troop"),
(quest_slot_eq, "qst_offer_gift", slot_quest_current_state, 2),
(store_random_in_range, ":random", 3),
(neq, ":random", 0),
(quest_get_slot, ":giver_troop", "qst_offer_gift", slot_quest_giver_troop),
(str_store_troop_name, s10, ":giver_troop"),
(call_script, "script_troop_get_family_relation_to_troop", ":giver_troop", "$g_talk_troop"),
],
"I received the gift, presented to me through my {s11} {s10}. For {reg4?her:his} sake, I am willing to let bygones be bygones.", "close_window", [
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
(store_sub, ":difference", 0, reg0),
(val_max, ":difference", 2),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":difference"),
(call_script, "script_end_quest", "qst_offer_gift"),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_start",[
(check_quest_active, "qst_offer_gift"),
(quest_slot_eq, "qst_offer_gift", slot_quest_target_troop, "$g_talk_troop"),
(quest_slot_eq, "qst_offer_gift", slot_quest_current_state, 2),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
(quest_get_slot, ":giver_troop", "qst_offer_gift", slot_quest_giver_troop),
(str_store_troop_name, s10, ":giver_troop"),
(call_script, "script_troop_get_family_relation_to_troop", ":giver_troop", "$g_talk_troop"),
],
"I received the gift, presented to me through my {s11} {s10}. Bah! Do you think you can buy my friendship?", "close_window", [
(call_script, "script_end_quest", "qst_offer_gift"),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_start",[
(check_quest_active, "qst_offer_gift"),
(quest_slot_eq, "qst_offer_gift", slot_quest_target_troop, "$g_talk_troop"),
(quest_slot_eq, "qst_offer_gift", slot_quest_current_state, 2),
(quest_get_slot, ":giver_troop", "qst_offer_gift", slot_quest_giver_troop),
(str_store_troop_name, s10, ":giver_troop"),
(call_script, "script_troop_get_family_relation_to_troop", ":giver_troop", "$g_talk_troop"),
],
"I received the gift, presented to me through my {s11} {s10}. As dear as {reg?she:he} is to me, however, I cannot forget our differences.", "close_window",
[
(assign, "$g_leave_encounter", 1),
(call_script, "script_end_quest", "qst_offer_gift"),
]],
[anyone|plyr,"lord_talk",[
(check_quest_active, "qst_denounce_lord"),
(quest_slot_eq, "qst_denounce_lord", slot_quest_giver_troop, "$g_talk_troop"),
(this_or_next|check_quest_succeeded, "qst_denounce_lord"),
(check_quest_failed, "qst_denounce_lord"),
(quest_get_slot, ":target_troop", "qst_denounce_lord", slot_quest_giver_troop),
(str_store_troop_name, s4, ":target_troop"),
],
"I did as you suggested, and denounced {s4}", "denounce_lord_results" ,
[
]],
[anyone,"denounce_lord_results",[
(check_quest_succeeded, "qst_denounce_lord"),
(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
(str_store_troop_name, s4, ":faction_leader"),
],
"Yes, and hopefully now {s4} will think twice before entrusting him with any additional fiefs, honors, or offices. We are grateful to you.", "lord_pretalk",
[
(call_script, "script_succeed_quest", "qst_denounce_lord"),
(call_script, "script_end_quest", "qst_denounce_lord"),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 8),
(add_xp_as_reward, 1000),
]],
[anyone,
"denounce_lord_results",[
# (check_quest_failed, "qst_denounce_lord"),
],
"So you did -- and we have heard that he forced you to retract your words, and thus emerged from this affair looking stronger than before. You will forgive me, {sir/my lady}, if my gratitude to you is somewhat muted.", "close_window",
[
(call_script, "script_end_quest", "qst_denounce_lord"),
]],
[anyone|plyr,"lord_talk",[
(check_quest_active, "qst_intrigue_against_lord"),
(quest_slot_eq, "qst_intrigue_against_lord", slot_quest_giver_troop, "$g_talk_troop"),
(this_or_next|check_quest_succeeded, "qst_intrigue_against_lord"),
(check_quest_failed, "qst_intrigue_against_lord"),
(quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
(str_store_troop_name, s4, ":target_troop"),
(faction_get_slot, ":liege", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s5, ":liege"),
],
"I did as you asked, and spoke to {s5} about the danger posed by {s4}.", "lord_quest_intrigue_result" ,
[
]],
[anyone,"lord_quest_intrigue_result",[
(check_quest_succeeded, "qst_intrigue_against_lord"),
],
"So we hear. Hopefully now {s5} will think twice before entrusting him with any additional fiefs, honors, or offices. We are grateful to you.", "lord_pretalk" ,
[
(call_script, "script_end_quest", "qst_intrigue_against_lord"),
(quest_set_slot, "qst_intrigue_against_lord", slot_quest_dont_give_again_remaining_days, 30),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 8),
(add_xp_as_reward, 500),
]],
[anyone,"lord_quest_intrigue_result",[
(check_quest_failed, "qst_intrigue_against_lord"),
],
"So we hear -- but alas, {s5} seems not to have listened. Still, we are grateful to you for trying.", "close_window" ,
[
(call_script, "script_end_quest", "qst_intrigue_against_lord"),
(quest_set_slot, "qst_intrigue_against_lord", slot_quest_dont_give_again_remaining_days, 30),
# (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 2),
]],
[anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(check_quest_active,"qst_lend_companion"),
(quest_slot_eq, "qst_lend_companion", slot_quest_giver_troop, "$g_talk_troop"),
(store_current_day, ":cur_day"),
(quest_get_slot, ":quest_target_amount", "qst_lend_companion", slot_quest_target_amount),
(ge, ":cur_day", ":quest_target_amount"),
(quest_get_slot, ":quest_target_troop", "qst_lend_companion", slot_quest_target_troop),
(str_store_troop_name,s14,":quest_target_troop"),
(troop_get_type, reg3, ":quest_target_troop"),
],
"I should like {s14} returned to me, {s65}, if you no longer require {reg3?her:his} services.", "lord_lend_companion_end",
[]],
[anyone,"lord_lend_companion_end",[(neg|hero_can_join, "p_main_party")],
"You've too many men in your company already, {playername}. You could not lead any more at the moment.", "lord_pretalk",
[]],
[anyone,"lord_lend_companion_end",[],
"Certainly, {playername}. {reg3?She:He} is a bright {reg3?girl:fellow}, you're a lucky {man/woman} to have such worthy companions.", "lord_pretalk",
[(quest_get_slot, ":quest_target_troop", "qst_lend_companion", slot_quest_target_troop),
(party_add_members, "p_main_party", ":quest_target_troop", 1),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
(add_xp_as_reward, 100),
(call_script, "script_end_quest", "qst_lend_companion"),
(str_store_troop_name,s14,":quest_target_troop"),
(troop_get_type, reg3, ":quest_target_troop"),
]],
[anyone|plyr,"lord_talk",[(check_quest_active,"qst_collect_debt"),
(quest_slot_eq, "qst_collect_debt", slot_quest_current_state, 0),
(quest_get_slot, ":quest_target_troop", "qst_collect_debt", slot_quest_target_troop),
(eq,"$g_talk_troop",":quest_target_troop"),
(quest_get_slot, ":quest_giver_troop", "qst_collect_debt", slot_quest_giver_troop),
(str_store_troop_name,1,":quest_giver_troop")],
"I've come to collect the debt you owe to {s1}.", "lord_ask_to_collect_debt",
[(assign, "$g_convince_quest", "qst_collect_debt")]],
[anyone,"lord_ask_to_collect_debt", [], "Oh. Well, {s1} did lend me some silver a ways back,\
but I've done him many favours in the past and I consider that money as my due payment.", "lord_ask_to_collect_debt_2",[]],
[anyone|plyr,"lord_ask_to_collect_debt_2", [], "{s1} considers it a debt. He asked me to speak to you on his behalf.", "convince_begin",[]],
[anyone|plyr,"lord_ask_to_collect_debt_2", [], "Then I will not press the matter any further.", "lord_pretalk",[]],
[anyone,"convince_accept",[(check_quest_active, "qst_collect_debt"),
(quest_slot_eq, "qst_collect_debt", slot_quest_target_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_giver_troop", "qst_collect_debt", slot_quest_giver_troop),
(str_store_troop_name,s8,":quest_giver_troop"),
(quest_get_slot, reg10, "qst_collect_debt", slot_quest_target_amount)],
"My debt to {s8} has long been overdue and was a source of great discomfort to me.\
Thank you for accepting to take the money to him.\
Please give him these {reg10} denars and thank him on my behalf.", "close_window",
[(call_script, "script_troop_add_gold", "trp_player", reg10),
(quest_set_slot, "qst_collect_debt", slot_quest_current_state, 1),
(call_script, "script_succeed_quest", "qst_collect_debt"),
(assign, "$g_leave_encounter", 1),
]],
[anyone|plyr,"lord_talk",[(check_quest_active,"qst_persuade_lords_to_make_peace"),
(quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
(quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
(this_or_next|eq, ":quest_target_troop", "$g_talk_troop"),
(eq, ":quest_object_troop", "$g_talk_troop"),
(quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
(quest_get_slot, ":quest_object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
(str_store_faction_name, s12, ":quest_target_faction"),
(str_store_faction_name, s13, ":quest_object_faction"),
],
"Please, {s64}, it's time to end this war between {s12} and {s13}.", "lord_ask_to_make_peace",
[(assign, "$g_convince_quest", "qst_persuade_lords_to_make_peace")]],
[anyone,"lord_ask_to_make_peace", [], "Eh? I'm not sure I heard you right, {playername}.\
War is not easily forgotten by either side of the conflict, and I have a very long memory.\
Why should I take any interest in brokering peace with those dogs?", "lord_ask_to_make_peace_2",[]],
[anyone|plyr,"lord_ask_to_make_peace_2", [], "Perhaps I can talk you into it...", "convince_begin",[]],
[anyone|plyr,"lord_ask_to_make_peace_2", [], "Never mind, peace can wait for now.", "lord_pretalk",[]],
[anyone,"convince_accept",[(check_quest_active, "qst_persuade_lords_to_make_peace"),
(this_or_next|quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, "$g_talk_troop"),
(quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
(quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
(str_store_faction_name, s12, ":quest_object_faction"),
(str_store_faction_name, s13, ":quest_target_faction"),
(try_begin), # store name of other faction
(eq,":quest_object_faction","$g_talk_troop_faction"),
(str_store_faction_name, s14, ":quest_target_faction"),
(else_try),
(str_store_faction_name, s14, ":quest_object_faction"),
(try_end),
],
"You... have convinced me, {playername}. Very well then, you've my blessing to bring a peace offer to {s14}. I cannot guarantee they will accept it, but on the off-chance they do, I will stand by it.", "close_window",
[(store_mul, ":new_value", "$g_talk_troop", -1),
(try_begin),
(quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, "$g_talk_troop"),
(quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, ":new_value"),
(else_try),
(quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, ":new_value"),
(try_end),
(quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_convince_value, 1500),#reseting convince value for the second persuasion
(assign, "$g_leave_encounter", 1),
(neg|quest_slot_ge, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, 0),
(neg|quest_slot_ge, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, 0),
(call_script, "script_succeed_quest", "qst_persuade_lords_to_make_peace"),
]],
##
##
## [anyone|plyr,"lord_talk",[(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (check_quest_active,"qst_bring_reinforcements_to_siege"),
## (quest_get_slot, ":quest_target_troop", "qst_bring_reinforcements_to_siege", slot_quest_target_troop),
## (eq,"$g_talk_troop",":quest_target_troop"),
## (quest_get_slot, ":quest_giver_troop", "qst_bring_reinforcements_to_siege", slot_quest_giver_troop),
## (quest_get_slot, ":quest_target_amount", "qst_bring_reinforcements_to_siege", slot_quest_target_amount),
## (quest_get_slot, ":quest_object_troop", "qst_bring_reinforcements_to_siege", slot_quest_object_troop),
## (party_count_companions_of_type, ":num_companions", "p_main_party", ":quest_object_troop"),
## (ge, ":num_companions", ":quest_target_amount"),
## (str_store_troop_name,1,":quest_giver_troop"),
## (assign, reg1, ":quest_target_amount"),
## (str_store_troop_name,2,":quest_object_troop")],
## "Sir, {s1} ordered me to bring {reg1} {s2} to reinforce your siege.", "lord_reinforcement_brought",
## [(quest_get_slot, ":quest_target_amount", "qst_bring_reinforcements_to_siege", slot_quest_target_amount),
## (quest_get_slot, ":quest_target_party", "qst_bring_reinforcements_to_siege", slot_quest_target_party),
## (quest_get_slot, ":quest_object_troop", "qst_bring_reinforcements_to_siege", slot_quest_object_troop),
## (party_remove_members, "p_main_party", ":quest_object_troop", ":quest_target_amount"),
## (party_add_members, ":quest_target_party", ":quest_object_troop", ":quest_target_amount"),
## (call_script, "script_finish_quest", "qst_bring_reinforcements_to_siege", 100),
## ]],
##
## [anyone|plyr,"lord_talk",[(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (check_quest_active,"qst_bring_reinforcements_to_siege"),
## (quest_get_slot, ":quest_target_troop", "qst_bring_reinforcements_to_siege", slot_quest_target_troop),
## (eq,"$g_talk_troop",":quest_target_troop"),
## (quest_get_slot, ":quest_giver_troop", "qst_bring_reinforcements_to_siege", slot_quest_giver_troop),
## (quest_get_slot, ":quest_target_amount", "qst_bring_reinforcements_to_siege", slot_quest_target_amount),
## (quest_get_slot, ":quest_object_troop", "qst_bring_reinforcements_to_siege", slot_quest_object_troop),
## (party_count_companions_of_type, ":num_companions", "p_main_party", ":quest_object_troop"),
## (lt, ":num_companions", ":quest_target_amount"),
## (gt, ":num_companions", 0),
## (str_store_troop_name,1,":quest_giver_troop"),
## (assign, reg1, ":quest_target_amount"),
## (str_store_troop_name,2,":quest_object_troop")],
## "Sir, {s1} ordered me to bring {reg1} {s2} as a reinforcement to your siege, but unfortunately I lost some of them during my expedition.", "lord_reinforcement_brought_some",
## [(quest_get_slot, ":quest_target_amount", "qst_bring_reinforcements_to_siege", slot_quest_target_amount),
## (quest_get_slot, ":quest_target_party", "qst_bring_reinforcements_to_siege", slot_quest_target_party),
## (quest_get_slot, ":quest_object_troop", "qst_bring_reinforcements_to_siege", slot_quest_object_troop),
## (party_count_companions_of_type, ":num_companions", "p_main_party", ":quest_object_troop"),
## (party_remove_members, "p_main_party", ":quest_object_troop", ":num_companions"),
## (party_add_members, ":quest_target_party", ":quest_object_troop", ":num_companions"),
## (assign, ":percentage_completed", 100),
## (val_mul, ":percentage_completed", ":num_companions"),
## (val_div, ":percentage_completed", ":quest_target_amount"),
## (call_script, "script_finish_quest", "qst_bring_reinforcements_to_siege", ":percentage_completed"),
## ]],
##
## [anyone,"lord_reinforcement_brought", [], "Well done {playername}. These men will no doubt be very useful. I will speak to {s1} of your help.", "lord_pretalk",[]],
## [anyone,"lord_reinforcement_brought_some", [], "That's not quite good enough {playername}. But I suppose it is better than no reinforcements at all. Whatever, I'll tell {s1} you tried your best.", "lord_pretalk",[]],
##
[anyone|plyr,"lord_talk",
[
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(check_quest_active,"qst_duel_for_lady"),
(neg|check_quest_concluded,"qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_giver_troop", "qst_duel_for_lady", slot_quest_giver_troop),
(str_store_troop_name, s1, ":quest_giver_troop")
],
"I want you to take back your accusations against {s1}.", "lord_challenge_duel_for_lady", []],
[anyone,"lord_challenge_duel_for_lady", [], "What accusations?\
Everyone knows that she beds her stable boys and anyone else she can lay hands on while her husband is away.\
I merely repeat the words of many.", "lord_challenge_duel_for_lady_2",[]],
[anyone|plyr,"lord_challenge_duel_for_lady_2", [], "You will recant these lies, sirrah, or prove them against my sword!", "lord_challenge_duel",[]],
[anyone|plyr,"lord_challenge_duel_for_lady_2", [], "If you say so...", "lord_pretalk",[]],
[anyone,"lord_challenge_duel",
[
(str_store_string, s15, "str_error__wrong_quest_type"),
(try_begin),
(check_quest_active,"qst_duel_for_lady"),
(neg|check_quest_concluded,"qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_talk_troop"),
(str_store_string, s15, "@You are challenging me to a duel? How droll!\
As you wish, {playername}, it will be good sport to bash your head in."),
(else_try),
(check_quest_active,"qst_duel_courtship_rival"),
(neg|check_quest_concluded,"qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_talk_troop"),
(str_store_string, s15, "str_call_me_coward_very_well_you_leave_me_no_choice"),
(try_end),
], "{s15}", "close_window",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
(call_script, "script_set_up_duel_with_troop", "$g_talk_troop"),
]],
[anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(check_quest_active,"qst_duel_courtship_rival"),
(neg|check_quest_concluded,"qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_giver_troop", "qst_duel_courtship_rival", slot_quest_giver_troop),
(str_store_troop_name, s5, ":quest_giver_troop")],
"Relinquish your suit of {s5}!", "lord_challenge_courtship_rival", []],
[anyone,"lord_challenge_courtship_rival",[], "Or what? Do you intend to duel over a lady? I'll let you know -- our liege frowns on this sort of hot-headed challenge, when every man must stand together against the foreign foe.", "lord_challenge_courtship_rival_2",[]],
[anyone|plyr,"lord_challenge_courtship_rival_2", [], "Do you fear to fight me?", "lord_challenge_duel",[]],
[anyone|plyr,"lord_challenge_courtship_rival_2", [], "My pardon. I have spoken rashly...", "lord_pretalk",[
(call_script, "script_end_quest", "qst_duel_courtship_rival"),
]],
[anyone|plyr,"lord_talk",[(check_quest_active,"qst_deliver_message"),
(quest_get_slot, ":quest_target_troop", "qst_deliver_message", slot_quest_target_troop),
(eq,"$g_talk_troop",":quest_target_troop"),
(quest_get_slot, ":quest_giver_troop", "qst_deliver_message", slot_quest_giver_troop),
(str_store_troop_name,s9,":quest_giver_troop")],
"I bring a message from {s9}.", "lord_message_delivered",
[]],
[anyone,"lord_message_delivered", [], "Oh? Let me see that...\
Well, well, well! It was good of you to bring me this, {playername}. Take my seal as proof that I've received it,\
and give my regards to {s9} when you see him again.", "lord_pretalk",[
(call_script, "script_end_quest", "qst_deliver_message"),
(quest_get_slot, ":quest_giver", "qst_deliver_message", slot_quest_giver_troop),
(str_store_troop_name,s9,":quest_giver"),
(call_script, "script_change_player_relation_with_troop", ":quest_giver", 1),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
]],
[anyone|plyr,"lord_talk",[(check_quest_active,"qst_deliver_message_to_enemy_lord"),
(quest_get_slot, ":quest_target_troop", "qst_deliver_message_to_enemy_lord", slot_quest_target_troop),
(eq,"$g_talk_troop",":quest_target_troop"),
(quest_get_slot, ":quest_giver_troop", "qst_deliver_message_to_enemy_lord", slot_quest_giver_troop),
(str_store_troop_name,s9,":quest_giver_troop")],
"I bring a message from {s9}.", "lord_message_delivered_enemy",
[]],
[anyone,"lord_message_delivered_enemy", [], "Oh? Let me see that...\
Hmmm. It was good of you to bring me this, {playername}. Take my seal as proof that I've received it,\
with my thanks.", "close_window",[
(call_script, "script_end_quest", "qst_deliver_message_to_enemy_lord"),
(quest_get_slot, ":quest_giver", "qst_deliver_message_to_enemy_lord", slot_quest_giver_troop),
(call_script, "script_change_player_relation_with_troop", ":quest_giver", 1),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
(assign, "$g_leave_encounter", 1),
]],
[anyone|plyr,"lord_talk", [(check_quest_active,"qst_deliver_message_to_prisoner_lord"),
(quest_slot_eq, "qst_deliver_message_to_prisoner_lord", slot_quest_target_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_giver_troop", "qst_deliver_message_to_prisoner_lord", slot_quest_giver_troop),
(str_store_troop_name, s11, ":quest_giver_troop")],
"I bring a message from {s11}.", "lord_deliver_message_prisoner",
[
#TODO: Add reward
(call_script, "script_end_quest", "qst_deliver_message_to_prisoner_lord"),
]],
[anyone,"lord_deliver_message_prisoner", [], "Can it be true?\
Oh, thank you kindly, {playername}! You have brought hope and some small ray of light to these bleak walls.\
Perhaps one day I will be able to repay you.", "lord_deliver_message_prisoner_2",[]],
[anyone|plyr,"lord_deliver_message_prisoner_2", [], " 'Twas the least I could do, {s65}.", "lord_deliver_message_prisoner_2a",[]],
[anyone,"lord_deliver_message_prisoner_2a", [], "You've no idea how grateful I am, {playername}. A thousand thanks and more.", "close_window",[]],
[anyone|plyr,"lord_deliver_message_prisoner_2", [], "Worry not, {s65}. You'll have ample opportunity once you are free again.", "lord_deliver_message_prisoner_2b",[]],
[anyone,"lord_deliver_message_prisoner_2b", [], "Hah, of course, {playername}. My eternal thanks go with you.", "close_window",[]],
[anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 1),
(troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(check_quest_active,"qst_rescue_lord_by_replace"),
(quest_slot_eq, "qst_rescue_lord_by_replace", slot_quest_target_troop, "$g_talk_troop"),
(neg|check_quest_succeeded, "qst_rescue_lord_by_replace")],
"Fear not, I am here to rescue you.", "lord_rescue_by_replace_offer",[]],
[anyone,"lord_rescue_by_replace_offer", [],
"By God, are you serious? What is your plan?", "lord_rescue_by_replace_offer_2",[]],
[anyone|plyr,"lord_rescue_by_replace_offer_2", [],
"A simple ruse, {s65}. If we exchange garments, I shall take your place here in prison,\
while you make your escape disguised as myself.\
I paid the guards a handsome bribe, with which I am sure they have already purchased half the wine stocks of the nearest tavern.\
With some luck they'll soon get so drunk they'd have trouble\
recognising their own mothers, let alone telling one of us from the other.\
At least not until you are safely away.", "lord_rescue_by_replace_offer_3",[]],
[anyone,"lord_rescue_by_replace_offer_3", [],
"Hmm, it might just work... But what of you, my {friend/lady}? The guards won't take kindly to this trickery.\
You may end up spending some time in this cell yourself.", "lord_rescue_by_replace_offer_4",[]],
[anyone|plyr,"lord_rescue_by_replace_offer_4", [],
"Not to worry, {s65}. The place is already starting to grow on me.", "lord_rescue_by_replace_offer_5a",[]],
[anyone|plyr,"lord_rescue_by_replace_offer_4", [],
"I shall be fine as long there is an ample reward waiting at the end.", "lord_rescue_by_replace_offer_5b",[]],
[anyone,"lord_rescue_by_replace_offer_5a",[],
"You are a brave soul indeed. I won't forget this.", "lord_rescue_by_replace_offer_6",[]],
[anyone,"lord_rescue_by_replace_offer_5b",[],
"Of course, my {friend/lady}, of course! Come to me when you have regained your freedom,\
and perhaps I shall be able to repay the debt I owe you.", "lord_rescue_by_replace_offer_6",[]],
[anyone|plyr,"lord_rescue_by_replace_offer_6",[],
"Quickly, {s65}, let us change garments. It is past time you were away from here.", "close_window",
[(call_script, "script_succeed_quest", "qst_rescue_lord_by_replace"),
(quest_get_slot, ":quest_target_troop", "qst_rescue_lord_by_replace", slot_quest_target_troop),
(quest_get_slot, ":quest_target_center", "qst_rescue_lord_by_replace", slot_quest_target_center),
(party_remove_prisoners, ":quest_target_center", ":quest_target_troop", 1),
#(troop_set_slot, ":quest_target_troop", slot_troop_is_prisoner, 0),
(troop_set_slot, ":quest_target_troop", slot_troop_prisoner_of_party, -1),
(assign, "$auto_menu", -1),
(assign, "$capturer_party", "$g_encountered_party"),
(jump_to_menu, "mnu_captivity_rescue_lord_taken_prisoner"),
(finish_mission),
]],
##
## [anyone|plyr,"lord_talk", [(check_quest_active, "qst_deliver_message_to_lover"),
## (troop_get_slot, ":cur_daughter", "$g_talk_troop", slot_troop_daughter),
## (quest_slot_eq, "qst_deliver_message_to_lover", slot_quest_target_troop, ":cur_daughter"),
## (quest_get_slot, ":troop_no", "qst_deliver_message_to_lover", slot_quest_giver_troop),
## (str_store_troop_name, 3, ":troop_no"),
## (str_store_troop_name, 4, ":cur_daughter")],
## "My lord, {s3} asked me to give this letter to your daughter, but I think you should read it first.", "lord_deliver_message_to_lover_tell_father",[]],
##
## [anyone,"lord_deliver_message_to_lover_tell_father", [],
## "That swine called {s3} is trying to approach my daughter eh? You have made the right decision by bringing this letter to me. I'll have a long talk with {s4} about it.", "lord_pretalk",
## [(add_xp_as_reward, 200),
## (call_script, "script_troop_add_gold", "trp_player", 1000),
## (quest_get_slot, ":quest_giver", "qst_deliver_message_to_lover", slot_quest_giver_troop),
## (quest_get_slot, ":target_troop", "qst_deliver_message_to_lover", slot_quest_target_troop),
## (call_script, "script_change_player_relation_with_troop", ":quest_giver", -20),
## (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
## (call_script, "script_change_player_relation_with_troop", ":target_troop", -10),
## (call_script, "script_end_quest", "qst_deliver_message_to_lover"),
## #Adding betrayal to the quest giver
## (troop_set_slot, ":quest_giver", slot_troop_last_quest, "qst_deliver_message_to_lover"),
## (troop_set_slot, ":quest_giver", slot_troop_last_quest_betrayed, 1)]],
##
##
##### TODO: QUESTS COMMENT OUT END
## [anyone|plyr,"lord_talk", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (ge,"$g_talk_troop_faction_relation",0),
## (party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle),
## (party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
## (eq, "$g_permitted_to_center",0),
## (party_get_num_companions, reg7, "p_main_party"),
## (val_sub, reg7, 1),
## ],
## "{reg7?Me and my men:I} need shelter for the night my lord. Can we rest in your castle for a while?", "lord_castle_let_in",[]],
##
## [anyone, "lord_castle_let_in", [(lt,"$g_talk_troop_relation",-10)],
## "What? Do I look like I am running an inn here? I have no place here for {reg7?you and your lot:you}. Now get off my lands...", "close_window",[(assign, "$g_permitted_to_center",1)]],
## [anyone, "lord_castle_let_in", [(lt,"$g_talk_troop_relation",2), (lt, "$g_talk_troop_faction_relation", 10),(assign, reg6, 100)],
## "I'll give you shelter if you pay a toll of {reg6} denars.", "lord_castle_let_in_toll",[]],
## [anyone|plyr,"lord_castle_let_in_toll", [(store_troop_gold, ":gold", "trp_player"),(gt,":gold",reg6)], "Of course sir. I'll pay the toll.", "lord_castle_let_in_toll_pay",
## [(troop_remove_gold, "trp_player",reg6)]],
## [anyone, "lord_castle_let_in_toll_pay", [(str_store_party_name, s1, "$g_encountered_party")],
## "Then you are welcome to {s1}.", "close_window",[(assign, "$g_permitted_to_center",1),(jump_to_menu, "mnu_town")]],
## [anyone|plyr,"lord_castle_let_in_toll", [], "I can't pay that sum sir.", "lord_castle_let_in_toll_nopay",[]],
## [anyone,"lord_castle_let_in_toll_nopay", [], "Then you are out of luck, I guess.", "lord_pretalk",[]],
##
## [anyone, "lord_castle_let_in", [(str_store_party_name, s1, "$g_encountered_party")],
## "Of course {playername}. You are welcome here. You may rest at {s1} as long as you wish.", "close_window",[(assign, "$g_permitted_to_center",1)]],
[anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(eq, "$players_oath_renounced_against_kingdom", "$g_talk_troop_faction"),
(str_store_faction_name, s4, "$g_talk_troop_faction"),],
"{s66}, I wish to restore my old oath to {s4}.", "lord_ask_pardon_after_oath_renounced",[]],
[anyone,"lord_ask_pardon_after_oath_renounced",
[
(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
(neq, ":faction_leader", "$g_talk_troop"),
(str_store_troop_name, s4, ":faction_leader"),
], "That is too great a matter for me to decide, {playername}. You should seek out {s4}. Such clemency is his alone to grant or deny.", "lord_pretalk",[]],
[anyone,"lord_ask_pardon_after_oath_renounced",
[
(assign, ":num_centers_captured_by_player"),
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":cur_center_faction", ":cur_center"),
(eq, ":cur_center_faction", "fac_player_supporters_faction"),
(party_slot_eq, ":cur_center", slot_center_faction_when_oath_renounced, "$g_talk_troop_faction"),
(val_add, ":num_centers_captured_by_player", 1),
(try_end),
(store_mul, ":peace_score", ":num_centers_captured_by_player", 500),
(store_current_hours, ":cur_hours"),
(val_sub, ":cur_hours", "$players_oath_renounced_begin_time"),
(val_add, ":peace_score", ":cur_hours"),
(try_begin),
(gt, ":peace_score", 800),
#Do not agree to give any centers but agree to make peace
(assign, ":given_center", -1),
(try_begin),
(gt, ":peace_score", 1500),
(try_begin),
#Agree to give one center
(eq, "$players_oath_renounced_given_center", 0),
(store_random_in_range, ":given_center", 0, ":num_centers_captured_by_player"),
(try_end),
(else_try),
(assign, "$players_oath_renounced_given_center", 0),
(try_end),
(assign, ":num_centers_written", 0),
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":cur_center_faction", ":cur_center"),
(eq, ":cur_center_faction", "fac_player_supporters_faction"),
(party_slot_eq, ":cur_center", slot_center_faction_when_oath_renounced, "$g_talk_troop_faction"),
(try_begin),
(eq, ":given_center", 0),
(assign, "$players_oath_renounced_given_center", ":cur_center"),
(else_try),
(neq, "$players_oath_renounced_given_center", ":cur_center"),
(try_begin),
(eq, ":num_centers_written", 0),
(str_store_party_name, s17, ":cur_center"),
(else_try),
(eq, ":num_centers_written", 1),
(str_store_party_name, s16, ":cur_center"),
(str_store_string, s17, "@{s16} and {s17}"),
(else_try),
(str_store_party_name, s16, ":cur_center"),
(str_store_string, s17, "@{!}{s16}, {s17}"),
(try_end),
(val_add, ":num_centers_written", 1),
(try_end),
(val_sub, ":given_center", 1),
(try_end),
(try_begin),
(eq, ":num_centers_written", 0),#white peace
(str_store_string, s11, "@Very well, I will accept you back into my ranks, if you're ready to swear your solemn oath once more."),
(assign, "$players_oath_renounced_terms_state", 1),
(else_try),
(str_store_string, s11, "@A pardon will only be possible if you are willing to cede {s17} to me. Do you agree my terms?"),
(assign, "$players_oath_renounced_terms_state", 2),
(try_end),
(else_try),
#Do not agree to make peace
(str_store_string, s11, "@No. There is no chance of peace between us, I am not interested."),
(assign, "$players_oath_renounced_terms_state", 0),
(try_end),
], "{s11}.", "lord_ask_pardon_terms",[]],
[anyone|plyr,"lord_ask_pardon_terms",
[(eq, "$players_oath_renounced_terms_state", 0),
],
"As you like, {s65}. I will accept your judgment.", "lord_pretalk",[]],
[anyone|plyr,"lord_ask_pardon_terms",
[(eq, "$players_oath_renounced_terms_state", 0),
],
"A shame, {s65}. A shame.", "lord_pretalk",[]],
[anyone|plyr,"lord_ask_pardon_terms",
[(eq, "$players_oath_renounced_terms_state", 0),
],
"Very well, go and die without me.", "lord_pretalk",[]],
[anyone|plyr,"lord_ask_pardon_terms",
[(eq, "$players_oath_renounced_terms_state", 1),
],
"Aye, I am ready.", "lord_ask_pardon_after_renounce_peace",[]],
[anyone|plyr,"lord_ask_pardon_terms",
[(eq, "$players_oath_renounced_terms_state", 1),
],
"On second thought, no. I don't wish to be in your service again.", "lord_ask_pardon_terms_rejected",[]],
[anyone|plyr,"lord_ask_pardon_terms",
[(eq, "$players_oath_renounced_terms_state", 2),
],
"Aye, I agree to those terms.", "lord_ask_pardon_after_renounce_peace",[]],
[anyone|plyr,"lord_ask_pardon_terms",
[(eq, "$players_oath_renounced_terms_state", 2),
],
"That is too high a price, {s65}. I must decline.", "lord_ask_pardon_terms_rejected",[]],
[anyone,"lord_ask_pardon_after_renounce_peace",
[], "Excellent. Though you strayed from us, {playername}, it gladdens all our hearts that you have found your way back to the right path. I hereby restore your homage to me. Rise once more as an honoured {man/warrior} in my service.", "lord_pretalk",
[
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":cur_center_faction", ":cur_center"),
(eq, ":cur_center_faction", "fac_player_supporters_faction"),
(party_slot_eq, ":cur_center", slot_center_faction_when_oath_renounced, "$g_talk_troop_faction"),
(neq, ":cur_center", "$players_oath_renounced_given_center"),
(call_script, "script_give_center_to_faction", ":cur_center", "$g_talk_troop_faction"),
(try_end),
(call_script, "script_player_join_faction", "$g_talk_troop_faction"),
(assign, "$player_has_homage", 1),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
]],
[anyone,"lord_ask_pardon_terms_rejected",
[], "Then get out of my sight, traitor! Begone with you, and do not come back!", "close_window",
[
(assign, "$g_leave_encounter", 1),
#TODO: Add relation drop. $players_oath_renounced_begin_time can also be reset to current time for worse conditions in the next conversation.
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
]],
[anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(lt, "$g_talk_troop_faction_relation", 0),
(store_relation, ":players_kingdom_relation", "$g_talk_troop_faction", "$players_kingdom"),
(this_or_next|ge, ":players_kingdom_relation", 0),
(this_or_next|eq, "$players_kingdom", 0),
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(neq, "$players_oath_renounced_against_kingdom", "$g_talk_troop_faction"),
(assign, ":continue", 1),
(try_begin),
(gt, "$supported_pretender", 0),
(eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(is_between, "$g_talk_troop_faction", kingdoms_begin, kingdoms_end),
(str_store_faction_name, s4, "$g_talk_troop_faction"),],
"I wish to make peace with the {s4}.", "lord_ask_pardon",[]],
[anyone,"lord_ask_pardon", [(lt, "$g_talk_troop_relation", -10)], "Do you indeed, {playername}? Then go and trip on your sword. Give us all peace.", "lord_pretalk",[]],
[anyone,"lord_ask_pardon",
[
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(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),
(eq, ":has_center", 1),
(lt, "$player_right_to_rule", 10),
], "{playername}, you are a {lord/lady} without a master, holding lands in your name, with only the barest scrap of a claim to legitimacy.\
No king in Calradia would accept a lasting peace with you.", "lord_pretalk",[]],
[anyone,"lord_ask_pardon",
[
(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),
(eq, ":has_center", 1),
(encountered_party_is_attacker),
], "Make peace when I have you at an advantage? I think not.", "lord_pretalk",[]],
#If the player faction is active
[anyone,"lord_ask_pardon",
[
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(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),
(eq, ":has_center", 1),
(call_script, "script_npc_decision_checklist_peace_or_war", "$g_encountered_party_faction", "fac_player_supporters_faction", "trp_player"),
(lt, reg0, 0),
], "I do not see it as being in my current interest to make peace.", "lord_pretalk",[]],
[anyone,"lord_ask_pardon",
[
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(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),
(eq, ":has_center", 1),
], "Yes... I am weary of fighting you. I could offer you a truce of forty days. If you keep your word and do not molest my lands and subjects, we may talk again...", "lord_truce_offer",[]],
[anyone|plyr,"lord_truce_offer",
[
(call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_encountered_party_faction", "$players_kingdom", 1),
], "I accept. Let us stop making war upon each other, for the time being anyway", "close_window",[]],
[anyone|plyr,"lord_truce_offer",
[], "On second thought, such an accord would not be in my interests.", "lord_pretalk",[]],
[anyone,"lord_ask_pardon", [
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(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),
(eq, ":has_center", 0),
(store_sub, ":hostility", 4, "$g_talk_troop_faction_relation"),
(val_mul, ":hostility", ":hostility"), #square it
(store_mul, reg16, ":hostility", 10),
(str_store_faction_name, s4, "$g_talk_troop_faction"),
], "Hmm. I could use my considerable influence to arrange a pardon for you, {playername},\
but there are some who see you as an enemy and will not be satisfied unless you pay tribute.\
All in all, you'd need to bring no less than {reg16} denars to make any friends in {s4}.", "lord_ask_pardon_2",[]],
[anyone,"lord_ask_pardon",
[
(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
(neq, "$g_talk_troop", ":faction_leader"),
(str_store_troop_name, s7, ":faction_leader"),
], "I am in no position to offer you anything. You must speak to {s7}.", "lord_pretalk",[]],
[anyone,"lord_ask_pardon",
[
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(neg|faction_slot_ge, "fac_player_supporters_faction", slot_faction_leader, 1),
(store_sub, ":hostility", 4, "$g_talk_troop_faction_relation"),
(val_mul, ":hostility", ":hostility"), #square it
(store_mul, reg16, ":hostility", 10),
(str_store_faction_name, s4, "$g_talk_troop_faction"),
], "Yes... I have bigger worries than you or your followers. However, you have wronged my subjects, and wrongs demand compensation. For the sume of {reg16} denars, I suppose that I could agree to grant you a pardon. What do you say?", "lord_ask_pardon_2",[
]],
[anyone,"lord_ask_pardon",
[
], "I am sorry. I am in no position to offer you a pardon", "lord_pretalk",[
]],
[anyone|plyr,"lord_ask_pardon_2", [(store_troop_gold, ":gold","trp_player"),(ge, ":gold", reg16)], "I have the money here. {reg16} denars.", "lord_ask_pardon_tribue_accept",[]],
[anyone|plyr,"lord_ask_pardon_2", [], "I fear I cannot pay that much.", "lord_ask_pardon_tribue_deny",[]],
[anyone,"lord_ask_pardon_tribue_accept", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
], "Excellent, {playername}.\
I will use this to make amends to those you have wronged, and I will let it be known that you are no longer an enemy of the {s4}.", "close_window",
[
(troop_remove_gold, "trp_player", reg16),
(store_relation, ":players_kingdom_relation", "$g_talk_troop_faction", "$players_kingdom"),
(try_begin),
(this_or_next|eq, "$players_kingdom", 0),
(ge, ":players_kingdom_relation", 0),
(call_script, "script_set_player_relation_with_faction", "$g_talk_troop_faction", 0),
(try_end),
(assign,"$g_leave_town_outside",1),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_ask_pardon_tribue_accept", [], "Excellent, {playername}.\
I'll use the coin to smooth the feathers of those that can oppose your pardon, and I'm sure that word will soon spread that you are no longer an enemy of {s4}.", "close_window",
[
(troop_remove_gold, "trp_player", reg16),
(store_relation, ":players_kingdom_relation", "$g_talk_troop_faction", "$players_kingdom"),
(try_begin),
(this_or_next|eq, "$players_kingdom", 0),
(ge, ":players_kingdom_relation", 0),
(call_script, "script_set_player_relation_with_faction", "$g_talk_troop_faction", 0),
(else_try),
(call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_talk_troop_faction", "$players_kingdom", 1),
(try_end),
(assign,"$g_leave_town_outside",1),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_ask_pardon_tribue_deny", [], "Then there's nothing I can do for you, {playername}. No silver, no pardon.", "lord_pretalk",[]],
[anyone|plyr,"lord_talk", [(store_partner_quest,":lords_quest"),
(ge,":lords_quest",0),
],
"About the task you gave me...", "lord_active_mission_1",[]],
# This is done automatically now.
## [anyone|plyr,"lord_talk", [(faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader, "$g_talk_troop"),
## (eq, "$players_kingdom", "$g_talk_troop_faction"),
## (eq, "$player_has_homage", 0),
## (gt, "$mercenary_service_accumulated_pay", 0),
## ],
## "{s67}, I humbly request the weekly payment for my service.", "lord_pay_mercenary",[]],
##
## [anyone,"lord_pay_mercenary", [(assign, reg8, "$mercenary_service_accumulated_pay")],
## "Hmm, let me see... According to my ledgers, we owe you {reg8} denars for your work. Here you are.", "lord_pay_mercenary_2",
## [(troop_add_gold, "trp_player", "$mercenary_service_accumulated_pay"),
## (assign, "$mercenary_service_accumulated_pay", 0)]],
##
## [anyone|plyr,"lord_pay_mercenary_2", [], "Thank you, sir.", "lord_pretalk", []],
[anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
],
"Let us discuss matters related to our household.", "lord_switch_to_spouse",[]],
[anyone,"lord_switch_to_spouse", [
(assign, ":feast_venue", -1),
(try_begin),
(is_between, "$current_town", walled_centers_begin, walled_centers_end),
(this_or_next|party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(party_slot_eq, "$current_town", slot_town_lord, "$g_talk_troop"),
(assign, ":feast_venue", "$current_town"),
(else_try),
(try_for_range, ":center", walled_centers_begin, walled_centers_end),
(eq, ":feast_venue", -1),
(this_or_next|party_slot_eq, ":center", slot_town_lord, "trp_player"),
(party_slot_eq, ":center", slot_town_lord, "$g_talk_troop"),
(assign, ":feast_venue", ":center"),
(try_end),
(is_between, ":feast_venue", walled_centers_begin, walled_centers_end), #unless there's a try/fail, will not do last check
(else_try),
(is_between, "$current_town", walled_centers_begin, walled_centers_end),
(assign, ":feast_venue", "$current_town"),
(try_end),
(neg|is_between, ":feast_venue", walled_centers_begin, walled_centers_end),
],
"Let us wait until we are in a hall, my wife, as it is difficult to deal with household inventories and such matters in the field.", "lord_pretalk",[]],
[anyone,"lord_switch_to_spouse", [],
"Certainly, my wife", "spouse_talk",[]],
[anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(ge, "$g_talk_troop_faction_relation", 0),
(store_partner_quest,":lords_quest"),
(lt,":lords_quest",0),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
# (eq,"$g_talk_troop_faction","$players_kingdom")
],
"Do you have any tasks for me?", "lord_request_mission_ask",[]],
[anyone|plyr,"lord_talk",
[
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(eq, "$player_has_homage", 1),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
],
"Do you think we can work together to advance our standings in this realm?", "combined_political_quests",[
(call_script, "script_get_political_quest", "$g_talk_troop"),
(assign, "$political_quest_found", reg0),
(assign, "$political_quest_target_troop", reg1),
(assign, "$political_quest_object_troop", reg2),
]],
[anyone,"combined_political_quests", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(lt, "$g_talk_troop_effective_relation", -5),
],
"I do not imagine that you and I have many mutual interests.", "lord_pretalk",[
]],
[anyone,"combined_political_quests", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(gt, "$political_quest_found", 0),
(assign, ":continue", 1),
(try_begin),
(call_script, "script_cf_troop_can_intrigue", "$g_talk_troop", 1),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
],
"Hmm.. Perhaps we can discuss this matter in a more private setting, at a later date.", "lord_pretalk",[
]],
[anyone,"combined_political_quests", [
(this_or_next|eq, "$political_quest_found", "qst_intrigue_against_lord"),
(eq, "$political_quest_found", "qst_denounce_lord"),
(troop_slot_ge, "trp_player", slot_troop_controversy, 30),
],
"Hmm.. I do have an idea, but it would require you that you be free of controversy. If you were to wait some time without getting into any arguments with the other lords of our realm, perhaps we could proceed further.", "lord_pretalk",[
]],
[anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
(faction_slot_eq, "$players_kingdom", slot_faction_leader, "$g_talk_troop"),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
],
"I wish to resign the marshalship", "lord_ask_resign_marshalship",[]],
[anyone,"lord_ask_resign_marshalship", [],
"So be it. I shall have to find someone else.", "lord_pretalk",[
(assign, ":faction_no", "$players_kingdom"),
(faction_set_slot, ":faction_no", slot_faction_political_issue, 1), #Appointment of marshal
(store_current_hours, ":hours"),
(val_max, ":hours", 0),
(faction_set_slot, ":faction_no", slot_faction_political_issue_time, ":hours"), #Appointment of marshal
(faction_get_slot, ":old_marshall", ":faction_no", slot_faction_marshall),
(try_begin),
(ge, ":old_marshall", 0),
(troop_get_slot, ":old_marshall_party", ":old_marshall", slot_troop_leaded_party),
(party_is_active, ":old_marshall_party"),
(party_set_marshall, ":old_marshall_party", 0),
(try_end),
(faction_set_slot, ":faction_no", slot_faction_marshall, -1),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":active_npc_faction", ":active_npc"),
(eq, ":active_npc_faction", ":faction_no"),
(troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
(try_end),
(try_begin),
(eq, "$players_kingdom", ":faction_no"),
(troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
(try_end),
(call_script, "script_add_notification_menu", "mnu_notification_relieved_as_marshal", 0, 0),
]],
[anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
(ge, "$g_talk_troop_faction_relation", 0),
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(neq, "$players_kingdom", "$g_talk_troop_faction"),
(store_partner_quest, ":lords_quest"),
(neq, ":lords_quest", "qst_join_faction"),
],
"{s66}, I have come to offer you my sword in vassalage!", "lord_ask_enter_service",[]],
[anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(eq, "$player_has_homage", 0),
(store_partner_quest, ":lords_quest"),
(neq, ":lords_quest", "qst_join_faction"),
],
"{s66}, I wish to become your sworn {man/woman} and fight for your honour.", "lord_ask_enter_service",[]],
[anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
(ge, "$g_talk_troop_faction_relation", 0),
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(eq, "$player_has_homage", 1),
],
"{s66}, I wish to be released from my oath to you.", "lord_ask_leave_service",[]],
## [anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
## (ge, "$g_talk_troop_faction_relation", 0),
## (troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
## (eq, "$players_kingdom", 0),
## (eq,1,0)],
## "TODO2:I want to fight alongside you against your enemies.", "close_window",[]],
[anyone|plyr,"lord_talk", [(eq, 1, 0),(le,"$talk_context", tc_party_encounter),(ge, "$g_talk_troop_faction_relation", 0)],
"I have an offer for you.", "lord_talk_preoffer",[]],
[anyone|plyr,"lord_talk", [(eq, "$g_talk_troop_faction", "fac_player_supporters_faction"),
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"I want to give some troops to you.", "lord_give_troops",[]],
[anyone,"lord_give_troops", [],
"Well, I could use some good soldiers. Thank you.", "lord_pretalk",
[
(change_screen_give_members, "$g_talk_troop_party"),
]],
[anyone|plyr,"lord_talk",
[
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"I have a new task for you.", "lord_give_order_ask",[]],
[anyone|plyr,"lord_talk",
[
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"May I suggest a course of action?", "lord_give_suggestion_ask",[]],
[anyone,"lord_give_order_ask", [],
"Yes?", "lord_give_order",[]],
[anyone,"lord_give_suggestion_ask", [
(faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
],
"I will gladly follow your direction, {sire/your Highness}. If you intend to direct an extensive campaign, however, you may also wish to declare yourself marshal, so there is no cause for confusion.", "lord_give_order",[]],
[anyone,"lord_give_suggestion_ask", [
(lt, "$g_talk_troop_effective_relation", 5), #was five
],
"My apologies. I don't know you well enough to take your advice.", "lord_pretalk",[]],
[anyone,"lord_give_suggestion_ask", [
],
"What is it?", "lord_give_order",[
]],
[anyone|plyr,"lord_give_order", [
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
],
"Follow me.", "lord_give_order_answer",
[
(assign, "$temp", spai_accompanying_army),
(assign, "$temp_2", "p_main_party"),
(store_current_hours, ":hours"),
(party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, "trp_kingdom_heroes_including_player_begin"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_type, "$temp"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_object, "$temp_2"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_time, ":hours"),
]],
[anyone|plyr,"lord_give_order", [
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
],
"Will you follow me? I have a plan...", "lord_give_order_answer",
[
(assign, "$temp", spai_accompanying_army),
(assign, "$temp_2", "p_main_party"),
(store_current_hours, ":hours"),
(party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, "trp_kingdom_heroes_including_player_begin"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_type, "$temp"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_object, "$temp_2"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_time, ":hours"),
]],
[anyone|plyr,"lord_give_order", [
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
],
"Go to...", "lord_give_order_details_ask",
[
(assign, "$temp", spai_holding_center),
]],
[anyone|plyr,"lord_give_order", [
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
],
"Raid around the village of...", "lord_give_order_details_ask",
[
(assign, "$temp", spai_raiding_around_center),
]],
[anyone|plyr,"lord_give_order", [
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
],
"Patrol around...", "lord_give_order_details_ask",
[
(assign, "$temp", spai_patrolling_around_center),
]],
#only as suggestion
[anyone|plyr,"lord_give_order", [
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_besieging_center),
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(party_slot_eq, ":ai_object", slot_center_is_besieged_by, "$g_talk_troop_party"),
(party_slot_eq, ":ai_object", slot_village_state, svs_under_siege),
(str_store_party_name, s11, ":ai_object"),
],
"Together, you and I can take {s11}. You should assault immediately...", "lord_give_order_assault",
[
#for this one and another one, if the $g_talk_troop is a _t
# (assign, "$temp", spai_patrolling_around_center),
]],
#only as suggestion
[anyone|plyr,"lord_give_order", [
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"), #not an order, only a suggestion
],
"We are under attack, but the enemy can be repulsed. You should ride towards...", "lord_give_order_details_ask",
[
(assign, "$temp", spai_patrolling_around_center),
]],
#only as suggestion
[anyone|plyr,"lord_give_order", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, "$g_talk_troop"),
],
"We are under attack, but the enemy can be repulsed. You should assemble the army and march to...", "lord_give_order_details_ask",
[
(assign, "$temp", spai_patrolling_around_center),
]],
[anyone,"lord_give_order_assault", [
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(party_get_slot, ":besieging_party", ":ai_object", slot_center_is_besieged_by),
(neq, ":besieging_party", "$g_talk_troop_party"),
(party_stack_get_troop_id, ":siege_commander", ":besieging_party", 0),
(str_store_troop_name, s4, ":siege_commander"),
(troop_get_type, reg4, ":siege_commander"),
],
"{s4} is directing this siege. I suggest you speak to {reg4?her:him}", "lord_pretalk",
[]],
[anyone,"lord_give_order_assault", [
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(party_get_slot, ":siege_begun", ":ai_object", slot_center_siege_begin_hours),
(store_current_hours, ":cur_hour"),
(store_sub, ":hours_of_siege", ":cur_hour", ":siege_begun"),
(try_begin),
(assign, ":hours_required", 9),
(try_end),
(val_sub, ":hours_required", ":hours_of_siege"),
(gt, ":hours_required", 0),
(try_begin),
(gt, ":hours_required", 1),
(assign, reg3, ":hours_required"),
(str_store_string, s11, "str_reg3_hours"),
(else_try),
(str_store_string, s11, "str_hour"),
(try_end),
],
"Our preparations are not yet ready. We need another {s11}", "lord_pretalk",
[
]],
[anyone,"lord_give_order_assault", [
],
"Very well -- to the walls!", "close_window",
[
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(call_script, "script_begin_assault_on_center", ":ai_object"),
(party_set_slot, "$g_talk_troop_party", slot_party_under_player_suggestion, spai_besieging_center),
(assign, "$g_leave_encounter", 1),
]],
#only as suggestion
[anyone|plyr,"lord_give_order", [
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"), #not an order, only a suggestion
],
"There is a fortress which can easily be taken. Go to..", "lord_give_order_details_ask",
[
(assign, "$temp", spai_besieging_center),
]],
[anyone|plyr,"lord_give_order", [
# (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
],
"The enemy is coming in force. Flee in the direction of...", "lord_give_order_details_ask",
[
(assign, "$temp", spai_retreating_to_center),
]],
[anyone|plyr,"lord_give_order",
[
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
# (neg|troop_slot_eq, "$g_talk_troop", slot_troop_player_order_state, spai_undefined),
],
"I won't need you for some time. You are free to do as you like.", "lord_give_order_stop",
[]],
[anyone|plyr,"lord_give_order",
[
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_accompanying_army),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_object, "p_main_party"),
],
"You no longer need to accompany me.", "lord_give_order_stop",
[]],
[anyone|plyr,"lord_give_order", [],
"Never mind.", "lord_pretalk",
[]],
[anyone,"lord_give_order_details_ask", [
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(eq, "$temp", spai_retreating_to_center),
],
"It is not my way to turn tail and run, without even laying eyes on the enemy.", "lord_pretalk",[]],
[anyone,"lord_give_order_details_ask", [
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(eq, "$temp", spai_besieging_center),
],
"You want me to shed my blood outside a fortress while others stand by and watch? I think not.", "lord_pretalk",[]],
[anyone,"lord_give_order_details_ask", [],
"Where?", "lord_give_order_details",[]],
[anyone|plyr|repeat_for_parties, "lord_give_order_details",
[
(store_repeat_object, ":party_no"),
(store_faction_of_party, ":party_faction", ":party_no"),
(store_relation, ":relation", ":party_faction", "$players_kingdom"),
(assign, ":continue", 0),
(try_begin),
(this_or_next|eq, "$temp", spai_retreating_to_center),
(eq, "$temp", spai_holding_center),
(try_begin),
(this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_castle),
(party_slot_eq, ":party_no", slot_party_type, spt_town),
(eq, ":party_faction", "$players_kingdom"),
(assign, ":continue", 1),
(try_end),
(else_try),
(eq, "$temp", spai_raiding_around_center),
(try_begin),
(party_slot_eq, ":party_no", slot_party_type, spt_village),
(lt, ":relation", 0),
(assign, ":continue", 1),
(try_end),
(else_try),
(eq, "$temp", spai_besieging_center),
(try_begin),
(this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_castle),
(party_slot_eq, ":party_no", slot_party_type, spt_town),
(party_slot_eq, ":party_no", slot_center_is_besieged_by, -1),
(lt, ":relation", 0),
(assign, ":continue", 1),
(try_end),
(else_try),
(eq, "$temp", spai_patrolling_around_center),
(try_begin),
(eq, ":party_faction", "$players_kingdom"),
(is_between, ":party_no", centers_begin, centers_end),
(assign, ":continue", 1),
(else_try),
(is_between, ":party_no", centers_begin, centers_end),
(store_distance_to_party_from_party, ":distance", ":party_no", "p_main_party"),
(le, ":distance", 25),
(assign, ":continue", 1),
(try_end),
(try_end),
(eq, ":continue", 1),
(neq, ":party_no", "$g_encountered_party"),
(str_store_party_name, s1, ":party_no")],
"{s1}", "lord_give_order_answer",
[
(store_repeat_object, "$temp_2"),
(store_current_hours, ":hours"),
(party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, "trp_kingdom_heroes_including_player_begin"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_type, "$temp"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_object, "$temp_2"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_time, ":hours"),
]],
[anyone|plyr, "lord_give_order_details",
[], "Never mind.", "lord_pretalk",[]],
#Simple stop order
[anyone,"lord_give_order_stop", [],
"All right. I will stop here.", "lord_pretalk",
[
(party_set_slot, "$g_talk_troop_party", slot_party_orders_type, spai_undefined),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_object, -1),
#this is not set above, so should be set here
(store_current_hours, ":hours"),
(val_sub, ":hours", 36),
(val_max, ":hours", 0),
(party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, "trp_kingdom_heroes_including_player_begin"),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_type, spai_undefined),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_object, -1),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_time, ":hours"),
#same variable as above
(troop_get_slot, ":party_no", "$g_talk_troop", slot_troop_leaded_party),
(try_begin),
(gt, ":party_no", 0),
(call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
(party_set_slot, ":party_no", slot_party_commander_party, -1),
(try_end),
]],
[anyone,"lord_give_order_answer",
[
(eq, "$temp", spai_accompanying_army),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
(call_script, "script_troop_get_player_relation", "$g_talk_troop"),
(assign, ":player_relation", reg0),
(troop_get_slot, ":troop_renown", "$g_talk_troop", slot_troop_renown),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
#(val_mul, ":troop_renown", 3),
#(val_div, ":troop_renown", 4),
#(this_or_next|lt, ":player_renown", ":troop_renown"),
#(lt, ":player_relation", 0),
(store_skill_level, ":player_persuasion_level", "skl_persuasion", "trp_player"),
(store_div, ":player_relation_div_5", ":player_relation", 5),
(val_min, ":player_relation_div_5", 10),
(store_add, ":player_persuasion_power", ":player_relation_div_5", ":player_persuasion_level"),
(store_sub, ":needed_lowest_renown", 20, ":player_persuasion_power"),
(val_mul, ":needed_lowest_renown", ":troop_renown"),
(val_div, ":needed_lowest_renown", 10),
(this_or_next|lt, ":player_renown", ":needed_lowest_renown"),
(lt, ":player_relation", 0),
],
"That would hardly be proper. It would be more appropriate for you to follow me instead. Did you have any other ideas?", "lord_give_order",
[
(party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, 0),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_type, 0),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_object, 0),
(party_set_slot, "$g_talk_troop_party", slot_party_orders_time, 0),
]],
#More complicated order
[anyone,"lord_give_order_answer",
[
(call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
(eq, reg0, "$temp"),
(eq, reg1, "$temp_2"),
(str_clear, s12),
(try_begin),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, "trp_player"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
(str_store_string, s12, "str_but_if_this_goes_badly"),
(try_end),
],
"All right. I will do that.{s12}", "lord_pretalk",
[
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", "$temp", "$temp_2"),
(str_clear, s12),
(try_begin),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, "trp_player"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
(str_store_string, s12, "str_but_if_this_goes_badly"),
(try_end),
#Set courage and aggressiveness in party_set_ai_astate
(assign, "$g_leave_encounter", 1),
]],
#Recalculated orders do not match
[anyone,"lord_give_order_answer", [],
"I am sorry. I need to attend my own business at the moment.", "lord_pretalk",
[
(call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),
]],
#generic lord comments - must be far down
[anyone,"lord_start", [],
"What is it?", "lord_talk",[]],
[anyone|plyr,"lord_talk",
[
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(this_or_next|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
(faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
],
"I want to start a new campaign. Let us assemble the army here.", "lord_give_order_call_to_arms_verify",
[]],
[anyone,"lord_give_order_call_to_arms_verify", [],
"You wish to summon all lords for a new campaign?", "lord_give_order_call_to_arms_verify_2",[]],
[anyone|plyr,"lord_give_order_call_to_arms_verify_2", [], "Yes. We must gather all our forces before we march on the enemy.", "lord_give_order_call_to_arms",[]],
[anyone|plyr,"lord_give_order_call_to_arms_verify_2", [], "On second thought, it won't be necessary to summon everyone.", "lord_pretalk",[]],
[anyone,"lord_give_order_call_to_arms",
[],
"All right then. I will send messengers and tell everyone to come here.", "lord_pretalk",
[
(assign, "$player_marshal_ai_state", sfai_gathering_army),
(assign, "$player_marshal_ai_object", "p_main_party"),
(call_script, "script_decide_faction_ai", "$players_kingdom"),
(assign, "$g_recalculate_ais", 1),
]],
[anyone|plyr,"lord_talk",
[
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
],
"I want to end the campaign and let everyone return home.", "lord_give_order_disband_army_verify", []],
[anyone,"lord_give_order_disband_army_verify", [],
"You want to end the current campaign and release all lords from duty?", "lord_give_order_disband_army_2",[]],
[anyone|plyr,"lord_give_order_disband_army_2", [], "Yes. We no longer need all our forces here.", "lord_give_order_disband_army",[]],
[anyone|plyr,"lord_give_order_disband_army_2", [], "On second thought, it will be better to stay together for now.", "lord_pretalk",[]],
[anyone,"lord_give_order_disband_army",
[],
"All right. I will let everyone know that they are released from duty.", "lord_pretalk",
[
(assign, "$player_marshal_ai_state", sfai_default),
(assign, "$player_marshal_ai_object", -1),
(call_script, "script_decide_faction_ai", "$players_kingdom"),
(assign, "$g_recalculate_ais", 1),
]],
[anyone|plyr,"lord_talk", [
(ge,"$g_encountered_party_relation",0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"I wish to ask you something.", "lord_talk_ask_something",[]],
[anyone,"lord_talk_ask_something", [],
"Aye? What is it?", "lord_talk_ask_something_2",[]],
[anyone,"lord_talk_ask_something_again", [],
"Is there anything else?", "lord_talk_ask_something_2",[]],
[anyone|plyr,"lord_talk_ask_something_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"I want to know the location of someone.", "lord_talk_ask_location",[]],
[anyone|plyr,"lord_talk_ask_something_2", [
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_leaded_party, -1)
],
"What are you and your men doing?", "lord_tell_objective",[
(party_get_slot, ":ai_behavior", "$g_talk_troop_party", slot_party_ai_state),
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(try_begin),
(eq, "$cheat_mode", 1),
(party_get_ai_initiative, reg4, "$g_talk_troop_party"),
(party_get_helpfulness, reg5, "$g_talk_troop_party"),
(display_message, "@{!}DEBUG : Initiative {reg4}, helpfulness {reg5}"),
(try_end),
(str_clear, s14),
(str_clear, s15),
(str_clear, s16),
(try_begin),
(call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
(eq, reg0, ":ai_behavior"),
(eq, reg1, ":ai_object"),
(else_try),
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),
(str_store_string, s14, "str_however_circumstances_have_changed_since_we_made_that_decision_and_i_may_reconsider_shortly_s16"),
(try_begin),
(ge, "$cheat_mode", 1),
(display_message, "@{!}DEBUG -- ai behavior: {reg0}, ai object: {reg1}"),
(try_end),
(try_end),
]],
[anyone|plyr,"lord_talk_ask_something_2", [
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"What is the realm doing?", "lord_talk_ask_about_strategy",[]],
[anyone,"lord_talk_ask_about_strategy", [
(eq, "$players_kingdom", "$g_talk_troop_faction"),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, "trp_player"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
],
"You should decide that, as you are the marshal.", "lord_pretalk",[]],
[anyone|plyr,"lord_talk_ask_something_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"How goes the war?", "lord_talk_ask_about_war",[]],
#Marriage proposal
[anyone|plyr,"lord_talk_ask_something_2",[
(check_quest_active, "qst_formal_marriage_proposal"),
(neg|check_quest_failed, "qst_formal_marriage_proposal"),
(neg|check_quest_succeeded, "qst_formal_marriage_proposal"),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
(quest_slot_eq, "qst_formal_marriage_proposal", slot_quest_target_troop, "$g_talk_troop"),
(quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
(str_store_troop_name, s10, ":bride"),
(call_script, "script_troop_get_family_relation_to_troop", ":bride", "$g_talk_troop"),
(call_script, "script_troop_get_relation_with_troop", "trp_player", ":bride"),
(try_begin),
(gt, reg0, 20),
(str_store_string, s19, "str_i_wish_to_marry_your_s11_s10_i_ask_for_your_blessing"),
(else_try),
(str_store_string, s19, "str_i_wish_to_marry_your_s11_s10_i_ask_for_your_help"),
(try_end),
],
"{s19}", "lord_marriage_permission",
[
]],
#no permission
[anyone,"lord_marriage_permission", [
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
],
"Great heaven, man -- if I haven't given you permission to see her, do you think I'm going to give you permission to marry her?", "lord_pretalk",[
(call_script, "script_fail_quest", "qst_formal_marriage_proposal"),
(call_script, "script_end_quest", "qst_formal_marriage_proposal"),
]],
#unwilling bride -- failed due to lord personality
[anyone,"lord_marriage_permission", [
(troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
(quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
(call_script, "script_troop_get_relation_with_troop", "trp_player", ":bride"),
(lt, reg0, 20),
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(call_script, "script_troop_get_family_relation_to_troop", ":bride", "$g_talk_troop"),
],
"It is not my way to push my {s11} to marry against her will or her better judgment", "lord_pretalk",[
(call_script, "script_fail_quest", "qst_formal_marriage_proposal"),
(call_script, "script_end_quest", "qst_formal_marriage_proposal"),
]],
#unwilling bride -- failed due to competitor
[anyone,"lord_marriage_permission", [
(troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
(quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
(call_script, "script_troop_get_relation_with_troop", "trp_player", ":bride"),
(lt, reg0, 20),
(assign, ":highest_competitor_score", "$g_talk_troop_relation"),
(try_for_range, ":competitor", lords_begin, lords_end),
(this_or_next|troop_slot_eq, ":competitor", slot_troop_love_interest_1, ":bride"),
(this_or_next|troop_slot_eq, ":competitor", slot_troop_love_interest_2, ":bride"),
(troop_slot_eq, ":competitor", slot_troop_love_interest_3, ":bride"),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":competitor"),
(gt, reg0, ":highest_competitor_score"),
(assign, ":highest_competitor_score", reg0),
(str_store_troop_name, s12, ":competitor"),
(try_end),
(gt, ":highest_competitor_score", "$g_talk_troop_relation"),
(call_script, "script_troop_get_family_relation_to_troop", ":bride", "$g_talk_troop"),
],
"Sorry, lad -- I'm not going to make my {s11} marry you, when I'd rather see her married to {s12}", "lord_pretalk",[
(call_script, "script_fail_quest", "qst_formal_marriage_proposal"),
(call_script, "script_end_quest", "qst_formal_marriage_proposal"),
]],
#Permission granted
[anyone,"lord_marriage_permission", [
(quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
(str_store_troop_name, s11, ":bride"),
],
"Splendid news, my young man -- I shall be proud to have you in our family. Now, let us talk the terms of the marriage. As per our custom, the two of us must make sure that {s11} has sufficient finances to support herself, in the event of any unforeseen circumstances..", "lord_marriage_permission_endowment",[
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(troop_get_slot, ":guardian_renown", "$g_talk_troop", slot_troop_renown),
(store_mul, "$marriage_dowry", ":player_renown", 20),
(val_min, "$marriage_dowry", 20000),
(store_mul, "$marriage_dower", ":guardian_renown", 20),
(val_min, "$marriage_dower", 20000),
]],
[anyone,"lord_marriage_permission_endowment", [
(assign, reg3, "$marriage_dower"),
(assign, reg4, "$marriage_dowry"),
],
"I would say that, taking into consideration the prestige of our two houses, that you can provide a dower of {reg3} denars, while I will supply a dowry of {reg4} denars. This shall be her ladyship's property, as a security, lest for any reason you are unable to provide for her. What say you to that?", "lord_marriage_permission_endowment_answer",[
]],
[anyone|plyr,"lord_marriage_permission_endowment_answer", [
(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", "$marriage_dower"),
],
"Very well -- so let it be.", "lord_marriage_permission_engagement_date",[
]],
[anyone|plyr,"lord_marriage_permission_endowment_answer", [],
"I cannot afford that right now.", "lord_marriage_permission_endowment_answer_delay",[
]],
[anyone|plyr,"lord_marriage_permission_endowment_answer", [
(eq, 1, 0),
],
"That is too much to pay.", "lord_marriage_permission_endowment_answer_no",[
]],
[anyone,"lord_marriage_permission_endowment_answer_no", [],
"Well. I cannot in all decency allow my daughter to marry without some security, can I? Let me know if you change your mind.", "close_window",[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_marriage_permission_engagement_date", [
(quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
(call_script, "script_get_kingdom_lady_social_determinants", ":bride"),
(assign, ":venue", reg1),
(is_between, ":venue", walled_centers_begin, walled_centers_end),
(party_slot_eq, ":venue", slot_village_state, svs_normal),
(str_store_party_name, s24, ":venue"),
],
"Splendid! You two may now consider yourselves offically betrothed. Very well -- I shall plan to hold a great feast in {s24}, as soon as circumstances permit. We will be sure to notify you when the day comes.", "close_window",
[
(quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
(troop_set_slot, "trp_player", slot_troop_betrothed, ":bride"),
(troop_set_slot, ":bride", slot_troop_betrothed, "trp_player"),
(call_script, "script_end_quest", "qst_formal_marriage_proposal"),
(troop_remove_gold, "trp_player", "$marriage_dower"),
(call_script, "script_get_kingdom_lady_social_determinants", ":bride"),
(assign, ":venue", reg1),
(str_store_troop_name, s3, ":bride"),
(str_store_troop_name, s4, "$g_talk_troop"),
(str_store_party_name, s5, ":venue"),
(setup_quest_text, "qst_wed_betrothed"),
(str_store_string, s2, "str_you_plan_to_marry_s3_at_a_feast_hosted_by_s4_in_s5_you_should_be_notifed_of_the_feast_as_soon_as_it_is_held"),
(call_script, "script_start_quest", "qst_wed_betrothed", "$g_talk_troop"),
(quest_set_slot, "qst_wed_betrothed", slot_quest_expiration_days, 365),
(quest_set_slot, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),
(quest_set_slot, "qst_wed_betrothed", slot_quest_target_troop, ":bride"),
(try_begin),
(eq,"$talk_context",tc_party_encounter),
(assign, "$g_leave_encounter", 1),
(try_end),
]],
[anyone,"lord_marriage_permission_engagement_date", [],
"Unfortunately, there is one final complication -- there is no safe place to hold the wedding. Let us hold off on finalizing this, for the time being.", "close_window",
[]],
[anyone,"lord_marriage_permission_endowment_answer_delay", [],
"No matter -- take the time you need to raise the money. I want her ladyship to be well looked after.", "lord_pretalk",[
]],
[anyone,"lord_marriage_permission_endowment_answer_delay", [],
"That is a shame, but I would be remiss in my duty if I allowed her ladyship to face an uncertain future.", "lord_pretalk",[
(call_script, "script_fail_quest", "qst_formal_marriage_proposal"),
(call_script, "script_end_quest", "qst_formal_marriage_proposal"),
]],
#courtship
[anyone|plyr,"lord_talk_ask_something_2",[
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
(assign, "$marriage_candidate", 0),
(try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
(eq, "$marriage_candidate", 0),
(troop_slot_ge, ":lady", slot_troop_courtship_state, 2),
(neg|troop_slot_eq, ":lady", slot_troop_courtship_state, 4),
(neg|troop_slot_ge, ":lady", slot_troop_spouse, 0),
(call_script, "script_get_kingdom_lady_social_determinants", ":lady"),
(eq, reg0, "$g_talk_troop"),
(assign, "$marriage_candidate", ":lady"),
(str_clear, s14),
(call_script, "script_troop_get_family_relation_to_troop", ":lady", "$g_talk_troop"),
(gt, reg0, 0),
(str_store_string, s14, "str_your_s11_"),
(try_end),
(gt, "$marriage_candidate", 0),
(str_store_troop_name, s12, "$marriage_candidate"),
(str_clear, s10),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
(str_store_string, s10, "str_i_ask_again_may"),
(else_try),
(str_store_string, s10, "str_may"),
(try_end),
],
"{s10} I have the honor of visiting with {s14}{s12}?", "lord_courtship_permission",
[]],
[anyone,"lord_courtship_permission", [
(troop_slot_ge, "$marriage_candidate", slot_troop_met, 2),
(neg|troop_slot_eq, "$marriage_candidate", slot_troop_met, 4),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(call_script, "script_troop_get_relation_with_troop", "$marriage_candidate", "trp_player"),
(gt, reg0, 0),
],
"From what I hear, you have already spoken to her -- without my permission. Let me tell you this: I am her lord and guardian, and I have plans for her. I will not be mocked behind my back as a man who cannot control the women of his household. I would ask you not to discuss this matter with me again.", "lord_pretalk",
[
(troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -1),
]],
[anyone,"lord_courtship_permission", [
(call_script, "script_npc_decision_checklist_male_guardian_assess_suitor", "$g_talk_troop", "trp_player"),
(lt, reg0, 1),
(str_store_string, s14, reg1),
],
"{s14}", "lord_pretalk",
[
(troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
]],
[anyone,"lord_courtship_permission", [
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
(str_store_string, s12, "str_very_well_as_far_as_im_concerned_i_suppose_she_can_see_most_anyone_she_likes__within_reason_of_course"),
(else_try),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(str_store_string, s12, "str_very_well_an_alliance_with_you_could_be_valuable_go_chat_with_her_and_see_if_you_can_get_her_to_take_a_fancy_to_you_if_she_doesnt_and_if_we_still_want_to_conclude_this_business_then_i_can_make_her_see_reason"),
(else_try),
(str_store_string, s12, "str_you_have_my_blessing_to_pay_suit_to_her__so_long_as_your_intentions_are_honorable_of_course_depending_on_how_things_proceed_between_you_two_we_may_have_more_to_discuss_at_a_later_date"),
(try_end),
],
"{s12}", "lord_pretalk",
[
(troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
]],
#Ask for marriage, following courtship, both with or against lady's wishes
[anyone|plyr,"lord_talk_ask_something_2", [
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
(troop_get_type, ":is_female", "$g_talk_troop"),
(neq, ":is_female", 1),
],
"What would it take to cement a lasting alliance with your house?", "lord_talk_ask_marriage_1",[]],
[anyone|plyr,"lord_talk_ask_something_2", [],
"Never mind.", "lord_pretalk",[]],
[anyone,"lord_talk_ask_location", [],
"Very well, I may or may not have an answer for you. About whom do you wish to hear?", "lord_talk_ask_location_2",[]],
[anyone|plyr|repeat_for_troops,"lord_talk_ask_location_2", [(store_repeat_object, ":troop_no"),
(neq, "$g_talk_troop", ":troop_no"),
(is_between, ":troop_no", active_npcs_begin, kingdom_ladies_end),
(neq, ":troop_no", "trp_player"),
(this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_lady),
(store_troop_faction, ":faction_no", ":troop_no"),
(eq, "$g_encountered_party_faction", ":faction_no"),
(str_store_troop_name, s1, ":troop_no"),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, ":troop_no"),
(str_store_string, s1, "@Our marshal, {s1}"),
(try_end),
],
"{s1}", "lord_talk_ask_location_3",[(store_repeat_object, "$hero_requested_to_learn_location")]],
[anyone|plyr,"lord_talk_ask_location_2", [
(is_between, "$g_talk_troop", kingdom_ladies_begin, kingdom_ladies_end),
], "Never mind.", "lady_pretalk",[]],
[anyone|plyr,"lord_talk_ask_location_2", [
(neg|is_between, "$g_talk_troop", kingdom_ladies_begin, kingdom_ladies_end),
], "Never mind.", "lord_pretalk",[]],
[anyone,"lord_talk_ask_location_3",
[
(is_between, "$g_talk_troop", kingdom_ladies_begin, kingdom_ladies_end),
(call_script, "script_update_troop_location_notes", "$hero_requested_to_learn_location", 1),
(call_script, "script_get_information_about_troops_position", "$hero_requested_to_learn_location", 0),
],
"{s1}", "lady_pretalk",[]],
[anyone,"lord_talk_ask_location_3",
[
(call_script, "script_update_troop_location_notes", "$hero_requested_to_learn_location", 1),
(call_script, "script_get_information_about_troops_position", "$hero_requested_to_learn_location", 0),
],
"{s1}", "lord_pretalk",[]],
[anyone,"lord_talk_ask_about_war", [],
"{s12}", "lord_talk_ask_about_war_2",[
(assign, ":num_enemies", 0),
(try_for_range_backwards, ":cur_faction", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
(store_relation, ":cur_relation", ":cur_faction", "$g_talk_troop_faction"),
(lt, ":cur_relation", 0),
(try_begin),
(eq, ":num_enemies", 0),
(str_store_faction_name_link, s12, ":cur_faction"),
(else_try),
(eq, ":num_enemies", 1),
(str_store_faction_name_link, s11, ":cur_faction"),
(str_store_string, s12, "@{s11} and {s12}"),
(else_try),
(str_store_faction_name_link, s11, ":cur_faction"),
(str_store_string, s12, "@{!}{s11}, {s12}"),
(try_end),
(val_add, ":num_enemies", 1),
(try_end),
(try_begin),
(eq, ":num_enemies", 0),
(str_store_string, s12, "@We are not at war with anyone."),
(else_try),
(str_store_string, s12, "@We are at war with {s12}."),
(try_end),
]],
[anyone|plyr|repeat_for_factions, "lord_talk_ask_about_war_2", [(store_repeat_object, ":faction_no"),
(is_between, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(store_relation, ":cur_relation", ":faction_no", "$g_talk_troop_faction"),
(lt, ":cur_relation", 0),
(str_store_faction_name, s1, ":faction_no")],
"Tell me more about the war with {s1}.", "lord_talk_ask_about_war_details",[(store_repeat_object, "$faction_requested_to_learn_more_details_about_the_war_against")]],
[anyone|plyr,"lord_talk_ask_about_war_2", [], "That's all I wanted to know. Thank you.", "lord_pretalk",[]],
[anyone,"lord_talk_ask_about_war_details", [],
# "We have {reg5?{reg5}:no} {reg3?armies:army} and they have {reg6?{reg6}:none}. Overall, {s9}.",
"{s9}.",
"lord_talk_ask_about_war_2",
[#(call_script, "script_faction_get_number_of_armies", "$g_encountered_party_faction"),
#(assign, reg5, reg0),
#(assign, reg3, 1),
#(try_begin),
# (eq, reg5, 1),
# (assign, reg3, 0),
#(try_end),
#(call_script, "script_faction_get_number_of_armies", "$faction_requested_to_learn_more_details_about_the_war_against"),
#(assign, reg6, reg0),
#(assign, reg4, 1),
#(try_begin),
# (eq, reg6, 1),
# (assign, reg4, 0),
#(try_end),
#(store_div, ":our_str", reg5, 2),
#(store_div, ":enemy_str", reg6, 2),
#(store_sub, ":advantage", ":our_str", ":enemy_str"),
#(val_clamp, ":advantage", -4, 5),
#(val_add, ":advantage", 4),
#(store_add, ":adv_str", "str_war_report_minus_4", ":advantage"),
#(str_store_string, s9, ":adv_str"),
(store_add, ":war_damage_slot", "$faction_requested_to_learn_more_details_about_the_war_against", slot_faction_war_damage_inflicted_on_factions_begin),
(val_sub, ":war_damage_slot", kingdoms_begin),
(faction_get_slot, ":war_damage_inflicted", "$g_talk_troop_faction", ":war_damage_slot"),
(store_add, ":war_damage_slot", "$g_talk_troop_faction", slot_faction_war_damage_inflicted_on_factions_begin),
(val_sub, ":war_damage_slot", kingdoms_begin),
(faction_get_slot, ":war_damage_suffered", "$faction_requested_to_learn_more_details_about_the_war_against", ":war_damage_slot"),
(val_max, ":war_damage_suffered", 1),
(store_mul, ":war_damage_ratio", ":war_damage_inflicted", 100),
(val_div, ":war_damage_ratio", ":war_damage_suffered"),
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg3, ":war_damage_inflicted"),
(assign, reg4, ":war_damage_suffered"),
(assign, reg5, ":war_damage_ratio"),
(display_message, "str_war_damage_inflicted_reg3_suffered_reg4_ratio_reg5"),
(try_end),
(str_store_string, s9, "str_error__did_not_calculate_war_progress_string_properly"),
(try_begin),
(lt, ":war_damage_inflicted", 5),
(str_store_string, s9, "str_the_war_has_barely_begun_so_and_it_is_too_early_to_say_who_is_winning_and_who_is_losing"),
(else_try),
(gt, ":war_damage_inflicted", 100),
(gt, ":war_damage_ratio", 200),
(str_store_string, s9, "str_we_have_been_hitting_them_very_hard_and_giving_them_little_chance_to_recover"),
(else_try),
(gt, ":war_damage_inflicted", 80),
(gt, ":war_damage_ratio", 150),
(str_store_string, s9, "str_the_fighting_has_been_hard_but_we_have_definitely_been_getting_the_better_of_them"),
(else_try),
(gt, ":war_damage_suffered", 100),
(lt, ":war_damage_ratio", 50),
(str_store_string, s9, "str_they_have_been_hitting_us_very_hard_and_causing_great_suffering"),
(else_try),
(gt, ":war_damage_suffered", 80),
(lt, ":war_damage_ratio", 68),
(str_store_string, s9, "str_the_fighting_has_been_hard_and_i_am_afraid_that_we_have_been_having_the_worst_of_it"),
(else_try),
(gt, ":war_damage_suffered", 50),
(gt, ":war_damage_inflicted", 50),
(gt, ":war_damage_ratio", 65),
(str_store_string, s9, "str_both_sides_have_suffered_in_the_fighting"),
(else_try),
(gt, ":war_damage_ratio", 125),
(str_store_string, s9, "str_no_clear_winner_has_yet_emerged_in_the_fighting_but_i_think_we_are_getting_the_better_of_them"),
(else_try),
(gt, ":war_damage_ratio", 80),
(str_store_string, s9, "str_no_clear_winner_has_yet_emerged_in_the_fighting_but_i_fear_they_may_be_getting_the_better_of_us"),
(else_try),
(str_store_string, s9, "str_no_clear_winner_has_yet_emerged_in_the_fighting"),
(try_end),
(try_begin),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(call_script, "script_npc_decision_checklist_peace_or_war", "$g_talk_troop_faction", "$faction_requested_to_learn_more_details_about_the_war_against", -1),
(str_store_string, s9, "str_s9_s14"),
(try_end),
]],
[anyone,"lord_talk_ask_about_strategy", [
(faction_get_slot, ":ai_state", "$g_encountered_party_faction", slot_faction_ai_state),
(faction_get_slot, ":ai_object", "$g_encountered_party_faction", slot_faction_ai_object),
(faction_get_slot, ":ai_decider", "$g_encountered_party_faction", slot_faction_marshall),
(try_begin),
(eq, ":ai_decider", -1),
(faction_get_slot, ":ai_decider", "$g_encountered_party_faction", slot_faction_leader),
(try_end),
(call_script, "script_npc_decision_checklist_faction_ai_alt", ":ai_decider"),
(assign, ":planned_state", reg0),
(assign, ":planned_object", reg1),
(try_begin),
(gt, ":ai_object", -1),
(str_store_party_name, s8, ":ai_object"),
(try_end),
(try_begin),
(eq, ":ai_state", sfai_default),
(str_store_string, s7, "str_there_is_no_campaign_currently_in_progress"),
(else_try),
(eq, ":ai_state", sfai_gathering_army),
(str_store_string, s7, "str_we_are_assembling_the_army"),
(else_try),
(eq, ":ai_state", sfai_attacking_center),
(str_store_string, s7, "str_we_aim_to_take_the_fortress_of_s8"),
(else_try),
(eq, ":ai_state", sfai_raiding_village),
(str_store_string, s7, "str_we_are_on_a_raid_and_are_now_targeting_s8"),
(else_try),
(eq, ":ai_state", sfai_attacking_enemy_army),
(str_store_string, s7, "str_we_are_trying_to_seek_out_and_defeat_s8"),
(else_try),
(eq, ":ai_state", sfai_attacking_enemies_around_center),
(str_store_string, s7, "str_we_are_riding_to_the_defense_of_s8"),
(else_try),
(eq, ":ai_state", sfai_feast),
(str_store_string, s7, "str_we_are_gathering_for_a_feast_at_s8"),
(try_end),
#Additional information for gathering the army
(str_clear, s9),
(try_begin),
(eq, ":ai_state", sfai_gathering_army),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(gt, ":faction_marshal", -1),
(troop_get_slot, ":marshal_party", ":faction_marshal", slot_troop_leaded_party),
(party_is_active, ":marshal_party"),
(this_or_next|eq, "$g_talk_troop", ":faction_marshal"),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_object, ":marshal_party"),
(party_get_slot, ":marshal_object", ":marshal_party", slot_party_ai_object),
(try_begin),
(eq, ":marshal_object", -1),
(str_store_string, s9, "str_we_are_waiting_here_for_vassals"),
(else_try),
(str_store_party_name, s11, ":marshal_object"),
(str_store_string, s9, "str_we_are_travelling_to_s11_for_vassals"),
(try_end),
(try_end),
(try_begin),
(this_or_next|neq, ":ai_state", ":planned_state"),
(neq, ":ai_object", ":planned_object"),
(str_store_string, s14, "str__however_that_may_change_shortly_s14"),
(try_end),
],
"{s7} {s9} {s14}", "lord_strategy_follow_evaluation",
[]],
[anyone, "lord_strategy_follow_evaluation", [
(this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, "$g_talk_troop"),
(this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
],
"Did you have any other questions?",
"lord_talk_ask_something_2",[
]],
[anyone, "lord_strategy_follow_evaluation", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_gathering_army),
(call_script, "script_npc_decision_checklist_faction_ai_alt", "$g_talk_troop"),
(assign, ":talk_troop_preferred_strategy", reg0),
(neq, ":talk_troop_preferred_strategy", sfai_gathering_army),
(store_current_hours, ":hours_at_current_state"),
(faction_get_slot, ":current_state_started", "$g_talk_troop_faction", slot_faction_ai_current_state_started),
(val_sub, ":hours_at_current_state", ":current_state_started"),
(ge, ":hours_at_current_state", 40),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
(neq, ":faction_marshal", "$g_talk_troop"),
(str_store_troop_name, s4, ":faction_marshal"),
],
"Our leader {s4} is far too cautious. {reg4?She:He} should either use the army to attack the enemy, or let it go home.",
"lord_strategy_follow_up",[
(assign, "$g_talk_troop_disagrees_with_marshal", 1),
]],
[anyone, "lord_strategy_follow_evaluation", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_gathering_army),
(store_current_hours, ":hours_at_current_state"),
(faction_get_slot, ":current_state_started", "$g_talk_troop_faction", slot_faction_ai_current_state_started),
(val_sub, ":hours_at_current_state", ":current_state_started"),
(ge, ":hours_at_current_state", 40),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
(neq, ":faction_marshal", "$g_talk_troop"),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_marshal"),
(lt, reg0, 5),
(str_store_troop_name, s4, ":faction_marshal"),
],
"Our army sits, doing nothing. Apparently, too few vassals have answered the call to arms. Perhaps {s4} does not enjoy the confidence of the great lords of this realm.",
"lord_strategy_follow_up",[
(assign, "$g_talk_troop_disagrees_with_marshal", 1),
]],
#To Steve - Why we need this dialog? It already included in below lord_strategy_follow_evaluation dialogs
#[anyone, "lord_strategy_follow_evaluation",
#[
# (this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
# (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
#
# (faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
# (call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", "$g_talk_troop", ":cur_object", 1, 0),
# (lt, reg0, 0),
#
# (str_store_string, s9, reg1),
# (str_store_party_name, s8, ":cur_object"),
#],
# "I disagree with the marshal's decision. I believe that {s8} {s9}",
# "lord_strategy_why_not",[
# ]],
#This dialog appears when lord disagrees with marshal about the selected faction ai (attack/defend/gather/other).
#To Steve - I took that dialog upper from below one. Lord should compare his faction ai choice with marshal's one before comparing preffered ai objects.
[anyone, "lord_strategy_follow_evaluation",
[
(call_script, "script_npc_decision_checklist_faction_ai_alt", "$g_talk_troop"),
(assign, ":talk_troop_preferred_strategy", reg0),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, ":talk_troop_preferred_strategy"),
(assign, ":continue", 1),
(try_begin),
(eq, ":talk_troop_preferred_strategy", sfai_raiding_village),
(str_store_string, s4, "@go on the offensive now."),
(else_try),
(eq, ":talk_troop_preferred_strategy", sfai_attacking_center),
(str_store_string, s4, "@go on the offensive now."),
(else_try),
(eq, ":talk_troop_preferred_strategy", sfai_attacking_enemies_around_center),
(str_store_string, s4, "@act to defend our lands."),
(else_try),
(eq, ":talk_troop_preferred_strategy", sfai_gathering_army),
(str_store_string, s4, "@take more time to gather the army."),
(else_try),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
(neq, ":faction_marshal", "$g_talk_troop"),
(str_store_troop_name, s10, ":faction_marshal"),
(assign, "$g_talk_troop_disagrees_with_marshal", 1),
],
"I disagree with this strategy. I would prefer to {s4}.",
"lord_strategy_follow_up", [
(assign, "$g_talk_troop_disagrees_with_marshal", 1),
]],
#This dialog appears when lord disagrees with marshal about the city will be attacked.
[anyone, "lord_strategy_follow_evaluation",
[
(this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
(call_script, "script_find_center_to_attack_alt", "$g_talk_troop", 1, 0),
(assign, ":preferred_center", reg0),
(is_between, ":preferred_center", centers_begin, centers_end),
(faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
(neq, ":cur_object", ":preferred_center"),
#To Steve - if lord's preffered center is different from marshal's current one then this should be enough for lord to say I disagree with marshal isn't this better?
#Because it is not easy for any lord to return minus score for a center, so if we do not do this, we will not be able to see lords which disagree with marshal.
#Conclusion : I removed condition of (lt, reg0, 0),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
(neq, ":faction_marshal", "$g_talk_troop"),
(call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", ":preferred_center", 1, 0),
#(lt, reg0, 0),
(str_store_string, s9, reg1),
(str_store_party_name, s8, ":preferred_center"),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
(neq, ":faction_marshal", "$g_talk_troop"),
(str_store_troop_name, s10, ":faction_marshal"),
],
"I personally would prefer to attack {s8}, but our marshal {s10} believes that it {s9}",
"lord_strategy_follow_up",[
(assign, "$g_talk_troop_disagrees_with_marshal", 1),
]],
#This dialog appears when lord disagrees with marshal about the city will be defended.
[anyone, "lord_strategy_follow_evaluation",
[
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_enemies_around_center),
(call_script, "script_find_center_to_defend", "$g_talk_troop"),
(assign, ":preferred_center", reg0),
(is_between, ":preferred_center", centers_begin, centers_end),
(faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
(neq, ":cur_object", ":preferred_center"),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
(neq, ":faction_marshal", "$g_talk_troop"),
(str_store_party_name, s8, ":preferred_center"),
(str_store_party_name, s9, ":cur_object"),
],
"I personally would prefer to defend {s8}, instead of {s9}.",
"lord_strategy_follow_up",[
(assign, "$g_talk_troop_disagrees_with_marshal", 1),
]],
[anyone, "lord_strategy_follow_evaluation",
[
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(this_or_next|neg|is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
(eq, ":faction_marshal", "$g_talk_troop"),
],
"Is there anything else?",
"lord_talk",[
]],
[anyone, "lord_strategy_follow_evaluation",
[],
"This strategy seems reasonable to me.",
"lord_strategy_follow_up",[
(assign, "$g_talk_troop_disagrees_with_marshal", 0),
]],
[anyone|plyr, "lord_strategy_follow_up", [
(this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
],
"If you're attacking, why aren't you...",
"lord_strategy_why_not",[
]],
[anyone|plyr, "lord_strategy_follow_up", [
],
"I see....",
"lord_talk_ask_something_again",[
]],
[anyone|plyr, "lord_strategy_follow_up", [
(eq, "$g_talk_troop_disagrees_with_marshal", 1),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
(str_store_troop_name, s4, ":faction_marshal"),
],
"Would you say, then, that {s4} should no longer be marshal?",
"lord_talk_replace_marshal",[
]],
[anyone, "lord_talk_replace_marshal", [
(faction_get_slot, ":faction_issue", "$g_talk_troop_faction", slot_faction_political_issue),
(is_between, ":faction_issue", centers_begin, centers_end),
(str_store_party_name, s4, ":faction_issue"),
],
"I believe that our realm should resolve the issue of {s4} before we begin to debate replacing the marshal.",
"lord_talk_ask_something_again",[
]],
[anyone, "lord_talk_replace_marshal", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_political_issue, 1),
(troop_get_slot, ":stance_on_faction_issue", "$g_talk_troop", slot_troop_stance_on_faction_issue),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(neq, ":stance_on_faction_issue", ":faction_marshal"),
(str_store_troop_name, s4, ":stance_on_faction_issue"),
(str_store_troop_name, s5, ":faction_marshal"),
],
"Yes. I have already made my position on this matter clear. I believe that {s4} should be marshal instead of {s5}.",
"lord_talk_ask_something_again",[
]],
[anyone, "lord_talk_replace_marshal", [
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_marshal"),
(assign, ":relation_with_marshal", reg0),
(gt, ":relation_with_marshal", "$g_talk_troop_effective_relation"),
],
"I will make up my mind on this matter without your persuasion, {sir/my lady}.",
"lord_talk_ask_something_again",[
]],
[anyone, "lord_talk_replace_marshal", [
],
"Hmm...",
"lord_talk_replace_marshal_decision",[
(faction_set_slot, "$g_talk_troop_faction", slot_faction_political_issue, 1),
]],
[anyone, "lord_talk_replace_marshal_decision", [
(call_script, "script_npc_decision_checklist_take_stand_on_issue", "$g_talk_troop"),
(assign, ":replacement_candidate", reg0),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, ":replacement_candidate"),
(call_script, "script_troop_describes_troop_to_s15", "$g_talk_troop", ":replacement_candidate"),
],
"Yes, I would say that. At this point, I would be tempted to say that I support {s15} instead. I am glad that you and I had this discussion, so that I know that we are of the same mind on this matter.",
"lord_talk_ask_something_again",[
(call_script, "script_npc_decision_checklist_take_stand_on_issue", "$g_talk_troop"),
(assign, ":replacement_candidate", reg0),
(troop_set_slot, "$g_talk_troop", slot_troop_stance_on_faction_issue, ":replacement_candidate"),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(troop_get_slot, ":marshal_controversy", ":faction_marshal", slot_troop_controversy),
(val_add, ":marshal_controversy", 5),
(troop_set_slot, ":faction_marshal", slot_troop_controversy, ":marshal_controversy"),
(call_script, "script_troop_describes_troop_to_s15", "$g_talk_troop", ":replacement_candidate"),
]],
[anyone, "lord_talk_replace_marshal_decision", [
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(str_store_troop_name, s4, ":faction_marshal"),
],
"Not necessarily. It is possible for {s4} and I have to have an honest disagreement over strategy, without my seeking to replace him.",
"lord_talk_ask_something_again",[
]],
[anyone, "lord_strategy_why_not", [
],
"Yes?",
"lord_strategy_why_not_select",[
]],
[anyone|plyr, "lord_strategy_why_not_select", [
],
"Never mind",
"lord_talk_ask_something_again",[]],
[anyone|plyr, "lord_strategy_why_not_select",
[
(this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
(faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(gt, ":faction_marshal", -1),
(call_script, "script_find_center_to_attack_alt", ":faction_marshal", 1, 0),
(neq, reg0, ":cur_object"),
(str_store_party_name,s4, ":cur_object"),
],
"..planning to continue with the attack on {s4}?",
"lord_strategy_why_not_reason",[
]],
[anyone|plyr|repeat_for_parties, "lord_strategy_why_not_select",
[
(store_repeat_object, ":selected_center"),
(is_between, ":selected_center", centers_begin, centers_end),
(store_faction_of_party, ":selected_center_faction", ":selected_center"),
(eq, ":selected_center_faction", "$g_talk_troop_faction"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, ":selected_center"),
(neq, "$g_target_after_gathering", ":selected_center"),
(party_slot_ge, ":selected_center", slot_center_sortie_enemy_strength, 1),
(str_store_party_name,s4, ":selected_center"),
],
"..defending {s4}?",
"lord_strategy_why_not_reason",[
(store_repeat_object, "$temp"),
]],
[anyone|plyr|repeat_for_parties, "lord_strategy_why_not_select",
[
(store_repeat_object, ":selected_center"),
(is_between, ":selected_center", centers_begin, centers_end),
(store_faction_of_party, ":selected_center_faction", ":selected_center"),
(store_relation, ":relation", ":selected_center_faction", "$g_talk_troop_faction"),
(lt, ":relation", 0),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, ":selected_center"),
(str_store_party_name,s4, ":selected_center"),
],
"..attacking {s4}?",
"lord_strategy_why_not_reason",
[
(store_repeat_object, "$temp"),
(try_begin),
(eq, "$cheat_mode", 1),
(store_sub, ":faction_recce_slot", "$g_talk_troop_faction", kingdoms_begin),
(val_add, ":faction_recce_slot", slot_center_last_reconnoitered_by_faction_time),
(store_current_hours, ":hours_since_last_recon"),
(party_get_slot, ":last_recon_time", "$temp", ":faction_recce_slot"),
(val_sub, ":hours_since_last_recon", ":last_recon_time"),
(try_end),
]],
[anyone, "lord_strategy_why_not_reason",
[
(assign, ":selected_center", "$temp"),
(store_faction_of_party, ":selected_center_faction", ":selected_center"),
(eq, ":selected_center_faction", "$g_talk_troop_faction"),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(call_script, "script_find_center_to_defend", ":faction_marshal"),
(assign, ":most_threatened_center", reg0),
(assign, ":threat_danger_level", reg1),
(assign, ":enemy_strength_near_threatened_center", reg2),
(try_begin),
(call_script, "script_find_center_to_attack_alt", ":faction_marshal", 1, 0),
(assign, ":target_value_level", reg1),
(call_script, "script_find_center_to_attack_alt", ":faction_marshal", 1, 1),
(assign, ":target_value_level_all_vassals", reg1),
(try_begin),
(ge, ":target_value_level_all_vassals", ":target_value_level"),
(assign, ":target_value_level_max", ":target_value_level_all_vassals"),
(else_try),
(assign, ":target_value_level_max", ":target_value_level"),
(try_end),
(gt, ":target_value_level_max", ":threat_danger_level"),
(assign, reg4, ":target_value_level"),
(assign, reg5, ":threat_danger_level"),
(str_store_string, s9, "str_reason_1"),
(else_try),
(assign, ":continue", 0),
(try_begin),
(is_between, ":selected_center", villages_begin, villages_end),
(is_between, ":most_threatened_center", walled_centers_begin, walled_centers_end),
(assign, ":continue", 1),
(try_end),
(try_begin),
(is_between, ":selected_center", castles_begin, castles_end),
(is_between, ":most_threatened_center", towns_begin, towns_end),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(str_store_party_name, s8, ":most_threatened_center"),
#values of centers : town > castle > village
#Situation : We are going to defend more valueable center.
#To Steve - Please find a better explaining string for below line.
(str_store_string, s9, "str_reason_2"),
(else_try),
(neq, ":most_threatened_center", ":selected_center"),
(str_store_party_name, s8, ":most_threatened_center"),
(str_store_string, s9, "str_reason_3"),
(else_try),
(troop_get_slot, ":marshal_party", ":faction_marshal", slot_troop_leaded_party),
(party_is_active, ":marshal_party"),
(party_get_slot, ":cached_strength", ":marshal_party", slot_party_cached_strength),
(party_get_slot, ":follower_strength", ":marshal_party", slot_party_follower_strength),
(store_add, ":total_strength", ":cached_strength", ":follower_strength"),
(ge, ":enemy_strength_near_threatened_center", ":total_strength"),
(assign, reg4, ":enemy_strength_near_threatened_center"),
(assign, reg5, ":total_strength"),
(str_store_string, s9, "str_reason_4"),
(else_try),
(str_store_string, s9, "str_reason_5"),
(try_end),
],
"{s9}",
"lord_talk_why_not_repeat",[]],
[anyone, "lord_strategy_why_not_reason",
[
(assign, ":selected_center", "$temp"),
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(faction_get_slot, ":faction_ai_object", "$g_talk_troop_faction", slot_faction_ai_object),
(call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", ":faction_ai_object", 1, 0),
(assign, "$g_faction_object_score", reg0),
(assign, "$g_do_not_skip_other_than_current_ai_object", 1),
(call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", ":selected_center", 1, 0),
(assign, "$g_do_not_skip_other_than_current_ai_object", 0),
(lt, reg0, 0),
(assign, ":explainer_string", reg1),
(try_begin),
(eq, "$g_use_current_ai_object_as_s8", 0),
(str_store_party_name, s8, ":selected_center"),
(else_try),
(str_store_party_name, s8, ":faction_ai_object"),
(try_end),
(str_store_string, s9, ":explainer_string"),
(str_clear, s10),
(str_store_troop_name, s11, ":faction_marshal"),
#s10 will say that
],
"Our marshal {s11} believes that {s8} {s9}{s10}",
"lord_talk_why_not_repeat",[]],
[anyone, "lord_strategy_why_not_reason",
[
(faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshall),
(faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
(call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", ":cur_object", 1, 0),
(assign, ":power_ratio_for_cur_object", reg2),
(call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", "$temp", 1, 0),
(assign, ":power_ratio_for_selected_center", reg2),
(try_begin),
(eq, ":power_ratio_for_selected_center", 0),
(str_store_string, s7, "str_reason_6"),
(else_try),
(lt, ":power_ratio_for_selected_center", 200),
(str_store_string, s7, "str_reason_7"),
(else_try),
(is_between, ":power_ratio_for_selected_center", 200, 300),
(str_store_string, s7, "str_reason_8"),
(else_try),
(ge, ":power_ratio_for_selected_center", 300),
(str_store_string, s7, "str_reason_9"),
(else_try),
(str_store_string, s7, "str_error_string"),
(try_end),
(try_begin),
(eq, ":power_ratio_for_cur_object", 0),
(str_store_string, s8, "str_reason_6"),
(else_try),
(lt, ":power_ratio_for_cur_object", 200),
(str_store_string, s8, "str_reason_7"),
(else_try),
(is_between, ":power_ratio_for_cur_object", 200, 300),
(str_store_string, s8, "str_reason_8"),
(else_try),
(ge, ":power_ratio_for_cur_object", 300),
(str_store_string, s8, "str_reason_9"),
(else_try),
(str_store_string, s8, "str_error_string"),
(try_end),
(try_begin),
(ge, ":cur_object", 0),
(str_store_party_name, s4, ":cur_object"),
(else_try),
(ge, "$g_target_after_gathering", 0),
(str_store_party_name, s4, "$g_target_after_gathering"),
(else_try),
(str_store_party_name, s4, "str_error_string"),
(try_end),
(str_store_troop_name, s5, ":faction_marshal"),
(try_begin),
(eq, "$cheat_mode", 1),
(store_sub, ":faction_recce_slot", "$g_talk_troop_faction", kingdoms_begin),
(val_add, ":faction_recce_slot", slot_center_last_reconnoitered_by_faction_time),
(store_current_hours, ":hours_since_last_recon"),
(party_get_slot, ":last_recon_time", "$temp", ":faction_recce_slot"),
(val_sub, ":hours_since_last_recon", ":last_recon_time"),
(store_sub, ":faction_recce_slot", "$g_talk_troop_faction", kingdoms_begin),
(val_add, ":faction_recce_slot", slot_center_last_reconnoitered_by_faction_time),
(store_current_hours, ":hours_since_last_recon"),
(party_get_slot, ":last_recon_time", ":cur_object", ":faction_recce_slot"),
(val_sub, ":hours_since_last_recon", ":last_recon_time"),
(try_end),
(try_begin),
(assign, ":continue", 0),
(try_begin),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, sfai_gathering_army),
(lt, "$g_target_after_gathering", 0), #then this means faction is gathering army to attack a center.
(assign, ":continue", 1),
(try_end),
(this_or_next|eq, ":continue", 1),
(this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
(str_store_string, s3, "str_has_decided_that_an_attack_on_"),
(str_store_string, s6, "str_this_would_be_better_worth_the_effort"),
(else_try),
(str_store_string, s3, "str_has_decided_to_defend_"),
(str_store_party_name, s9, "$temp"),
(str_store_string, s6, "str_before_going_offensive_we_should_protect_our_lands_if_there_is_any_threat_so_this_can_be_reason_marshall_choosed_defending_s4"),
(str_clear, s8),
(try_end),
],
"We could go there. {s7} However, {s5} {s3} {s4}. {s6} {s8}.",
"lord_talk_why_not_repeat",[
]],
[anyone,"lord_talk_why_not_repeat", [
],
"Did you have any similar questions? Why we are not...",
"lord_strategy_why_not_select",[
]],
[anyone,"lord_talk_ask_marriage_1", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
],
"You will not take offense if I tell you that, as a king, I have other plans for my children.",
"lord_pretalk",[
]],
[anyone,"lord_talk_ask_marriage_1", [
(assign, "$marriage_candidate", -1),
(try_begin),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 1),
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
(assign, "$marriage_candidate", "$g_talk_troop"),
(else_try),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 0),
(assign, "$marriage_candidate", -1),
(try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
(troop_slot_eq, ":lady", slot_troop_spouse, -1),
(troop_slot_eq, ":lady", slot_troop_betrothed, -1),
(call_script, "script_get_kingdom_lady_social_determinants", ":lady"),
(eq, reg0, "$g_talk_troop"),
(call_script, "script_troop_get_family_relation_to_troop", ":lady", "$g_talk_troop"),
(assign, "$marriage_candidate", ":lady"),
(str_store_troop_name, s14, "$marriage_candidate"),
(str_store_string, s15, "str_it_is_our_custom_to_seal_any_such_alliances_with_marriage_and_in_fact_we_have_been_looking_for_a_suitable_groom_for_my_s11_s14"),
(try_end),
(try_end),
(eq, "$marriage_candidate", -1),
],
"It is our custom to seal any such alliances with marriage. Unfortunately, no one in my household is eligible to wed.",
"lord_pretalk",[
]],
[anyone,"lord_talk_ask_marriage_1", [
(troop_get_type, ":type", "trp_player"),
(eq, ":type", 0),
],
"{s15}",
"lord_courtship_pre_permission",[
]],
[anyone,"lord_talk_ask_marriage_1", [
(eq, "$marriage_candidate", "$g_talk_troop"),
],
"Are you proposing that you and I marry?",
"lord_marriage_proposal_female_pc_confirm",[
]],
[anyone|plyr,"lord_courtship_pre_permission", [
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, 1),
(neg|troop_slot_ge, "trp_player", slot_troop_betrothed, 1),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 0),
(str_clear, s15),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
(str_store_string, s15, "str_once_again_"),
(try_end),
],
"May I {s15}suggest that I be considered as a groom?",
"lord_courtship_permission",[
]],
[anyone|plyr,"lord_courtship_pre_permission", [
(eq, "$cheat_mode", 2),
],
"CHEAT -- Start engagement",
"lord_marriage_permission_engagement_date",[
(setup_quest_text, "qst_formal_marriage_proposal"),
(str_store_string, s2, "str_cheat__marriage_proposal"),
(call_script, "script_start_quest", "qst_formal_marriage_proposal", "$marriage_candidate"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$marriage_candidate"),
]],
[anyone|plyr,"lord_courtship_pre_permission", [
],
"Never mind",
"lord_pretalk",[
]],
[anyone|plyr,"lord_marriage_proposal_female_pc_confirm", [
],
"Yes. That is my proposal.",
"lord_marriage_proposal_female_pc_reax",[
]],
[anyone|plyr,"lord_marriage_proposal_female_pc_confirm", [
],
"No, I think you have misunderstood me.",
"lord_pretalk",[
]],
[anyone,"lord_marriage_proposal_female_pc_reax", [
(call_script, "script_npc_decision_checklist_marry_female_pc", "$g_talk_troop"),
(le, reg0, 0),
],
"{s14}",
"lord_pretalk",[
]],
[anyone,"lord_marriage_proposal_female_pc_reax", [
(call_script, "script_npc_decision_checklist_marry_female_pc", "$g_talk_troop"),
(eq, reg0, 2),
],
"{s14}",
"lord_pretalk",[
(troop_set_slot, "$g_talk_troop", slot_troop_met, 2),
]],
[anyone,"lord_marriage_proposal_female_pc_reax", [
],
"{s14}",
"lord_marriage_proposal_female_pc_next_step",[
]],
# [anyone,"lord_marriage_proposal_female_pc_next_step", [
# ],
# "I must say, though. You live your life like a man, riding where you will, with the company you choose. This will not make it easy for the other lords to accept our marriage. I don't suppose that you would give up adventuring, for the sake of our marriage?",
# "lord_marriage_proposal_female_pc_next_step_2",[
# ]],
# [anyone|plyr,"lord_marriage_proposal_female_pc_next_step_2", [
# ],
# "I think not!",
# "lord_marriage_proposal_female_pc_next_step_3",[
# ]],
[anyone,"lord_marriage_proposal_female_pc_next_step", [
],
"I suppose the next step would be for me to send a message to your family, asking for their permission to marry you, but I suppose that you make your own decisions.",
"lord_marriage_proposal_female_pc_next_step_4",[
]],
[anyone|plyr,"lord_marriage_proposal_female_pc_next_step_4", [
],
"You assume correctly.",
"lord_marriage_proposal_female_pc_next_step_5",[
]],
[anyone,"lord_marriage_proposal_female_pc_next_step_5", [
],
"Very well, then. As there are no obstacles to our marriage, should we then consider ourselves engaged to be wed? I will organize a great feast, and we can exchange our vows before all the lords of the realm. If you are willing, that is...",
"lord_marriage_proposal_female_pc_confirm_engagement",[
]],
[anyone|plyr,"lord_marriage_proposal_female_pc_confirm_engagement", [
],
"I am willing.",
"lord_marriage_proposal_female_pc_confirm_engagement_yes",[
(troop_set_slot, "$g_talk_troop", slot_troop_betrothed, "trp_player"),
(troop_set_slot, "trp_player", slot_troop_betrothed, "$g_talk_troop"),
(assign, "$g_other_quest", 0),
(try_begin),
(store_partner_quest, ":other_quest", "$g_talk_troop"),
(gt, ":other_quest", 0),
(assign, "$g_other_quest", ":other_quest"),
(try_end),
(str_store_troop_name, s4, "$g_talk_troop"),
(setup_quest_text, "qst_wed_betrothed_female"),
(str_store_string, s2, "str_you_plan_to_marry_s4_as_you_have_no_family_in_calradia_he_will_organize_the_wedding_feast"),
(call_script, "script_start_quest", "qst_wed_betrothed_female", "$g_talk_troop"),
(quest_set_slot, "qst_wed_betrothed_female", slot_quest_expiration_days, 120),
(quest_set_slot, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
]],
[anyone|plyr,"lord_marriage_proposal_female_pc_confirm_engagement", [
],
"Actually, I would like to reconsider.",
"lord_marriage_proposal_female_pc_confirm_engagement_no",[
]],
[anyone,"lord_marriage_proposal_female_pc_confirm_engagement_yes", [
(str_clear, s12),
(try_begin),
(gt, "$g_other_quest", 0),
(call_script, "script_succeed_quest", "$g_other_quest"),
(call_script, "script_end_quest", "$g_other_quest"),
(str_store_string, s12, "str_cancel_fiancee_quest"),
(try_end),
],
"Very well. Hopefully, a little over a month from now, we shall be wed.{s12}",
"close_window",[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_marriage_proposal_female_pc_confirm_engagement_no", [
],
"Take whatever time you need, my lady.",
"close_window",[
(assign, "$g_leave_encounter", 1),
]],
#continue marriage talks here
[anyone|plyr,"lord_talk", [(eq,"$talk_context",tc_party_encounter),
(lt, "$g_encountered_party_relation", 0),
(str_store_troop_name,s4,"$g_talk_troop")],
"I say this only once, {s4}! Surrender or die!", "party_encounter_lord_hostile_ultimatum_surrender", []],
[anyone,"party_encounter_lord_hostile_ultimatum_surrender", [],
"{s43}", "close_window", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_challenged_default"),
(call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
(try_begin),
(gt, "$g_talk_troop_relation", -10),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
(try_end),
(assign,"$encountered_party_hostile",1),
(assign,"$encountered_party_friendly",0),]],
[anyone|plyr,"lord_talk", [(eq,"$talk_context", tc_party_encounter),
(neq,"$g_encountered_party_faction","$players_kingdom"),
(ge, "$g_encountered_party_relation", 0),
], "I'm here to deliver you my demands!", "lord_predemand",[]],
[anyone,"lord_predemand", [], "Eh? What do you want?", "lord_demand",[]],
[anyone|plyr,"lord_demand", [(neq,"$g_encountered_party_faction","$players_kingdom"),
(ge, "$g_encountered_party_relation", 0),], "I offer you one chance to surrender or die.", "lord_ultimatum_surrender",[]],
#Neutral attack on lord
[anyone,"lord_ultimatum_surrender", [(ge, "$g_encountered_party_relation", 0)], "{s43}", "lord_attack_verify",[#originally, speak you rascal
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_unprovoked_attack_default"),
(try_begin),
(faction_slot_ge, "$g_encountered_party_faction", slot_faction_truce_days_with_factions_begin, 1),
(str_store_faction_name, s34, "$g_encountered_party_faction"),
(str_store_string, s43, "str_s43_just_so_you_know_if_you_attack_me_you_will_be_in_violation_of_the_truce_you_signed_with_the_s34"),
(try_end),
(try_begin),
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(str_store_string, s43, "str_s43_also_you_should_know_that_an_unprovoked_assault_is_declaration_of_war"),
(try_end),
]],
[anyone|plyr,"lord_attack_verify", [], "Forgive me sir. I don't know what I was thinking.", "lord_attack_verify_cancel",[]],
[anyone,"lord_attack_verify_cancel", [], "Be gone, then.", "close_window",[(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),(assign, "$g_leave_encounter",1)]],
[anyone|plyr,"lord_attack_verify", [], "That is none of your business. Prepare to fight!", "lord_attack_verify_commit",[
]],
#The kingdoms are already at war
[anyone,"lord_ultimatum_surrender", [], "{s43}", "lord_attack_verify_b", #originally, you will not survive this
[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_unnecessary_attack_default"),
(call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
(assign,"$encountered_party_hostile",1),
(assign,"$encountered_party_friendly",0),
]],
[anyone|plyr,"lord_attack_verify_b", [], "Forgive me sir. I don't know what I was thinking.", "lord_attack_verify_cancel",[]],
[anyone|plyr,"lord_attack_verify_b", [], "I stand my ground. Prepare to fight!", "lord_attack_verify_commit",[]],
[anyone,"lord_attack_verify_commit", [], "{s43}", "close_window",
[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_challenged_default"),
(try_begin),
(ge, "$g_encountered_party_relation", 0),
(call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
(try_end),
(try_begin), #this try is added so that a player monarch ccannot spark a war by attacking a neutral. The player does however cause a provocation, which may allow the other side to go to war
#If a player can create a hostile faction simply by attacking, this will allow a number of exploits. Therefore, it is quite important to keep this condition in here for active player kingdoms
(neq, "$players_kingdom", "fac_player_supporters_faction"),
(call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
(else_try),
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(call_script, "script_diplomacy_start_war_between_kingdoms", "fac_player_supporters_faction", "$g_encountered_party_faction", 1),
(try_end),
# (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
(assign,"$encountered_party_hostile",1),
(assign,"$encountered_party_friendly",0),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
]],
#Post 0907 changes end
[anyone|plyr,"lord_demand", [], "Forgive me. It's nothing.", "lord_pretalk",[]],
## [anyone|plyr,"lord_talk", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (ge, "$g_talk_troop_faction_relation", 0),
## ],
## "I wish to ask for a favor.", "lord_ask_for_favor_ask",[]],
[anyone|plyr,"lord_talk", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(troop_slot_eq, "$g_talk_troop", slot_troop_discussed_rebellion, 0),
(assign, ":pretender", 0),
(try_for_range, ":possible_pretender", pretenders_begin, pretenders_end),
(troop_slot_eq, ":possible_pretender", slot_troop_original_faction, "$g_talk_troop_faction"),
(assign, ":pretender", ":possible_pretender"),
(try_end),
(troop_slot_ge, ":pretender", slot_troop_met, 1),
(str_store_troop_name, s45, ":pretender"),
(troop_get_type, reg3, ":pretender"),
],
"I have met in my travels one who calls {reg3?herself:himself} {s45}...", "liege_defends_claim_1",[
]],
[anyone,"liege_defends_claim_1", [],
"Oh really? It is not everyone who dares mention that name in my presence. I am not sure whether to reward your bravery, or punish you for your impudence.", "liege_defends_claim_2", [
(troop_set_slot, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
]],
[anyone,"liege_defends_claim_2", [],
"Very well. I will indulge your curiosity. But listen closely, because I do not wish to speak of this matter again.", "liege_defends_claim_3", [
]],
[anyone,"liege_defends_claim_3", [],
"{s48}", "liege_defends_claim_4", [
(store_sub, ":rebellion_string", "$g_talk_troop_faction", "fac_kingdom_1"),
(val_add, ":rebellion_string", "str_swadian_rebellion_monarch_response_1"),
(str_store_string, 48, ":rebellion_string"),
]],
[anyone,"liege_defends_claim_4", [],
"{s48}", "lord_talk", [
(store_sub, ":rebellion_string", "$g_talk_troop_faction", "fac_kingdom_1"),
(val_add, ":rebellion_string", "str_swadian_rebellion_monarch_response_2"),
(str_store_string, 48, ":rebellion_string"),
]],
#Rebellion changes begin
# [anyone|plyr,"lord_talk", [
# (gt, "$supported_pretender", 0),
# (eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
# (troop_slot_eq, "$g_talk_troop", slot_troop_discussed_rebellion, 0),
# (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
# (troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
# (str_store_troop_name, s12, "$supported_pretender"),
# (str_store_faction_name, s14, "$supported_pretender_old_faction"),
# (faction_get_slot, ":old_faction_lord", "$supported_pretender_old_faction", slot_faction_leader),
# (str_store_troop_name, s15, ":old_faction_lord"),
# ],
# "{s12} is the rightful ruler of {s14}. Join our cause against the usurper, {s15}!", "lord_join_rebellion_suggest",[]],
[anyone|plyr,"lord_talk",
[
(eq, "$cheat_mode", 2),
(gt, "$supported_pretender", 0),
(eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
],
"{!}CHEAT - Join our cause by force.", "lord_join_rebellion_suggest_cheat",[]],
[anyone|plyr,"party_encounter_lord_hostile_attacker_2",
[
(eq, "$cheat_mode", 2),
(gt, "$supported_pretender", 0),
(eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
],
"{!}CHEAT - Join our cause by force.", "lord_join_rebellion_suggest_cheat",[]],
[anyone,"lord_join_rebellion_suggest_cheat",
[], "Cheat:Allright.",
"lord_join_rebellion_ask_for_order",
[
(troop_set_slot, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
(call_script, "script_change_troop_faction", "$g_talk_troop", "$players_kingdom"),
(assign, "$g_leave_encounter", 1),
]],
# [anyone|plyr,"party_encounter_lord_hostile_attacker_2", [
# (gt, "$supported_pretender", 0),
# (eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
# (neg|troop_slot_ge, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
# (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
# (troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
# (str_store_troop_name, s12, "$supported_pretender"),
# (str_store_faction_name, s14, "$supported_pretender_old_faction"),
# (faction_get_slot, ":old_faction_lord", "$supported_pretender_old_faction", slot_faction_leader),
# (str_store_troop_name, s15, ":old_faction_lord"),
# ],
# "{s12} is your rightful ruler. Join our cause against the usurper, {s15}!", "lord_join_rebellion_suggest",[]],
# [anyone,"lord_join_rebellion_suggest", [
# (eq,"$talk_context",tc_party_encounter),
# (encountered_party_is_attacker),
# (lt, "$g_talk_troop_relation", -5),
# ], "I have no time to bandy words with the likes of you. Now defend yourself!",
# "party_encounter_lord_hostile_attacker_2",
# [
# (try_begin),
# (neg|troop_slot_ge, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
# (troop_set_slot, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
# (try_end),
# ]],
#removed a number of rebellion scripts...
#Rebellion changes end
[anyone|plyr,"lord_talk",
[
(troop_get_slot, ":prison_location", "$g_talk_troop", slot_troop_prisoner_of_party),
(is_between, ":prison_location", centers_begin, centers_end),
(neg|party_slot_eq, ":prison_location", slot_town_lord, "trp_player"),
(neq, "$talk_context", tc_prison_break),
],
"I've come to break you out of here.", "lord_prison_break_chains",[]],
[anyone,"lord_prison_break_chains", [],
"Thank the heavens you came! However, I'm not going anywhere with these chains on my legs. You'll need to get the key away from the guard somehow.", "close_window",[]],
[anyone|plyr,"lord_talk",
[
(ge, "$cheat_mode", 1),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"{!}CHEAT - Take the following action.", "lord_suggest_action_ask",[]],
[anyone,"lord_tell_objective",
[
(troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"What am I doing? What does it look like I'm doing?! I'm a prisoner here!", "lord_pretalk",[]],
[anyone,"lord_tell_objective",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_leaded_party, -1)
],
"I am not commanding any men at the moment.", "lord_pretalk",[]],
#sdsd
[anyone,"lord_tell_objective", [
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_holding_center),
(party_get_attached_to, ":cur_center_no", "$g_talk_troop_party"),
(try_begin),
(lt, ":cur_center_no", 0),
(party_get_cur_town, ":cur_center_no", "$g_talk_troop_party"),
(try_end),
(is_between, ":cur_center_no", centers_begin, centers_end),
],
"We are resting at {s1}. {s14}{s15}",
"lord_pretalk",
[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object")]],
[anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_holding_center)],
"We are travelling to {s1}. {s14}{s15}", "lord_pretalk",
[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object"),
]],
[anyone|auto_proceed,"lord_tell_objective", [
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, "$g_talk_troop"),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_visiting_village)],
"{!}Warning: This line should never display.", "lord_tell_objective_2",
[]],
#fix for translation variable changes
[anyone,"lord_tell_objective_2", [],
"I am heading to the vicinity of {s1}. {s14}{s15}", "lord_pretalk",
[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object")]],
[anyone,"lord_tell_objective", [
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_visiting_village)],
"We are recruiting new soldiers from {s1}. {s14}{s15}", "lord_pretalk",
[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object")]],
[anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_patrolling_around_center)],
"We are scouting for the enemy around {s1}. {s14}{s15}", "lord_pretalk",
[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object"),
]],
# [anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_raiding_around_center)],
# "We ride out to lay waste to village of {s1} to punish the foe for his misdeeds.", "lord_pretalk",[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
# (str_store_party_name, s1, ":ai_object")]],
[anyone,"lord_tell_objective", [
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_raiding_around_center),
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object")
],
"We are laying waste to the village of {s1}. {s14}{s15}", "lord_pretalk",[]],
[anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_retreating_to_center)],
"We are retreating to {s1}. {s14}{s15}", "lord_pretalk",[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object")]],
[anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_besieging_center)],
"We are besieging {s1}. {s14}{s15}", "lord_pretalk",[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object")]],
[anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_engaging_army),
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(party_is_active, ":ai_object"),
],
"We are fighting against {s1}. {s14}{s15}", "lord_pretalk",
[
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object")
]],
[anyone,"lord_tell_objective", [
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_screening_army)],
"I am screening {s1}'s advance. {s14}{s15}", "lord_pretalk",[
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(party_stack_get_troop_id, ":ai_object_commander", ":ai_object", 0),
(str_store_troop_name, s1, ":ai_object_commander")
]],
[anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_accompanying_army)],
"We are accompanying {s1}. {s14}{s15}", "lord_pretalk",[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object")]],
[anyone,"lord_tell_objective",
[
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, "$g_talk_troop"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
],
"I am leading the army of the realm.", "lord_talk_ask_about_strategy",[]],
[anyone,"lord_tell_objective",
[
(assign, ":pass", 0),
(try_begin),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_undefined),
(assign, ":pass", 1),
(else_try),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_engaging_army),
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(neg|party_is_active, ":ai_object"),
(assign, ":pass", 1),
(try_end),
(eq, ":pass", 1),
],
"We are reconsidering our next objective.", "lord_pretalk",[]],
[anyone,"lord_tell_objective", [],
"I don't know: {reg1} {s1} (ERROR)", "lord_pretalk",[(party_get_slot, reg1, "$g_talk_troop_party", slot_party_ai_state),
(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
(str_store_party_name, s1, ":ai_object")]],
[anyone|plyr,"lord_talk",
[
(eq, "$talk_context", tc_party_encounter),
(eq, 1, 0),
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(party_slot_eq, "$g_encountered_party", slot_party_following_player, 0),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshall, "trp_player"),
],
"Will you follow me? I have a plan.", "lord_ask_follow",[]],
[anyone,"lord_ask_follow", [(party_get_slot, ":dont_follow_until_time", "$g_encountered_party", slot_party_dont_follow_player_until_time),
(store_current_hours, ":cur_time"),
(lt, ":cur_time", ":dont_follow_until_time")],
"I enjoy your company, {playername}, but there are other things I must attend to. Perhaps in a few days I can ride with you again.", "close_window",
[(assign, "$g_leave_encounter",1)]],
[anyone,"lord_ask_follow", [(troop_get_slot, ":troop_renown", "$g_talk_troop", slot_troop_renown),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(val_mul, ":troop_renown", 3),
(val_div, ":troop_renown", 4),
(lt, ":player_renown", ":troop_renown"),
],
"That would hardly be proper, {playername}. Why don't you follow me instead?", "close_window",
[(assign, "$g_leave_encounter",1)]],
[anyone,"lord_ask_follow", [(lt, "$g_talk_troop_effective_relation", 25)],
"{s43}", "close_window",
[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_follow_refusal_default"),
(assign, "$g_leave_encounter",1)]],
#Post 0907 changes end
[anyone,"lord_ask_follow", [],
"Lead the way, {playername}! Let us bring death and defeat to all our enemies.", "close_window",
[(party_set_slot, "$g_talk_troop_party", slot_party_commander_party, "p_main_party"),
#(call_script, "script_party_decide_next_ai_state_under_command", "$g_talk_troop_party"),
(call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"), #This handles AI for both marshal and other parties
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),
(store_current_hours, ":follow_until_time"),
(store_add, ":follow_period", 30, "$g_talk_troop_relation"),
(val_div, ":follow_period", 2),
(val_add, ":follow_until_time", ":follow_period"),
(party_set_slot, "$g_encountered_party", slot_party_follow_player_until_time, ":follow_until_time"),
(party_set_slot, "$g_encountered_party", slot_party_following_player, 1),
(assign, "$g_leave_encounter",1)]],
[anyone,"lord_talk_preoffer", [], "Yes?", "lord_talk_offer",[]],
## [anyone|plyr,"lord_talk_offer", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"), #he is not a faction leader!
## (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
## (eq, reg0, 0), #he has no castles or towns
## (hero_can_join),
## ],
## "I need capable men like you. Will you join me?", "knight_offer_join",[
## ]],
[anyone|plyr,"lord_talk_offer", [(eq,1,0)],
"I wish to ransom one of your prisoners.", "knight_offer_join",[
]],
[anyone|plyr,"lord_talk_offer", [], "Never mind.", "lord_pretalk",[]],
[anyone ,"knight_offer_join", [(call_script, "script_cf_is_quest_troop", "$g_talk_troop")],
"I fear I cannot join you at the moment, {playername}, I've important business to attend to and it cannot wait.", "hero_pretalk",[]],
[anyone ,"knight_offer_join", [(lt, "$g_talk_troop_relation", 5),
(store_character_level,":player_level","trp_player"),
(store_character_level,":talk_troop_level","$g_talk_troop"),
(val_mul,":player_level",2),
(lt, ":player_level", ":talk_troop_level")],
"You forget your place, {sir/madam}. I do not take orders from the likes of you.", "hero_pretalk",[]],
[anyone ,"knight_offer_join", [
(assign, ":num_player_companions",0),
(try_for_range, ":hero_id", heroes_begin, heroes_end),
(troop_slot_eq, ":hero_id",slot_troop_occupation, slto_player_companion),
(val_add, ":num_player_companions",1),
(try_end),
(assign, reg5, ":num_player_companions"),
(store_add, reg6, reg5, 1),
(val_mul, reg6,reg6),
(val_mul, reg6, 1000),
(gt, reg6,0)], #note that we abuse the value of reg6 in the next line.
"I would be glad to fight at your side, my friend, but there is a problem...\
The thing is, I've found myself in a bit of debt that I must repay very soon. {reg6} denars altogether,\
and I am honour-bound to return every coin. Unless you've got {reg6} denars with you that you can spare,\
I've to keep my mind on getting this weight off my neck.", "knight_offer_join_2",[]],
[anyone ,"knight_offer_join", [(gt,reg6, 100000)], "Join you? I think not.", "close_window",[]],
[anyone ,"knight_offer_join", [], "Aye, my friend, I'll be happy to join you.", "knight_offer_join_2",[]],
[anyone|plyr,"knight_offer_join_2", [(gt, reg6,0),(store_troop_gold, ":gold", "trp_player"),(gt,":gold",reg6)],
"Here, take it, all {reg6} denars you need. 'Tis only money.", "knight_offer_join_accept",[(troop_remove_gold, "trp_player",reg6)]],
[anyone|plyr,"knight_offer_join_2", [(le, reg6,0)], "Then let us ride together, my friend.", "knight_offer_join_accept",[]],
[anyone|plyr,"knight_offer_join_2", [(eq, "$talk_context", tc_hero_freed)], "That's good to know. I will think on it.", "close_window",[]],
[anyone|plyr,"knight_offer_join_2", [(neq, "$talk_context", tc_hero_freed)], "That's good to know. I will think on it.", "hero_pretalk",[]],
[anyone ,"knight_offer_join_accept", [(troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1)],
"I've some trusted men in my band who could be of use to you. What do you wish to do with them?", "knight_offer_join_accept_party",[
]],
[anyone ,"knight_offer_join_accept", [], "Ah, certainly, it might be fun!", "close_window",[
(call_script, "script_recruit_troop_as_companion", "$g_talk_troop"),
(assign, "$g_leave_encounter",1)
]],
[anyone|plyr,"knight_offer_join_accept_party", [], "You may disband your men. I've no need for other troops.", "knight_join_party_disband",[]],
[anyone|plyr,"knight_offer_join_accept_party", [(troop_get_slot, ":companions_party","$g_talk_troop", slot_troop_leaded_party),
(party_can_join_party,":companions_party","p_main_party"),
], "Your men may join as well. We need every soldier we can muster.", "knight_join_party_join",[]],
[anyone|plyr,"knight_offer_join_accept_party", [(is_between,"$g_encountered_party",centers_begin, centers_end)], "Lead your men out of the town. I shall catch up with you on the road.", "knight_join_party_lead_out",[]],
[anyone|plyr,"knight_offer_join_accept_party", [(neg|is_between,"$g_encountered_party",centers_begin, centers_end)],
"Keep doing what you were doing. I'll catch up with you later.", "knight_join_party_lead_out",[]],
[anyone ,"knight_join_party_disband", [], "Ah . . . Very well, {playername}. Much as I dislike losing good men,\
the decision is yours. I'll disband my troops and join you.", "close_window",[
(call_script, "script_recruit_troop_as_companion", "$g_talk_troop"),
(troop_get_slot, ":companions_party","$g_talk_troop", slot_troop_leaded_party),
(party_detach, ":companions_party"),
(remove_party, ":companions_party"),
(assign, "$g_leave_encounter",1)
]],
[anyone ,"knight_join_party_join", [], "Excellent.\
My lads and I will ride with you.", "close_window",[
(call_script, "script_recruit_troop_as_companion", "$g_talk_troop"),
(party_remove_members, "p_main_party", "$g_talk_troop", 1),
(troop_get_slot, ":companions_party","$g_talk_troop", slot_troop_leaded_party),
(assign, "$g_move_heroes", 1),
(call_script, "script_party_add_party", "p_main_party", ":companions_party"),
(party_detach, ":companions_party"),
(remove_party, ":companions_party"),
(assign, "$g_leave_encounter",1)
]],
[anyone ,"knight_join_party_lead_out", [], "Very well then.\
I shall maintain a patrol of this area. Return if you have further orders for me.", "close_window",[
(call_script, "script_recruit_troop_as_companion", "$g_talk_troop"),
(party_remove_members, "p_main_party", "$g_talk_troop", 1),
(troop_get_slot, ":companions_party","$g_talk_troop", slot_troop_leaded_party),
(party_set_faction, ":companions_party", "fac_player_supporters_faction"),
(party_detach, ":companions_party"),
(party_set_ai_behavior, ":companions_party", ai_bhvr_patrol_location),
(party_set_flags, ":companions_party", pf_default_behavior, 0),
]],
[anyone,"lord_enter_service_reject", [
(eq, "$players_kingdom", "fac_player_supporters_faction"),
], "Indeed.... Did you offer vassalage, then, just to by time? Very well -- you shall have time to reconsider, but if you are toying with me, it will do your reputation no credit.", "close_window",
[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_give_oath_give_up", [
(eq, "$players_kingdom", "fac_player_supporters_faction"),
], "Indeed.... Did you offer vassalage, then, just to buy time? Very well -- you shall have time to reconsider, but if you are toying with me, it will do your reputation no credit.", "close_window",
[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_enter_service_reject", [], "What pigswill!\
And to think I would offer you a place among my nobles. Begone, beggar, before I lose my temper!", "close_window",
[
(try_begin),
(store_partner_quest, ":lords_quest"),
(eq, ":lords_quest", "qst_join_faction"),
(call_script, "script_abort_quest", "qst_join_faction", 1),
(try_end),
(assign, "$g_invite_faction", 0),
(assign, "$g_invite_faction_lord", 0),
(assign, "$g_invite_offered_center", 0),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_ask_enter_service", [(gt, "$players_kingdom", 0),
(neq, "$players_kingdom", "$g_talk_troop_faction"),
(faction_get_slot, ":players_lord", "$players_kingdom", slot_faction_leader),
(neq, ":players_lord", "trp_player"),
(str_store_troop_name, s5, ":players_lord"),
], "You are already oath-bound to serve {s5}, are you not?", "lord_give_oath_under_oath_already",[]],
[anyone|plyr ,"lord_give_oath_under_oath_already", [], "Indeed I am, {s65}. Forgive my rambling.", "lord_pretalk",[]],
[anyone,"lord_ask_enter_service", [(lt, "$g_talk_troop_effective_relation", -5)], "I accept oaths only from those I can trust to keep them, {playername}.", "lord_pretalk",[]],
[anyone,"lord_ask_enter_service", [
(troop_get_type, ":type", "trp_player"),
(eq, ":type", 1),
(try_for_range, ":center", centers_begin, centers_end),
(party_slot_eq, ":center", slot_town_lord, "trp_player"),
(assign, "$bypass_female_vassal_explanation", 1),
(try_end),
(eq, "$bypass_female_vassal_explanation", 0),
# (troop_get_slot, ":husband", "trp_player", slot_troop_spouse),
], "My lady, you seem to have the makings of a good war leader. For a woman to show such skill is an uncommon thing in Calradia, but not completely without precedent. Noblewomen have often taken command of armies after their husbands or fathers were slain or captured, for example.", "lord_ask_enter_service_female_2",[
(assign, "$bypass_female_vassal_explanation", 1),
]],
[anyone,"lord_ask_enter_service_female_2", [
], "However, I have never heard of a king who granted a fief to a woman, no matter how valorous, simply because he needed an extra vassal. Were I to do such a thing, I would raise eyebrows across Calradia. Men would say that I was besotted or bewitched, or that I aimed to overturn the natural order of things. As much as I regret it, I cannot afford to grant you a fief.", "lord_ask_enter_service_female_response",[]],
[anyone|plyr, "lord_ask_enter_service_female_response", [],
"What if I were to take one of your enemy's castles by force?", "lord_ask_enter_service_female_solution_capture", []],
[anyone|plyr, "lord_ask_enter_service_female_response", [
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
],
"What if I were to marry one of your lords?", "lord_ask_enter_service_female_solution_marriage", []],
[anyone|plyr, "lord_ask_enter_service_female_response", [],
"Perhaps one of your competitors will prove to be more open-minded.", "lord_ask_enter_service_female_solution_competitor", []],
[anyone|plyr, "lord_ask_enter_service_female_response", [],
"I would be willing to fight for you, even without the fief.", "lord_ask_enter_service", []],
[anyone|plyr, "lord_ask_enter_service_female_response", [],
"Never mind.", "lord_pretalk", []],
[anyone,"lord_ask_enter_service_female_solution_marriage", [
], "Well, I still would not be willing to grant you any fiefs. However, you would no doubt have the use of your husband's properties, which would allow you to act as one of my vassals in all but name. Did you have an other questions?", "lord_ask_enter_service_female_response",[]],
[anyone,"lord_ask_enter_service_female_solution_competitor", [
], "Oh, perhaps you might find someone who was truly desperate -- but then, I would think, they would not have many fiefs to bestow. Did you have an other questions?", "lord_ask_enter_service_female_response",[]],
[anyone,"lord_ask_enter_service_female_solution_capture", [
], "Well, in that case, depending on the circumstances, I might be inclined to let you keep it. Did you have an other questions?", "lord_ask_enter_service_female_response",[]],
[anyone,"lord_ask_enter_service",
[
(assign, "$g_invite_offered_center", -1),
(troop_get_slot, ":renown", "trp_player", slot_troop_renown),
(store_mul, ":vassal_potential", "$g_talk_troop_effective_relation", 5),
(val_add, ":vassal_potential", ":renown"),
(call_script, "script_get_number_of_hero_centers", "trp_player"),
(assign, ":num_centers_owned", reg0),
(store_mul, ":center_affect", ":num_centers_owned", 50),
(val_add, ":vassal_potential", ":center_affect"),
(ge, ":vassal_potential", 150),
(try_begin),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 0),
(eq, ":num_centers_owned", 0),
(call_script, "script_get_poorest_village_of_faction", "$g_talk_troop_faction"),
(gt, reg0, 0),
(assign, "$g_invite_offered_center", reg0),
(try_end),
],
"You are known as a brave {man-at-arms/warrior} and a fine leader of men, {playername}.\
I shall be pleased to accept your sword into my service and bestow vassalage upon you,\
if you are ready to swear homage to me.", "lord_give_oath_1",[]],
[anyone,"lord_ask_enter_service", [], "You've yet to show yourself as a competent commander, {playername}.\
Take your sword to my enemies and prove to me that you are worthy of becoming my vassal.\
Then we may speak more of this.", "lord_pretalk",[]],
[anyone|plyr,"lord_give_oath_1", [], "I am ready, {s65}.", "lord_give_oath_2", []],
[anyone|plyr,"lord_give_oath_1", [], "Forgive me, {s65}, I must give the matter more thought first...", "lord_give_oath_give_up", []],
[anyone,"lord_give_oath_give_up", [
(troop_get_type, ":type", "trp_player"),
(eq, ":type", 1),
], "Take whatever time you need, my lady.", "lord_pretalk", []],
[anyone,"lord_give_oath_give_up", [], "What are you playing at, {playername}? Go and make up your mind, and stop wasting my time.", "close_window", [(assign, "$g_leave_encounter",1)]],
[anyone,"lord_give_oath_2", [], "Good. Then repeat the words of the oath with me: I swear homage to you as lawful ruler of the {s41}.", "lord_give_oath_3", [
(str_store_faction_name, 41, "$g_talk_troop_faction"),
(try_begin),
(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":rebel_faction", "$g_talk_troop", slot_troop_original_faction),
(str_store_faction_name, 41, ":rebel_faction"),
(try_end),
]],
[anyone|plyr,"lord_give_oath_3", [], "I pledge homage to you as lawful ruler of the {s41}.", "lord_give_oath_4", []],
[anyone|plyr,"lord_give_oath_3", [], "Excuse me, {reg65?my lady:sir}. But I feel I need to think about this.", "lord_give_oath_give_up", []],
[anyone,"lord_give_oath_4", [], "I will remain as your loyal and devoted {man/follower} as long as my breath remains....", "lord_give_oath_5", []],
[anyone|plyr,"lord_give_oath_5", [], "I will remain as your loyal and devoted {man/follower} as long as my breath remains...", "lord_give_oath_6", []],
[anyone|plyr,"lord_give_oath_5", [], "{reg65?My lady:Sir}, may I ask for some time to think about this?", "lord_give_oath_give_up", []],
[anyone,"lord_give_oath_6", [], "...and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_7", []],
[anyone|plyr,"lord_give_oath_7", [], "...and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_8", []],
[anyone|plyr,"lord_give_oath_7", [], "{reg65?My lady:My lord}, please give me more time to think about this.", "lord_give_oath_give_up", []],
[anyone,"lord_give_oath_8", [], "Finally, I will uphold your lawful claims and those of your legitimate heirs.", "lord_give_oath_9", []],
[anyone|plyr,"lord_give_oath_9", [], "Finally, I will uphold your lawful claims and those of your legitimate heirs.", "lord_give_oath_10", []],
[anyone|plyr,"lord_give_oath_9", [], "{reg65?My lady:Sir}, I must have more time to consider this.", "lord_give_oath_give_up", []],
[anyone,"lord_give_oath_10", [], "Very well. You have given me your solemn oath, {playername}. May you uphold it always, with proper courage and devotion.", "lord_give_oath_go_on_2", []],
[anyone,"lord_give_oath_go_on_2",
[
(assign, reg1, 1),
(try_begin),
(le, "$g_invite_offered_center", 0),
(assign, reg1, 0),
(else_try),
(str_store_party_name, s1, "$g_invite_offered_center"),
(try_end),
],
"Let it be known that from this day forward, you are my sworn {man/follower} and vassal.\
I give you my protection and grant you the right to bear arms in my name, and I pledge that I shall not deprive you of your life, liberty or properties except by the lawful judgment of your peers or by the law and custom of the land.{reg1? Furthermore I give you the fief of {s1} with all its rents and revenues.:}", "lord_give_oath_go_on_3", []],
[anyone,"lord_give_oath_go_on_3",
[
],
"You have done a wise thing, {playername}. Serve me well and I promise, you will rise high.", "lord_give_conclude", []],
## [anyone,"lord_give_oath_go_on_2", [], "Then let it be know that from now on, you are my sworn {man/follower}.\
## I give you my protection and grant you the right to bear arms in my name.\
## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
# [anyone,"lord_ask_enter_service", [(lt, "$g_talk_troop_relation", 10),
# (store_character_level, ":player_level", "trp_player"),
# (lt, ":player_level", 10),
# ], "I know not much about you. Keep serving me {playername}. Prove your loyality, then I will know I can trust you and accept your oath.", "lord_pretalk",[]],
## [anyone,"lord_ask_enter_service", [], "What kind of oath are you willing to make?", "lord_oath_what_kind",[]],
##
## [anyone|plyr ,"lord_oath_what_kind", [], "I will give you my oath to serve you for two months.", "lord_oath_what_kind_2",[(assign, "$temp", 60)]],
## [anyone|plyr ,"lord_oath_what_kind", [], "I will give you my oath to serve you for three months.", "lord_oath_what_kind_2",[(assign, "$temp", 90)]],
## [anyone|plyr ,"lord_oath_what_kind", [], "I will give you my oath to serve you for six months.", "lord_oath_what_kind_2",[(assign, "$temp", 180)]],
## [anyone|plyr ,"lord_oath_what_kind", [], "I will give you my oath to serve you indefinitely.", "lord_oath_what_kind_2",[(assign, "$temp", 720)]],
## [anyone|plyr ,"lord_oath_what_kind", [], "Maybe I should give more thought to this, my lord.", "lord_oath_what_kind_cancel",[]],
## [anyone ,"lord_oath_what_kind_cancel", [], "What nonsense is this? Now go make up your mind and stop wasting my time.", "close_window",[]],
##
## [anyone, "lord_oath_what_kind_2", [], "Hmmm. Do you ask for anything in return?", "lord_oath_what_do_you_want",[]],
##
## [anyone|plyr, "lord_oath_what_do_you_want", [], "I ask for nothing but your blessing, my lord.", "lord_oath_consider",[(assign,"$temp2",0)]],
## [anyone|plyr, "lord_oath_what_do_you_want", [], "I only ask for the right to have my own banner, my lord.", "lord_oath_consider",[(assign,"$temp2",1)]],
## [anyone|plyr, "lord_oath_what_do_you_want", [], "I just ask for the right to hold one castle, my lord.", "lord_oath_consider",[(assign,"$temp2",2)]],
## [anyone|plyr, "lord_oath_what_do_you_want", [], "I ask for the right to hold two castles, my lord.", "lord_oath_consider",[(assign,"$temp2",4)]],
## [anyone|plyr, "lord_oath_what_do_you_want", [], "I ask for the right to hold three castles, my lord.", "lord_oath_consider",[(assign,"$temp2",6)]],
## [anyone|plyr ,"lord_oath_what_do_you_want", [], "Maybe I should give more thought to this, my lord.", "lord_oath_what_kind_cancel",[]],
##
## [anyone ,"lord_oath_consider", [
## (store_character_level, ":player_level", "trp_player"),
## (store_mul, ":benefit", ":player_level", 5),
## (val_add, ":benefit", "$temp"),
## (val_add, ":benefit", "$g_talk_troop_relation"),
##
## (store_mul, ":cost", "$temp2", 100),
## (lt, ":cost", ":benefit"),
## ], "That is agreeable {playername}. Give me your oath now and I will accept you as my follower and offer you my protection.", "lord_give_oath_go_on",[]],
##
## [anyone ,"lord_oath_consider", [], "Hmmm. What you ask for is not acceptible {playername}.", "close_window",[]],
##
## [anyone|plyr,"lord_give_oath_go_on", [(eq, "$temp", 60)], "I give you my oath lord, that I will remain in your service for two months.\
## During this time, I will be faithful to you,\
## I will not act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_go_on_2", []],
## [anyone|plyr,"lord_give_oath_go_on", [(eq, "$temp", 90)], "I give you my oath lord, that I will remain in your service for three months.\
## During this time, I will be faithful to you,\
## I will not act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_go_on_2", []],
## [anyone|plyr,"lord_give_oath_go_on", [(eq, "$temp", 180)], "I give you my oath lord, that I will remain in your service for six months.\
## During this time, I will be faithful to you,\
## I will not act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_go_on_2", []],
## [anyone|plyr,"lord_give_oath_go_on", [(gt, "$temp", 700)], "I give you my oath lord, that I will remain as your loyal and devoted {man/follower} as long as my breath remains.\
## I will never act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_go_on_2", []],
##
## [anyone,"lord_give_oath_go_on_2", [(eq,"$temp2",0)], "Then let it be know that from now on, you are my sworn {man/follower}.\
## I give you my protection and grant you the right to bear arms in my name.\
## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
##
## [anyone,"lord_give_oath_go_on_2", [(eq,"$temp2",1)], "Then let it be know that from now on, you are my sworn {man/follower}.\
## I give you my protection and grant you the right to hold your own banner.\
## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
##
## [anyone,"lord_give_oath_go_on_2", [(eq,"$temp2",2)], "Then let it be know that from now on, you are my sworn {man/follower} and vassal.\
## I give you my protection and grant you the right to hold a castle.\
## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
##
## [anyone,"lord_give_oath_go_on_2", [(eq,"$temp2",4)], "Then let it be know that from now on, you are my sworn {man/follower} and vassal.\
## I give you my protection and grant you the right to hold two castles.\
## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
##
## [anyone,"lord_give_oath_go_on_2", [], "Then let it be know that from now on, you are my sworn {man/follower} and vassal.\
## I give you my protection and grant you the right to hold three castles.\
## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
[anyone|plyr,"lord_give_conclude",
[
(troop_get_type, reg39, "$g_talk_troop"),
(try_begin), #activate husband as pretender
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
(str_store_string, s41, "str_very_well__you_are_now_my_liege_as_well_as_my_husband"),
(else_try), #all other situations
(str_store_string, s41, "str_i_thank_you_reg39my_ladylord"),
(try_end),
], "{s41}", "lord_give_conclude_2",
[
#Pretender changes
(assign, ":is_pretender", 0),
(try_begin),
(this_or_next|is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(assign, ":is_pretender", 1),
(assign, "$supported_pretender", "$g_talk_troop"),
(troop_get_slot, "$supported_pretender_old_faction", "$g_talk_troop", slot_troop_original_faction),
(troop_set_faction, "$g_talk_troop", "fac_player_supporters_faction"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
(assign, "$g_talk_troop_faction", "fac_player_supporters_faction"),
(quest_set_slot, "qst_rebel_against_kingdom", slot_quest_giver_troop, "$g_talk_troop"),
(quest_set_slot, "qst_rebel_against_kingdom", slot_quest_target_faction, "$supported_pretender_old_faction"),
(str_store_faction_name_link, s14, "$supported_pretender_old_faction"),
(str_store_troop_name_link, s13, "$g_talk_troop"),
(setup_quest_text,"qst_rebel_against_kingdom"),
(str_store_string, s2, "@You promised to help {s13} claim the throne of {s14}."),
(call_script, "script_start_quest", "qst_rebel_against_kingdom", "$g_talk_troop"),
(try_end),
(try_begin),
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(call_script, "script_deactivate_player_faction"),
(try_for_range, ":npc", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":npc_faction", ":npc"),
(eq, ":npc_faction", "fac_player_supporters_faction"),
(troop_slot_eq, ":npc", slot_troop_occupation, slto_kingdom_hero),
(call_script, "script_change_troop_faction", ":npc", "$g_talk_troop_faction"),
(try_end),
(try_end),
(try_begin),
(is_between, "$players_oath_renounced_against_kingdom", kingdoms_begin, kingdoms_end),
(neq, "$players_oath_renounced_against_kingdom", "$g_talk_troop_faction"),
(store_relation, ":relation", "fac_player_supporters_faction", "$players_oath_renounced_against_kingdom"),
(val_min, ":relation", -40),
(call_script, "script_set_player_relation_with_faction", "$players_oath_renounced_against_kingdom", ":relation"),
(call_script, "script_update_all_notes"),
(assign, "$g_recalculate_ais", 1),
(try_end),
(try_begin),
(is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
(neq, "$players_kingdom", "fac_player_supporters_faction"),
(neq, "$players_kingdom", "$g_talk_troop_faction"), #ie, don't leave faction if the player is already part of the same kingdom
(faction_get_slot, ":old_leader", "$players_kingdom", slot_faction_leader),
(call_script, "script_add_log_entry", logent_renounced_allegiance, "trp_player", -1, ":old_leader", "$players_kingdom"),
(try_begin),
(eq, ":is_pretender", 1),
(call_script, "script_activate_player_faction", "$g_talk_troop"),
(try_end),
(call_script, "script_player_leave_faction", 0),
(try_end),
(call_script, "script_player_join_faction", "$g_talk_troop_faction"),
(try_begin),
(gt, "$g_invite_offered_center", 0),
(call_script, "script_give_center_to_lord", "$g_invite_offered_center", "trp_player", 0),
(try_begin),
(faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_invite_offered_center"),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
(try_end),
(try_end),
(call_script, "script_add_log_entry", logent_pledged_allegiance, "trp_player", -1, "$g_talk_troop", "$g_talk_troop_faction"),
(try_begin),
(check_quest_active, "qst_join_faction"),
(eq, "$g_invite_faction_lord", "$g_talk_troop"),
(call_script, "script_end_quest", "qst_join_faction"),
(else_try),
(check_quest_active, "qst_join_faction"),
(call_script, "script_abort_quest", "qst_join_faction", 0),
(try_end),
(assign, "$player_has_homage" ,1),
(assign, "$g_player_banner_granted", 1),
(assign, "$g_invite_faction", 0),
(assign, "$g_invite_faction_lord", 0),
(assign, "$g_invite_offered_center", 0),
(assign, "$g_leave_encounter",1)]],
[anyone,"lord_give_conclude_2", [
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
], "So be it, my wife. May all my vassals be as valiant and loyal as you.", "close_window", [(assign, "$g_leave_encounter",1)]],
[anyone,"lord_give_conclude_2", [], "I have great hopes for you {playername}.\
I know you shall prove yourself worthy of the trust I have placed in you.", "close_window", [(assign, "$g_leave_encounter",1)]],
[anyone,"lord_ask_enter_service", [(str_store_faction_name,5,"$g_talk_troop_faction")], "Heh, a wise move,\
{playername}. With loyal service, a {man/woman} in my service could become wealthy and powerful,\
and our enemies... Well, our enemies are as wheat before a scythe.\
However, to enter my service you must first renounce all worldly oaths and bonds,\
and swear to serve only the {s5}.", "lord_enter_service_swear",[]],
[anyone|plyr ,"lord_enter_service_swear", [], "I do so swear, {s65}.", "lord_enter_service_swear_accepted",[]],
[anyone|plyr ,"lord_enter_service_swear", [], "I need some time to think about this.", "lord_enter_service_swear_denied",[]],
[anyone ,"lord_enter_service_swear_denied", [], "Are you having me on? I've no time for games, {playername}.\
Make up your mind and stop wasting my time.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone ,"lord_enter_service_swear_accepted", [(str_store_faction_name,5,"$g_talk_troop_faction")],
"Then it is my pleasure to welcome you to the service of my house. From this day on, {playername},\
you are a soldier of the {s5} with all the duties and privileges that come with it.", "lord_enter_service_swear_accepted_2",
[
]],
[anyone ,"lord_enter_service_swear_accepted_2", [(str_store_faction_name,5,"$g_talk_troop_faction")],
"I charge you with rooting out and destroying the forces of our enemies wherever you may find them.\
Moreover, I will have special tasks for you from time to time, as may some of my other vassal lords.\
Serve, fight, and honour your oaths. These things will take you far, if you've a mind for promotion.\
May God grant us long lives and many victories to toast in my hall!", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone,"lord_ask_leave_service", [(ge, "$g_talk_troop_relation", 1)], "Hrm.\
Has your oath become burdensome, {playername}? It is unusual to request release from homage,\
but in respect of your fine service, I will not hold you if you truly wish to end it.\
Though you would be sorely missed.", "lord_ask_leave_service_verify",[]],
[anyone,"lord_ask_leave_service", [], "Release from homage? Hmm, perhaps it would be for the best...\
However, {playername}, you must be sure that release is what you desire. This is not a thing done lightly.", "lord_ask_leave_service_verify",[]],
[anyone|plyr ,"lord_ask_leave_service_verify", [], "It is something I must do, {s65}.", "lord_ask_leave_service_2",[]],
[anyone|plyr ,"lord_ask_leave_service_verify", [], "You are right, {s65}. My place is here.", "lord_ask_leave_service_giveup",[]],
[anyone,"lord_ask_leave_service_giveup", [], "I am pleased to hear it, {playername}.\
I hope you'll banish such unworthy thoughts from your mind from now on.", "lord_pretalk",[]],
[anyone,"lord_ask_leave_service_2", [], "Then you are sure? Also, be aware that if you leave my services, you will be surrendering to me all the fiefs which you hold in my name.", "lord_ask_leave_service_verify_again",[]],
[anyone|plyr ,"lord_ask_leave_service_verify_again", [], "Yes, {s65}.", "lord_ask_leave_service_3",[]],
[anyone|plyr ,"lord_ask_leave_service_verify_again", [], "Of course not, {s65}. I am ever your loyal vassal.", "lord_ask_leave_service_giveup",[]],
[anyone,"lord_ask_leave_service_3", [], "As you wish. I hereby declare your oaths to be null and void.\
You will no longer hold land or titles in my name, and you are released from your duties to my house.\
You are free, {playername}.", "lord_ask_leave_service_end",
[
(call_script, "script_add_log_entry", logent_renounced_allegiance, "trp_player", -1, "$g_talk_troop", "$g_talk_troop_faction"),
(call_script, "script_player_leave_faction", 1), #1 means give back fiefs
]],
[anyone|plyr ,"lord_ask_leave_service_end", [], "Thank you, sir. It was an honour to serve you..", "lord_ask_leave_service_end_2",[]],
[anyone|plyr ,"lord_ask_leave_service_end", [], "My thanks. It feels good to be {a free man/free} once again.", "lord_ask_leave_service_end_2",[]],
[anyone ,"lord_ask_leave_service_end_2", [], "Farewell then, {playername}, and good luck go with you.", "close_window",
[(assign, "$g_leave_encounter", 1)]],
#Active quests
##### TODO: QUESTS COMMENT OUT BEGIN
[anyone,"lord_active_mission_1", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_lend_companion"),
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(check_quest_active,"qst_lend_companion"),
(quest_slot_eq, "qst_lend_companion", slot_quest_giver_troop, "$g_talk_troop"),
(store_current_day, ":cur_day"),
(quest_get_slot, ":quest_target_amount", "qst_lend_companion", slot_quest_target_amount),
(ge, ":cur_day", ":quest_target_amount"),
## (quest_get_slot, ":quest_target_troop", "qst_lend_companion", slot_quest_target_troop),
## (str_store_troop_name,s14,":quest_target_troop"),
## (troop_get_type, reg3, ":quest_target_troop"),
],
"Oh, you want your companion back? I see...", "lord_lend_companion_end",[]],
[anyone,"lord_active_mission_1", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_lend_companion")],
"{playername}, I must beg your patience, I still have need of your companion. Please return later when things have settled.", "lord_pretalk",[]],
#default
[anyone,"lord_active_mission_1", [], "Yes, have you made any progress on it?", "lord_active_mission_2",[]],
[anyone|plyr,"lord_active_mission_2",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(check_quest_active,"qst_capture_prisoners"),
(quest_slot_eq, "qst_capture_prisoners", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_target_amount", "qst_capture_prisoners", slot_quest_target_amount),
(quest_get_slot, ":quest_target_troop", "qst_capture_prisoners", slot_quest_target_troop),
(party_count_prisoners_of_type, ":count_prisoners", "p_main_party", ":quest_target_troop"),
(ge, ":count_prisoners", ":quest_target_amount"),
(assign, reg1, ":quest_target_amount"),
(str_store_troop_name_plural, s1, ":quest_target_troop")],
"Indeed. I brought you {reg1} {s1} as prisoners.", "lord_generic_mission_thank",
[(quest_get_slot, ":quest_target_amount", "qst_capture_prisoners", slot_quest_target_amount),
(quest_get_slot, ":quest_target_troop", "qst_capture_prisoners", slot_quest_target_troop),
(party_remove_prisoners, "p_main_party", ":quest_target_troop", ":quest_target_amount"),
(party_add_prisoners, "$g_encountered_party", ":quest_target_troop", ":quest_target_amount"),
(call_script, "script_finish_quest", "qst_capture_prisoners", 100)]],
[anyone|plyr,"lord_active_mission_2",
[
#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(store_partner_quest, ":lords_quest"),
(eq, ":lords_quest", "qst_capture_enemy_hero"),
(assign, ":has_prisoner", 0),
(quest_get_slot, ":quest_target_faction", "qst_capture_enemy_hero", slot_quest_target_faction),
(party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop", "p_main_party", ":i_stack"),
(troop_is_hero, ":stack_troop"),
(store_troop_faction, ":stack_faction", ":stack_troop"),
(eq, ":quest_target_faction", ":stack_faction"),
(troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero),
(assign, ":has_prisoner", 1),
(quest_set_slot, "qst_capture_enemy_hero", slot_quest_target_troop, ":stack_troop"),
(try_end),
(eq, ":has_prisoner", 1),
(str_store_faction_name, s13, ":quest_target_faction")
],
"Oh, indeed. I've captured a lord from {s13} for you.", "capture_enemy_hero_thank",
[]],
[anyone,"capture_enemy_hero_thank", [],
"Many thanks, my friend. He will serve very well for a bargain. You've done a fine work here. Please accept these {reg5} denars for your help.", "capture_enemy_hero_thank_2",
[(quest_get_slot, ":quest_target_troop", "qst_capture_enemy_hero", slot_quest_target_troop),
(quest_get_slot, ":quest_target_faction", "qst_capture_enemy_hero", slot_quest_target_faction),
(party_remove_prisoners, "p_main_party", ":quest_target_troop", 1),
(store_relation, ":reln", "$g_encountered_party_faction", ":quest_target_faction"),
(try_begin),
(lt, ":reln", 0),
(party_add_prisoners, "$g_encountered_party", ":quest_target_troop", 1), #Adding him to the dungeon
(else_try),
#Do not add a non-enemy lord to the dungeon (due to recent diplomatic changes or due to a neutral town/castle)
#(troop_set_slot, ":quest_target_troop", slot_troop_is_prisoner, 0),
(troop_set_slot, ":quest_target_troop", slot_troop_prisoner_of_party, -1),
(try_end),
(quest_get_slot, ":reward", "qst_capture_enemy_hero", slot_quest_gold_reward),
(assign, reg5, ":reward"),
(call_script, "script_troop_add_gold", "trp_player", ":reward"),
(add_xp_as_reward, 2500),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 4),
(call_script, "script_end_quest", "qst_capture_enemy_hero"),
]],
[anyone|plyr,"capture_enemy_hero_thank_2", [],
"Certainly, {s65}.", "lord_pretalk",[]],
[anyone|plyr,"capture_enemy_hero_thank_2", [],
"It was nothing.", "lord_pretalk",[]],
[anyone|plyr,"capture_enemy_hero_thank_2", [],
"Give me more of a challenge next time.", "lord_pretalk",[]],
##
## [anyone|plyr,"lord_active_mission_2", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_capture_messenger"),
## (quest_get_slot, ":quest_target_troop", ":lords_quest", slot_quest_target_troop),
## (quest_get_slot, ":quest_target_amount", ":lords_quest", slot_quest_target_amount),
## (store_num_parties_destroyed_by_player, ":num_destroyed", "pt_messenger_party"),
## (gt, ":num_destroyed", ":quest_target_amount"),
## (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_target_troop"),
## (ge, ":num_prisoners", 1),
## (str_store_troop_name, 3, ":quest_target_troop")],
## "Indeed sir. I have captured a {s3} my lord.", "lord_generic_mission_thank",[(quest_get_slot, ":quest_target_troop", "qst_capture_messenger", slot_quest_target_troop),
## (party_remove_prisoners, "p_main_party", ":quest_target_troop", 1),
## (party_add_prisoners, "$g_encountered_party", ":quest_target_troop", 1),#Adding him to the dungeon
## (call_script, "script_finish_quest", "qst_capture_messenger", 100)]],
##
##
[anyone|plyr,"lord_active_mission_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_raise_troops"),
(quest_get_slot, ":quest_target_troop", ":lords_quest", slot_quest_target_troop),
(quest_get_slot, ":quest_target_amount", ":lords_quest", slot_quest_target_amount),
(party_count_companions_of_type, ":num_companions", "p_main_party", ":quest_target_troop"),
(ge, ":num_companions", ":quest_target_amount"),
(assign, reg1, ":quest_target_amount"),
(str_store_troop_name_plural, s13, ":quest_target_troop")],
"Indeed. I have raised {reg1} {s13}. You can take them.", "lord_raise_troops_thank",[(quest_get_slot, ":quest_target_troop", "qst_raise_troops", slot_quest_target_troop),
(quest_get_slot, ":quest_target_amount", "qst_raise_troops", slot_quest_target_amount),
(call_script,"script_change_player_relation_with_troop","$g_talk_troop", 3),
(party_remove_members, "p_main_party", ":quest_target_troop", ":quest_target_amount"),
(call_script, "script_end_quest", "qst_raise_troops"),
(troop_get_slot, ":cur_lords_party", "$g_talk_troop", slot_troop_leaded_party),
(gt, ":cur_lords_party", 0),
(party_add_members, ":cur_lords_party", ":quest_target_troop", ":quest_target_amount"),
]],
[anyone,"lord_raise_troops_thank", [],
"These men may well turn the tide in my plans, {playername}. I am confident you've trained them well. My thanks and my compliments to you.", "lord_raise_troops_thank_2",[]],
[anyone|plyr,"lord_raise_troops_thank_2", [],
"Well, the lads are at your command now, sir. I am sure you will take good care of them.", "lord_pretalk",[]],
[anyone|plyr,"lord_active_mission_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
# (store_partner_quest,":lords_quest"),
# (eq, ":lords_quest", "qst_collect_taxes"),
(check_quest_active, "qst_collect_taxes"),
(quest_slot_eq, "qst_collect_taxes", slot_quest_giver_troop, "$g_talk_troop"),
(check_quest_succeeded, "qst_collect_taxes"),
(eq, "$qst_collect_taxes_halve_taxes", 0),
(quest_get_slot, ":quest_gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
(store_mul, ":required_gold", ":quest_gold_reward", 8),
(val_div, ":required_gold", 10),
(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", ":required_gold"),
(assign, reg19, ":quest_gold_reward"),
(quest_get_slot, ":quest_target_center", "qst_collect_taxes", slot_quest_target_center),
(str_store_party_name, s3, ":quest_target_center"),
],
"Here are all the taxes from {s3}. It comes up to {reg19} denars.", "lord_collect_taxes_success",
[]],
[anyone|plyr,"lord_active_mission_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(check_quest_active, "qst_collect_taxes"),
(quest_slot_eq, "qst_collect_taxes", slot_quest_giver_troop, "$g_talk_troop"),
# (store_partner_quest,":lords_quest"),
# (eq, ":lords_quest", "qst_collect_taxes"),
(check_quest_succeeded, "qst_collect_taxes"),
(eq, "$qst_collect_taxes_halve_taxes", 1),
(quest_get_slot, ":quest_gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
(store_mul, ":required_gold", ":quest_gold_reward", 95),
(val_div, ":required_gold", 100),
(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", ":required_gold"),
(assign, reg19, ":quest_gold_reward"),
(quest_get_slot, ":quest_target_center", "qst_collect_taxes", slot_quest_target_center),
(str_store_party_name, s3, ":quest_target_center"),
],
"Here are the taxes from {s3}. It comes up to {reg19} denars.", "lord_collect_taxes_half_success",
[]],
[anyone|plyr,"lord_active_mission_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(check_quest_active, "qst_collect_taxes"),
(quest_slot_eq, "qst_collect_taxes", slot_quest_giver_troop, "$g_talk_troop"),
# (store_partner_quest,":lords_quest"),
# (eq, ":lords_quest", "qst_collect_taxes"),
(check_quest_failed, "qst_collect_taxes"),
(quest_get_slot, ":quest_gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", ":quest_gold_reward"),
(assign, reg19, ":quest_gold_reward"),
(quest_get_slot, ":quest_target_center", "qst_collect_taxes", slot_quest_target_center),
(str_store_party_name, s3, ":quest_target_center"),
],
"Unfortunately, a revolt broke up while I was collecting the taxes.\
I could only collect {reg19} denars.", "lord_collect_taxes_fail",
[]],
[anyone,"lord_collect_taxes_success", [(quest_get_slot, ":total_revenue", "qst_collect_taxes", slot_quest_gold_reward),
(store_mul, ":owner_share", ":total_revenue", 8),
(val_div, ":owner_share", 10),
(assign, reg20, ":owner_share"),
(store_sub, reg21, ":total_revenue", ":owner_share")],
"Well done, {playername}, very well done indeed! You were truly the right {man/person} for the job.\
I promised you a fifth of the taxes, so that amounts to {reg21} denars.\
If you give me {reg20} denars, you may keep the difference.\
A good result for everyone, eh?", "lord_pretalk",
[
(troop_remove_gold, "trp_player", reg20),
(quest_set_slot, "qst_collect_taxes", slot_quest_gold_reward, 0),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
(call_script, "script_end_quest", "qst_collect_taxes"),
]],
[anyone,"lord_collect_taxes_half_success", [(quest_get_slot, ":gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
(val_mul, ":gold_reward", 95),
(val_div, ":gold_reward", 100),
(assign, reg20, ":gold_reward")],
"What?! Is this some scheme of yours, {playername}? That's less than half the taxes I'm owed!\
You have let them get away with murder as well as my money. What a farce!\
You can forget the money I promised you, I'm taking {reg20} denars from what you collected,\
and you're lucky I'm leaving you a few coins for honour's sake.", "lord_pretalk",
[(troop_remove_gold, "trp_player", reg20),
(quest_set_slot, "qst_collect_taxes", slot_quest_gold_reward, 0),
(call_script, "script_end_quest", "qst_collect_taxes"),
]],
[anyone,"lord_collect_taxes_fail", [],
"God, what a bloody mess you've gotten us into, {playername}.\
This could turn very ugly if I do not take immediate action.\
I certainly hope you're not here expecting to be paid for failure.\
Hand over my {reg19} denars, if you please, and end our business together.", "lord_pretalk",
[(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
(quest_get_slot, ":gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
(troop_remove_gold, "trp_player", ":gold_reward"),
(quest_set_slot, "qst_collect_taxes", slot_quest_gold_reward, 0),
(call_script, "script_end_quest", "qst_collect_taxes"),
]],
[anyone|plyr,"lord_active_mission_2", [ (check_quest_active, "qst_hunt_down_fugitive"),
(quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_giver_troop, "$g_talk_troop"),
(check_quest_succeeded, "qst_hunt_down_fugitive"),
(quest_get_slot, ":quest_target_center", "qst_hunt_down_fugitive", slot_quest_target_center),
(str_store_party_name, s3, ":quest_target_center"),
(quest_get_slot, ":quest_target_dna", "qst_hunt_down_fugitive", slot_quest_target_dna),
(call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
(str_store_string, s4, s50),],
"I found {s4} hiding at {s3} and gave him his punishment.", "lord_hunt_down_fugitive_success",
[]],
[anyone|plyr,"lord_active_mission_2", [
(check_quest_active, "qst_hunt_down_fugitive"),
(quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_giver_troop, "$g_talk_troop"),
(check_quest_failed, "qst_hunt_down_fugitive"),
],
"I'm afraid he got away.", "lord_hunt_down_fugitive_fail",
[]],
[anyone,"lord_hunt_down_fugitive_success", [],
"And we'll all be a lot better off without him! Thank you, {playername},\
for removing this long-festering thorn from my side. 'Tis good to know you can be trusted to handle things\
with an appropriate level of tactfulness.\
A bounty I promised, and a bounty you shall have. 300 denars and not a copper less!", "lord_hunt_down_fugitive_success_2",
[
(add_xp_as_reward, 300),
]],
[anyone|plyr,"lord_hunt_down_fugitive_success_2", [],
"Let me take the money, {s65}. Thank you.", "lord_hunt_down_fugitive_reward_accept",[]],
[anyone|plyr,"lord_hunt_down_fugitive_success_2", [],
"This is blood money. I can't accept it.", "lord_hunt_down_fugitive_reward_reject",[]],
#Post 0907 changes begin
[anyone,"lord_hunt_down_fugitive_reward_accept", [],
"Of course, {playername}. Here you are. Once again, you've my thanks for ridding me of that {s43}.", "lord_pretalk",[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
(call_script, "script_troop_add_gold", "trp_player", 300),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
(call_script, "script_end_quest", "qst_hunt_down_fugitive"),
]],
[anyone,"lord_hunt_down_fugitive_reward_reject", [],
"You are a {man/woman} for whom justice is its own reward, eh? As you wish it, {playername}, as you wish it.\
An honourable sentiment, to be true. Regardless, you've my thanks for ridding me of that {s43}.", "lord_pretalk",[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
(call_script, "script_change_player_honor", 3),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
(call_script, "script_end_quest", "qst_hunt_down_fugitive"),
]],
[anyone,"lord_hunt_down_fugitive_fail", [],
"It is a sad day when that {s43} manages to avoid the hand of justice yet again.\
I thought you would be able to do this, {playername}. Clearly I was wrong.", "lord_pretalk",
[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
(call_script, "script_end_quest", "qst_hunt_down_fugitive"),
]],
#Post 0907 changes end
##
##
## [anyone|plyr,"lord_active_mission_2", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (store_partner_quest,":lords_quest"),
## (eq,":lords_quest","qst_bring_back_deserters"),
## (quest_get_slot, ":quest_target_troop", ":lords_quest", slot_quest_target_troop),
## (quest_get_slot, ":quest_target_amount", ":lords_quest", slot_quest_target_amount),
## (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_target_troop"),
## (ge, ":num_prisoners", ":quest_target_amount"),
## (assign, reg1, ":quest_target_amount")],
## "Yes sir. I have brought {reg1} deserters as you asked me to.", "lord_generic_mission_thank",[(quest_get_slot, ":quest_target_troop", "qst_bring_back_deserters", slot_quest_target_troop),
## (quest_get_slot, ":quest_target_amount", "qst_bring_back_deserters", slot_quest_target_amount),
## (party_remove_prisoners, "p_main_party", ":quest_target_troop", ":quest_target_amount"),
## (faction_get_slot, ":faction_tier_2_troop", "$g_talk_troop_faction", slot_faction_tier_2_troop),
## (try_begin),
## (gt, ":faction_tier_2_troop", 0),
## (troop_get_slot, ":cur_lords_party", "$g_talk_troop", slot_troop_leaded_party),
## (gt, ":cur_lords_party", 0),
## (party_add_members, ":cur_lords_party", ":faction_tier_2_troop", ":quest_target_amount"),
## (try_end),
## (call_script, "script_finish_quest", "qst_bring_back_deserters", 100)]],
##
##
##### TODO: QUESTS COMMENT OUT END
[anyone|plyr,"lord_active_mission_2", [], "I am still working on it.", "lord_active_mission_3",[]],
[anyone|plyr,"lord_active_mission_2", [], "I am afraid I won't be able to do this quest.", "lord_mission_failed",[]],
[anyone,"lord_active_mission_3", [], "Good. Remember, I am counting on you.", "lord_pretalk",[]],
#Post 0907 changes begin
[anyone,"lord_mission_failed", [], "{s43}", "lord_pretalk",
[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_mission_failed_default"),
(store_partner_quest,":lords_quest"),
(call_script, "script_abort_quest", ":lords_quest", 1)]],
#Post 0907 changes end
#Claim center
## [anyone,"lord_claim_center_begin", [],
## "What do you want to do with {s4}?", "lord_claim_center_ask",[]],
##
## [anyone|plyr,"lord_claim_center_ask", [],
## "I want to claim it for myself.", "lord_claim_center_2",[]],
## [anyone|plyr,"lord_claim_center_ask", [],
## "I will leave it to you my lord. I have no interest in holding {s4}.", "lord_claim_center_leave_to_lord",[]],
## [anyone,"lord_claim_center_2", [(eq, "$g_player_permitted_castles", 0),],
## "You are an able warrior {playername} and there is no question of your bravery.\
## Alas, you are not noble born, and there are those who will be upset if I allow you to hold a castle.\
## So, it saddens me but I must decline your request.", "lord_claim_center_deny", []],
##
## [anyone|plyr,"lord_claim_center_deny", [],
## "This is not fair my lord. I shed my blood to take {s4}. Now another {man/master} will rule over it.", "lord_claim_center_deny_2", []],
## [anyone|plyr,"lord_claim_center_deny", [],
## "I understand sir. Do as you will.", "lord_claim_center_leave_to_lord", []],
## [anyone,"lord_claim_center_deny_2", [],
## "Remember that you gave me your oath {playername}. And you agreed to do as told.", "lord_claim_center_deny_3", []],
## [anyone,"lord_claim_center_deny_3", [],
## "Yes sir.", "lord_claim_center_leave_to_lord", []],
##
## [anyone,"lord_claim_center_leave_to_lord", [],
## "Very well. Then I will find a suitable master for {s4}.\
## In recognition of your bravery and service, I give you these 5000 denars.", "lord_pretalk",
## [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
## (val_sub, ":wealth", 6000),
## (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
## (call_script, "script_troop_add_gold", "trp_player", 5000),
##
## (assign, ":new_master", "$g_talk_troop"),
## (assign, ":max_wealth", 0),
##
## (try_for_range, ":hero_no", kingdom_heroes_begin, kingdom_heroes_end),
## (troop_slot_eq, ":hero_no", slot_troop_is_prisoner, 0),
## (troop_slot_eq, ":hero_no", slot_troop_occupation, slto_kingdom_hero),
## (store_troop_faction, ":hero_faction", ":hero_no"),
## (eq, ":hero_faction", "$players_kingdom"),
## (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
## (assign, ":no_of_owned_centers", reg0),
## (neg|faction_slot_eq, "$players_kingdom", slot_faction_leader, ":hero_no"),
## (lt, ":no_of_owned_centers", 2),
## (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
## (ge, ":wealth", ":max_wealth"),
## (assign, ":new_master", ":hero_no"),
## (assign, ":max_wealth", ":wealth"),
## (try_end),
##
## (call_script, "script_give_center_to_lord", "$center_to_be_claimed", ":new_master"),
## (set_spawn_radius, 1),
## (spawn_around_party, "$center_to_be_claimed", "pt_old_garrison"),
## (assign, ":new_party", reg0),
## (party_set_ai_behavior, ":new_party", ai_bhvr_attack_party),
## (party_set_ai_object, ":new_party", "p_main_party"),
## (party_set_flags, ":new_party", pf_default_behavior, 0),
## (call_script, "script_party_copy", ":new_party", "$center_to_be_claimed"),
## (party_clear, "$center_to_be_claimed"),
##
## (faction_get_slot, ":reinforcement_template_a", "$g_talk_troop_faction", slot_faction_reinforcements_a),
## (faction_get_slot, ":reinforcement_template_b", "$g_talk_troop_faction", slot_faction_reinforcements_b),
## (party_add_template, "$center_to_be_claimed", ":reinforcement_template_a"),
## (party_add_template, "$center_to_be_claimed", ":reinforcement_template_b"),
## ]],
##
##
## [anyone,"lord_claim_center_2", [(assign, ":number_of_claimed_centers", 0),
## (try_for_range, ":center_no", centers_begin, centers_end),
## (party_slot_eq, ":center_no", slot_party_type, spt_castle),
## (store_faction_of_party, ":faction_no", ":center_no"),
## (eq, ":faction_no", "fac_player_supporters_faction"),
## (party_slot_eq, ":center_no", slot_town_claimed_by_player, 1),
## (val_add, ":number_of_claimed_centers", 1),
## (try_end),
## (lt, ":number_of_claimed_centers", "$g_player_permitted_castles"),
## (assign, reg7, ":number_of_claimed_centers"),
## ],
## "I had promised you to defend your right to hold {reg7?a:another} castle {playername}. Now I honor that promise.\
## I can think of {no man finer than you/no one better than you} to be the {lord/lady} of {s4}.\
## Renew your oath to me now. Then I will be your liege,\
## and I'll support you and protect you against all those who oppose your claim.",
## "lord_claim_center_give_oath",[]],
##
##
## [anyone|plyr,"lord_claim_center_give_oath", [], "I give you my oath lord, I will forever be faithful to you,\
## I will never act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_claim_center_direct_3", []],
## [anyone,"lord_claim_center_direct_3", [], "You have given your oath of fealty {playername}. I accept your oath and give you the fief of {s4}.\
## Rule it wisely and protect it against our enemies.", "lord_claim_center_direct_4", [
## (party_set_slot, "$center_to_be_claimed", slot_town_claimed_by_player, 1),
## (call_script, "script_give_center_to_lord", "$center_to_be_claimed", "trp_player")]],
## [anyone|plyr,"lord_claim_center_direct_4", [], "I thank you lord.", "close_window", [(assign, "$g_leave_encounter",1)]],
#Ask for favor
## [anyone,"lord_ask_for_favor_ask", [],
## "What is it? I don't have time for personal requests.", "lord_ask_for_favor",[]],
## [anyone,"lord_ask_for_favor_ask", [],
## "Say it then. If it's something possible...", "lord_ask_for_favor",[]],
##
## [anyone|plyr,"lord_ask_for_favor", [],
## "Nothing my lord. It's not important.", "lord_pretalk",[]],
#Suggest action
[anyone,"lord_suggest_action_ask", [],
"{!}What do you suggest?", "lord_suggest_action",[]],
## [anyone|plyr,"lord_suggest_action",
## [(troop_get_type, ":is_female", "trp_player"),
## (eq, ":is_female", 1),
## (lt, "$talk_context", tc_siege_commander),
## ],
## "{!}CHEAT: I want to marry you! (1)", "lord_groom_vows",[]],
[anyone|plyr,"lord_suggest_action", [],
"{!}CHEAT: I want to join your faction.", "lord_suggest_join_faction",[]],
[anyone,"lord_suggest_join_faction", [],
"{!}Alright then.", "lord_give_oath_5",[]],
[anyone|plyr,"lord_suggest_action", [],
"{!}CHEAT: I want to know your leaded party ID.", "lord_suggest_learn_party_id",[]],
[anyone,"lord_suggest_learn_party_id", [
(assign, reg1, "$g_encountered_party"),
(troop_get_slot, reg0, "$g_talk_troop", slot_troop_leaded_party)],
"{!}It is {reg0}. Encountered party is {reg1}", "lord_pretalk",[]],
[anyone|plyr,"lord_suggest_action", [],
"{!}CHEAT: I want to know your AI initiative.", "lord_suggest_learn_ai_initiative",[]],
[anyone,"lord_suggest_learn_ai_initiative", [(party_get_ai_initiative, reg0, "$g_encountered_party")],
"{!}It is {reg0}.", "lord_pretalk",[]],
[anyone|plyr,"lord_suggest_action", [(eq, "$players_kingdom", "$g_talk_troop_faction"),],
"{!}CHEAT: I want to be your kingdom's marshall.", "lord_suggest_become_marshall",[]],
[anyone,"lord_suggest_become_marshall", [],
"{!}Alright then.", "lord_pretalk",
[
(faction_get_slot, ":old_marshall", "$g_talk_troop_faction", slot_faction_marshall),
(try_begin),
(ge, ":old_marshall", 0),
(troop_get_slot, ":old_marshall_party", ":old_marshall", slot_troop_leaded_party),
(party_is_active, ":old_marshall_party"),
(party_set_marshall, ":old_marshall_party", 0),
(try_end),
(faction_set_slot, "$g_talk_troop_faction", slot_faction_marshall, "trp_player"),
(faction_set_slot, "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
(assign, "$g_recalculate_ais", 1),
]],
[anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
"{!}CHEAT: Let us attack an enemy town or castle.", "lord_suggest_attack_enemy_castle",[]],
[anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
"{!}CHEAT: Let us return back to a friendly town.", "lord_suggest_go_to_friendly_town",[]],
[anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
"{!}CHEAT: Let us attack an enemy war party.", "lord_suggest_attack_enemy_party",[]],
[anyone|plyr,"lord_suggest_action", [(eq, "$talk_context", tc_siege_commander)],
"{!}CHEAT: Let us lift this siege.", "lord_suggest_lift_siege",[]],
[anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
"{!}CHEAT: Follow me.", "lord_suggest_follow_me",[]],
[anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
"{!}CHEAT: Follow someone.", "lord_suggest_follow_other",[]],
[anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
"{!}CHEAT: Raid a village.", "lord_suggest_raid_village",[]],
[anyone|plyr,"lord_suggest_action", [],
"{!}CHEAT: Like me.", "lord_pretalk",[(call_script,"script_change_player_relation_with_troop","$g_talk_troop",20)]],
[anyone,"lord_suggest_lift_siege", [],
"{!}As you wish, {playername}.", "close_window",[(call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_undefined),
(party_leave_cur_battle, "$g_talk_troop_party"),
(assign, "$g_leave_encounter", 1)]],
[anyone,"lord_suggest_go_to_friendly_town", [],
"{!}Hmm. Which town or castle do you suggest we go to?", "lord_suggest_go_to_friendly_town2",[]],
[anyone|plyr|repeat_for_parties,"lord_suggest_go_to_friendly_town2", [
(store_repeat_object, ":center_no"),
(this_or_next|party_slot_eq,":center_no",slot_party_type, spt_castle),
(party_slot_eq,":center_no",slot_party_type, spt_town),
(neq, ":center_no", "$g_encountered_party"),
(store_faction_of_party, ":town_faction", ":center_no"),
(eq, ":town_faction", "$g_talk_troop_faction"),
(str_store_party_name, s1, ":center_no")],
"{!}CHEAT: {s1}", "lord_suggest_go_to_friendly_town3",[(store_repeat_object, "$town_suggested_to_go_to")]],
[anyone|plyr,"lord_suggest_go_to_friendly_town2", [],
"{!}CHEAT: Never mind.", "lord_pretalk",[]],
[anyone,"lord_suggest_go_to_friendly_town3", [(str_store_party_name, 1, "$town_suggested_to_go_to")],
"{!}Very well, we go to {s1}.", "lord_pretalk",
[
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_holding_center, "$town_suggested_to_go_to"),
]],
[anyone,"lord_suggest_attack_enemy_party", [],
"{!}Hmm. Which party do you suggest we attack?", "lord_suggest_attack_enemy_party2",[]],
[anyone|plyr|repeat_for_parties,"lord_suggest_attack_enemy_party2", [
(store_repeat_object, ":party_no"),
(party_slot_eq,":party_no",slot_party_type, spt_kingdom_hero_party),
(party_is_active, ":party_no"),
(store_faction_of_party, ":party_faction", ":party_no"),
(store_relation, ":party_relation", ":party_faction", "$g_talk_troop_faction"),
(le, ":party_relation", -10),
(call_script, "script_get_closest_walled_center", ":party_no"),
(assign, ":center_no", reg0),
(str_store_party_name, s3, ":center_no"),
(str_store_faction_name, s2, ":party_faction"),
(str_store_party_name, s1, ":party_no")],
"{!}CHEAT: {s1} of {s2} around {s3}", "lord_suggest_attack_enemy_party3",[(store_repeat_object, "$suggested_to_attack_party")]],
[anyone|plyr,"lord_suggest_attack_enemy_party2", [],
"{!}CHEAT: Never mind.", "lord_pretalk",[]],
[anyone,"lord_suggest_attack_enemy_party3", [(str_store_party_name, 1, "$suggested_to_attack_party")],
"{!}As you wish, we will attack {s1}.", "lord_pretalk",
[
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_engaging_army, "$suggested_to_attack_party"),
]],
## [anyone,"lord_suggest_attack_enemy_castle", [(troop_get_slot, ":player_favor", "$g_talk_troop", slot_troop_player_favor),
## (lt, ":player_favor", 20)],
## "Hmm. No, I don't think that's a good idea.", "lord_pretalk",[]],
[anyone,"lord_suggest_attack_enemy_castle", [],
"{!}Hmm. Which one do you suggest we attack?", "lord_suggets_attack_enemy_castle2",[]],
[anyone|plyr|repeat_for_parties,"lord_suggets_attack_enemy_castle2", [
(store_repeat_object, ":center_no"),
(this_or_next|party_slot_eq,":center_no",slot_party_type, spt_castle),
(party_slot_eq,":center_no",slot_party_type, spt_town),
(store_faction_of_party, ":town_faction", ":center_no"),
(store_relation, ":town_relation", ":town_faction", "$g_talk_troop_faction"),
(le, ":town_relation", -10),
(str_store_faction_name, s2, ":town_faction"),
(str_store_party_name, s1, ":center_no")],
"{!}CHEAT: {s1} of {s2}", "lord_suggets_attack_enemy_castle3",[(store_repeat_object, "$suggested_to_attack_center")]],
[anyone|plyr,"lord_suggets_attack_enemy_castle2", [],
"{!}CHEAT: Never mind my lord.", "lord_pretalk",[]],
[anyone,"lord_suggets_attack_enemy_castle3", [(str_store_party_name, 1, "$suggested_to_attack_center")],
"That should be possible. Very well, we'll attack {s1}.", "lord_pretalk",
[
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_besieging_center, "$suggested_to_attack_center"),
]],
[anyone,"lord_suggest_raid_village", [],
"{!}Hmm. Which village do you suggest we attack?", "lord_suggest_raid_village_2",[]],
[anyone|plyr|repeat_for_parties,"lord_suggest_raid_village_2", [
(store_repeat_object, ":center_no"),
(party_slot_eq,":center_no",slot_party_type, spt_village),
(store_faction_of_party, ":town_faction", ":center_no"),
(store_relation, ":town_relation", ":town_faction", "$g_talk_troop_faction"),
(le, ":town_relation", -10),
(str_store_faction_name, s2, ":town_faction"),
(str_store_party_name, s1, ":center_no")],
"{!}CHEAT: {s1} of {s2}", "lord_suggest_raid_village_3",[(store_repeat_object, "$suggested_to_attack_center")]],
[anyone|plyr,"lord_suggest_raid_village_2", [],
"{!}CHEAT: Never mind.", "lord_pretalk",[]],
[anyone,"lord_suggest_raid_village_3", [(str_store_party_name, s1, "$suggested_to_attack_center")],
"{!}That should be possible. Very well, we'll attack {s1}.", "lord_pretalk",
[
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_raiding_around_center, "$suggested_to_attack_center"),
]],
[anyone,"lord_suggest_follow_me", [],
"{!}Aye, I'll follow you.", "lord_pretalk",
[
(party_set_slot, "$g_talk_troop_party", slot_party_commander_party, "p_main_party"),
#(call_script, "script_party_decide_next_ai_state_under_command", "$g_talk_troop_party")
(call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),
]],
[anyone,"lord_suggest_follow_other", [],
"{!}Who do you want me to follow?", "lord_suggest_follow_other_2",[]],
[anyone|plyr|repeat_for_parties,"lord_suggest_follow_other_2", [
(store_repeat_object, ":party_no"),
(party_slot_eq,":party_no",slot_party_type, spt_kingdom_hero_party),
(neq, ":party_no", "$g_talk_troop"),
(store_faction_of_party, ":party_faction", ":party_no"),
(eq, ":party_faction", "$g_talk_troop_faction"),
(str_store_party_name, s1, ":party_no")],
"{!}CHEAT: {s1}", "lord_suggest_follow_other_3",[(store_repeat_object, "$town_suggested_to_go_to")]],
[anyone|plyr,"lord_suggest_follow_other_2", [],
"{!}CHEAT: Never mind.", "lord_pretalk",[]],
[anyone,"lord_suggest_follow_other_3", [(str_store_party_name, 1, "$town_suggested_to_go_to")],
"{!}As you wish, I shall be accompanying {s1}.", "lord_pretalk",
[
(party_set_slot, "$g_talk_troop_party", slot_party_commander_party, "$town_suggested_to_go_to"),
#(call_script, "script_party_decide_next_ai_state_under_command", "$g_talk_troop_party"),
(call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
(call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),
]],
[anyone|plyr,"lord_suggest_action", [],
"{!}CHEAT: Nothing, {s65}. It's not important.", "lord_pretalk",[]],
##### TODO: QUESTS COMMENT OUT BEGIN
#Request Mission
[anyone|auto_proceed,"lord_request_mission_ask",
[(eq, "$players_kingdom", 0),
(ge, "$g_talk_troop_faction_relation", 0),
(ge, "$g_talk_troop_relation", 0),
(troop_slot_ge, "trp_player", slot_troop_renown, 30),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
(faction_get_slot, ":last_offer_time", "$g_talk_troop_faction", slot_faction_last_mercenary_offer_time),
(assign, ":num_enemies", 0),
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_state, sfs_active),
(store_relation, ":reln", "$g_talk_troop_faction", ":faction_no"),
(lt, ":reln", 0),
(val_add, ":num_enemies", 1),
(try_end),
(ge, ":num_enemies", 1),
(store_current_hours, ":cur_hours"),
(store_add, ":week_past_last_offer_time", ":last_offer_time", 7 * 24),
(val_add, ":last_offer_time", 24),
(ge, ":cur_hours", ":last_offer_time"),
(store_random_in_range, ":rand", 0, 100),
(this_or_next|lt, ":rand", 20),
(ge, ":cur_hours", ":week_past_last_offer_time"),
(troop_get_type, ":type", "trp_player"),
(this_or_next|eq, ":type", 0),
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
],
"{!}Warning: This line should never display.", "lord_propose_mercenary",[(store_current_hours, ":cur_hours"),
(faction_set_slot, "$g_talk_troop_faction", slot_faction_last_mercenary_offer_time, ":cur_hours")]],
[anyone,"lord_propose_mercenary", [(call_script, "script_party_calculate_strength", "p_main_party", 0),
(assign, ":offer_value", reg0),
(val_add, ":offer_value", 100),
(call_script, "script_round_value", ":offer_value"),
(assign, ":offer_value", reg0),
(assign, "$temp", ":offer_value"),
(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
(neq, ":faction_leader", "$g_talk_troop"),
(str_store_faction_name, s9, "$g_talk_troop_faction"),
(str_store_troop_name, s10, ":faction_leader"),
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 3), #disabled
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
(str_store_string, s11, "str_now_some_might_say_that_women_have_no_business_leading_mercenary_companies_but_i_suspect_that_you_would_prove_them_wrong_what_do_you_say"),
(else_try),
(str_store_string, s11, "@What do you say to entering the service of {s9} as a mercenary captain?\
I have no doubt that you would be up to the task."),
(try_end)
],
"As it happens, {playername}, I promised {s10} that I would hire a company of mercenaries for an upcoming campaign.\
","lord_mercenary_service", []],
[anyone|plyr,"lord_mercenary_service", [], "I'm not interested, thank you.", "lord_mercenary_service_reject", []],
[anyone|plyr,"lord_mercenary_service", [], "Aye, I'll join {s9}.", "lord_mercenary_service_accept", []],
[anyone|plyr,"lord_mercenary_service", [], "I'm interested. Please tell me more.", "lord_mercenary_elaborate_pay", []],
[anyone,"lord_mercenary_service_accept", [(str_store_faction_name, s9, "$g_talk_troop_faction")],
"Perfect. Of course you shall have to make a formal declaration of allegiance,\
and give your oath that you and your company will remain in service to {s9}\
for a period of no less than one month.", "lord_mercenary_service_verify", []],
[anyone|plyr,"lord_mercenary_service_verify", [], "As you wish. Your enemies are my enemies.", "lord_mercenary_service_verify_2", []],
[anyone|plyr,"lord_mercenary_service_verify", [], "On second thought, forget it.", "lord_mercenary_service_reject", []],
[anyone,"lord_mercenary_service_verify_2", [], "That will do. You've made a wise choice, my friend.\
{s9} does well by its loyal fighters, you will receive many rewards for your service.", "lord_mercenary_service_accept_3", [
(call_script, "script_troop_add_gold", "trp_player", "$temp"),
(store_current_day, ":cur_day"),
(store_add, "$mercenary_service_next_renew_day", ":cur_day", 30),
(call_script, "script_player_join_faction", "$g_talk_troop_faction"),
(str_store_faction_name, s9, "$g_talk_troop_faction"),]],
[anyone,"lord_mercenary_service_accept_3", [], "Now, I suggest you prepare for a serious campaign.\
Train and equip your soldiers as best you can in the meantime, and respond quickly when you are summoned for duty.", "lord_pretalk", []],
[anyone,"lord_mercenary_service_reject", [(str_store_faction_name, s9, "$g_talk_troop_faction")],
"I'm very sorry to hear that. You'll find no better place than {s9}, be sure of that.", "lord_pretalk", []],
[anyone,"lord_mercenary_elaborate_pay", [(assign, reg12, "$temp")],
"I can offer you a contract for one month. At the end of this period, it can be extended on a monthly basis.\
An initial sum of {reg12} denars will be paid to you to seal the contract.\
After that, you'll receive wages from {s10} each week, according to the number and quality of the soldiers in your company.\
You still have your rights to battlefield loot and salvage, as well as any prisoners you capture.\
War can be very profitable at times...", "lord_mercenary_elaborate_1",
[(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
(str_store_troop_name, s10, ":faction_leader")]],
[anyone,"lord_mercenary_service_elaborate_duty", [],
"Duties... There are only a few, none of them difficult. The very first thing is to declare your allegiance.\
An oath of loyalty to our cause. Once that's done, you shall be required to fulfill certain responsibilities.\
You'll participate in military campaigns, fulfill any duties given to you by your commanders,\
and most of all you shall attack the enemies of our kingdom wherever you might find them.", "lord_mercenary_elaborate_1",
[(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
(str_store_troop_name, s10, ":faction_leader")]],
[anyone|plyr,"lord_mercenary_elaborate_1", [], "And what about my duties as a mercenary?", "lord_mercenary_service_elaborate_duty", []],
[anyone|plyr,"lord_mercenary_elaborate_1", [], "Can I hold on to any castles I take?", "lord_mercenary_elaborate_castle", []],
[anyone|plyr,"lord_mercenary_elaborate_1",
[
(neg|troop_slot_ge, "trp_player", slot_troop_banner_scene_prop, 1),
#custom_banner begin
## (eq, "trp_player", slot_troop_custom_banner_flag_type, -1),
#custom_banner end
], "Can I fly my own banner?", "lord_mercenary_elaborate_banner", []],
[anyone|plyr,"lord_mercenary_elaborate_1", [], "How much will you pay me for my service?", "lord_mercenary_elaborate_pay", []],
[anyone|plyr,"lord_mercenary_elaborate_1", [], "Sounds good. I wish to enter your service as a mercenary.", "lord_mercenary_service_accept", []],
[anyone|plyr,"lord_mercenary_elaborate_1", [], "Apologies, my sword is not for hire.", "lord_mercenary_service_reject", []],
[anyone,"lord_mercenary_elaborate_castle", [(troop_get_type, ":type", "trp_player"),(eq, ":type", 1),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop")
],
"Only my loyal vassals can own lands and castles in my realm -- and all my vassals are men.\I am not inclined to depart from this tradition without a very good reason. If you prove yourself in battle, you can swear an oath of homage to me and become my vassal.\We may then discuss how you may obtain a castle.",
"lord_mercenary_elaborate_1", []],
[anyone,"lord_mercenary_elaborate_castle", [(troop_get_type, ":type", "trp_player"),(eq, ":type", 1),
],
"Hmm... Only loyal vassals of {s10} can own lands and castles. While kings will sometimes accept vassalage from men who prove themselves in battle, and grant them land, I have never heard of a king who gave fiefs to women. You had best discuss that issue with {s10} himself.",
"lord_mercenary_elaborate_1", []],
[anyone,"lord_mercenary_elaborate_castle", [(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop")],
"Only my loyal vassals can own lands and castles in my realm.\
A mercenary can not be trusted with such a responsibility.\
However, after serving for some time, you can swear homage to me and become my vassal.\
Then you will be rewarded with a fief.", "lord_mercenary_elaborate_1", []],
[anyone,"lord_mercenary_elaborate_castle", [], "Only loyal vassals of {s10} can own lands and castles.\
You understand, a simple mercenary cannot be trusted with such responsibility.\
However, after serving for some time, you may earn the right to swear homage to {s10} and become his vassal.\
Then you would be rewarded with a fief.", "lord_mercenary_elaborate_1", []],
[anyone,"lord_mercenary_elaborate_banner", [(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop")],
"Only my noble vassals have the honour of carrying their own banners.\
However, after some time in mercenary service, you may earn the opportunity to swear homage to me and become my vassal,\
gaining the right to choose a banner of your own and fight under it in battle.", "lord_mercenary_elaborate_1", []],
[anyone,"lord_mercenary_elaborate_banner", [], "Only noble vassals of {s10} have the honour of carrying their own banners.\
However, after some time of mercenary service, perhaps you can earn the opportunity to swear homage to {s10} and become his vassal,\
gaining the right to choose a banner of your own and fight under it in battle.", "lord_mercenary_elaborate_1", []],
[anyone,"lord_request_mission_ask", [(store_partner_quest,":lords_quest"),(ge,":lords_quest",0)],
"You still haven't finished the last job I gave you, {playername}. You should be working on that, not asking me for other things to do.", "lord_pretalk",[]],
[anyone,"lord_request_mission_ask", [(troop_slot_eq, "$g_talk_troop", slot_troop_does_not_give_quest, 1)],
"I don't have any other jobs for you right now.", "lord_pretalk",[]],
[anyone|auto_proceed,"lord_request_mission_ask", [], "A task?", "lord_tell_mission",
[
(call_script, "script_get_quest", "$g_talk_troop"),
(assign, "$random_quest_no", reg0),
]],
#check with armagan on this
[anyone,"lord_request_mission_ask", [
(this_or_next|troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
(troop_slot_eq, "trp_player", slot_troop_betrothed, "$g_talk_troop"),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 1),
],
"My lady, by the traditions of courtship, I should be offering my services to you. Unfortunately, I have little time right now, so I beg you to take this declaration of my esteem in its place.", "lord_pretalk",[]],
[anyone,"lord_tell_mission", [
(eq, "$player_has_homage" ,1),
(neq, "$random_quest_no", "qst_rescue_prisoner"),
(neq, "$random_quest_no", "qst_destroy_bandit_lair"),
(neq, "$random_quest_no", "qst_raise_troops"),
(neq, "$random_quest_no", "qst_escort_lady"),
(neq, "$random_quest_no", "qst_lend_companion"),
(neq, "$random_quest_no", "qst_capture_enemy_hero"),
(neq, "$random_quest_no", "qst_cause_provocation"),
],
"There are some minor errands which I need completed, but it would be more appropriate to give them to one of my own men, not to a sworn vassal of the realm.", "lord_tell_mission_sworn_vassal",[]],
[anyone,"lord_tell_mission_sworn_vassal", [
(this_or_next|party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_besieging_center),
(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_raiding_around_center),
(party_get_slot, ":cur_object", "$g_talk_troop_party", slot_party_ai_object),
(is_between, ":cur_object", centers_begin, centers_end),
(str_store_party_name, s4, ":cur_object"),
],
"If you are looking for action against our foes, you may join our attack on {s4}. The enemy may come in force to oppose us, so it is good to have as many men as possible.", "lord_pretalk",[]],
[anyone,"lord_tell_mission_sworn_vassal", [
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(party_get_slot, ":cur_object", "$g_talk_troop_party", slot_party_ai_object),
(is_between, ":cur_object", centers_begin, centers_end),
(party_get_slot, ":last_spotted_enemy", ":cur_object", slot_center_last_spotted_enemy),
(party_is_active, ":last_spotted_enemy"),
(store_faction_of_party, ":last_spotted_enemy_faction", ":last_spotted_enemy"),
(store_relation, ":relation",":last_spotted_enemy_faction", "$g_talk_troop_faction"),
(lt, ":relation", 0),
(is_between, ":last_spotted_enemy_faction", kingdoms_begin, kingdoms_end),
(str_store_party_name, s4, ":cur_object"),
(str_store_faction_name, s5, ":last_spotted_enemy_faction"),
],
"If you are looking for action against our foes, you may try venturing out to {s4}. We have received word that a force of the {s5} is in the area, and I am going there myself. I cannot guarantee you that our enemies will be there when you arrive, of course.", "lord_pretalk",[]],
[anyone,"lord_tell_mission_sworn_vassal", [
(eq, "$g_talk_troop_faction", "$players_kingdom"),
(assign, ":alarmed_center_found", -1),
(assign, ":score_to_beat", 9999),
(try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "$g_talk_troop_faction"),
(party_get_slot, ":last_spotted_enemy", ":center_no", slot_center_last_spotted_enemy),
(party_is_active, ":last_spotted_enemy"),
(store_faction_of_party, ":last_spotted_enemy_faction", ":last_spotted_enemy"),
(is_between, ":last_spotted_enemy_faction", kingdoms_begin, kingdoms_end),
(store_relation, ":relation", ":last_spotted_enemy_faction", "$g_talk_troop_faction"),
(lt, ":relation", 0),
(store_distance_to_party_from_party, ":distance", ":center_no", "p_main_party"),
(lt, ":distance", ":score_to_beat"),
(assign, ":alarmed_center_found", ":center_no"),
(assign, ":score_to_beat", ":distance"),
(str_store_faction_name, s5, ":last_spotted_enemy_faction"),
(try_end),
(is_between, ":alarmed_center_found", centers_begin, centers_end),
(str_store_party_name, s4, ":alarmed_center_found"),
],
"If you are looking for action against our foes, you may try venturing out to {s4}. We have received word that a force of the {s5} is in the area. I am not currently headed that way, but others may be. I cannot guarantee you that our enemies will be there when you arrive, of course.", "lord_pretalk",[]],
[anyone,"lord_tell_mission_sworn_vassal", [ ],
"If a worthy task presents itself, however, I may have a favor to ask of you at a later date.", "lord_pretalk",[]],
[anyone,"lord_tell_mission", [
(eq,"$random_quest_no", "qst_destroy_bandit_lair"),
(quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
(party_stack_get_troop_id, ":bandit_type", ":bandit_lair", 0),
(str_store_troop_name_plural, s4, ":bandit_type"),
], "Yes -- there is something you can do for us. We have heard reports that a group of {s4} have established a hideout in this area, and have been attacking travellers. If you could find their lair and destroy it, we would be very grateful.", "destroy_lair_quest_brief", #s48 is bandits, s42 is the road information
[]],
[anyone,"lord_tell_mission",
[(eq,"$random_quest_no","qst_rescue_prisoner")],
"My {s11}, {s13}, has been taken prisoner by {s14} of the {s15}. Normally, honorable nobles will grant prisoners of gentle blood the privilege of parole, and treat them as honored guests so long as they give their word that they will not attempt to escape, until such time as a ransom can be paid. But {s14}, instead of granting {s13} parole, has consigned my {s11} to his dungeons -- no doubt in the hope that he can demand more from us.", "lord_mission_rescue_prisoner",
[
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(troop_get_slot, ":quest_target_center", ":quest_target_troop", slot_troop_prisoner_of_party),
(call_script, "script_troop_get_family_relation_to_troop", ":quest_target_troop", "$g_talk_troop"),
(str_store_troop_name_link, s9, "$g_talk_troop"),
(str_store_troop_name_link, s13, ":quest_target_troop"),
(str_store_party_name_link, s24, ":quest_target_center"),
(party_get_slot, ":captor", ":quest_target_center", slot_town_lord),
(str_store_troop_name, s14, ":captor"),
(store_faction_of_party, ":target_faction", ":quest_target_center"),
(str_store_faction_name, s15, ":target_faction"),
(setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
(str_store_string, s2, "str_s9_asked_you_to_rescue_s13_who_is_prisoner_at_s24"),
]],
[anyone,"lord_mission_rescue_prisoner", [],
"We need you to get my {s11} out of prison. You may be able to pay a ransom -- in which case we could cover your expenses, up to 5000 denars. If you have connections within {s24}, you may be able to use them to sneak him out. Or, you may try a more direct approach -- walk up to the gaoler, take the keys by force, and then fight your way out. Can you do this for us?", "lord_mission_rescue_prisoner_confirm",
[
]],
[anyone|plyr,"lord_mission_rescue_prisoner_confirm", [],
"I can try.", "lord_mission_rescue_prisoner_accepted",[]],
[anyone|plyr,"lord_mission_rescue_prisoner_confirm", [], "I don't think that I can help you.", "lord_mission_rescue_prisoner_rejected",[]],
[anyone,"lord_mission_rescue_prisoner_rejected", [], "It would not have been an easy task. Perhaps we will find another way.", "close_window",[
(assign, "$g_leave_encounter",1),
]],
[anyone,"lord_mission_rescue_prisoner_accepted", [], "We are most grateful. Could I ask you how you were planning to proceed?", "lord_mission_rescue_prisoner_method",
[(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
]],
[anyone,"lord_mission_rescue_other_ideas", [], "Did you have any other ideas which you wished to discuss?", "lord_mission_rescue_prisoner_method",
[]],
[anyone|plyr,"lord_mission_rescue_prisoner_method", [
(eq, 1, 0),
],
"I am thinking of paying the ransom.", "lord_mission_rescue_prisoner_method_ransom",[]],
[anyone|plyr,"lord_mission_rescue_prisoner_method", [
(eq, 1, 0),
],
"I am thinking of using my connections in {s24}.", "lord_mission_rescue_prisoner_method_connections",[]],
[anyone|plyr,"lord_mission_rescue_prisoner_method", [],
"I am thinking of breaking into the prison in {s24}, finding {s13}, and fighting my way out.", "lord_mission_rescue_prisoner_method_prisonbreak",[]],
[anyone|plyr,"lord_mission_rescue_prisoner_method", [],
"I am thinking of taking {s24} by storm.", "lord_mission_rescue_prisoner_method_siege",[]],
[anyone|plyr,"lord_mission_rescue_prisoner_method", [],
"I have done enough planning. Time to act!", "lord_mission_rescue_prisoner_planning_end",[]],
[anyone,"lord_mission_rescue_prisoner_planning_end", [],
"May the heavens protect you.", "close_window",[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"lord_mission_rescue_prisoner_method_ransom", [],
"{!}[Ransom option not yet implemented]", "lord_mission_rescue_other_ideas",[]],
[anyone,"lord_mission_rescue_prisoner_method_prisonbreak", [],
"I had discussed this idea with some of my men. One could enter {s24}, either in disguise or openly, then walk up to the prison guard and try to take the keys by force. However, getting out may be difficult. The garrison may be slow to react, but even so, you are likely to find yourself fighting a half dozen or more of the enemy at once, with limited space in which to maneuver. If you can fight your way past them, though, you can probably get out.", "lord_mission_rescue_prisoner_method_prisonbreak_2",[]],
[anyone,"lord_mission_rescue_prisoner_method_prisonbreak_2", [],
"You may find it useful to create a distraction, to divert the attention of some of the garrison. If you have any connections in the villages near {s24}, this may be a time to put them to use.", "lord_mission_rescue_other_ideas",[]],
[anyone,"lord_mission_rescue_prisoner_method_siege", [],
"Well, that is certainly the most direct approach.", "lord_mission_rescue_other_ideas",[]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_deliver_message")],
"I need to send a letter to {s13} who should be currently at {s4}.\
If you will be heading towards there, would you deliver it to him?\
The letter needs to be in his hands in 30 days.", "lord_mission_deliver_message",
[
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_troop_name_link,s9,"$g_talk_troop"),
(str_store_troop_name_link,s13,":quest_target_troop"),
(str_store_party_name_link,s4,":quest_target_center"),
(setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
(str_store_string, s2, "@{s9} asked you to take a message to {s13}. {s13} was believed to be at {s4} when you were given this quest."),
]],
[anyone|plyr,"lord_mission_deliver_message", [], "Certainly, I intend to pass by {s4} and it would be no trouble.", "lord_mission_deliver_message_accepted",[]],
[anyone|plyr,"lord_mission_deliver_message", [], "I doubt I'll be seeing {s13} anytime soon, {s65}. You'd best send it with someone else.", "lord_mission_deliver_message_rejected",[]],
[anyone|plyr,"lord_mission_deliver_message", [], "I am no errand boy, sir. Hire a courier for your trivialities.", "lord_mission_deliver_message_rejected_rudely",[]],
[anyone,"lord_mission_deliver_message_accepted", [], "I appreciate it, {playername}. Here's the letter,\
and a small sum to cover your travel expenses. Give my regards to {s13} when you see him.", "close_window",
[(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_troop_add_gold", "trp_player", 30), (assign, "$g_leave_encounter",1),
]],
[anyone,"lord_mission_deliver_message_rejected", [], "Ah, all right then. Well, I am sure I will find someone else.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
[anyone,"lord_mission_deliver_message_rejected_rudely", [], "Hm, is this how you respond to a polite request\
for a small favor? A poor show, {playername}. I didn't know you would take offence.", "lord_mission_deliver_message_rejected_rudely_2",[]],
[anyone|plyr,"lord_mission_deliver_message_rejected_rudely_2", [], "Then you shall know better from now on.", "lord_mission_deliver_message_rejected_rudely_3",[]],
[anyone|plyr,"lord_mission_deliver_message_rejected_rudely_2", [], "Forgive my temper, {s65}. I'll deliver your letter.", "lord_mission_deliver_message_accepted",[]],
[anyone,"lord_mission_deliver_message_rejected_rudely_3", [], "All right. I will remember that.", "close_window",[
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-4),
(quest_set_slot, "$random_quest_no", slot_quest_dont_give_again_remaining_days, 150),
(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
(assign, "$g_leave_encounter",1),
]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_deliver_message_to_enemy_lord")],
"I need to deliver a letter to {s13} of {s15}, who must be at {s4} currently.\
If you are going towards there, would you deliver my letter to him? The letter needs to reach him in 40 days.", "lord_mission_deliver_message",
[
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_troop_name_link,s9,"$g_talk_troop"),
## (str_store_party_name,2,"$g_encountered_party"),
(str_store_troop_name_link,s13,":quest_target_troop"),
(str_store_party_name_link,s4,":quest_target_center"),
(store_troop_faction, ":target_faction", ":quest_target_troop"),
(str_store_faction_name_link,s15,":target_faction"),
(setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
(str_store_string, s2, "@{s9} asked you to take a message to {s13} of {s15}. {s13} was believed to be at {s4} when you were given this quest."),
]],
##
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_deliver_message_to_lover")],
## "My dear friend, I have a deep affection for {s3} and I believe she feels the same way for me as well.\
## Alas, her father {s5} finds me unsuitable for her and will do anything to prevent our union.\
## I really need your help. Please, will you take this letter to her? She should be at {s4} at the moment.", "lord_mission_told",
## [
## (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
## (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
## (str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name_link,2,"$g_encountered_party"),
## (str_store_troop_name_link,3,":quest_target_troop"),
## (str_store_party_name_link,4,":quest_target_center"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## ]],
##
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_escort_lady")],
"There is a small thing... My {s17} {s13} is due for a visit to her relatives at {s14}.\
The visit has been postponed several times already with all the trouble on the roads,\
but this time she is adamant about going. So, I want to at least make sure she's well-guarded.\
I trust you well, {playername} so I would be very grateful if you could escort her to {s14}\
and make sure she arrives safe and sound.", "lord_mission_told",
[
(quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(try_begin),
(troop_slot_eq, ":quest_object_troop", slot_troop_father, "$g_talk_troop"),
(str_store_string, s17, "str_daughter"),
(else_try),
(str_store_string, s17, "str_wife"),
(try_end),
(str_store_troop_name_link, s11, "$g_talk_troop"),
(str_store_troop_name_link, s13, ":quest_object_troop"),
(str_store_party_name_link, s14, ":quest_target_center"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@{s11} asked you to escort his {s17} {s13} to {s14}."),
]],
##
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_hunt_down_raiders")],
## "A messenger came with important news a few hours ago.\
## A group of enemy raiders have attacked a village near {s3}.\
## They have murdered anyone who tried to resist, stolen everything they could carry and put the rest to fire.\
## Now, they must be on their way back to their base at {s4}.\
## You must catch them on the way and make them pay for their crimes.", "lord_mission_told",
## [
## (quest_get_slot, ":quest_object_center", "$random_quest_no", slot_quest_object_center),
## (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
## (str_store_party_name_link,3,":quest_object_center"),
## (str_store_party_name_link,4,":quest_target_center"),
## ]],
##
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_bring_back_deserters")],
## "I am worried about the growing number of deserters. If we don't do something about it, we may soon have noone left to fight in our wars.\
## I want you to go now and bring back {reg1} {s3}. I would ask you to hang the bastards but we are short of men and we need them back in the ranks.", "lord_mission_told",
## [
## (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
## (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
##
## (str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name_link,2,"$g_encountered_party"),
## (str_store_troop_name_plural,3,":quest_target_troop"),
## (assign, reg1, ":quest_target_amount"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## ]],
##
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_deliver_supply_to_center_under_siege")],
## "The enemy has besieged {s5}. Our brothers there are doing their best to fend off attacks, but they can't hold for long without supplies.\
## We need someone to take the supplies they need and make it into the town as soon as possible.\
## It's a very dangerous job, but if there's one person who can do it, it's you {playername}.\
## You can take the supplies from seneschal {s3}. When you arrive at {s5}, give them to the seneschal of that town.", "lord_mission_told",
## [
## (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
## (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
## (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
## (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
##
## (str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name_link,2,"$g_encountered_party"),
## (str_store_troop_name_link,3,":quest_object_troop"),
## (str_store_troop_name,4,":quest_target_troop"),
## (str_store_party_name_link,5,":quest_target_center"),
## (assign, reg1, ":quest_target_amount"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## ]],
##
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_bring_reinforcements_to_siege")],
## "{s4} has besieged {s5} and God willing, that town will not hold for long.\
## Still I promised him to send {reg1} {s3} as reinforcements and I need someone to lead those men.\
## Can you take them to {s4}?", "lord_mission_told",
## [
## (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
## (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
## (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
## (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
##
## (str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name_link,2,"$g_encountered_party"),
## (str_store_troop_name_plural,3,":quest_object_troop"),
## (str_store_troop_name_link,4,":quest_target_troop"),
## (str_store_party_name_link,5,":quest_target_center"),
## (assign, reg1, ":quest_target_amount"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## ]],
##
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_rescue_lady_under_siege")],
## "The enemy has besieged {s4} and my dear {s7} {s3} has been trapped within the town walls.\
## As you may guess, I am greatly distressed by this. I need a very reliable commander, to rescue her from the town and bring her back to me.\
## Will you do that {playername}?", "lord_mission_told",
## [
## (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
## (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
##
## (try_begin),
## (troop_slot_eq, "$g_talk_troop", slot_troop_daughter, ":quest_object_troop"),
## (str_store_string, s7, "str_daughter"),
## (else_try),
## (str_store_string, s7, "str_wife"),
## (try_end),
##
## (str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name_link,2,"$g_encountered_party"),
## (str_store_troop_name_link,3,":quest_object_troop"),
## (str_store_party_name_link,4,":quest_target_center"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## ]],
##
##
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_bring_prisoners_to_enemy")],
## "The enemy wants to ransom some of their soldiers that we captured at the last battle.\
## They'll pay 100 denars in return for giving them back {reg1} {s3}.\
## God knows I can use that money so I accepted their offer.\
## Now, what I need is someone to take the prisoners to {s4} and come back with the money.", "lord_mission_told",
## [
## (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
## (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
## (quest_get_slot, reg1, "$random_quest_no", slot_quest_target_amount),
## (str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name_link,2,"$g_encountered_party"),
## (str_store_troop_name_plural,3,":quest_object_troop"),
## (str_store_party_name_link,4,":quest_target_center"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## ]],
##
# Deal with bandits
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_deal_with_bandits_at_lords_village")],
"A group of bandits have taken refuge in my village of {s15}.\
They are plundering nearby farms, and getting rich and fat stealing my taxes and feasting on my cattle.\
I'd like nothing better than to go out there and teach them a lesson,\
but I have my hands full at the moment, so I can't do anything about it.", "lord_mission_deal_with_bandits_told",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_party_name_link,s15,":quest_target_center"),
(str_store_troop_name_link,s13,"$g_talk_troop"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@{s13} asked you to deal with the bandits who are occupying the village of {s15} and then report back to him."),
]],
[anyone|plyr,"lord_mission_deal_with_bandits_told", [],
"Worry not, I can go to {s15} and deal with these scum for you.", "lord_mission_deal_with_bandits_accepted",[]],
[anyone|plyr,"lord_mission_deal_with_bandits_told", [], "You shall have to find help elsewhere, I am too busy.", "lord_mission_deal_with_bandits_rejected",[]],
[anyone,"lord_mission_deal_with_bandits_accepted", [], "Will you do that?\
Know that, I will be grateful to you. Here is some money for the expenses of your campaign.\
Make an example of those {s43}s.", "close_window",
[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_troop_add_gold", "trp_player", 200),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
(assign, "$g_leave_encounter",1),
]],
[anyone,"lord_mission_deal_with_bandits_rejected", [], "Ah... Very well then, forget I brought it up.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
# Raise troops
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_raise_troops")],
"No lord should have to admit this, {playername}, but I was inspecting my soldiers the other day\
and there are men here who don't know which end of a sword to hold.\
{s43}\
You are a warrior of renown, {playername}. Will you train some troops for me?\
I would be grateful to you.", "lord_tell_mission_raise_troops",[
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_troop_train_request_default"),
]],
[anyone|plyr,"lord_tell_mission_raise_troops", [], "How many men do you need?", "lord_tell_mission_raise_troops_2",[]],
[anyone,"lord_tell_mission_raise_troops_2", [], "If you can raise {reg1} {s14} and bring them to me, that will probably be enough.", "lord_mission_raise_troops_told",
[
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(quest_get_slot, reg1, "$random_quest_no", slot_quest_target_amount),
(str_store_troop_name_link,s9,"$g_talk_troop"),
(str_store_troop_name_plural,s14,":quest_target_troop"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@{s9} asked you to raise {reg1} {s14} and bring them to him."),
]],
[anyone|plyr,"lord_mission_raise_troops_told", [(quest_get_slot, reg1, "$random_quest_no", slot_quest_target_amount)],
"Of course, {s65}. Give me {reg1} fresh recruits and I'll train them to be {s14}.", "lord_mission_raise_troops_accepted",[]],
[anyone|plyr,"lord_mission_raise_troops_told", [], "I am too busy these days to train anyone.", "lord_mission_raise_troops_rejected",[]],
[anyone,"lord_mission_raise_troops_accepted", [], "You've taken a weight off my shoulders, {playername}.\
I shall tell my sergeants to send you the recruits and attach them to your command.\
Also, I'll advance you some money to help with expenses. Here, this purse should do it.\
Thank you for your help.", "close_window",
[(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_troop_add_gold", "trp_player", 100),
(quest_get_slot, ":recruit_troop", "$random_quest_no", slot_quest_object_troop),
(quest_get_slot, ":num_recruits", "$random_quest_no", slot_quest_target_amount),
(party_add_members, "p_main_party", ":recruit_troop", ":num_recruits"),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
(assign, "$g_leave_encounter",1),
]],
[anyone,"lord_mission_raise_troops_rejected", [], "Oh, of course. I had expected as much. Well, good luck to you then.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
#Collect Taxes
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_collect_taxes"),
(assign, reg9, 0),
(try_begin),
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(party_slot_eq, ":quest_target_center", slot_party_type, spt_town),
(assign, reg9, 1),
(try_end),
], "You probably know that I am the lord of the {reg9?town:village} of {s3}.\
However, it has been months since {s3} has delivered the taxes and rents due me as its rightful lord.\
Apparently the populace there has grown unruly lately and I need someone to go there and remind them of\
their obligations. And to . . . persuade them if they won't listen.\
If you go there and raise the taxes they owe me, I will grant you one-fifth of everything you collect.", "lord_mission_collect_taxes_told",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_troop_name_link,s9,"$g_talk_troop"),
(str_store_party_name_link,s3,":quest_target_center"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@{s9} asked you to collect taxes from {s3}. He offered to leave you one-fifth of all the money you collect there."),
]],
[anyone|plyr,"lord_mission_collect_taxes_told", [],
"A fair offer, {s65}. We have an agreement.", "lord_mission_collect_taxes_accepted",[]],
[anyone|plyr,"lord_mission_collect_taxes_told", [], "Forgive me, I don't have the time.", "lord_mission_collect_taxes_rejected",[]],
[anyone,"lord_mission_collect_taxes_accepted", [], "Welcome news, {playername}.\
I will entrust this matter to you.\
Remember, those {reg9?townsmen:peasants} are foxy beasts, they will make every excuse not to pay me my rightful incomes.\
Do not let them fool you.", "close_window",
[(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
(assign, "$g_leave_encounter",1),
(assign, reg9, 0),
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(try_begin),
(party_slot_eq, ":quest_target_center", slot_party_type, spt_town),
(assign, reg9, 1),
(try_end),
]],
[anyone,"lord_mission_collect_taxes_rejected", [], "Oh, yes. Well, good luck to you then.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
#Hunt down fugitive
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_hunt_down_fugitive")],
"I have something you could help with, an issue with the lawless villain known as {s4}. \
He murdered one of my men and has been on the run from his judgment ever since.\
I can't let him get away with avoiding justice, so I've put a bounty of 300 denars on his head.\
Friends of the murdered man reckon that this assassin may have taken refuge with his kinsmen at {s3}.\
You might be able to hunt him down and give him what he deserves, and claim the bounty for yourself.", "lord_mission_hunt_down_fugitive_told",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(quest_get_slot, ":quest_target_dna", "$random_quest_no", slot_quest_target_dna),
(str_store_troop_name_link,s9, "$g_talk_troop"),
(str_store_party_name_link,s3, ":quest_target_center"),
(call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
(str_store_string, s4, s50),
(setup_quest_text, "$random_quest_no"),
(str_store_string, s2, "@{s9} asked you to hunt down a fugitive named {s4}. He is currently believed to be at {s3}."),
]],
[anyone|plyr,"lord_mission_hunt_down_fugitive_told", [],
"Then I will hunt him down and execute the law.", "lord_mission_hunt_down_fugitive_accepted",[]],
[anyone|plyr,"lord_mission_hunt_down_fugitive_told", [], "I am too busy to go after him at the moment.", "lord_mission_hunt_down_fugitive_rejected",[]],
[anyone,"lord_mission_hunt_down_fugitive_accepted", [], "That's excellent, {playername}.\
I will be grateful to you and so will the family of the man he murdered.\
And of course the bounty on his head will be yours if you can get him.\
Well, good hunting to you.", "close_window",
[(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
(assign, "$g_leave_encounter",1),
]],
[anyone,"lord_mission_hunt_down_fugitive_rejected", [], "As you wish, {playername}.\
I suppose there are plenty of bounty hunters around to get the job done . . .", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_capture_messenger")],
## "The enemy seems to be preparing for some kind of action and I want to know what their plans are.\
## Capture one of their messengers and bring him to me.", "lord_mission_told",
## [
## (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
##
## (str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name_link,2,"$g_encountered_party"),
## (str_store_troop_name,3,":quest_target_troop"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## ]],
##
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_kill_local_merchant")],
"The wretched truth is that I owe a considerable sum of money to one of the merchants here in {s3}.\
I've no intention of paying it back, of course, but that loud-mouthed fool is making a terrible fuss about it.\
He even had the audacity to come and threaten me -- me! --\
with a letter of complaint to the trade guilds and bankers. Why, he'd ruin my good reputation!\
So I need a {man/woman} I can trust, someone who will guarantee the man's silence. For good.", "lord_mission_told_kill_local_merchant",
[
(str_store_troop_name_link,s9,"$g_talk_troop"),
(str_store_party_name_link,s3,"$current_town"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@{s9} asked you to assassinate a local merchant at {s3}."),
]],
[anyone|plyr,"lord_mission_told_kill_local_merchant", [], "Worry not, he shan't breathe a word.", "lord_mission_accepted_kill_local_merchant",[]],
[anyone|plyr,"lord_mission_told_kill_local_merchant", [], "I'm no common murderer, sir. Find someone else for your dirty job.", "lord_mission_rejected",[]],
[anyone,"lord_mission_accepted_kill_local_merchant", [], "Very good. I trust in your skill and discretion,\
{playername}. Do not disappoint me.\
Go now and wait for my word, I'll send you a message telling when and where you can catch the merchant.\
Dispose of him for me and I shall reward you generously.", "close_window",
[(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(assign, "$g_leave_town",1),
(assign, "$qst_kill_local_merchant_center", "$current_town"),
(rest_for_hours, 10, 4, 0),
(finish_mission),
]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_meet_spy_in_enemy_town"),
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_party_name, s13, ":quest_target_center"),
(store_faction_of_party,":quest_target_center_faction",),
(str_store_faction_name, s14, ":quest_target_center_faction"),
],
"I have a sensitive matter which needs tending to, {playername}, and no trustworthy retainers to take care of it. The fact is that I have a spy in {s13} to keep an eye on things for me, and report anything that might warrant my attention. Every week I send someone to collect the spy's reports and bring them back to me. The job's yours if you wish it.", "lord_mission_told_meet_spy_in_enemy_town",
[
]],
[anyone|plyr,"lord_mission_told_meet_spy_in_enemy_town", [], "I don't mind a bit of skullduggery. Count me in.", "quest_meet_spy_in_enemy_town_accepted",[]],
[anyone|plyr,"lord_mission_told_meet_spy_in_enemy_town", [], "I must decline. This cloak-and-dagger work isn't fit for me.", "quest_meet_spy_in_enemy_town_rejected",[]],
[anyone,"quest_meet_spy_in_enemy_town_accepted", [], "Excellent! Make your way to {s13} as soon as you can, the spy will be waiting.", "quest_meet_spy_in_enemy_town_accepted_response",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(quest_get_slot, ":secret_sign", "$random_quest_no", slot_quest_target_amount),
(store_sub, ":countersign", ":secret_sign", secret_signs_begin),
(val_add, ":countersign", countersigns_begin),
(str_store_troop_name_link, s9, "$g_talk_troop"),
(str_store_string, s11, ":secret_sign"),
(str_store_string, s12, ":countersign"),
(str_store_party_name_link, s13, ":quest_target_center"),
(setup_quest_text, "$random_quest_no"),
(str_store_string, s2, "@{s9} has asked you to meet with a spy in {s13}."),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_cf_center_get_free_walker", ":quest_target_center"),
(call_script, "script_center_set_walker_to_type", ":quest_target_center", reg0, walkert_spy),
(str_store_item_name,s14,"$spy_item_worn"),
#TODO: Change this value
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
(assign, "$g_leave_encounter",1),
]],
[anyone|plyr,"quest_meet_spy_in_enemy_town_accepted_response", [(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_party_name_link, s13, ":quest_target_center")],
"{s13} is heavily defended. How can I get close without being noticed?", "quest_meet_spy_in_enemy_town_accepted_2",
[]],
[anyone,"quest_meet_spy_in_enemy_town_accepted_2", [], "You shall have to use stealth. Take care to avoid enemy strongholds, villages and patrols, and don't bring too many men with you. If you fail to sneak in the first time, give it a while for the garrison to lower its guard again, or you may have a difficult time infiltrating the town.", "quest_meet_spy_in_enemy_town_accepted_response",
[]],
[anyone|plyr,"quest_meet_spy_in_enemy_town_accepted_response", [], "How will I recognise the spy?", "quest_meet_spy_in_enemy_town_accepted_3",
[]],
[anyone,"quest_meet_spy_in_enemy_town_accepted_3", [(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_party_name_link, s13, ":quest_target_center"),
(troop_get_type, reg7, "$spy_quest_troop"),
(quest_get_slot, ":secret_sign", "$random_quest_no", slot_quest_target_amount),
(store_sub, ":countersign", ":secret_sign", secret_signs_begin),
(val_add, ":countersign", countersigns_begin),
(str_store_string, s11, ":secret_sign"),
(str_store_string, s12, ":countersign"),],
"Once you get to {s13} you must talk to the locals, the spy will be one of them. If you think you've found the spy, say the phrase '{s11}' The spy will respond with the phrase '{s12}' Thus you will know the other, and {reg7?she:he} will give you any information {reg7?she:he}'s gathered in my service.", "quest_meet_spy_in_enemy_town_accepted_response",
[]],
[anyone|plyr,"quest_meet_spy_in_enemy_town_accepted_response", [], "Will I be paid?", "quest_meet_spy_in_enemy_town_accepted_4",
[]],
[anyone,"quest_meet_spy_in_enemy_town_accepted_4", [], "Of course, I have plenty of silver in my coffers for loyal {men/women} like you. Do well by me, {playername}, and you'll rise high.", "quest_meet_spy_in_enemy_town_accepted_response",
[]],
[anyone|plyr,"quest_meet_spy_in_enemy_town_accepted_response", [], "I know what to do. Farewell, my lord.", "quest_meet_spy_in_enemy_town_accepted_end",
[]],
[anyone,"quest_meet_spy_in_enemy_town_accepted_end", [(quest_get_slot, ":secret_sign", "$random_quest_no", slot_quest_target_amount),
(store_sub, ":countersign", ":secret_sign", secret_signs_begin),
(val_add, ":countersign", countersigns_begin),
(str_store_string, s11, ":secret_sign"),
(str_store_string, s12, ":countersign")],
"Good luck, {playername}. Remember, the secret phrase is '{s11}' The counterphrase is '{s12}' Bring any reports back to me, and I'll compensate you for your trouble.", "lord_pretalk",
[]],
[anyone,"quest_meet_spy_in_enemy_town_rejected", [], "As you wish, {playername}, but I strongly advise you to forget anything I told you about any spies. They do not exist, have never existed, and no one will ever find them. Remember that.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_cause_provocation"),
(quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
(str_store_faction_name_link, s13, ":quest_target_faction")],
"This peace with {s13} ill suits me, {playername}. We've let those swine have their way for far too long.\
Now they get stronger with each passing and their arrogance knows no bounds.\
I say, we must wage war on them before it's too late!\
Unfortunately, some of the bleeding hearts among our realm's lords are blocking a possible declaration of war.\
Witless cowards with no stomach for blood.", "lord_mission_told_raid_caravan_to_start_war",
[
]],
[anyone|plyr,"lord_mission_told_raid_caravan_to_start_war", [], "You are right, {s65}, but what can we do?", "lord_mission_tell_raid_caravan_to_start_war_2",[]],
[anyone|plyr,"lord_mission_told_raid_caravan_to_start_war", [], "I disagree, sir. It is better that there be peace.", "quest_raid_caravan_to_start_war_rejected_1",[]],
[anyone,"lord_mission_tell_raid_caravan_to_start_war_2", [(quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
(str_store_faction_name_link, s13, ":quest_target_faction"),
(str_store_faction_name, s14, "$g_talk_troop_faction")],
"Ah, 'tis good to hear someone who understands!\
As a matter of fact, there is something we can do, {playername}. A little bit of provocation...\
If one of our war parties managed to enter their territory and pillage one of their caravans, or raided one of their villages,\
and perhaps left behind a little token or two of the {s14},\
they would have ample cause to declare war on us.\
And then, well, even the cowards among us must rise to defend themselves.\
So what do you say? Are you interested?", "lord_mission_tell_raid_caravan_to_start_war_3",[]],
[anyone|plyr,"lord_mission_tell_raid_caravan_to_start_war_3", [], "An excellent plan. Count me in.", "quest_raid_caravan_to_start_war_accepted",[]],
[anyone|plyr,"lord_mission_tell_raid_caravan_to_start_war_3", [], "Why don't you do that yourself?", "lord_mission_tell_raid_caravan_to_start_war_4",[]],
[anyone,"lord_mission_tell_raid_caravan_to_start_war_4", [
], "Well, {playername}, some of the lords in our kingdom\
won't like the idea of someone inciting a war without their consent.\
They are already looking for an excuse to get at me, and if I did this they could make me pay for it dearly.\
You, on the other hand, are young and well-liked and daring, so you might just get away with it.\
And of course I will back you up and defend your actions against your opponents.\
All in all, a few lords might be upset at your endeavour, but I am sure you won't be bothered with that.", "lord_mission_tell_raid_caravan_to_start_war_5",[]],
[anyone|plyr,"lord_mission_tell_raid_caravan_to_start_war_5", [], "That seems reasonable. I am willing to do this.", "quest_raid_caravan_to_start_war_accepted",[]],
[anyone|plyr,"lord_mission_tell_raid_caravan_to_start_war_5", [], "I don't like this. Find yourself someone else to take the blame for your schemes.", "quest_raid_caravan_to_start_war_rejected_2",[]],
[anyone,"quest_raid_caravan_to_start_war_accepted", [], "Very good!\
A raid on a caravan, or, if you can't manage that, an attack on one of their villages, should do the trick.\
Now, good luck and good hunting. Go set the borders aflame!", "close_window",
[
(quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
(quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
(str_store_troop_name_link, s9, "$g_talk_troop"),
(str_store_faction_name_link, s13, ":quest_target_faction"),
(assign, reg13, ":quest_target_amount"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "str_s9_asked_you_to_attack_a_village_or_some_caravans_as_to_provoke_a_war_with_s13"),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
# (call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
(assign, "$g_leave_encounter",1),
]],
[anyone,"quest_raid_caravan_to_start_war_rejected_1", [], "Ah, you think so? But how long will your precious peace last? Not long, believe me.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
[anyone,"quest_raid_caravan_to_start_war_rejected_2", [], "Hm. As you wish, {playername}.\
I thought you had some fire in you, but it seems I was wrong.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_bring_back_runaway_serfs")],
"Well, some of the serfs working my fields in {s4} have run away. The ungrateful swine,\
I let them plough my fields and rent my cottages, and this is how they repay me!\
From what I've been hearing, they're running to {s3} as fast as they can,\
and have split up into three groups to try and avoid capture.\
I want you to capture all three groups and fetch them back to {s4} by whatever means necessary.\
I should really have them hanged for attempting to escape, but we need hands for the upcoming harvest,\
so I'll let them go off this time with a good beating.", "lord_mission_told",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(quest_get_slot, ":quest_object_center", "$random_quest_no", slot_quest_object_center),
(str_store_troop_name_link, s9, "$g_talk_troop"),
(str_store_party_name_link, s3, ":quest_target_center"),
(str_store_party_name_link, s4, ":quest_object_center"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "str_s9_asked_you_to_catch_the_three_groups_of_runaway_serfs_and_bring_them_back_to_s4_alive_and_breathing_he_said_that_all_three_groups_are_heading_towards_s3"),
]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_follow_spy")],
"I have good information that a man in this very town is actually an enemy spy.\
He should be seized and hanged for his impudence,\
but we also believe that very soon he will leave town to meet with his master,\
the man to whom the spy feeds all his little whispers.\
The spy himself is of little import, but the master is a dangerous man, and could tell us a great deal\
if we could only get our hands on him...", "lord_tell_mission_follow_spy",[]],
[anyone,"lord_tell_mission_follow_spy", [],
"I want you to wait here until the spy leaves town. Then you must follow him, stealthily, to the meeting place.\
You must take absolute care not to be seen by the spy on your way, else he may suspect foul play and turn back.\
When the master appears, you must ambush and arrest them and bring the pair back to me.\
Alive, if you please.", "lord_tell_mission_follow_spy_2",
[
]],
[anyone|plyr, "lord_tell_mission_follow_spy_2", [],
"I'll do it, {s65}.", "lord_tell_mission_follow_spy_accepted", []],
[anyone|plyr, "lord_tell_mission_follow_spy_2", [],
"No, this skulking is not for me.", "lord_tell_mission_follow_spy_rejected", []],
[anyone,"lord_tell_mission_follow_spy_accepted", [],
"Good, I'm sure you'll do a fine job of it. One of my men will point the spy out to you when he leaves,\
so you will know the man to follow. Remember, I want them both, and I want them alive.", "close_window",
[
(str_store_troop_name_link, s11, "$g_talk_troop"),
(str_store_party_name_link, s12, "$g_encountered_party"),
(setup_quest_text, "$random_quest_no"),
(str_store_string, s2, "@{s11} asked you to follow the spy that will leave {s12}. Be careful not to let the spy see you on the way, or he may get suspicious and turn back. Once the spy meets with his accomplice, you are to capture them and bring them back to {s11}."),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
#TODO: Change this value
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
(spawn_around_party, "p_main_party", "pt_spy_partners"),
(assign, "$qst_follow_spy_spy_partners_party", reg0),
(party_set_position, "$qst_follow_spy_spy_partners_party", pos63),
(party_set_ai_behavior, "$qst_follow_spy_spy_partners_party", ai_bhvr_hold),
(party_set_flags, "$qst_follow_spy_spy_partners_party", pf_default_behavior, 0),
(set_spawn_radius, 0),
(spawn_around_party, "$g_encountered_party", "pt_spy"),
(assign, "$qst_follow_spy_spy_party", reg0),
(party_set_ai_behavior, "$qst_follow_spy_spy_party", ai_bhvr_travel_to_party),
(party_set_ai_object, "$qst_follow_spy_spy_party", "$qst_follow_spy_spy_partners_party"),
(party_set_flags, "$qst_follow_spy_spy_party", pf_default_behavior, 0),
(assign, "$g_leave_town", 1),
(rest_for_hours, 2, 4, 0),
#no need to set g_leave_encounter to 1 since this quest can only be given at a town
]],
[anyone,"lord_tell_mission_follow_spy_rejected", [],
"A shame. Well, carry on as you were, {playername}...", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_capture_enemy_hero")],
"There is a difficult job I need done, {playername}, and you may be the {man/one} who can carry it off.\
I need someone to capture one of the noble lords of {s13} and bring him to me.\
Afterwards, I'll be able to exchange him in return for a relative of mine held by {s13}.\
It is a simple enough job, but whomever you choose will be guarded by an elite band of personal retainers.\
Are you up for a fight?", "lord_tell_mission_capture_enemy_hero",
[
(quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
(str_store_faction_name, s13, ":quest_target_faction"),
]],
[anyone|plyr, "lord_tell_mission_capture_enemy_hero", [],
"Consider it done, {s65}.", "lord_tell_mission_capture_enemy_hero_accepted", []],
[anyone|plyr, "lord_tell_mission_capture_enemy_hero", [],
"I must refuse, {s65}. I am not a kidnapper.", "lord_tell_mission_capture_enemy_hero_rejected", []],
[anyone,"lord_tell_mission_capture_enemy_hero_accepted", [],
"I like your spirit! Go and bring me one of our enemies,\
and I'll toast your name in my hall when you return! And reward you for your efforts, of course...", "close_window",
[
(quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
(str_store_troop_name_link, s11, "$g_talk_troop"),
(str_store_faction_name_link, s13, ":quest_target_faction"),
(setup_quest_text, "$random_quest_no"),
(str_store_string, s2, "@{s11} asked you to capture a lord from {s13}, any lord, and then drag your victim back to {s11} for safekeeping."),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
#TODO: Change this value
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
(assign, "$g_leave_encounter",1),
]],
[anyone,"lord_tell_mission_capture_enemy_hero_rejected", [],
"Clearly you lack the mettle I had thought you possessed. Very well, {playername}, I will find someone else.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_lend_companion")],
"I don't have a job for you right now, but your companion {s3} is a skilled {reg3?lass:fellow}\
and I need someone with {reg3?her:his} talents. Will you lend {reg3?her:him} to me for a while?", "lord_tell_mission_lend_companion",
[
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
(val_add, ":quest_target_amount", 1),
(assign, reg1, ":quest_target_amount"),
(str_store_troop_name_link,s9,"$g_talk_troop"),
(str_store_troop_name,s3,":quest_target_troop"),
(setup_quest_text,"$random_quest_no"),
(troop_get_type, reg3, ":quest_target_troop"),
(str_store_string, s2, "@{s9} asked you to lend your companion {s3} to him for a week."),
]],
[anyone|plyr,"lord_tell_mission_lend_companion", [],
"How long will you be needing {reg3?her:him}?", "lord_tell_mission_lend_companion_2", []],
[anyone,"lord_tell_mission_lend_companion_2", [],
"Just a few days, a week at most.", "lord_mission_lend_companion_told", []],
[anyone|plyr,"lord_mission_lend_companion_told",
[(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),(str_store_troop_name,s3,":quest_target_troop"),],
"Then I will leave {s3} with you for one week.", "lord_tell_mission_lend_companion_accepted", []],
[anyone|plyr,"lord_mission_lend_companion_told", [(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(str_store_troop_name,s3,":quest_target_troop"),],
"I am sorry, but I cannot do without {s3} for a whole week.", "lord_tell_mission_lend_companion_rejected", []],
[anyone,"lord_tell_mission_lend_companion_accepted", [],
"I cannot thank you enough, {playername}. Worry not, your companion shall be returned to you with due haste.", "close_window",
[(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(party_remove_members, "p_main_party", ":quest_target_troop", 1),
(assign, "$g_leave_encounter",1),
]],
[anyone,"lord_tell_mission_lend_companion_rejected", [],
"Well, that's damned unfortunate, but I suppose I cannot force you or {s3} to agree.\
I shall have to make do without.", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_collect_debt")],
"Some time ago, I loaned out a considerable sum of money to {s3}. {reg4} denars, to be precise.\
He was supposed to pay it back within a month but I haven't received a copper from him since.\
That was months ago. If you could collect the debt from him on my behalf,\
I would be grateful indeed. I would even let you keep one fifth of the money for your trouble.\
What do you say?", "lord_tell_mission_collect_debt",
[
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(quest_get_slot, reg4, "$random_quest_no", slot_quest_target_amount),
(str_store_troop_name_link,s9,"$g_talk_troop"),
(str_store_troop_name_link,s3,":quest_target_troop"),
(str_store_party_name_link,s4,":quest_target_center"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@{s9} asked you to collect the debt of {reg4} denars {s3} owes to him. {s3} was at {s4} when you were given this quest."),
]],
[anyone|plyr,"lord_tell_mission_collect_debt", [],
"Do you know where I can find {s3}, {s65}?", "lord_tell_mission_collect_debt_2", []],
[anyone,"lord_tell_mission_collect_debt_2", [],
"If you leave now, you should be able to find him at {s4}.\
I've no doubt that he will be suitably embarassed by his conduct and give you all the money he owes me.", "lord_tell_mission_collect_debt_3", []],
[anyone|plyr,"lord_tell_mission_collect_debt_3", [], "Then I will talk to {s3} on your behalf.", "lord_tell_mission_collect_debt_accepted", []],
[anyone|plyr,"lord_tell_mission_collect_debt_3", [], "Forgive me, {s65}, but I doubt I would be more successful than yourself.", "lord_tell_mission_collect_debt_rejected", []],
[anyone,"lord_tell_mission_collect_debt_accepted", [], "You made me very happy by accepting this {playername}. Please, talk to {s3} and don't leave him without my money.", "close_window",
[(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop", 1),
(assign, "$g_leave_encounter",1),
]],
[anyone,"lord_tell_mission_collect_debt_rejected", [], "Perhaps not, {playername}. I suppose I'm never getting that money back...", "lord_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
##
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_capture_conspirators")],
## "TODO: I want you to capture troops in {reg1} conspirator parties that plan to rebel against me and join {s3}.", "lord_mission_told",
## [
## (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
## (assign, reg1, "$qst_capture_conspirators_num_parties_to_spawn"),
## (str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name_link,2,"$g_encountered_party"),
## (str_store_troop_name,3,":quest_target_troop"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## ]],
##
##
## [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_defend_nobles_against_peasants")],
## "TODO: I want you to defend {reg1} noble parties against peasants.", "lord_mission_told",
## [
## (assign, reg1, "$qst_defend_nobles_against_peasants_num_noble_parties_to_spawn"),
## (str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name_link,2,"$g_encountered_party"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## ]],
##
##
[anyone,"lord_tell_mission", [(eq, "$random_quest_no", "qst_incriminate_loyal_commander"),
(quest_get_slot, ":quest_target_troop", "qst_incriminate_loyal_commander", slot_quest_target_troop),
(quest_get_slot, ":quest_object_troop", "qst_incriminate_loyal_commander", slot_quest_object_troop),
(quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
(str_store_troop_name_link, s13,":quest_target_troop"),
(str_store_party_name_link, s14,":quest_target_center"),
(str_store_troop_name_link, s15,":quest_object_troop"),
],
"I tell you, that blubbering fool {s13} is not fit to rule {s14}.\
God knows he would be divested of his lands in an instant were it not for one of his loyal vassals, {s15}.\
As long as he has his vassal aiding him, it will be a difficult job beating him.\
So I need to get {s15} out of the picture, and I have a plan just to do that...\
With your help, naturally.", "lord_tell_mission_incriminate_commander",[]],
[anyone|plyr,"lord_tell_mission_incriminate_commander", [], "{s66}, I am all ears.", "lord_tell_mission_incriminate_commander_2",[]],
[anyone|plyr,"lord_tell_mission_incriminate_commander", [], "I don't wish to involve myself in anything dishonourable against {s15}.", "lord_tell_mission_incriminate_commander_rejected",[]],
[anyone,"lord_tell_mission_incriminate_commander_rejected", [], "Dishonourable? Bah!\
I was hoping I could count on you, {playername}, but you've shown me what a fool I was.\
I shall have to find someone whose loyalty I can trust.", "lord_pretalk",
[(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-5),
(call_script, "script_change_player_honor", 2)]],
[anyone,"lord_tell_mission_incriminate_commander_2", [], "I have written a fake letter to {s15},\
bearing my own seal, which implicates him in a conspiracy with us to stage a coup in {s14}, in my favour.\
If we can make {s13} believe the letter is genuine, he will deal with {s15} very swiftly.\
Of course, the challenge there is to convince {s13} that the letter is indeed real...", "lord_tell_mission_incriminate_commander_3",[]],
[anyone|plyr,"lord_tell_mission_incriminate_commander_3", [], "Please continue, {s65}...", "lord_tell_mission_incriminate_commander_4",[]],
[anyone|plyr,"lord_tell_mission_incriminate_commander_3", [], "No, I will not sully myself with this dishonourable scheme.", "lord_tell_mission_incriminate_commander_rejected",[]],
[anyone,"lord_tell_mission_incriminate_commander_4", [], "This is where you come into play.\
You'll take the letter to {s14}, then give it to one of your soldiers and instruct him to take it to {s15}.\
I will have one of my spies inform the town garrison so that your man will be arrested on his way.\
The guards will then find the letter and take it to {s13}.\
They'll torture your man, of course, to try and get the truth out of him,\
but all he knows is that you ordered the letter to be delivered to {s15} under the utmost secrecy.\
{s13} knows you serve me, and the fool will certainly believe the whole charade.", "lord_tell_mission_incriminate_commander_5",[]],
[anyone|plyr,"lord_tell_mission_incriminate_commander_5", [], "Is that all?", "lord_tell_mission_incriminate_commander_7",[]],
[anyone,"lord_tell_mission_incriminate_commander_7", [(str_store_troop_name, s8, "$incriminate_quest_sacrificed_troop"),
(str_store_troop_name_plural, s9, "$incriminate_quest_sacrificed_troop"),
], "There is one more thing...\
Your messenger must be someone trustworthy. If you sent the letter with a simple peasant, someone expendable,\
{s13} might suspect a plot. He may have the wits of a snail, but even a snail can see the obvious.\
Give the letter to someone of rank. One of your {s9}, perhaps.", "lord_tell_mission_incriminate_commander_8",[]],
[anyone|plyr,"lord_tell_mission_incriminate_commander_8", [], "What? I can't send one of my trusted {s9} to his death!", "lord_tell_mission_incriminate_commander_9",[]],
[anyone|plyr,"lord_tell_mission_incriminate_commander_8", [], "Then a {s8} it will be.", "lord_tell_mission_incriminate_commander_fin",[]],
[anyone,"lord_tell_mission_incriminate_commander_9", [], "Come now, {playername}.\
There is a place for sentimentality, but this is not it. Believe me, you shall be generously compensated,\
and what is the purpose of soldiers if not to die at our say-so?", "lord_tell_mission_incriminate_commander_10",[]],
[anyone|plyr,"lord_tell_mission_incriminate_commander_10", [], "A {s8} it is.", "lord_tell_mission_incriminate_commander_fin",[]],
[anyone|plyr,"lord_tell_mission_incriminate_commander_10", [], "No, I'll not sacrifice one of my chosen men.", "lord_tell_mission_incriminate_commander_rejected",[]],
[anyone,"lord_tell_mission_incriminate_commander_fin", [], "I can't tell you how pleased I am to hear that,\
{playername}. You are removing one of the greatest obstacles in my path.\
Here is the letter, as well as 300 denars for your expenses.\
Remember, there'll be more once you succeed. Much, much more...", "lord_pretalk",
[
(quest_get_slot, ":quest_target_troop", "qst_incriminate_loyal_commander", slot_quest_target_troop),
(quest_get_slot, ":quest_object_troop", "qst_incriminate_loyal_commander", slot_quest_object_troop),
(quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
(call_script, "script_troop_add_gold", "trp_player", 300),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",2),
(str_store_troop_name_link, s11,"$g_talk_troop"),
(str_store_troop_name_link, s13,":quest_target_troop"),
(str_store_party_name_link, s14,":quest_target_center"),
(str_store_troop_name_plural, s15,"$incriminate_quest_sacrificed_troop"),
(str_store_troop_name_link, s16,":quest_object_troop"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@{s11} gave you a fake letter to fool {s13} into banishing his vassal {s16}.\
You are to go near {s14}, give the letter to one of your {s15} and send him into the town as a messenger,\
believing his orders to be genuine."),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
]],
[anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_capture_prisoners")],
"A group of my soldiers were captured in a recent skirmish with the enemy.\
Thankfully we have a mutual agreement of prisoner exchange, and they will release my men,\
but they want us to give them prisoners of equal rank and number. Prisoners I don't currently have.\
So, I need a good {man/warrior} to find me {reg1} {s3} as prisoners, that I may exchange them.", "lord_mission_told",
[
(quest_get_slot, ":quest_target_troop", "qst_capture_prisoners", slot_quest_target_troop),
(quest_get_slot, ":quest_target_amount", "qst_capture_prisoners", slot_quest_target_amount),
(assign,reg1,":quest_target_amount"),
(str_store_troop_name_link,s9,"$g_talk_troop"),
## (str_store_party_name,2,"$g_encountered_party"),
(str_store_troop_name_by_count,3,":quest_target_troop",":quest_target_amount"),
(setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
(str_store_string, s2, "@{s9} has requested you to bring him {reg1} {s3} as prisoners."),
]],
[anyone,"lord_tell_mission", [], "No {playername}. I do not need your help at this time.", "lord_pretalk",[]],
[anyone|plyr,"lord_mission_told", [], "You can count on me, {s65}.", "lord_mission_accepted",[]],
[anyone|plyr,"lord_mission_told", [], "I fear I cannot accept such a mission at the moment.", "lord_mission_rejected",[]],
[anyone,"lord_mission_accepted", [], "Excellent, {playername}, excellent. I have every confidence in you.", "close_window",
[(assign, "$g_leave_encounter",1),
(try_begin),
(eq, "$random_quest_no", "qst_escort_lady"),
(quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
(troop_set_slot, ":quest_object_troop", slot_troop_cur_center, 0),
(troop_join, ":quest_object_troop"),
## (else_try),
## (eq, "$random_quest_no", "qst_hunt_down_raiders"),
## (quest_get_slot, ":quest_object_center", "$random_quest_no", slot_quest_object_center),
## (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
## (quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
## (set_spawn_radius, 3),
## (call_script, "script_cf_create_kingdom_party", ":quest_target_faction", spt_raider),
### (spawn_around_party,":quest_object_center",":quest_target_party_template"),
## (assign, ":quest_target_party", reg0),
## (party_relocate_near_party, reg0, ":quest_object_center"),
## (quest_set_slot, "$random_quest_no", slot_quest_target_party, ":quest_target_party"),
## (party_set_ai_behavior,":quest_target_party",ai_bhvr_travel_to_party),
## (party_set_ai_object,":quest_target_party",":quest_target_center"),
## (party_set_flags, ":quest_target_party", pf_default_behavior, 0),
## (party_set_faction,":quest_target_party",":quest_target_faction"),
## (str_store_troop_name,1,"$g_talk_troop"),
## (str_store_party_name,2,"$g_encountered_party"),
## (str_store_party_name,3,":quest_object_center"),
## (str_store_party_name,4,":quest_target_center"),
## (setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
## (else_try),
## (eq, "$random_quest_no", "qst_bring_reinforcements_to_siege"),
## (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
## (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
## (troop_get_slot, ":cur_party", "$g_talk_troop", slot_troop_leaded_party),
## (party_remove_members, ":cur_party", ":quest_object_troop", ":quest_target_amount"),
## (party_add_members, "p_main_party", ":quest_object_troop", ":quest_target_amount"),
## (else_try),
## (eq, "$random_quest_no", "qst_bring_prisoners_to_enemy"),
## (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
## (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
## (party_add_prisoners, "p_main_party", ":quest_object_troop", ":quest_target_amount"),
(else_try),
(eq, "$random_quest_no", "qst_deliver_message_to_enemy_lord"),
(call_script, "script_troop_add_gold", "trp_player", 10),
(else_try),
(eq, "$random_quest_no", "qst_bring_back_runaway_serfs"),
(quest_get_slot, ":quest_giver_center", "$random_quest_no", slot_quest_giver_center),
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(quest_get_slot, ":quest_target_party_template", "$random_quest_no", slot_quest_target_party_template),
(set_spawn_radius, 3),
(spawn_around_party,":quest_giver_center",":quest_target_party_template"),
(assign, "$qst_bring_back_runaway_serfs_party_1", reg0),
(party_set_ai_behavior,"$qst_bring_back_runaway_serfs_party_1",ai_bhvr_travel_to_party),
(party_set_ai_object,"$qst_bring_back_runaway_serfs_party_1",":quest_target_center"),
(party_set_flags, "$qst_bring_back_runaway_serfs_party_1", pf_default_behavior, 0),
(spawn_around_party,":quest_giver_center",":quest_target_party_template"),
(assign, "$qst_bring_back_runaway_serfs_party_2", reg0),
(party_set_ai_behavior,"$qst_bring_back_runaway_serfs_party_2",ai_bhvr_travel_to_party),
(party_set_ai_object,"$qst_bring_back_runaway_serfs_party_2",":quest_target_center"),
(party_set_flags, "$qst_bring_back_runaway_serfs_party_2", pf_default_behavior, 0),
(spawn_around_party,":quest_giver_center",":quest_target_party_template"),
(assign, "$qst_bring_back_runaway_serfs_party_3", reg0),
(party_set_ai_behavior,"$qst_bring_back_runaway_serfs_party_3",ai_bhvr_travel_to_party),
(party_set_ai_object,"$qst_bring_back_runaway_serfs_party_3",":quest_target_center"),
(party_set_flags, "$qst_bring_back_runaway_serfs_party_3", pf_default_behavior, 0),
(rest_for_hours, 1, 4),
## (else_try),
## (eq, "$random_quest_no", "qst_capture_conspirators"),
## (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
## (spawn_around_party,"p_main_party","pt_conspirator_leader"),
## (assign, "$qst_capture_conspirators_party_1", reg0),
## (assign, "$qst_capture_conspirators_num_parties_spawned", 1),
## (party_set_ai_behavior, "$qst_capture_conspirators_party_1", ai_bhvr_hold),
## (party_set_flags, "$qst_capture_conspirators_party_1", pf_default_behavior, 0),
## (party_get_position, pos1, ":quest_target_center"),
## (call_script, "script_map_get_random_position_around_position_within_range", 17, 19),
## (party_set_position, "$qst_capture_conspirators_party_1", pos2),
## (party_get_num_companions, ":num_companions", "$qst_capture_conspirators_party_1"),
## (val_add, "$qst_capture_conspirators_num_troops_to_capture", ":num_companions"),
## (else_try),
## (eq, "$random_quest_no", "qst_defend_nobles_against_peasants"),
## (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
## (set_spawn_radius, 9),
## (try_for_range, ":unused", 0, "$qst_defend_nobles_against_peasants_num_peasant_parties_to_spawn"),
## (spawn_around_party, ":quest_target_center", "pt_peasant_rebels"),
## (try_begin),
## (le, "$qst_defend_nobles_against_peasants_peasant_party_1", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_1", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_peasant_party_2", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_2", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_peasant_party_3", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_3", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_peasant_party_4", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_4", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_peasant_party_5", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_5", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_peasant_party_6", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_6", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_peasant_party_7", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_7", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_peasant_party_8", 0),
## (assign, "$qst_defend_nobles_against_peasants_peasant_party_8", reg0),
## (try_end),
## (try_end),
## (set_spawn_radius, 0),
## (party_get_position, pos1, ":quest_target_center"),
## (try_for_range, ":unused", 0, "$qst_defend_nobles_against_peasants_num_noble_parties_to_spawn"),
## (spawn_around_party, ":quest_target_center", "pt_noble_refugees"),
## (assign, ":cur_noble_party", reg0),
## (party_set_ai_behavior, ":cur_noble_party", ai_bhvr_travel_to_party),
## (party_set_ai_object, ":cur_noble_party", ":quest_target_center"),
## (party_set_flags, ":cur_noble_party", pf_default_behavior, 0),
## (call_script, "script_map_get_random_position_around_position_within_range", 13, 17),
## (party_set_position, ":cur_noble_party", pos2),
## (party_get_num_companions, ":num_companions", ":cur_noble_party"),
## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_to_save", ":num_companions"),
## (try_begin),
## (le, "$qst_defend_nobles_against_peasants_noble_party_1", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_1", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_noble_party_2", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_2", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_noble_party_3", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_3", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_noble_party_4", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_4", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_noble_party_5", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_5", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_noble_party_6", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_6", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_noble_party_7", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_7", reg0),
## (else_try),
## (le, "$qst_defend_nobles_against_peasants_noble_party_8", 0),
## (assign, "$qst_defend_nobles_against_peasants_noble_party_8", reg0),
## (try_end),
## (try_end),
(try_end),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(try_begin),
(eq, "$random_quest_no", "qst_lend_surgeon"),
(assign, "$g_leave_town_outside", 1),
(assign,"$auto_enter_town","$g_encountered_party"),
# (store_current_hours, "$quest_given_time"),
(rest_for_hours, 4),
(assign, "$lord_requested_to_talk_to", "$g_talk_troop"),
(try_end),
]],
[anyone,"lord_mission_rejected", [], "Is that so? Well, I suppose you're just not up to the task.\
I shall have to look for somebody with more mettle.", "close_window",
[(assign, "$g_leave_encounter",1),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
(try_begin),
(quest_slot_eq, "$random_quest_no", slot_quest_dont_give_again_remaining_days, 0),
(quest_set_slot, "$random_quest_no", slot_quest_dont_give_again_remaining_days, 1),
(try_end),
(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
]],
##### TODO: QUESTS COMMENT OUT END
#Leave
[anyone|plyr,"lord_talk",
[
(troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
], "I must leave now.", "lord_leave_prison",[]],
[anyone|plyr,"lord_talk",
[
(lt, "$g_talk_troop_faction_relation", 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
], "This audience is over. I leave now.", "lord_leave",[]],
[anyone|plyr,"lord_talk",
[
(ge, "$g_talk_troop_faction_relation", 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
], "I must beg my leave.", "lord_leave",[]],
[anyone,"lord_leave", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(lt, "$g_talk_troop_faction_relation", 0),
(store_partner_quest,":enemy_lord_quest"),
(lt, ":enemy_lord_quest", 0),
(troop_slot_eq, "$g_talk_troop", slot_troop_does_not_give_quest, 0),
(call_script, "script_get_quest", "$g_talk_troop"),
(assign, "$random_quest_no", reg0),
(ge, "$random_quest_no", 0),
(this_or_next|eq, "$random_quest_no", "qst_lend_surgeon"), #so far only for quest lend surgeon
(eq, 2, 1),
],
"Before you go, {playername}, I have something to ask of you... We may be enemies in this war,\
but I pray that you believe, as I do, that we can still be civil towards each other.\
Thus I hoped that you would be kind enough to assist me in something important to me.", "lord_leave_give_quest",[]],
[anyone|plyr,"lord_leave_give_quest", [],
"I am listening.", "enemy_lord_tell_mission",[]],
[anyone,"enemy_lord_tell_mission", [(eq,"$random_quest_no","qst_lend_surgeon")],
"I have a friend here, an old warrior, who is very sick. Pestilence has infected an old battle wound,\
and unless he is seen to by a surgeon soon, he will surely die. This man is dear to me, {playername},\
but he's also stubborn as a hog and refuses to have anyone look at his injury because he doesn't trust the physicians here.\
I have heard that you've a capable surgeon with you. If you would let your surgeon come here and have a look,\
{reg3?she:he} may be able to convince him to give his consent to an operation.\
Please, I will be deeply indebted to you if you grant me this request.", "lord_mission_told",
[
(quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
(str_store_troop_name_link,1,"$g_talk_troop"),
## (str_store_party_name,2,"$g_encountered_party"),
(str_store_troop_name,3,":quest_object_troop"),
(troop_get_type, reg3, ":quest_object_troop"),
(setup_quest_text,"$random_quest_no"),
## (try_begin),
## (is_between, "$g_encountered_party", centers_begin, centers_end),
## (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
## (else_try),
## (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
## (try_end),
(str_store_string, s2, "@Lend your experienced surgeon {s3} to {s1}."),
]],
[anyone,"enemy_lord_tell_mission", [(str_store_quest_name, s7, "$random_quest_no")],
"{!}ERROR: MATCHED WITH QUEST: {s7}.", "close_window",
[]],
[anyone,"lord_leave_prison", [],
"We'll meet again.", "close_window",[]],
[anyone|auto_proceed,"lord_leave", [
(troop_get_type, ":type", "trp_player"),
(eq, ":type", 1),
(call_script, "script_troop_get_romantic_chemistry_with_troop", "trp_player", "$g_talk_troop"),
(gt, reg0, 7),
(ge, "$g_talk_troop_relation", 0),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_betrothed, active_npcs_begin),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_spouse, active_npcs_begin),
(neg|troop_slot_ge, "trp_player", slot_troop_betrothed, active_npcs_begin),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
],
"Farewell, my lady. I shall remain your most ardent admirer.", "close_window",
[(eq,"$talk_context",tc_party_encounter),
(assign, "$g_leave_encounter", 1)]],
[anyone|auto_proceed,"lord_leave", [(faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader,"$g_talk_troop")],
"Of course, {playername}. Farewell.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1)]],
[anyone|auto_proceed,"lord_leave", [(ge,"$g_talk_troop_relation",10)],
"Good journeys to you, {playername}.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1)]],
[anyone|auto_proceed,"lord_leave", [(ge, "$g_talk_troop_faction_relation", 0)],
"Yes, yes. Farewell.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1)]],
[anyone|auto_proceed,"lord_leave", [],
"We will meet again.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1)]],
#Royal family members
[anyone|plyr,"member_chat", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady)],
"Are you enjoying the journey, {s65}?", "lady_journey_1",[]],
[anyone,"lady_journey_1", [],
"I am doing quite fine, {playername}. Thank you for your concern.", "close_window",[]],
#Spouse
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
# (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
],
"Yes, my husband?", "spouse_talk",[
]],
[anyone|plyr,"spouse_talk",
[
(eq, "$g_player_minister", "$g_talk_troop"),
],
"As you are my chief minister, I wish to speak to about affairs of state", "minister_issues",[
]],
[anyone|plyr,"spouse_talk",
[
(assign, "$political_quest_to_cancel", -1),
(try_begin),
(check_quest_active, "qst_offer_gift"),
(quest_slot_eq, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
(assign, "$political_quest_to_cancel", "qst_offer_gift"),
(str_store_string, s10, "str_offer_gift_description"),
(else_try),
(check_quest_active, "qst_resolve_dispute"),
(quest_slot_eq, "qst_resolve_dispute", slot_quest_giver_troop, "$g_talk_troop"),
(assign, "$political_quest_to_cancel", "qst_resolve_dispute"),
(str_store_string, s10, "str_resolve_dispute_description"),
(try_end),
(gt, "$political_quest_to_cancel", 0),
],
"Let's abandon our plan to {s10}.", "spouse_cancel_political_quest",[
]],
[anyone,"spouse_cancel_political_quest",
[],
"Are you sure you want to drop that idea?", "spouse_cancel_political_quest_confirm",[
]],
[anyone|plyr,"spouse_cancel_political_quest_confirm",
[],
"Yes, I am sure. Let's abandon that idea.", "spouse_pretalk",[
(call_script, "script_abort_quest", "$political_quest_to_cancel", 1),
]],
[anyone|plyr,"spouse_cancel_political_quest_confirm",
[],
"Actually, never mind.", "spouse_pretalk",[
]],
[anyone|plyr,"spouse_talk",
[],
"Let us think of a way to improve our standing in this realm", "combined_political_quests",[
(call_script, "script_get_political_quest", "$g_talk_troop"),
(assign, "$political_quest_found", reg0),
(assign, "$political_quest_target_troop", reg1),
(assign, "$political_quest_object_troop", reg2),
]],
[anyone|plyr, "spouse_talk",
[
(neg|check_quest_active, "qst_organize_feast"),
],
"I was thinking that perhaps we could host a feast", "spouse_organize_feast",[
]],
[anyone|plyr, "spouse_talk",
[
],
"Let us take inventory of our household possessions", "spouse_household_possessions",[
(change_screen_loot, "trp_household_possessions"),
]],
[anyone, "spouse_household_possessions",
[
],
"Anyway, that is the content of our larder.", "spouse_pretalk",[
]],
[anyone|plyr,"spouse_talk",
[],
"We shall speak later, my {wife/husband}", "close_window",[
(assign, "$g_leave_encounter", 1),
]],
#Bride
[anyone,"wedding_ceremony_bride_vow",
[
# (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
# (check_quest_active, "qst_wed_betrothed"),
# (quest_slot_eq, "qst_wed_betrothed", slot_quest_target_troop, "$g_talk_troop"),
# (quest_slot_eq, "qst_wed_betrothed", slot_quest_current_state, 2),
# (neg|quest_slot_ge, "qst_wed_betrothed", slot_quest_expiration_days, 2),
],
"My husband, I hearby pledge to be your wife, to stand with you in good times and bad. May the heavens smile upon us and bless us with children, livestock, and land.", "wedding_ceremony_player_vow",[
(quest_get_slot, ":bride", "qst_wed_betrothed", slot_quest_target_troop),
(set_conversation_speaker_troop, ":bride"),
]],
[anyone|plyr,"wedding_ceremony_player_vow",
[],
"I pledge the same. Let us be husband and wife.", "wedding_ceremony_vows_complete",[
]],
[anyone|plyr,"wedding_ceremony_player_vow",
[],
"Wait -- hold on... I'm not quite ready for this.", "close_window",[
]],
[anyone,"wedding_ceremony_vows_complete",
[],
"I now declare you and {s3} to be husband and wife. Go now to the chamber prepared for you, and we shall make arrangements for your bride to join you in your hall in {s11}.", "close_window",[
(call_script, "script_courtship_event_bride_marry_groom", "$g_player_bride", "trp_player", 0), #parameters from dialog
(call_script, "script_get_kingdom_lady_social_determinants", "$g_player_bride"),
(str_store_troop_name, s3, "$g_player_bride"),
(try_begin),
(neq, reg0, "trp_player"),
(str_store_string, s11, "str_error__player_not_logged_as_groom"),
(else_try),
(str_store_party_name, s11, reg1),
(troop_set_slot, "$g_player_bride", slot_troop_cur_center, reg1),
(try_end),
]],
#WEDDING CUTSCENE BEGINS HERE
[anyone, "spouse_pretalk",
[],
"Is there anything else, my {husband/wife}?", "spouse_talk",[
]],
#take inventory
[anyone,"spouse_organize_feast",
[
(faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$players_kingdom", slot_faction_ai_object, "$g_encountered_party"),
],
"A splendid idea, my {husband/wife}. However, let us wait for the current feast here to conclude, before organizing another.", "spouse_pretalk",[
]],
[anyone,"spouse_organize_feast",
[
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(neg|is_between, "$g_player_court", centers_begin, centers_end),
],
"A splendid idea, my {husband/wife}. However, we must establish a court before hosting a feast.", "spouse_pretalk",[
]],
[anyone,"spouse_organize_feast",
[
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(store_current_hours, ":hours_since_last_feast"),
(faction_get_slot, ":last_feast_time", "$players_kingdom", slot_faction_last_feast_start_time),
(val_sub, ":hours_since_last_feast", ":last_feast_time"),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":hours_since_last_feast"),
(str_store_faction_name, s4, "$players_kingdom"),
(display_message, "@{!}DEBUG -- {reg4} hours since last feast for {s4}"),
(try_end),
(lt, ":hours_since_last_feast", 120),
(store_sub, ":days_to_wait", 168, ":hours_since_last_feast"),
(val_div, ":days_to_wait", 24),
(assign, reg3, ":days_to_wait"),
],
"A splendid idea, my {husband/wife}. However, our realm has recently had a feast. Perhaps we should wait another {reg3} days before we organize another one.", "spouse_pretalk",[
]],
[anyone,"spouse_organize_feast",
[],
"A splendid idea, my {husband/wife}. However, to not insult our guests, we must make sure that we can provide a large and varied repast, for the lords, their families, and their retinues. All told, we should count on a couple of hundred mouths to feed, over several days. Let us take an inventory of our household possessions...", "spouse_evaluate_larder_for_feast",[
]],
[anyone, "spouse_evaluate_larder_for_feast",
[
(call_script, "script_internal_politics_rate_feast_to_s9", "trp_household_possessions", 600, "$players_kingdom", 0), #party, number of guests, taste, consume items
(assign, "$feast_quality", reg0),
],
"{s9}", "spouse_feast_confirm",[]],
[anyone|plyr, "spouse_feast_confirm",
[
],
"Let me add more items to our storehouses", "spouse_feast_added_items", [
(change_screen_loot, "trp_household_possessions"),
]],
[anyone, "spouse_feast_added_items",
[],
"All right -- let me reevalute what is there...", "spouse_evaluate_larder_for_feast",[]],
[anyone|plyr, "spouse_feast_confirm",
[
(gt, "$feast_quality", 1),
],
"Let us dispatch the invitations", "spouse_feast_confirm_yes", []],
[anyone|plyr, "spouse_feast_confirm",
[
],
"Let us wait, then", "spouse_pretalk",[]],
[anyone, "spouse_feast_confirm_yes",
[ (neq, "$players_kingdom", "fac_player_supporters_faction"),],
"I shall send word, then, that we will host a feast as soon as conditions in the realm permit. You perhaps should continue to stock our larder, so that we may do justice to our reputation for hospitality.", "spouse_pretalk",[
(assign, ":feast_venue", -1),
(try_begin),
(is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
(this_or_next|party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
(party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
(assign, ":feast_venue", "$g_encountered_party"),
(else_try),
(try_for_range, ":center", walled_centers_begin, walled_centers_end),
(eq, ":feast_venue", -1),
(this_or_next|party_slot_eq, ":center", slot_town_lord, "trp_player"),
(party_slot_eq, ":center", slot_town_lord, "$g_talk_troop"),
(assign, ":feast_venue", ":center"),
(try_end),
(else_try),
(is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
(assign, ":feast_venue", "$g_encountered_party"),
(try_end),
(str_store_party_name, s9, ":feast_venue"),
(setup_quest_text, "qst_organize_feast"),
(str_store_string, s2, "str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit"),
(quest_set_slot, "qst_organize_feast", slot_quest_target_center, ":feast_venue"),
(quest_set_slot, "qst_organize_feast", slot_quest_expiration_days, 30),
(call_script, "script_start_quest", "qst_organize_feast", "$g_talk_troop"),
]],
[anyone, "spouse_feast_confirm_yes",
[
],
"Very well, then. Let the feast begin immediately at our court {reg4?here:} in {s9}. You perhaps should continue to stock our larder, so that we may do justice to our reputation for hospitality. You may declare the feast to be concluded at any time, either by beginning a campaign or by letting it be known that the vassals can return to their homes.", "spouse_pretalk",[
(str_store_party_name, s9, "$g_player_court"),
(setup_quest_text, "qst_organize_feast"),
(str_store_string, s2, "str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit"),
(quest_set_slot, "qst_organize_feast", slot_quest_target_center, "$g_player_court"),
(quest_set_slot, "qst_organize_feast", slot_quest_expiration_days, 30),
(call_script, "script_start_quest", "qst_organize_feast", "$g_talk_troop"),
(faction_set_slot, "$players_kingdom", slot_faction_ai_state, sfai_feast),
(faction_set_slot, "$players_kingdom", slot_faction_ai_object, "$g_player_court"),
(assign, "$player_marshal_ai_state", sfai_feast),
(assign, "$player_marshal_ai_object", "$g_player_court"),
(assign, "$g_recalculate_ais", 1),
(assign, reg4, 1),
(try_begin),
(neq, "$g_encountered_party", "$g_player_court"),
(assign, reg4, 0),
(try_end),
]],
[anyone,"start", #too early
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_wed_betrothed"),
(quest_slot_eq, "qst_wed_betrothed", slot_quest_target_troop, "$g_talk_troop"),
(quest_slot_ge, "qst_wed_betrothed", slot_quest_expiration_days, 2),
],
"How wonderful it is... In a short while we shall be married! However, I should point out that, in the remaining few days, it is not customary for us to speak too much together.", "close_window",[
(try_begin),
(check_quest_active, "qst_visit_lady"),
(quest_slot_eq, "qst_visit_lady", slot_quest_giver_troop, "$g_talk_troop"),
(call_script, "script_end_quest", "qst_visit_lady"),
(try_end),
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_wed_betrothed"),
(quest_slot_eq, "qst_wed_betrothed", slot_quest_target_troop, "$g_talk_troop"),
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
# (call_script, "script_get_heroes_attached_to_center", "$g_encountered_party", "p_temp_party"),
(troop_get_slot, ":guardian_led_party", ":guardian", slot_troop_leaded_party),
(party_is_active, ":guardian_led_party"),
(party_get_attached_to, ":guardian_led_party_attached", ":guardian_led_party"),
(eq, ":guardian_led_party_attached", "$g_encountered_party"),
(call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
(str_store_troop_name, s4, ":guardian"),
#use current location, or party is in?
],
"Em, {playername}, you might not be used to our wedding customs, but I had hoped that someone would tell you... Speak first to my {s11}, {s4}.", "close_window",[
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_wed_betrothed"),
(quest_slot_eq, "qst_wed_betrothed", slot_quest_target_troop, "$g_talk_troop"),
(quest_get_slot, ":giver_troop", "qst_wed_betrothed", slot_quest_giver_troop),
(call_script, "script_troop_get_family_relation_to_troop", ":giver_troop", "$g_talk_troop"),
(str_store_troop_name, s10, ":giver_troop"),
],
"I do not know where to find my {s11} {s10}, who by tradition should preside over our wedding. Perhaps we should wait until he can be found...", "close_window",[
(assign, "$g_leave_encounter", 1),
]],
#Captive
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
(party_get_slot, ":town_lord", "$g_encountered_party"),
(ge, ":town_lord", active_npcs_begin),
(str_store_troop_name, s12, ":town_lord"),
],
"The honorable {s12} has agreed to allow us to return home to our families. We shall be departing shortly.", "close_window",[
]],
[anyone,"start", #default for time since last talk
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
(troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
(gt, "$g_time_since_last_talk", 24),
],
"So great is my loneliness! How I miss my family!", "kingdom_lady_captive",[
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
(troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
(lt, "$g_talk_troop_relation", 1),
],
"You are a cad, {sir/madame}, to hold a lady like this...", "kingdom_lady_captive",[
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
(troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
(lt, "$g_talk_troop_relation", 11),
],
"It is strange. On occasion you have shown me such kindness, and yet you continue to hold me here against my will.", "kingdom_lady_captive",[
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
(troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
],
"Why haven't my family paid my ransom? You may hold me as prisoner, but it seems that you care for me more than they do!", "kingdom_lady_captive",[
]],
[anyone|auto_proceed, "start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
(troop_slot_eq, "$g_talk_troop", slot_troop_cur_center, "$g_encountered_party"),
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(neq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
(store_faction_of_troop, ":guardian_faction", ":guardian"),
(neq, ":guardian_faction", "$g_encountered_party_faction"),
],
"{!}.", "lady_stranded_next",
[]],
[anyone,"lady_stranded_next",
[],
"Greetings, {sir/my lady}. The tides of war have left me stranded here in this fortress, but I will shortly be departing. ", "close_window",[
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
(troop_slot_eq, "$g_talk_troop", slot_troop_cur_center, "$g_encountered_party"),
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(store_faction_of_troop, ":guardian_faction", ":guardian"),
(neq, ":guardian_faction", "$g_encountered_party_faction"),
],
"{playername} -- I assume that you, as a {man/lady} of honor, will accord gentle-born ladies such as ourselves the right to return to our families, and not demand a ransom.", "lady_talk_refugee",[
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
(troop_get_slot, ":new_location", "$g_talk_troop", slot_troop_cur_center),
(str_clear, s5),
(try_begin),
(is_between, ":new_location", centers_begin, centers_end),
(str_store_party_name, s4, ":new_location"),
(str_store_string, s5, "str_for_s4"),
(try_end),
],
"We will shortly depart{s5}. It is good to know that some people in this world retain a sense of honor.", "close_window",[
]],
[anyone|plyr,"lady_talk_refugee",
[],
"Of course, my lady", "close_window",[
(troop_get_slot, ":current_location", "$g_talk_troop", slot_troop_cur_center),
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":new_location", reg1),
(troop_set_slot, "$g_talk_troop", slot_troop_cur_center, ":new_location"),
(try_begin),
(neq, ":current_location", ":new_location"),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
(try_end),
]],
[anyone|plyr,"lady_talk_refugee",
[],
"You assume wrong, my lady!", "lady_captive_talk",[
]],
[anyone,"lady_captive_talk",
[],
"What?! What infamy is this?", "lady_captive_confirm",[
]],
[anyone|plyr,"lady_captive_confirm",
[],
"My apologies - you must have misunderstood me. Of course you may leave.", "close_window",[
]],
[anyone|plyr,"lady_captive_confirm",
[],
"Contact your family to arrange for a ransom, my lady.", "close_window",[
(troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
(call_script, "script_change_player_honor", -2),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -10),
#incomplete -- make sure ransoms are offered for ladies
]],
[anyone|plyr,"kingdom_lady_captive",
[],
"Then write to your family, and ask them to hurry up with the ransom!", "close_window",[
]],#incomplete
# [anyone|plyr,"kingdom_lady_captive",
# [
# (troop_get_slot, ":is_female", "trp_player"),
# (eq, ":is_female", 0),
# (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
# (troop_slot_eq, "trp_player", slot_troop_spouse, -1),
# ],
# "Then marry me forthwith, and stay here as my wife", "close_window",[
# ]],#incomplete
[anyone|plyr,"kingdom_lady_captive",
[],
"I have changed my mind -- you are free to go", "close_window",[
(troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, -1),
(troop_set_slot, "$g_talk_troop", slot_troop_met, 1),
]],#incomplete
#Kingdom ladies quest resolution
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_duel_courtship_rival"),
(check_quest_failed, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
(str_store_troop_name, s10, ":quest_target_troop"),
(lt, "$g_talk_troop_relation", 0),
],
"Well, {playername} -- you fought a duel with {s10}, and lost. According to our custom and tradition, I should no longer receive you. Farewell, {playername}.", "close_window",[
(call_script, "script_end_quest", "qst_duel_courtship_rival"),
(troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
]],#incomplete
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_duel_courtship_rival"),
(check_quest_failed, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
(str_store_troop_name, s10, ":quest_target_troop"),
],
"Oh {playername} -- I heard of your duel with {s10}. I wish now that you had never fought him, for our honor and tradition demand that, having lost to him, you now break off your suit with me. Farewell, {playername}.", "lady_duel_lost",[
(troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
(call_script, "script_end_quest", "qst_duel_courtship_rival"),
]],
[anyone|plyr,"lady_duel_lost",
[], "Very well - we must do as tradition demands... Farewell, my lady", "close_window", [
]],
[anyone|plyr,"lady_duel_lost",
[], "Let honor and tradition hang!", "lady_duel_lost_flaunt_conventions", [
]],
[anyone, "lady_duel_lost_flaunt_conventions",
[], "Oh, {playername}! Although people will talk, it would so break my heart to no longer be able to see you. We shall ignore this silly, cruel tradition.", "close_window", [
(troop_set_slot, "$g_talk_troop", slot_troop_met, 2),
(call_script, "script_change_player_honor", -5),
]],
[anyone, "lady_duel_lost_flaunt_conventions",
[], "No, {playername} -- I cannot afford to fritter away my good name, and neither can you.", "close_window", [
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_duel_courtship_rival"),
(check_quest_succeeded, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":quest_target_troop"),
(lt, reg0, 0),
(str_store_troop_name_link, s10, ":quest_target_troop"),
],
"Oh, {playername} -- I have heard that you won your duel with {s10}. I'm grateful that you have delivered me from that man's attentions!", "lady_start",[
(call_script, "script_end_quest", "qst_duel_courtship_rival"),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 3),
(add_xp_as_reward, 1000),
]],#incomplete
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_duel_courtship_rival"),
(check_quest_succeeded, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":quest_target_troop"),
(str_store_troop_name_link, s10, ":quest_target_troop"),
],
"Well, {playername} -- you won your duel with {s10}. Clearly, he was not worthy of my affections.", "lady_start",[
(call_script, "script_end_quest", "qst_duel_courtship_rival"),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 2),
(add_xp_as_reward, 1000),
]],
[anyone|auto_proceed,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_duel_courtship_rival"),
(check_quest_succeeded, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":quest_target_troop"),
(str_store_troop_name_link, s10, ":quest_target_troop"),
],
"{!}.", "lady_duel_rep_1",[]],
[anyone,"lady_duel_rep_1",
[],
"Well, {playername} -- you won your duel with {s10}. Oh, such foolishness, that men should fight over me! Sigh... But it is a bit romantic, I suppose.", "lady_start",[
(call_script, "script_end_quest", "qst_duel_courtship_rival"),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
(add_xp_as_reward, 1000),
]],
[anyone|auto_proceed,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_duel_courtship_rival"),
(check_quest_succeeded, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":quest_target_troop"),
(str_store_troop_name_link, s10, ":quest_target_troop"),
],
"{!}.", "lady_duel_rep_2",[]],
[anyone,"lady_duel_rep_2",
[],
"Well, {playername} -- you won your duel with {s10}. Honor now demands that he and I no longer meet... I was fond of him, you know. You did me no service by fighting him, sir.", "lady_start",[
(call_script, "script_end_quest", "qst_duel_courtship_rival"),
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -2),
(add_xp_as_reward, 1000),
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_duel_for_lady"),
(check_quest_succeeded, "qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_giver_troop, "$g_talk_troop"),
(le, "$talk_context", tc_siege_commander),
(quest_get_slot, ":quest_target_troop", "qst_duel_for_lady", slot_quest_target_troop),
(str_store_troop_name_link, s13, ":quest_target_troop"),
],
"My dear {playername}, how joyous to see you again! I heard you gave that vile {s13} a well-deserved lesson.\
I hope he never forgets his humiliation.\
I've a reward for you, but I fear it's little compared to what you've done for me.", "lady_qst_duel_for_lady_succeeded_1",[]],
[anyone|plyr,"lady_qst_duel_for_lady_succeeded_1", [], "Oh, it will just have to do.", "lady_qst_duel_for_lady_succeeded_2",[
(str_store_string,s10,"@Then take it, with my eternal thanks. You are a noble {man/woman}.\
I will never forget that you helped me in my time of need.")
]],
[anyone|plyr,"lady_qst_duel_for_lady_succeeded_1", [], "{s66}, this is far too much!", "lady_qst_duel_for_lady_succeeded_2",[
(str_store_string,s10,"@Forgive me, {playername}, but I must insist you accept it.\
The money means little to me, and I owe you so much.\
Here, take it, and let us speak no more of this."),
(call_script, "script_change_player_honor", 1),
]],
[anyone|plyr,"lady_qst_duel_for_lady_succeeded_1", [], "Please, {s65}, no reward is necessary.", "lady_qst_duel_for_lady_succeeded_2",[
(str_store_string,s10,"@{playername}, what a dear {man/woman} you are,\
but I will not allow you to refuse this. I owe you far more than I can say,\
and I am sure you can put this money to far better use than I."),
(call_script, "script_change_player_honor", 2),
]],
[anyone,"lady_qst_duel_for_lady_succeeded_2", [], "{s10}", "lady_pretalk",
[(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
(add_xp_as_reward, 1000),
(call_script, "script_troop_add_gold", "trp_player", 2000),
(call_script, "script_end_quest", "qst_duel_for_lady"),
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_duel_for_lady"),
(check_quest_failed, "qst_duel_for_lady"),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_giver_troop, "$g_talk_troop"),
(le, "$talk_context", tc_siege_commander),
(quest_get_slot, ":quest_target_troop", "qst_duel_for_lady", slot_quest_target_troop),
(str_store_troop_name_link, s13, ":quest_target_troop"),
],
"I was told that you sought satisfaction from {s13} to prove my innocence, {playername}.\
It was a fine gesture, and I thank you for your efforts.", "lady_qst_duel_for_lady_failed", []],
[anyone|plyr,"lady_qst_duel_for_lady_failed", [], "I beg your forgiveness for my defeat, {s65}...", "lady_qst_duel_for_lady_failed_2",[]],
[anyone,"lady_qst_duel_for_lady_failed_2", [], "It matters not, dear {playername}. You tried.\
The truth cannot be proven at the point of a sword, but you willingly put your life at stake for my honour.\
That alone will convince many of my innocence.", "lady_pretalk",
[(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 6),
(add_xp_as_reward, 400),
(call_script, "script_end_quest", "qst_duel_for_lady"),
]],
[anyone,"start", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_escort_lady"),
(eq, "$talk_context", tc_entering_center_quest_talk),
(quest_slot_eq, "qst_escort_lady", slot_quest_object_troop, "$g_talk_troop")],
"Thank you for escorting me here, {playername}. Please accept this gift as a token of my gratitude.\
I hope we shall meet again sometime in the future.", "lady_escort_lady_succeeded",
[
(quest_get_slot, ":cur_center", "qst_escort_lady", slot_quest_target_center),
(add_xp_as_reward, 300),
(call_script, "script_troop_add_gold", "trp_player", 250),
(call_script, "script_end_quest", "qst_escort_lady"),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
(troop_set_slot, "$g_talk_troop", slot_troop_cur_center, ":cur_center"),
(remove_member_from_party,"$g_talk_troop"),
]],
[anyone|plyr,"lady_escort_lady_succeeded", [], "It was an honor to serve you, {s65}.", "close_window",[]],
[anyone,"start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(troop_set_slot, "$g_talk_troop", slot_lady_no_messages, 0), #do this for all
(check_quest_active, "qst_visit_lady"),
(quest_slot_eq, "qst_visit_lady", slot_quest_giver_troop, "$g_talk_troop"),
], "Ah {playername} - you must have received my message. How happy I am that you could come!", "lady_start",[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
(call_script, "script_end_quest", "qst_visit_lady"),
# (assign, "$g_time_to_spare", 1),
]],
[anyone,"start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_formal_marriage_proposal"),
(quest_slot_eq, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
(neg|check_quest_succeeded, "qst_formal_marriage_proposal"),
(neg|check_quest_failed, "qst_formal_marriage_proposal"),
], "{playername} - is there any word from my family?", "lady_proposal_pending",[
]],
[anyone,"start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_formal_marriage_proposal"),
(quest_slot_eq, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
(check_quest_failed, "qst_formal_marriage_proposal"),
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
],
"I hear that my {s11} has refused your request to marry me. Does that mean that we must part?", "lady_betrothed",[
(call_script, "script_end_quest", "qst_formal_marriage_proposal"),
]],
#Marriage success
[anyone,"start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(le, "$talk_context", tc_siege_commander),
(check_quest_active, "qst_rescue_lord_by_replace"),
(check_quest_succeeded, "qst_rescue_lord_by_replace"),
(quest_slot_eq, "qst_rescue_lord_by_replace", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":cur_lord", "qst_rescue_lord_by_replace", slot_quest_target_troop),
(call_script, "script_troop_get_family_relation_to_troop", ":cur_lord", "$g_talk_troop"),
],
"Oh, {playername}, you brought him back to me! Thank you ever so much for rescuing my {s11}.\
Please, take this as some small repayment for your noble deed.", "lady_generic_mission_succeeded",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
(add_xp_as_reward, 2000),
(call_script, "script_troop_add_gold", "trp_player", 1500),
(call_script, "script_end_quest", "qst_rescue_lord_by_replace"),
]],
[anyone,"start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(check_quest_active, "qst_rescue_prisoner"),
(check_quest_succeeded, "qst_rescue_prisoner"),
(quest_slot_eq, "qst_rescue_prisoner", slot_quest_giver_troop, "$g_talk_troop"),
(quest_get_slot, ":cur_lord", "qst_rescue_prisoner", slot_quest_target_troop),
(call_script, "script_troop_get_family_relation_to_troop", ":cur_lord", "$g_talk_troop"),
],
"Oh, {playername}, you brought him back to me! Thank you ever so much for rescuing my {s11}.\
Please, take this as some small repayment for your noble deed.", "rescue_prisoner_succeed_1",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
(add_xp_as_reward, 2000),
(call_script, "script_troop_add_gold", "trp_player", 1500),
(call_script, "script_end_quest", "qst_rescue_prisoner"),
]],#rescuerescue
[anyone|plyr,"rescue_prisoner_succeed_1", [], "Always an honour to serve, {s65}.", "lady_pretalk",[]],
#first time greetings
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_lady),
(eq, "$g_talk_troop_met", 0),
(gt, "$g_player_tournament_placement", 4),
(str_clear, s8),
],
"You must be {playername}. We have just had the honor of watching you distinguish yourself in the recent tournament{s8}.",
"lady_meet_end", []],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_lady),
(eq, "$g_talk_troop_met", 0),
(le,"$talk_context",tc_siege_commander),
(assign, ":known_by_relative", 0),
(str_clear, s15),
(try_for_range, ":lord", lords_begin, lords_end),
(call_script, "script_troop_get_family_relation_to_troop", ":lord", "$g_talk_troop"),
(gt, reg0, 5),
(call_script, "script_troop_get_relation_with_troop", "trp_player", ":lord"),
(gt, reg0, 10),
(str_store_string, s15, s11),
(str_store_troop_name, s16, ":lord"),
(assign, ":known_by_relative", ":lord"),
(try_end),
(gt, ":known_by_relative", 0),
],
"You must be {playername}. My {s15} {s16} has spoken most highly of you. I am delighted to make your acquaintance.",
"lady_meet_end", []],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_lady),
(eq, "$g_talk_troop_met", 0),
(le,"$talk_context",tc_siege_commander),
],
"I say, you don't look familiar...", "lady_premeet", []],
#default greet
[anyone,"start",
[(troop_slot_eq, "$g_talk_troop", slot_troop_met, 4),
(lt, "$g_talk_troop_relation", 0),
],
"Ah, {playername}. How good it is to see you again. However, I believe that I am required elsewhere.", "close_window",[]],
[anyone,"start",
[(troop_slot_eq, "$g_talk_troop", slot_troop_met, 4),
],
"{playername} -- how good it is to see you. (Whispers:) I still remember your visits fondly.", "lady_start",[]],
[anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_lady),
(eq, "$g_talk_troop_met", 0),
(gt, "$g_player_tournament_placement", 4),
(ge, "$g_talk_troop_relation", 0),
],
"Ah, {playername}. How spendid it was to see you distinguish yourself in the recent tournament.",
"lady_meet_end", []],
[anyone,"start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(str_store_string, s12, "str_hello_playername"),
# (assign, "$g_time_to_spare", 1),
],
"{s12}", "lady_start",[]],
#lady_start - contains news, quest assignments
[anyone,"lady_start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(troop_slot_ge, "$g_talk_troop", slot_troop_met, 2),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_met, 4),
(troop_get_slot, ":betrothed", "$g_talk_troop", slot_troop_betrothed),
(gt, ":betrothed", -1),
(neq, ":betrothed", "trp_player"),
(str_store_troop_name, s5, ":betrothed"),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":betrothed"),
(lt, reg0, 0),
(ge, "$g_talk_troop_relation", 10),
],
"I have sad news. I have become betrothed to {s5} -- against my will, I should say! Oh {playername} - I would so much rather be wed to you!", "lady_betrothed",[]],
[anyone,"lady_start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(troop_slot_ge, "$g_talk_troop", slot_troop_met, 2),
(troop_get_slot, ":betrothed", "$g_talk_troop", slot_troop_betrothed),
(gt, ":betrothed", -1),
(neq, ":betrothed", "trp_player"),
(str_store_troop_name, s5, ":betrothed"),
],
"Good {playername} -- I have become betrothed to {s5}. It is now no longer seemly for us to see each other like this.", "lady_betrothed",[
# (try_begin),
# (check_quest_active, "qst_visit_lady"),
# (quest_slot_eq, "qst_visit_lady", slot_quest_giver_troop, "$g_talk_troop"),
# (call_script, "script_end_quest", "qst_visit_lady"),
# (try_end),
]],
[anyone,"lady_start",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
(neg|troop_slot_eq, "$g_talk_troop", slot_troop_met, 4),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_spouse, active_npcs_begin),
(gt, "$g_talk_troop_relation", 0),
(assign, "$romantic_rival", -1),
(try_for_range, ":rival_lord", lords_begin, lords_end),
(this_or_next|troop_slot_eq, ":rival_lord", slot_troop_love_interest_1, "$g_talk_troop"),
(this_or_next|troop_slot_eq, ":rival_lord", slot_troop_love_interest_2, "$g_talk_troop"),
(troop_slot_eq, ":rival_lord", slot_troop_love_interest_2, "$g_talk_troop"),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":rival_lord"),
(le, reg0, -4),
(this_or_next|troop_slot_eq, ":rival_lord", slot_lord_reputation_type, lrep_debauched),
(this_or_next|troop_slot_eq, ":rival_lord", slot_lord_reputation_type, lrep_quarrelsome),
(this_or_next|troop_slot_eq, ":rival_lord", slot_lord_reputation_type, lrep_roguish),
(troop_slot_eq, ":rival_lord", slot_lord_reputation_type, lrep_selfrighteous),
(assign, "$romantic_rival", ":rival_lord"),
(try_end),
(gt, "$romantic_rival", 0),
],
"I must tell you -- there is another lord who has been paying me attentions, although I cannot abide him. I fear he has designs on me, and may try to force me to wed against my will.", "lady_other_suitor",[]],
#romantic news/quest assignments end
[anyone,"lady_start", [ #friendly reminder that time is short
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(lt, "$g_time_since_last_talk", 24),
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
(gt, "$g_talk_troop_relation", 0),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_adventurous),
(str_store_string, s11, "str_i_do_enjoy_speaking_to_you_but_i_am_sure_you_understand_that_our_people_cluck_their_tongues_at_a_woman_to_spend_too_long_conversing_with_a_man_outside_her_family__although_the_heavens_know_its_never_the_man_who_is_held_to_blame_"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(str_store_string, s11, "str_as_much_as_i_enjoy_speaking_to_you_i_do_not_care_to_be_gossiped_about_by_others_who_might_lack_my_grace_and_beauty_"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
(str_store_string, s11, "str_i_do_so_enjoy_speaking_to_you_but_as_a_daughter_of_one_of_the_great_families_of_this_land_i_must_set_an_example_of_propriety_"),
(else_try),
(str_store_string, s11, "str_i_do_so_enjoy_speaking_to_you_but_as_a_daughter_of_good_family_i_must_protect_my_reputation_"),
(try_end),
],
"{s11}It is probably not suitable for us to tarry too long here in conversation, but I would hope to see you again soon.", "lady_talk",[]],
[anyone,"lady_start", [ #unfriendly reminder that time is short
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(lt, "$g_time_since_last_talk", 24),
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_adventurous),
(str_store_string, s11, "str_although_it_is_kind_of_you_to_pay_me_such_attentions_i_suspect_that_you_might_find_other_ladies_who_may_be_more_inclined_to_return_your_affection"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(str_store_string, s11, "str_as_flattered_as_i_am_by_your_attentions_perhaps_you_should_seek_out_another_lady_of_somewhat_shall_we_say_different_tastes"),
(else_try),
(str_store_string, s11, "str_as_flattered_as_i_am_by_your_attentions_i_am_a_daughter_of_good_family_and_must_be_aware_of_my_reputation_it_is_not_seemly_that_i_converse_too_much_at_one_time_with_one_man_i_am_sure_you_understand_now_if_you_will_excuse_me"),
(try_end),
],
"{s11}", "lady_talk",[]],
[anyone, "lady_start", [
(eq, "$lady_flirtation_location", "$g_encountered_party"),
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 1),
], "I was planning to retire for a little while, but perhaps we may have a chance to speak more later...", "lady_talk", []],
#Defeault lady_start - no news, assignments
[anyone,"lady_start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
(gt, "$g_talk_troop_relation", 0),
(str_clear, s12),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
(gt, "$g_talk_troop_relation", 0),
(gt, "$g_time_since_last_talk", 24),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_otherworldly),
(str_store_string, s12, "str_ah_my_gentle_playername_how_much_good_it_does_my_heart_to_see_you_again"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_adventurous),
(str_store_string, s12, "str_playername__i_am_so_glad_to_see_you_again_i_must_say_i_do_envy_your_freedom_to_ride_out_and_experience_the_world"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
(str_store_string, s12, "str_playername__i_am_so_glad_to_see_you_i_trust_that_you_have_been_behaving_honorably_since_last_we_met"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(str_store_string, s12, "str_greetings_playername__it_is_good_to_see_you_i_hope_that_you_have_had_success_in_your_efforts_to_make_your_name_in_the_world"),
(else_try),
(str_store_string, s12, "str_playername__i_am_so_glad_that_you_were_able_to_come"),
(try_end),
(try_end),
],"It is so delightful to have a chance to spend some time together.{s12}","lady_talk", []],
[anyone,"lady_start", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
],"What brings you here today?","lady_talk", []],
#Betrothed
[anyone|plyr, "lady_proposal_pending", [],
"No word so far...", "close_window",[]],
[anyone|plyr, "lady_proposal_pending", [],
"On second thought, now is not the time for us to marry", "lady_proposal_pending_end",[]],
[anyone,"lady_proposal_pending_end", [
(try_begin),
(gt, "$g_talk_troop_effective_relation", 19),
(str_store_string, s11, "str_very_well__i_will_let_you_choose_the_time"),
(else_try),
(str_store_string, s11, "str_good_i_am_glad_that_you_have_abandoned_the_notion_of_pushing_me_into_marriage_before_i_was_ready"),
(try_end),
],
"{s11}", "close_window",[
(call_script, "script_end_quest", "qst_formal_marriage_proposal"),
]],
[anyone|plyr,"lady_betrothed", [],
"Never! We must elope together at once!", "lady_suggest_elope",[]],
[anyone|plyr,"lady_betrothed", [
(troop_slot_eq, "$g_talk_troop", slot_troop_betrothed, -1),
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(call_script, "script_troop_get_family_relation_to_troop", reg0, "$g_talk_troop"),
],
"Perhaps I may still be able to change your {s11}'s mind", "lady_pretalk",[]],
[anyone|plyr,"lady_betrothed", [],
"So be it -- let us then part", "lady_conclude_relationship",[
]],
[anyone,"lady_suggest_elope", [(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional)],
"Good {playername} -- you are a good and kind man, but a lady cannot defy her family. Such things are not done!", "lady_conclude_relationship",[]],
[anyone,"lady_suggest_elope",
[
(assign, "$romantic_rival", -1),
(try_for_range, ":possible_rival", lords_begin, lords_end),
(this_or_next|troop_slot_eq, ":possible_rival", slot_troop_love_interest_1, "$g_talk_troop"),
(this_or_next|troop_slot_eq, ":possible_rival", slot_troop_love_interest_2, "$g_talk_troop"),
(troop_slot_eq, ":possible_rival", slot_troop_love_interest_2, "$g_talk_troop"),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":possible_rival"),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, s4, ":possible_rival"),
(display_message, "str_rival_found_s4_reg0_relation"),
(try_end),
(gt, reg0, "$g_talk_troop_relation"),
(assign, "$romantic_rival", ":possible_rival"),
(try_end),
(gt, "$romantic_rival", -1),
],
"Sir -- as you may know, I have been entertaining offers from a number of gentlemen such as yourself. I am not yet at a stage where I can commit to any of them.", "lady_other_suitor",[
]],
[anyone,"lady_suggest_elope", [
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 350)
],
"Ah {playername}, you must realize. You are still finding your way in the world. I have great affection for you, {playername}, but I will not consign myself to obscurity.", "lady_conclude_relationship",[]],
[anyone,"lady_suggest_elope", [
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
(lt, "$player_honor", 20)
],
"Ah {playername}, although you are kind to me, I am not certain enough of your moral fiber to risk such a thing. Although I bare little affection for my husband, it would be a weighty thing to go against my family's wishes, and I am not certain enough of you to take that step.", "lady_conclude_relationship",[]],
[anyone,"lady_suggest_elope", [(le, "$g_talk_troop_effective_relation", 20),],
"Good {playername} -- to elope would be to throw away my ties with my family, which are everything to me! I have a considerable affection for you, but I am not sure that I am prepared to risk that.", "lady_conclude_relationship",[]],
[anyone,"lady_suggest_elope", [
(assign, "$home_for_spouse", -1),
(try_for_range, ":player_center", centers_begin, centers_end),
(eq, "$home_for_spouse", -1),
(party_slot_eq, ":player_center", slot_town_lord, "trp_player"),
(is_between, ":player_center", walled_centers_begin, walled_centers_end),
# (this_or_next|is_between, ":player_center", walled_centers_begin, walled_centers_end),
# (party_slot_eq, ":player_center", slot_center_has_manor, 1),
(assign, "$home_for_spouse", ":player_center"),
(try_end),
(eq, "$home_for_spouse", -1),
],
"Good {playername} -- I am not used to the hardships of campaigning as you are. I want a home to call my own. If you were lord of a castle or town with a great hall, I would gladly go there as your wife, to be mistress of the household. But I do not wish to live like a hunted animal.", "lady_conclude_relationship",[]],
[anyone,"lady_suggest_elope", [
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(call_script, "script_troop_get_family_relation_to_troop", reg0, "$g_talk_troop"),
],
"Elope with you? Yes -- we could do that. It is a great step to defy my family -- but a loveless marriage, and life without you, might be a far worse thing! But be warned -- this will be a terrible blow to my {s11}'s prestige, and he will do everything in his power to bring you down.", "lady_elope_agree",[]],
[anyone|plyr,"lady_elope_agree", [],
"Quickly, then! There is no time to lose.", "lady_elope_agree_nurse",[
]],
[anyone|plyr,"lady_elope_agree", [],
"Everything in his power, you say? Em... Let me think about this...", "close_window",[
]],
[anyone, "lady_elope_agree_nurse", [],
"Your lordship... Your ladyship... Would you like me to witness your exchange of vows?", "lady_elope_agree_lady_vows",[
(set_conversation_speaker_troop, trp_nurse_for_lady),
]],
[anyone, "lady_elope_agree_lady_vows", [
(str_store_troop_name, s4, "$g_talk_troop"),
],
"Yes, do that. For my part, I make the following vow: I, {s4}, do swear that I accept {playername} as my husband, according to the ancient law and custom of our land...", "lady_elope_agree_nurse_2",[
]],
[anyone, "lady_elope_agree_nurse_2", [],
"Very good. Do you, {playername}, swear similarly to accept {s4} as your wife?", "lady_elope_agree_player_vows",[
(set_conversation_speaker_troop, trp_nurse_for_lady),
]],
[anyone|plyr,"lady_elope_agree_player_vows", [],
"I do.", "close_window",[
(call_script, "script_courtship_event_bride_marry_groom", "$g_talk_troop", "trp_player", 1), #1 is elopement
]],
[anyone|plyr,"lady_elope_agree_player_vows", [],
"Eh, what? This is all moving too fast...", "close_window",[
]],
#markspot - do elopement here
[anyone|plyr,"lady_elope_agree", [],
"Oh, really? My dear -- I could never separate a lady from her family like that...", "lady_conclude_relationship",[
]],
[anyone,"lady_conclude_relationship", [],
"So I suppose our time together must come to an end...", "lady_conclude_relationship_confirm", []],
[anyone|plyr,"lady_conclude_relationship_confirm", [],
"Yes -- it must be...", "lady_conclude_relationship_confirm_yes", []],
[anyone|plyr,"lady_conclude_relationship_confirm", [],
"Wait -- perhaps there is still a chance for us!", "lady_conclude_relationship_confirm_no", []],
[anyone,"lady_conclude_relationship_confirm_yes", [],
"Farewell, {playername}. We will see each other, in the courts and castles of this realm, but we must keep our distance from each other. I will remember these days fondly, nonetheless.", "close_window", [
(troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
]],
[anyone,"lady_conclude_relationship_confirm_no", [],
"In that case, we shall see what the future brings.", "close_window", [
]],
[anyone|plyr,"lady_generic_mission_succeeded", [], "Always an honour to serve, {s65}.", "lady_pretalk",[]],
[anyone|plyr ,"lady_premeet", [], "I am {playername}.", "lady_meet", []],
[anyone|plyr ,"lady_premeet", [], "My name is {playername}. At your service.", "lady_meet", []],
[anyone, "lady_meet", [
(troop_slot_ge, "trp_player", slot_troop_renown, 200),
], "Of course. How splendid to finally make your acquaintance.", "lady_meet_end", []],
[anyone, "lady_meet", [], "{playername}? I do not believe I've heard of you before.", "lady_meet_end", []],
[anyone, "lady_meet_end", [
(eq, "$lady_flirtation_location", "$g_encountered_party"),
], "I am about to retire for a little while, but perhaps we may have a chance to speak more later...", "lady_talk", []],
[anyone, "lady_meet_end", [
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
(call_script, "script_troop_get_romantic_chemistry_with_troop", "$g_talk_troop", "trp_player"),
(le, reg0, 0),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
(le, reg0, 0),
], "Now, if you will excuse me...", "lady_talk", []],
[anyone, "lady_meet_end", [], "Can I help you with anything?", "lady_talk", []],
[anyone|plyr,"lady_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(ge, "$g_encountered_party_relation", 0),
],
"I want to know the location of someone.", "lord_talk_ask_location",[]],
##### TODO: QUESTS COMMENT OUT BEGIN
## [anyone|plyr,"lady_talk", [(check_quest_active, "qst_deliver_message_to_lover"),
## (quest_slot_eq, "qst_deliver_message_to_lover", slot_quest_target_troop, "$g_talk_troop"),
## (quest_get_slot, ":troop_no", "qst_deliver_message_to_lover", slot_quest_giver_troop),
## (str_store_troop_name_link, 3, ":troop_no")],
## "I have brought you a message from {s3}", "lady_message_from_lover_success",[(call_script, "script_finish_quest", "qst_deliver_message_to_lover", 100)]],
##
## [anyone|plyr,"lady_talk", [(check_quest_active, "qst_rescue_lady_under_siege"),
## (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_object_troop, "$g_talk_troop"),
## (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_current_state, 0)],
## "TODO: I'm taking you home!", "lady_rescue_from_siege_check",[]],
##
##
## [anyone,"lady_rescue_from_siege_check", [(neg|hero_can_join)],
## "TODO: You don't have enough room for me!", "close_window",[]],
##
##
## [anyone,"lady_rescue_from_siege_check", [], "TODO: Thank you so much!", "lady_pretalk",[(quest_set_slot, "qst_rescue_lady_under_siege", slot_quest_current_state, 1),
## (troop_set_slot, "$g_talk_troop", slot_troop_cur_center, 0),
## (troop_join, "$g_talk_troop")]],
## [anyone,"lady_message_from_lover_success", [], "TODO: Thank you so much!", "lady_pretalk",[]],
##
[anyone,"lady_pretalk", [
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
(call_script, "script_troop_get_romantic_chemistry_with_troop", "$g_talk_troop", "trp_player"),
(le, reg0, 0),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
(le, reg0, 0),
], "Now, if you will excuse me...", "lady_talk",[]],
[anyone,"lady_pretalk", [], "Is there anything else?", "lady_talk",[]],
##[anyone|plyr,"lady_talk",
## [(troop_get_type, ":is_female", "trp_player"),
## (eq, ":is_female", 0),],
## "{!}CHEAT: I want to marry you! (1)", "wedding_ceremony_bride_vow",[]],
##[anyone|plyr,"lady_talk",
## [(troop_get_type, ":is_female", "trp_player"),
## (eq, ":is_female", 0),],
## "{!}CHEAT: I want to marry you! (2)", "lady_elope_agree_nurse_2",[]],
[anyone|plyr,"lady_talk",
[],
"May I have the honor of knowing more about you, my lady?", "lady_relations",[]],
[anyone,"lady_relations",
[
(str_store_string, s12, "str_i_am"),
(assign, ":relation_found", 0),
(assign, ":in_castle_of_relative", 0),
(try_for_range, ":lord", active_npcs_begin, kingdom_ladies_end), #use this as the basis for "troop_describe_relation_with_troop"
(call_script, "script_troop_get_family_relation_to_troop", "$g_talk_troop", ":lord"), #The normal order is reversed, because the lady is describing herself
(this_or_next|gt, reg0, 5),
(party_slot_eq, "$g_encountered_party", slot_town_lord, ":lord"),
(gt, reg0, 0),
(str_store_troop_name, s14, ":lord"),
(try_begin),
(eq, ":relation_found", 1),
(str_store_string, s12, "str_s12"),
(try_end),
(str_store_string, s12, "str_s12_s11_to_s14"),
(assign, ":relation_found", 1),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_town_lord, ":lord"),
(assign, ":in_castle_of_relative", 1),
(try_end),
(try_end),
(try_begin),
(eq, ":in_castle_of_relative", 1),
(str_store_string, s12, "str_s12"),
(else_try),
(eq, ":in_castle_of_relative", 0),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
(str_store_string, s12, "str_s12_i_am_here_for_the_feast"),
(else_try),
(str_store_string, s12, "str_s12"),
(try_end),
],
"{s12}", "lady_pretalk",[]],
[anyone|plyr,"lady_talk",
[
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 0),
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 1),
(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
(neq, "$lady_flirtation_location", "$g_encountered_party"),
],
"My lady, I would like to profess myself your most ardent admirer", "lady_profess_admiration",
[
(call_script, "script_troop_get_romantic_chemistry_with_troop", "$g_talk_troop", "trp_player"),
(assign, ":reaction_change", reg0),
# (try_begin),
# (gt, "$g_player_tournament_placement", 3),
# (val_sub, "$g_player_tournament_placement", 3),
# (val_mul, "$g_player_tournament_placement", 4), #Twice normal, but is divided by two
# (else_try),
# (assign, "$g_player_tournament_placement", 0),
# (try_end),
# (try_begin),
# (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional),
# (val_mul, "$g_player_tournament_placement", 2),
# (else_try),
# (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
# (val_div, "$g_player_tournament_placement", 2),
# (try_end),
# (val_add, ":reaction_change", "$g_player_tournament_placement"),
# (assign, "$g_player_tournament_placement", 0),
(val_div, ":reaction_change", 2),
(val_max, ":reaction_change", -2),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":reaction_change"),
(assign, "$g_time_to_spare", 0),
]],
[anyone|plyr,"lady_talk",
[
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 0),
(gt, "$g_player_tournament_placement", 3),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
],
"My lady, I would like to dedicate my successes in this recent tournament to you", "lady_tournament_dedication_reaction",
[
(try_begin),
(gt, "$g_player_tournament_placement", 3),
(val_sub, "$g_player_tournament_placement", 3),
(val_mul, "$g_player_tournament_placement", 2),
(else_try),
(assign, "$g_player_tournament_placement", 0),
(try_end),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lady_used_tournament, 1),
(val_div, "$g_player_tournament_placement", 3),
(str_store_string, s9, "str_another_tournament_dedication_oh_i_suppose_it_is_always_flattering"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional),
(val_mul, "$g_player_tournament_placement", 2),
(str_store_string, s9, "str_do_you_why_what_a_most_gallant_thing_to_say"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
(val_div, "$g_player_tournament_placement", 2),
(str_store_string, s9, "str_hmm_i_cannot_say_that_i_altogether_approve_of_such_frivolity_but_i_must_confess_myself_a_bit_flattered"),
(else_try),
(str_store_string, s9, "str_why_thank_you_you_are_most_kind_to_do_so"),
(try_end),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", "$g_player_tournament_placement"),
(assign, "$g_player_tournament_placement", 0),
(troop_set_slot, "$g_talk_troop", slot_lady_used_tournament, 1),
]],
[anyone,"lady_tournament_dedication_reaction", [],
"{s9}", "lady_pretalk",
[]],
[anyone,"lady_profess_admiration", [
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
(gt, reg0, 0),
(try_begin),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
(str_store_string, s11, "str_you_are_most_courteous_and_courtesy_is_a_fine_virtue_"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(str_store_string, s11, "str_hmm_youre_a_bold_one_but_i_like_that_"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_adventurous),
(str_store_string, s11, "str_ah_well_they_all_say_that_but_no_matter_a_compliment_well_delivered_is_at_least_a_good_start_"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_otherworldly),
(str_store_string, s11, "str_oh_do_you_mean_that_such_a_kind_thing_to_say"),
(else_try),
(str_store_string, s11, "str_you_are_a_most_gallant_young_man_"),
(try_end),
],
"{s11}I would like it very much if we could see more of each other.", "close_window",
[(troop_set_slot, "$g_talk_troop", slot_troop_met, 2),
(assign, "$lady_flirtation_location", "$g_encountered_party"),
]],
[anyone,"lady_profess_admiration", [
],
"Ah... You are too kind... My, the hour is getting rather late, isn't it? I really must be going.", "lady_pretalk",
[(troop_set_slot, "$g_talk_troop", slot_troop_met, 2),
]],
[anyone|plyr,"lady_talk",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
(eq, "$g_time_to_spare", 1),
(eq, "$talk_context", tc_courtship),
],
"Do you like poetry, my lady?", "lady_recite_poetry",[
(assign, "$g_time_to_spare", 0),
]],
[anyone,"lady_recite_poetry", [
],
"That would depend on the poem. Did you intend to recite a verse?", "lady_recite_poetry",
[]],
[anyone|plyr,"lady_recite_poetry",
[
(gt, "$tragic_poem_recitations", 0),
(troop_slot_eq, "$g_talk_troop", slot_lady_courtship_tragic_recited, 0),
],
"The wind that blows the dry steppe dust...", "lady_recite_poetry_response",[
(assign, "$poem_selected", courtship_poem_tragic),
(troop_set_slot, "$g_talk_troop", slot_lady_courtship_tragic_recited, 1),
]],
[anyone|plyr,"lady_recite_poetry",
[
(gt, "$comic_poem_recitations", 0),
(troop_slot_eq, "$g_talk_troop", slot_lady_courtship_comic_recited, 0),
],
"All the silks of Veluca/All the furs of Khudan...", "lady_recite_poetry_response",[
(assign, "$poem_selected", courtship_poem_comic),
(troop_set_slot, "$g_talk_troop", slot_lady_courtship_comic_recited, 1),
]],
[anyone|plyr,"lady_recite_poetry",
[
(gt, "$mystic_poem_recitations", 0),
(troop_slot_eq, "$g_talk_troop", slot_lady_courtship_mystic_recited, 0),
],
"You are the first and the last/the outer and the inner...", "lady_recite_poetry_response",[
(assign, "$poem_selected", courtship_poem_mystic),
(troop_set_slot, "$g_talk_troop", slot_lady_courtship_mystic_recited, 1),
]],
[anyone|plyr,"lady_recite_poetry",
[
(gt, "$heroic_poem_recitations", 0),
(troop_slot_eq, "$g_talk_troop", slot_lady_courtship_heroic_recited, 0),
],
"A light pierced the gloom over Wercheg cliffs...", "lady_recite_poetry_response",[
(assign, "$poem_selected", courtship_poem_heroic),
(troop_set_slot, "$g_talk_troop", slot_lady_courtship_heroic_recited, 1),
]],
[anyone|plyr,"lady_recite_poetry",
[
(gt, "$allegoric_poem_recitations", 0),
(troop_slot_eq, "$g_talk_troop", slot_lady_courtship_allegoric_recited, 0),
],
"I deflected her skeptical questioning darts/with armor made of purest devotion...", "lady_recite_poetry_response",[
(assign, "$poem_selected", courtship_poem_allegoric),
(troop_set_slot, "$g_talk_troop", slot_lady_courtship_allegoric_recited, 1),
]],
[anyone|plyr,"lady_recite_poetry",
[],"Actually, I can't think of any that I would care to recite...", "lady_pretalk",[]],
[anyone,"lady_recite_poetry_response",
[
(call_script, "script_courtship_poem_reactions", "$g_talk_troop", "$poem_selected"),
],
"{s11}", "lady_private_conversation_end",[
(assign, ":reaction", reg0),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":reaction"),
(call_script, "script_courtship_poem_reactions", "$g_talk_troop", "$poem_selected"), #this needs to be twice, as the above resets s11
]],
[anyone,"lady_private_conversation_end",
[
(str_clear, s11),
(try_begin),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
(gt, reg0, 0),
(str_store_string, s11, "str__do_come_and_see_me_again_soon"),
(try_end),
],
"Time is passing quickly, and we cannot linger here too long.", "lady_pretalk",
[
(assign, "$g_time_to_spare", 0),
]],
[anyone|plyr,"lady_talk",
[
(neg|check_quest_active, "qst_formal_marriage_proposal"),
(neg|troop_slot_ge, "trp_player", slot_troop_betrothed, active_npcs_begin),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
(troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
(eq, "$talk_context", tc_courtship),
],
"Do you think that we may have a future together, my lady?", "lady_marriage_discussion",[
]],
[anyone,"lady_marriage_discussion",
[
(assign, "$romantic_rival", -1),
(try_for_range, ":possible_rival", lords_begin, lords_end),
(this_or_next|troop_slot_eq, ":possible_rival", slot_troop_love_interest_1, "$g_talk_troop"),
(this_or_next|troop_slot_eq, ":possible_rival", slot_troop_love_interest_2, "$g_talk_troop"),
(troop_slot_eq, ":possible_rival", slot_troop_love_interest_2, "$g_talk_troop"),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":possible_rival"),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, s4, ":possible_rival"),
(display_message, "str_rival_found_s4_reg0_relation"),
(try_end),
(gt, reg0, "$g_talk_troop_relation"),
(assign, "$romantic_rival", ":possible_rival"),
(try_end),
(gt, "$romantic_rival", -1),
],
"Sir -- as you may know, I have been entertaining offers from a number of gentlemen such as yourself. I am not yet at a stage where I can commit to any of them.", "lady_other_suitor",[
]],
[anyone,"lady_marriage_discussion",
[
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 350),
],
"It is good to hear that you are thinking seriously about the future. However, I would like to see you rise a little further in the world before I am ready to commit to marry you.", "lady_proposal_refused",[
]],
[anyone,"lady_marriage_discussion",
[
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
(lt, "$player_honor", 10)
],
"It is good to hear that your intentions are honorable. However, I have resolved only to marry a man of the strongest moral fiber. I would like you to prove yourself more in that regard.", "lady_proposal_refused",[
]],
[anyone,"lady_marriage_discussion",
[
(lt, "$g_talk_troop_relation", 20),
],
"Sir -- it is comforting to hear that your intentions towards me are honorable. But perhaps we should take the time to get to allow our affections for each other to grow a little stronger, before making any such decision.", "lady_proposal_refused",[
]],
[anyone,"lady_marriage_discussion",
[
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(troop_slot_eq, ":guardian", slot_lord_granted_courtship_permission, -1),
(str_store_troop_name, s4, reg0),
(call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
],
"Oh {playername}, how happy that would make me! But my {s11} {s4} would never allow it... Perhaps it is best that we part...", "lady_betrothed", []],
[anyone,"lady_marriage_discussion",
[
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
(str_store_troop_name, s4, ":guardian"),
],
"Oh {playername}, how happy that would make me! Go ask my {s11} {s4} for permission!", "close_window",[
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(str_store_troop_name, s12, ":guardian"),
(str_store_troop_name, s15, "$g_talk_troop"),
(setup_quest_text, "qst_formal_marriage_proposal"),
(str_store_string, s2, "str_you_intend_to_ask_s12_for_permission_to_marry_s15"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_target_troop, ":guardian"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_expiration_days, 30),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_current_state, 0),
(call_script, "script_start_quest", "qst_formal_marriage_proposal", "$g_talk_troop"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
#Repeated to ensure strings work correctly
(call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
(str_store_troop_name, s4, ":guardian"),
]],
[anyone|plyr,"lady_proposal_refused",
[
(is_between, "$g_talk_troop_relation", 12, 20),
(this_or_next|neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(troop_slot_ge, "trp_player", slot_troop_renown, 350),
(this_or_next|neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
(ge, "$player_honor", 10),
],
"Perhaps I can persuade you to delay no further.", "lady_proposal_refused_persuade_check",[
]],
[anyone,"lady_proposal_refused_persuade_check",
[
],
"What do you have to say?", "lady_proposal_refused_persuade_player_response",[
(assign, reg4, 20),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
(assign, ":cur_relation", reg0),
(assign, reg5, ":cur_relation"),
(assign, reg9, 1),
(store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
(store_sub, ":difference", 20, ":cur_relation"),
(val_mul, ":persuasion_level", 2),
(try_begin),
(gt, ":difference", ":persuasion_level"),
(assign, "$g_persuasion_failure_chance", 100),
(else_try),
(store_mul, "$g_persuasion_failure_chance", ":difference", 100),
(val_div, "$g_persuasion_failure_chance", ":persuasion_level"),
(try_end),
(assign, reg8, "$g_persuasion_failure_chance"),
(store_sub, reg7, 100, "$g_persuasion_failure_chance"),
(dialog_box, "str_persuasion_opportunity"),
]],
[anyone|plyr,"lady_proposal_refused_persuade_player_response",
[
],
"Love is as a rose, my lady. Left unplucked, it may wither.", "lady_proposal_refused_persuade_result",[
]],
[anyone|plyr,"lady_proposal_refused_persuade_player_response",
[],
"Oh, never mind.", "lady_pretalk",
[]],
[anyone,"lady_proposal_refused_persuade_result",
[
(store_random_in_range, ":random", 0, 100),
(lt, ":random", "$g_persuasion_failure_chance"),
],
"Enough, sir! I shall not be rushed into marriage, with you or with anyone else! You have made me very cross. Please, leave me alone for a while. I shall let you know when I am ready to speak to you again.", "close_window", [
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -1),
(jump_to_menu, "mnu_town"),
(finish_mission),
]],
[anyone,"lady_proposal_refused_persuade_result",
[
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(troop_slot_eq, ":guardian", slot_lord_granted_courtship_permission, -1),
(str_store_troop_name, s4, reg0),
(call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
],
"Oh {playername}, I could never allow that to happen! Oh, if only we could be wed! But my {s11} {s4} would never give his permission... Perhaps it is best that we part...", "lady_betrothed", [
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 5),
]],
[anyone,"lady_proposal_refused_persuade_result",
[
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
(str_store_troop_name, s4, ":guardian"),
],
"Oh {playername}, I could never allow that to happen! Go ask my {s11} {s4} his permission for us to be wed!", "close_window",[
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 5),
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(str_store_troop_name, s12, ":guardian"),
(str_store_troop_name, s15, "$g_talk_troop"),
(setup_quest_text, "qst_formal_marriage_proposal"),
(str_store_string, s2, "str_you_intend_to_ask_s12_for_permission_to_marry_s15"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_target_troop, ":guardian"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_expiration_days, 30),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_current_state, 0),
(call_script, "script_start_quest", "qst_formal_marriage_proposal", "$g_talk_troop"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
]],
[anyone|plyr,"lady_proposal_refused",
[],
"Very well -- I shall continue to strive to be worthy of your esteem!", "close_window",[
]],
[anyone|plyr,"lady_proposal_refused",
[
(eq, 1, 0),
(neg|check_quest_active, "qst_formal_marriage_proposal"),
],
"I am tired of these games! I will speak to your family about arranging a wedding immediately..", "lady_player_threatens_compel",[
]],
[anyone,"lady_player_threatens_compel",
[],
"What? Do you mean that?", "lady_player_threatens_compel_2",[
]],
[anyone|plyr,"lady_player_threatens_compel_2",
[],
"No, of couse not. Please forgive my burst of temper", "lady_private_conversation_end",[
]],
[anyone|plyr,"lady_player_threatens_compel_2",
[],
"Yes -- you clearly do not know what is in your best interests.", "close_window",[
(call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
(assign, ":guardian", reg0),
(str_store_troop_name, s10, "$g_talk_troop"),
(str_store_troop_name, s12, ":guardian"),
(setup_quest_text, "qst_formal_marriage_proposal"),
(str_store_string, s2, "str_you_intend_to_ask_s12_to_pressure_s10_to_marry_you"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_target_troop, ":guardian"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_expiration_days, 30),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_current_state, 0),
(call_script, "script_start_quest", "qst_formal_marriage_proposal", "$g_talk_troop"),
(quest_set_slot, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
]],
#rival suitor sequence
[anyone|plyr,"lady_other_suitor",
[],
"It grieves me to hear that, my lady, but such things must be", "lady_pretalk",
[]],
[anyone|plyr,"lady_other_suitor",
[],
"Who is the miscreant! Tell me his name!", "lady_other_suitor_challenge",
[]],
[anyone|plyr,"lady_other_suitor", #similar to other
[
(eq, 1, 0),
],
"I am tired of these games! I will demand that your family compel you to marry me..", "lady_player_threatens_compel",[
]],
[anyone,"lady_other_suitor_challenge",
[
(check_quest_active,"qst_duel_courtship_rival"),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "$romantic_rival"),
(lt, reg0, 0)
],
"I would be so grateful! But from what I understand, you already have a duel on your hands. He is not honor-bound to fight you, if you are committed to another combat. Please, conclude your other business in a hurry, to rescue me from that man's attentions!.", "lady_pretalk",
[]],
[anyone,"lady_other_suitor_challenge",
[
(check_quest_active,"qst_duel_courtship_rival")
],
"Ah! Such talk. But from what I hear, you already have a duel on your hands. Finish one before you start another! Sigh... You men can be so silly...", "lady_pretalk",
[]],
[anyone,"lady_other_suitor_challenge",
[
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "$romantic_rival"),
(lt, reg0, 0),
(str_store_troop_name, s5, "$romantic_rival"),
],
"It is {s5}. Please, rescue me from that man's attentions!", "lady_other_suitor_challenge_confirm",
[]],
[anyone,"lady_other_suitor_challenge",
[
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(str_store_troop_name, s5, "$romantic_rival"),
],
"Will you now? This should be interesting. Very well. Your rival is {s5}. Let us see which of you has the greater mettle.", "lady_other_suitor_challenge_confirm",
[
(assign, "$quarrel_penalty", 0),
]],
[anyone,"lady_other_suitor_challenge",
[
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional),
(str_store_troop_name, s5, "$romantic_rival"),
],
"Oh, fie! I wish that this were not a matter of honor, so I could refuse such a request. But alas, I feel compelled to tell you that your rival is {s5}. I wish that heaven had not granted me such a fair visage, so that I would not inspire such passions in men!", "lady_other_suitor_challenge_confirm",
[
(assign, "$quarrel_penalty", -1),
]],
[anyone,"lady_other_suitor_challenge",
[
(str_store_troop_name, s5, "$romantic_rival"),
],
"I will have none of such talk! It is nonsense for you and {s5} to fight over -- whoops! I beg of you, sir, forget the name that just escaped my lips...", "lady_other_suitor_challenge_confirm",
[
(assign, "$quarrel_penalty", -3),
]],
[anyone|plyr,"lady_other_suitor_challenge_confirm",
[],
"So be it! I shall challenge him to a trial of arms!", "lady_other_suitor_challenge_confirm_yes",
[]],
[anyone|plyr,"lady_other_suitor_challenge_confirm",
[],
"On second thought, I let my passions run away with me there. Never mind.", "lady_other_suitor_challenge_confirm_no",
[]],
[anyone,"lady_other_suitor_challenge_confirm_yes",
[
(try_begin),
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "$romantic_rival"),
(lt, reg0, 0),
(str_store_string, s15, "str_do_be_careful_i_am_so_much_endebted_to_you_for_this"),
(else_try),
(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
(str_store_string, s15, "str_go_then__we_shall_see_which_of_you_triumphs"),
(else_try),
(str_store_string, s15, "str_sigh_i_will_never_truly_understand_men_and_their_rash_actions"),
(try_end),
],
"{s15}", "lady_pretalk",
[
(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", "$quarrel_penalty"),
(str_store_troop_name, s11, "$g_talk_troop"),
(str_store_troop_name_link, s13, "$romantic_rival"),
(setup_quest_text, "qst_duel_courtship_rival"),
(str_store_string, s2, "str_you_intend_to_challenge_s13_to_force_him_to_relinquish_his_suit_of_s11"),
(call_script, "script_start_quest", "qst_duel_courtship_rival", "$g_talk_troop"),
(quest_set_slot, "qst_duel_courtship_rival", slot_quest_target_troop, "$romantic_rival"),
(quest_set_slot, "qst_duel_courtship_rival", slot_quest_xp_reward, 400),
(quest_set_slot, "qst_duel_courtship_rival", slot_quest_expiration_days, 60),
(quest_set_slot, "qst_duel_courtship_rival", slot_quest_current_state, 0),
]],
[anyone,"lady_other_suitor_challenge_confirm_no",
[],
"Good. You are wise not to let your temper guide you.", "lady_private_conversation_end",
[]],
[anyone|plyr,"lady_talk",
[
(troop_slot_ge, "$g_talk_troop", slot_troop_spouse, 0),
# (troop_slot_ge, "$g_talk_troop", slot_troop_met, 2),
(store_partner_quest, ":ladys_quest"),
(lt, ":ladys_quest", 0)
],
"Is there anything I can do to win your favour?", "lady_ask_for_quest",[(call_script, "script_get_quest", "$g_talk_troop"),
(assign, "$random_quest_no", reg0)]],
[anyone,"lady_ask_for_quest",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
],
"I don't have anything else for you to do right now.", "lady_pretalk", []],
[anyone,"lady_ask_for_quest",
[
(this_or_next|eq, "$random_quest_no", "qst_rescue_lord_by_replace"),
(eq, "$random_quest_no", "qst_rescue_prisoner"),
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(call_script, "script_troop_get_family_relation_to_troop", ":quest_target_troop", "$g_talk_troop"),
(str_store_string, s17, s11),
],
"Oh, I fear I may never see my {s17}, {s13}, again... He is a prisoner in the dungeon of {s14}.\
We have tried to negotiate his ransom, but it has been set too high.\
We can never hope to raise that much money without selling everything we own,\
and God knows {s13} would rather spend his life in prison than make us destitute.\
Instead I came up with a plan to get him out of there, but it requires someone to make a great sacrifice,\
and so far my pleas have fallen on deaf ears...", "lady_mission_told",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(call_script, "script_troop_get_family_relation_to_troop", ":quest_target_troop", "$g_talk_troop"),
(str_store_string, s17, s11),
(str_store_troop_name, s11, "$g_talk_troop"),
(str_store_troop_name_link, s13, ":quest_target_troop"),
(str_store_party_name_link, s14, ":quest_target_center"),
(setup_quest_text,"$random_quest_no"),
(try_begin),
(eq, "$random_quest_no", "qst_rescue_lord_by_replace"),
(str_store_string, s2, "@{s11} asked you to rescue her {s17}, {s13}, from {s14} by switching clothes and taking his place in prison."),
(else_try),
(str_store_string, s2, "@{s11} asked you to rescue her {s17}, {s13}, from {s14}."),
(try_end),
]],
[anyone,"lady_ask_for_quest", [
(eq, "$random_quest_no", "qst_deliver_message_to_prisoner_lord"),
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(call_script, "script_troop_get_family_relation_to_troop", ":quest_target_troop", "$g_talk_troop"),
],
"My poor {s11}, {s13}, is a prisoner in the {s14} dungeons.\
The only way we can talk to each other is by exchanging letters whenever we can,\
but the journey is so dangerous that we get little chance to do so.\
Please, would you deliver one for me?", "lady_mission_told",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(str_store_troop_name, s11, "$g_talk_troop"),
(str_store_troop_name_link, s13, ":quest_target_troop"),
(str_store_party_name_link, s14, ":quest_target_center"),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@{s11} asked you to deliver a message to {s13}, who is imprisoned at {s14}."),
]],
[anyone,"lady_ask_for_quest", [(eq, "$random_quest_no", "qst_duel_for_lady")],
"Dear {playername}, you are kind to ask, but you know little of my troubles\
and I can't possibly ask you to throw yourself into danger on my behalf.", "lady_quest_duel_for_lady",[]],
[anyone|plyr,"lady_quest_duel_for_lady", [], "Tell me what the problem is, and I can make my own decision.", "lady_quest_duel_for_lady_2",
[
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(str_store_troop_name, s11, "$g_talk_troop"),
(str_store_troop_name_link, s13, ":quest_target_troop"),
(str_store_string, s2, "@You agreed to challenge {s13} to defend {s11}'s honour."),
(setup_quest_text,"$random_quest_no"),
]],
[anyone,"lady_quest_duel_for_lady_2", [], "Very well, as you wish it...\
My husband has made certain enemies in his life, {playername}. One of the most insidious is {s13}.\
He is going around making terrible accusations against me, impugning my honour at every turn!\
Because he cannot harm my husband directly, he is using me as a target to try and stain our name.\
You should hear the awful things he's said! I only wish there was someone brave enough to make him recant his slander,\
but {s13} is a very fine swordsman, and he's widely feared...", "lady_quest_duel_for_lady_3",[]],
[anyone|plyr,"lady_quest_duel_for_lady_3", [], "I fear him not, {s65}. I will make him take back his lies.", "lady_quest_duel_for_lady_3_accepted",[]],
[anyone,"lady_quest_duel_for_lady_3_accepted", [], "Oh! I can't ask that of you, {playername}, but...\
I would be forever indebted to you, and you are so sure. It would mean so much if you would defend my honour.\
Thank you a thousand times, all my prayers and my favour go with you.", "close_window",
[
(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
(call_script, "script_report_quest_troop_positions", "$random_quest_no", ":quest_target_troop", 3),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
]],
[anyone|plyr,"lady_quest_duel_for_lady_3", [], "If he's that dangerous, perhaps maybe it would be better to ignore him...", "lady_quest_duel_for_lady_3_rejected",[]],
[anyone,"lady_quest_duel_for_lady_3_rejected", [], "Oh... Perhaps you're right, {playername}.\
I should let go of these silly childhood ideas of chivalry and courage. {Men/People} are not like that,\
not anymore. Good day to you.", "close_window",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
]],
[anyone,"lady_ask_for_quest", [], "No, {playername}, I've no need for a champion right now.", "lady_pretalk",[]],
[anyone|plyr,"lady_mission_told", [], "As you wish it, {s65}, it shall be done.", "lady_mission_accepted",[]],
[anyone|plyr,"lady_mission_told", [], "{s66}, I fear I cannot help you right now.", "lady_mission_rejected",[]],
[anyone,"lady_mission_accepted", [], "You are a true {gentleman/lady}, {playername}.\
Thank you so much for helping me", "close_window",
[
(try_begin),
(eq, "$random_quest_no", "qst_deliver_message_to_prisoner_lord"),
(call_script, "script_troop_add_gold", "trp_player", 10),
(try_end),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
]],
[anyone,"lady_mission_rejected", [], "You'll not help a woman in need? You should be ashamed, {playername}...\
Please leave me, I have some important embroidery to catch up.", "close_window",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
]],
#Leave
[anyone|plyr,"lady_talk", [
(troop_slot_ge, "$g_talk_troop", slot_troop_spouse, 0),
], "I want to improve my relation with a lord. Can you help me?", "lady_restore_relation",[]],
[anyone,"lady_restore_relation", [(le, "$g_talk_troop_relation", 0)], "{playername}, I don't know you well enough to act on your behalf. I am sorry.", "lady_pretalk",[]],
[anyone,"lady_restore_relation", [], "Hmm. I guess you got on the wrong side of somebody. Very well, who do you want to restore your relation with?", "lady_restore_relation_2",[]],
[anyone|plyr|repeat_for_troops,"lady_restore_relation_2", [(store_repeat_object, ":troop_no"),
(is_between, ":troop_no", active_npcs_begin, active_npcs_end),
(store_troop_faction, ":faction_no", ":troop_no"),
(eq, "$g_talk_troop_faction", ":faction_no"),
(call_script, "script_troop_get_player_relation", ":troop_no"),
(lt, reg0, 0),
(str_store_troop_name, s1, ":troop_no")],
"{s1}", "lady_restore_relation_2b",[(store_repeat_object, "$troop_to_restore_relations_with")]],
[anyone|plyr,"lady_restore_relation_2", [], "Never mind. I get along with everyone well enough.", "lady_pretalk",[]],
[anyone,"lady_restore_relation_2b", [(str_store_troop_name, s10, "$troop_to_restore_relations_with")], "Well I can try to help you there.\
I am sure a few expensive gifts will make {s10} look at you more favorably.", "lady_restore_relation_3",[]],
[anyone,"lady_restore_relation_3", [(str_store_troop_name, s10, "$troop_to_restore_relations_with"),
(assign, "$lady_restore_cost_1", 1000),
(assign, "$lady_restore_cost_2", 2000),
(assign, "$lady_restore_cost_3", 3000),
(assign, reg10, "$lady_restore_cost_1"),
(assign, reg11, "$lady_restore_cost_2"),
(assign, reg12, "$lady_restore_cost_3"),
(troop_get_type, reg4, "$troop_to_restore_relations_with"),
],
"You can improve your relation with {s10} by sending {reg4?her:him} a gift worth {reg10} denars.\
But if you can afford spending {reg11} denars on the gift, it would make a good impression on {reg4?her:him}.\
And if you can go up to {reg12} denars, that would really help smooth things out.", "lady_restore_relation_4",[]],
[anyone|plyr,"lady_restore_relation_4", [(store_troop_gold,":gold", "trp_player"),
(ge, ":gold", "$lady_restore_cost_1"),
(assign, reg10, "$lady_restore_cost_1")],
"I think a gift of {reg10} denars will do.", "lady_restore_relation_5",[(assign, "$temp", 1), (assign, "$temp_2", "$lady_restore_cost_1")]],
[anyone|plyr,"lady_restore_relation_4", [(store_troop_gold,":gold", "trp_player"),
(ge, ":gold", "$lady_restore_cost_2"),
(assign, reg11, "$lady_restore_cost_2")],
"Maybe I can afford {reg11} denars.", "lady_restore_relation_5",[(assign, "$temp", 2), (assign, "$temp_2", "$lady_restore_cost_2")]],
[anyone|plyr,"lady_restore_relation_4", [(store_troop_gold,":gold", "trp_player"),
(ge, ":gold", "$lady_restore_cost_3"),
(assign, reg12, "$lady_restore_cost_3")],
"In that case, I am ready to spend {reg12} denars.", "lady_restore_relation_5",[(assign, "$temp", 3), (assign, "$temp_2", "$lady_restore_cost_3")]],
[anyone|plyr,"lady_restore_relation_4", [], "I don't think I can afford a gift at the moment.", "lady_restore_relation_cant_afford",[]],
[anyone,"lady_restore_relation_5", [], "Excellent. Then I'll choose an appropriate gift for you and send it to {s10} with your compliments.\
I am sure {reg4?she:he} will appreciate the gesture.", "lady_restore_relation_6",[
(troop_remove_gold, "trp_player","$temp_2"),
(call_script, "script_change_player_relation_with_troop", "$troop_to_restore_relations_with", "$temp"),
(troop_get_type, reg4, "$troop_to_restore_relations_with"),
]],
[anyone|plyr,"lady_restore_relation_6", [], "Thank you for your help, madame.", "lady_pretalk",[]],
[anyone,"lady_restore_relation_cant_afford", [], "I am afraid, I can't be of much help in that case, {playername}. I am sorry.", "lady_pretalk",[]],
[anyone|plyr,"lady_talk", [], "I must beg my leave.", "lady_leave",[]],
[anyone|auto_proceed,"lady_leave", [
(call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
(try_begin),
(lt, reg0, 0),
(str_store_string, s12, "str_farewell"),
(else_try),
(str_store_string, s12, "str_farewell_playername"),
(try_end),
], "{s12}", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1)]],
#Convincing bargaining
[anyone,"convince_begin", [], "I still don't see why I should accept what you're asking of me.", "convince_options",
[(quest_get_slot, "$convince_value", "$g_convince_quest", slot_quest_convince_value),
]],
[anyone|plyr,"convince_options", [(assign, reg8, "$convince_value")], "Then I'll make it worth your while. ({reg8} denars)", "convince_bribe",[]],
[anyone|plyr,"convince_options",
[(store_div, "$convince_relation_penalty", "$convince_value", 300),
(val_add, "$convince_relation_penalty", 1),
(assign, reg9, "$convince_relation_penalty")],
"Please, do it for the sake of our friendship. (-{reg9} to relation)", "convince_friendship",[]],
[anyone|plyr,"convince_options", [], "Let me try and convince you. (Persuasion)", "convince_persuade_begin", []],
[anyone|plyr,"convince_options", [], "Never mind.", "lord_pretalk",[]],
[anyone,"convince_bribe", [], "Mmm, a generous gift to my coffers would certainly help matters...\
{reg8} denars should do it. If you agree, then I'll go with your suggestion.", "convince_bribe_verify",[]],
[anyone|plyr,"convince_bribe_verify", [(store_troop_gold, ":gold", "trp_player"),
(lt, ":gold", "$convince_value")],
"I'm afraid my finances will not allow for such a gift.", "convince_bribe_cant_afford",[]],
[anyone|plyr,"convince_bribe_verify", [(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", "$convince_value")],
"Very well, please accept these {reg8} denars as a token of my gratitude.", "convince_bribe_goon",[]],
[anyone|plyr,"convince_bribe_verify", [], "Let me think about this some more.", "convince_begin",[]],
[anyone,"convince_bribe_cant_afford", [], "Ah. In that case, there is little I can do,\
unless you have some further argument to make.", "convince_options",[]],
[anyone,"convince_bribe_goon", [], "My dear {playername}, your generous gift has led me to reconsider what you ask,\
and I have come to appreciate the wisdom of your proposal.", "convince_accept",[(troop_remove_gold, "trp_player","$convince_value")]],
[anyone,"convince_friendship",
[(store_add, ":min_relation", 5, "$convince_relation_penalty"),
(ge, "$g_talk_troop_effective_relation", ":min_relation")], "You've done well by me in the past, {playername},\
and for that I will go along with your request, but know that I do not like you using our relationship this way.", "convince_friendship_verify",[]],
[anyone|plyr,"convince_friendship_verify", [], "I am sorry, my friend, but I need your help in this.", "convince_friendship_go_on",[]],
[anyone|plyr,"convince_friendship_verify", [], "If it will not please you, then I'll try something else.", "lord_pretalk",[]],
[anyone,"convince_friendship_go_on", [], "All right then, {playername}, I will accept this for your sake. But remember, you owe me for this.", "convince_accept",
[(store_sub, ":relation_change", 0, "$convince_relation_penalty"),
(call_script, "script_change_player_relation_with_troop","$g_talk_troop",":relation_change")]],
[anyone,"convince_friendship",
[(ge, "$g_talk_troop_relation", -5)], "I don't think I owe you such a favor {playername}.\
I see no reason to accept this for you.", "lord_pretalk",[]],
[anyone,"convince_friendship", [], "Is this a joke? You've some nerve asking me for favours, {playername},\
and let me assure you you'll get none.", "lord_pretalk",[]],
[anyone,"convince_persuade_begin",
[(troop_get_slot, ":last_persuasion_time", "$g_talk_troop", slot_troop_last_persuasion_time),
(store_current_hours, ":cur_hours"),
(store_add, ":valid_time", ":last_persuasion_time", 24),
(gt, ":cur_hours", ":valid_time"),
],
"Very well. Make your case.", "convince_persuade_begin_2",[]],
[anyone|plyr,"convince_persuade_begin_2", [], "[Attempt to persuade]", "convince_persuade",[
(try_begin),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 30),
(store_current_hours, ":cur_hours"),
(troop_set_slot, "$g_talk_troop", slot_troop_last_persuasion_time, ":cur_hours"),
(try_end),
(store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
(store_add, ":persuasion_potential", ":persuasion_level", 5),
(store_random_in_range, ":random_1", 0, ":persuasion_potential"),
(store_random_in_range, ":random_2", 0, ":persuasion_potential"),
(store_add, ":rand", ":random_1", ":random_2"),
(assign, ":persuasion_difficulty", "$convince_value"),
(convert_to_fixed_point, ":persuasion_difficulty"),
(store_sqrt, ":persuasion_difficulty", ":persuasion_difficulty"),
(convert_from_fixed_point, ":persuasion_difficulty"),
(val_div, ":persuasion_difficulty", 10),
(val_add, ":persuasion_difficulty", 4),
(store_sub, "$persuasion_strength", ":rand", ":persuasion_difficulty"),
(val_mul, "$persuasion_strength", 20),
(assign, reg5, "$persuasion_strength"),
(val_sub, "$convince_value", "$persuasion_strength"),
(quest_set_slot, "$g_convince_quest", slot_quest_convince_value, "$convince_value"),
(str_store_troop_name, s50, "$g_talk_troop"),
(troop_get_type, reg51, "$g_talk_troop"),
(try_begin),
(lt, "$persuasion_strength", -30),
(str_store_string, s5, "str_persuasion_summary_very_bad"),
(else_try),
(lt, "$persuasion_strength", -10),
(str_store_string, s5, "str_persuasion_summary_bad"),
(else_try),
(lt, "$persuasion_strength", 10),
(str_store_string, s5, "str_persuasion_summary_average"),
(else_try),
(lt, "$persuasion_strength", 30),
(str_store_string, s5, "str_persuasion_summary_good"),
(else_try),
(str_store_string, s5, "str_persuasion_summary_very_good"),
(try_end),
(dialog_box, "@{s5} (Persuasion strength: {reg5})", "@Persuasion Attempt"),
]],
[anyone|plyr,"convince_persuade_begin_2", [], "Wait, perhaps there is another way to convince you.", "convince_begin",[]],
[anyone,"convince_persuade_begin", [], "By God's grace, {playername}!\
Haven't we talked enough already? I am tired of listening to you,\
and I do not want to hear any more of it right now.", "lord_pretalk",[]],
[anyone,"convince_persuade", [(le, "$convince_value", 0)], "All right, all right. You have persuaded me to it.\
I'll go ahead with what you suggest.", "convince_accept",[]],
[anyone,"convince_persuade", [(gt, "$persuasion_strength", 5)], "You've a point, {playername},\
I'll admit that much. However I am not yet convinced I should do as you bid.", "convince_options",[]],
[anyone,"convince_persuade", [(gt, "$persuasion_strength", -5)], "Enough, {playername}.\
You've a lot of arguments, but I find none of them truly convincing. I stand by what I said before.", "convince_options",[]],
[anyone,"convince_persuade", [], "Truthfully, {playername}, I fail to see the virtue of your reasoning.\
What you ask for makes even less sense now than it did before.", "convince_options",[]],
#Seneschal
[anyone,"start", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_seneschal),
(eq, "$talk_context", tc_siege_won_seneschal),
(str_store_party_name, s1, "$g_encountered_party"),
],
"I must congratulate you on your victory, my {lord/lady}. Welcome to {s1}.\
We, the housekeepers of this castle, are at your service.", "siege_won_seneschal_1",[]],
[anyone|plyr,"siege_won_seneschal_1", [], "Are you the seneschal?", "siege_won_seneschal_2",[]],
[anyone,"siege_won_seneschal_2", [], "Indeed I am, my {lord/lady}.\
I have always served the masters of {s1} to the best of my ability, whichever side they might be on.\
Thus you may count on my utmost loyalty for as long as you are the {lord/lady} of this place.\
Now, do you intend to keep me on as the seneschal? I promise you will not be disappointed.", "siege_won_seneschal_3",[]],
[anyone|plyr,"siege_won_seneschal_3", [], "Very well, you may keep your post for the time being.", "siege_won_seneschal_4",[]],
[anyone|plyr,"siege_won_seneschal_3", [], "You can stay, but I shall be keeping a close watch on you.", "siege_won_seneschal_4",[]],
[anyone,"siege_won_seneschal_4", [], "Thank you, my {lord/lady}. If you do not mind my impudence,\
may I inquire as to what you wish to do with the castle?", "siege_won_seneschal_5",[]],
[anyone|plyr,"siege_won_seneschal_5", [], "I will sell it to another lord.", "siege_won_seneschal_6",[]],
[anyone|plyr,"siege_won_seneschal_5", [], "I intend to claim it for myself.", "siege_won_seneschal_6",[]],
[anyone|plyr,"siege_won_seneschal_5", [], "I haven't given it much thought. What are my options?", "siege_won_seneschal_list_options",[]],
[anyone,"siege_won_seneschal_list_options", [], "According to our laws and traditions,\
you can do one of several things.\
First, you could station a garrison here to protect the castle from any immediate counterattacks,\
then request an audience with some wealthy lord and ask him to make you an offer.\
It would be worth a tidy sum, believe you me.\
If you do not wish to sell, then you will have to find yourself a liege lord and protector who would accept homage from you.\
Without a royal investiture and an army at your back, you would have a difficult time holding on to the castle.\
Both you and {s1} would become great big targets for any man with a few soldiers and a scrap of ambition.\
", "siege_won_seneschal_list_options_2",[]],
[anyone|plyr,"siege_won_seneschal_list_options_2", [], "What do you mean, a liege lord and protector? I won this place by my own hand, I don't need anyone else!", "siege_won_seneschal_list_options_3",[]],
[anyone,"siege_won_seneschal_list_options_3", [], "Of course you don't, my {lord/lady}.\
However, no lord in the land will recognize your claim to the castle unless it is verified by royal decree.\
They would call {s1} an outlaw stronghold and take it from you at the earliest opportunity.\
Surely not even you could stand against a whole army.", "siege_won_seneschal_list_options_4",[]],
[anyone|plyr,"siege_won_seneschal_list_options_4", [], "Hmm. I'll give it some thought.", "siege_won_seneschal_6",[]],
[anyone,"siege_won_seneschal_6", [], "I am very pleased to hear it, my {lord/lady}.\
I am only trying to serve you to the best of my ability. Now,\
if at any time you find you have further need of me,\
I will be in the great hall arranging a smooth handover of the castle to your forces.\
", "close_window",[]],
[anyone,"start", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_seneschal),(eq,"$g_talk_troop_met",0),(str_store_party_name,s1,"$g_encountered_party")],
"Good day, {sir/madam}. I do nott believe I've seen you here before.\
Let me extend my welcome to you as the seneschal of {s1}.", "seneschal_intro_1",[]],
[anyone|plyr,"seneschal_intro_1", [], "A pleasure to meet you, {s65}.", "seneschal_intro_1a",[]],
[anyone,"seneschal_intro_1a", [], "How can I help you?", "seneschal_talk",[]],
[anyone|plyr,"seneschal_intro_1", [], "What exactly do you do here?", "seneschal_intro_1b",[]],
[anyone,"seneschal_intro_1b", [], "Ah, a seneschal's duties are many, good {sire/woman}.\
For example, I collect the rents from my lord's estates, I manage the castle's storerooms,\
I deal with the local peasantry, I take care of castle staff, I arrange supplies for the garrison...\
All mundane matters on this fief are my responsibility, on behalf of my lord.\
Everything except commanding the soldiers themselves.", "seneschal_talk",[]],
[anyone,"start", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_seneschal)],
"Good day, {sir/madam}.", "seneschal_talk",[]],
[anyone,"seneschal_pretalk", [], "Anything else?", "seneschal_talk",[]],
##### TODO: QUESTS COMMENT OUT BEGIN
## [anyone|plyr,"seneschal_talk", [(check_quest_active, "qst_deliver_supply_to_center_under_siege"),
## (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_target_troop, "$g_talk_troop"),
## (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_current_state, 1),
## (store_item_kind_count, ":no_supplies", "itm_siege_supply"),
## (quest_get_slot, ":target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
## (ge, ":no_supplies", ":target_amount")],
## "TODO: Here are the supplies.", "seneschal_supplies_given",[]],
##
## [anyone|plyr,"seneschal_talk", [(check_quest_active, "qst_deliver_supply_to_center_under_siege"),
## (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_target_troop, "$g_talk_troop"),
## (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_current_state, 1),
## (store_item_kind_count, ":no_supplies", "itm_siege_supply"),
## (quest_get_slot, ":target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
## (lt, ":no_supplies", ":target_amount"),
## (gt, ":no_supplies", 0)],
## "TODO: Here are the supplies, but some of them are missing.", "seneschal_supplies_given_missing",[]],
##
## [anyone|plyr,"seneschal_talk", [(check_quest_active, "qst_deliver_supply_to_center_under_siege"),
## (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_object_troop, "$g_talk_troop"),
## (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_current_state, 0)],
## "TODO: Give me the supplies.", "seneschal_supplies",[]],
##
## [anyone,"seneschal_supplies", [(store_free_inventory_capacity, ":free_inventory"),
## (quest_get_slot, ":quest_target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
## (ge, ":free_inventory", ":quest_target_amount"),
## (quest_get_slot, ":quest_target_center", "qst_deliver_supply_to_center_under_siege", slot_quest_target_center),
## (str_store_party_name, 0, ":quest_target_center"),
## (troop_add_items, "trp_player", "itm_siege_supply", ":quest_target_amount")],
## "TODO: Here, take these supplies. You must deliver them to {s0} as soon as possible.", "seneschal_pretalk",[(quest_set_slot, "qst_deliver_supply_to_center_under_siege", slot_quest_current_state, 1)]],
##
## [anyone,"seneschal_supplies", [],
## "TODO: You don't have enough space to take the supplies. Free your inventory and return back to me.", "seneschal_pretalk",[]],
##
##
## [anyone,"seneschal_supplies_given", [],
## "TODO: Thank you.", "seneschal_pretalk",[(party_get_slot, ":town_siege_days", "$g_encountered_party", slot_town_siege_days),
## (quest_get_slot, ":target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
## (val_sub, ":town_siege_days", ":target_amount"),
## (try_begin),
## (lt, ":town_siege_days", 0),
## (assign, ":town_siege_days", 0),
## (try_end),
## (party_set_slot, "$g_encountered_party", slot_town_siege_days, ":town_siege_days"),
## (troop_remove_items, "trp_player", "itm_siege_supply", ":target_amount"),
## (call_script, "script_finish_quest", "qst_deliver_supply_to_center_under_siege", 100)]],
##
## [anyone,"seneschal_supplies_given_missing", [],
## "TODO: Thank you but it's not enough...", "seneschal_pretalk",[(store_item_kind_count, ":no_supplies", "itm_siege_supply"),
## (quest_get_slot, ":target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
## (assign, ":percentage_completed", 100),
## (val_mul, ":percentage_completed", ":no_supplies"),
## (val_div, ":percentage_completed", ":target_amount"),
## (call_script, "script_finish_quest", "qst_deliver_supply_to_center_under_siege", ":percentage_completed"),
## (party_get_slot, ":town_siege_days", "$g_encountered_party", slot_town_siege_days),
## (val_sub, ":town_siege_days", ":no_supplies"),
## (try_begin),
## (lt, ":town_siege_days", 0),
## (assign, ":town_siege_days", 0),
## (try_end),
## (party_set_slot, "$g_encountered_party", slot_town_siege_days, ":town_siege_days"),
## (troop_remove_items, "trp_player", "itm_siege_supply", ":no_supplies"),
## (call_script, "script_end_quest", "qst_deliver_supply_to_center_under_siege")]],
##
##### TODO: QUESTS COMMENT OUT END
[anyone|plyr,"seneschal_talk", [(store_relation, ":cur_rel", "fac_player_supporters_faction", "$g_encountered_party_faction"),
(ge, ":cur_rel", 0),],
"I would like to ask you a question...", "seneschal_ask_something",[]],
[anyone|plyr,"seneschal_talk", [(store_relation, ":cur_rel", "fac_player_supporters_faction", "$g_encountered_party_faction"),
(ge, ":cur_rel", 0),],
"I wish to know more about someone...", "seneschal_ask_about_someone",[]],
[anyone,"seneschal_ask_about_someone", [],
"Perhaps I may be able to help. Whom did you have in mind?", "seneschal_ask_about_someone_2",[]],
# [anyone|plyr|repeat_for_troops,"seneschal_ask_about_someone_2", [(store_repeat_object, ":troop_no"),
# (is_between, ":troop_no", heroes_begin, heroes_end),
# (store_troop_faction, ":faction_no", ":troop_no"),
# (eq, "$g_encountered_party_faction", ":faction_no"),
# (str_store_troop_name, s1, ":troop_no")],
# "{s1}", "seneschal_ask_about_someone_3",[(store_repeat_object, "$hero_requested_to_learn_relations")]],
[anyone|plyr,"seneschal_ask_about_someone_2", [], "Never mind.", "seneschal_pretalk",[]],
# [anyone, "seneschal_ask_about_someone_3", [(call_script, "script_troop_write_family_relations_to_s1", "$hero_requested_to_learn_relations"),
# (call_script, "script_troop_write_owned_centers_to_s2", "$hero_requested_to_learn_relations")
# ],
# "{s2}{s1}", "seneschal_ask_about_someone_4",[(add_troop_note_from_dialog, "$hero_requested_to_learn_relations", 2)]],
# [anyone, "seneschal_ask_about_someone_relation", [(call_script, "script_troop_count_number_of_enemy_troops", "$hero_requested_to_learn_relations"),
# (assign, ":no_enemies", reg0),
# (try_begin),
# (gt, ":no_enemies", 1),
# (try_for_range, ":i_enemy", 1, ":no_enemies"),
# (store_add, ":slot_no", slot_troop_enemies_begin, ":i_enemy"),
# (troop_get_slot, ":cur_enemy", "$hero_requested_to_learn_relations", ":slot_no"),
# (str_store_troop_name_link, s50, ":cur_enemy"),
# (try_begin),
# (eq, ":i_enemy", 1),
# (troop_get_slot, ":cur_enemy", "$hero_requested_to_learn_relations", slot_troop_enemy_1),
# (str_store_troop_name_link, s51, ":cur_enemy"),
# (str_store_string, s51, "str_s50_and_s51"),
# (else_try),
# (str_store_string, s51, "str_s50_comma_s51"),
# (try_end),
# (try_end),
# (else_try),
# (eq, ":no_enemies", 1),
# (troop_get_slot, ":cur_enemy", "$hero_requested_to_learn_relations", slot_troop_enemy_1),
# (str_store_troop_name_link, s51, ":cur_enemy"),
# (else_try),
# (str_store_string, s51, "str_noone"),
# (try_end),
# (troop_get_type, reg1, "$hero_requested_to_learn_relations")],
# "{reg1?She:He} hates {s51}.", "seneschal_ask_about_someone_4",[(add_troop_note_from_dialog, "$hero_requested_to_learn_relations", 3)]],
# Ryan END
# [anyone|plyr,"seneschal_ask_about_someone_4", [], "Where does {s1} stand with others?.", "seneschal_ask_about_someone_relation",[]],
# [anyone|plyr,"seneschal_ask_about_someone_4", [], "My thanks, that was helpful.", "seneschal_pretalk",[]],
[anyone|plyr,"seneschal_talk", [], "I must take my leave of you now. Farewell.", "close_window",[]],
[anyone,"seneschal_ask_something", [],
"I'll do what I can to help, of course. What did you wish to ask?", "seneschal_ask_something_2",[]],
[anyone|plyr,"seneschal_ask_something_2", [],
"Perhaps you know where to find someone...", "seneschal_ask_location",[]],
[anyone,"seneschal_ask_location", [],
"Well, a man in my position does hear a lot of things. Of whom were you thinking?", "seneschal_ask_location_2",[]],
[anyone|plyr|repeat_for_troops,"seneschal_ask_location_2", [(store_repeat_object, ":troop_no"),
(is_between, ":troop_no", heroes_begin, heroes_end),
(store_troop_faction, ":faction_no", ":troop_no"),
(eq, "$g_encountered_party_faction", ":faction_no"),
(str_store_troop_name, s1, ":troop_no")],
"{s1}", "seneschal_ask_location_3",[(store_repeat_object, "$hero_requested_to_learn_location")]],
[anyone|plyr,"seneschal_ask_location_2", [], "Never mind.", "seneschal_pretalk",[]],
[anyone,"seneschal_ask_location_3", [(call_script, "script_get_information_about_troops_position", "$hero_requested_to_learn_location", 0)],
"{s1}", "seneschal_pretalk",[]],
#caravan merchants
[anyone,"start",
[(eq, "$caravan_escort_state",1),
(eq, "$g_encountered_party","$caravan_escort_party_id"),
(le, "$talk_context",tc_party_encounter),
(store_distance_to_party_from_party, reg0, "$caravan_escort_destination_town", "$caravan_escort_party_id"),
(lt, reg0, 5),
(str_store_party_name, s3, "$caravan_escort_destination_town"),
(assign, reg3, "$caravan_escort_agreed_reward"),
],
"There! I can see the walls of {s3} in the distance. We've made it safely.\
Here, take this purse of {reg3} denars, as I promised. I hope we can travel together again someday.", "close_window",
[
(assign,"$caravan_escort_state",0),
(call_script, "script_troop_add_gold", "trp_player", "$caravan_escort_agreed_reward"),
(assign,reg(4), "$caravan_escort_agreed_reward"),
(val_mul,reg(4), 1),
(add_xp_as_reward,reg(4)),
(assign, "$g_leave_encounter",1),
]],
[anyone,"start",
[(eq, "$caravan_escort_state", 1),
(eq, "$g_encountered_party", "$caravan_escort_party_id"),
(eq, "$talk_context", tc_party_encounter),
],
"We've made it this far... Is everything clear up ahead?", "talk_caravan_escort",[]],
[anyone|plyr,"talk_caravan_escort", [],
"There might be bandits nearby. Stay close.", "talk_caravan_escort_2a",[]],
[anyone,"talk_caravan_escort_2a", [],
"Trust me, {playername}, we're already staying as close to you as we can. Lead the way.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone|plyr,"talk_caravan_escort", [],
"No sign of trouble, we can breathe easy.", "talk_caravan_escort_2b",[]],
[anyone,"talk_caravan_escort_2b", [],
"I'll breathe easy when we reach {s1} and not a moment sooner. Let's keep moving.", "close_window",[[str_store_party_name,s1,"$caravan_escort_destination_town"],(assign, "$g_leave_encounter",1)]],
[anyone,"start", [(eq,"$talk_context", tc_party_encounter),
(eq, "$g_encountered_party_type", spt_kingdom_caravan),
(party_slot_ge, "$g_encountered_party", slot_party_last_toll_paid_hours, "$g_current_hours"),
],
"What do you want? We paid our toll to you less than three days ago.", "merchant_talk",[]],
[anyone,"start", [(eq,"$talk_context", tc_party_encounter),(eq, "$g_encountered_party_type", spt_kingdom_caravan),(ge,"$g_encountered_party_relation",0)],
"Hail, friend.", "merchant_talk",[]],
[anyone,"start", [(eq,"$talk_context", tc_party_encounter),
(eq, "$g_encountered_party_type", spt_kingdom_caravan),
(lt,"$g_encountered_party_relation",0),
(eq, "$g_encountered_party_faction", "fac_merchants"),
],
"What do you want? We are but simple merchants, we've no quarrel with you, so leave us alone.", "merchant_talk",[]],
[anyone,"start", [(eq,"$talk_context", tc_party_encounter),
(eq, "$g_encountered_party_type", spt_kingdom_caravan),
(lt,"$g_encountered_party_relation",0),
(faction_get_slot, ":faction_leader", "$g_encountered_party_faction",slot_faction_leader),
(str_store_troop_name, s9, ":faction_leader"),
],
"Be warned, knave! This caravan is under the protection of {s9}.\
Step out of our way or you will face his fury!", "merchant_talk",[]],
[anyone,"start", [(party_slot_eq, "$g_encountered_party", slot_party_type, spt_kingdom_caravan),(this_or_next|eq,"$talk_context", tc_party_encounter),(eq,"$talk_context", 0)],
"Yes? What do you want?", "merchant_talk",[]],
[anyone,"merchant_pretalk", [], "Anything else?", "merchant_talk",[]],
[anyone|plyr,"merchant_talk", [(le,"$talk_context", tc_party_encounter),
(check_quest_active, "qst_cause_provocation"),
(neg|check_quest_concluded, "qst_cause_provocation"),
(quest_slot_eq, "qst_cause_provocation", slot_quest_target_faction, "$g_encountered_party_faction"),
(quest_get_slot, ":giver_troop", "qst_cause_provocation", slot_quest_giver_troop),
(store_faction_of_troop, ":giver_troop_faction", ":giver_troop"),
(str_store_faction_name, s17, ":giver_troop_faction"),
],
"You are trespassing in the territory of the {s17}. I am confiscating this caravan and all its goods!", "caravan_start_war_quest_1",[]],
[anyone,"caravan_start_war_quest_1", [(quest_get_slot, ":giver_troop", "qst_cause_provocation", slot_quest_giver_troop),
(store_faction_of_troop, ":giver_troop_faction", ":giver_troop"),
(str_store_faction_name, s17, ":giver_troop_faction"),
],
"What? What nonsense is this? We are at peace with the {s17}, and are free to cross its lands!", "caravan_start_war_quest_2",[]],
[anyone|plyr,"caravan_start_war_quest_2", [], "We'll see about that! Defend yourselves!", "merchant_attack",[]],
[anyone|plyr,"caravan_start_war_quest_2", [], "Hmm. Maybe this was all a misunderstanding. Farewell.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone|plyr,"merchant_talk", [(le,"$talk_context", tc_party_encounter),(eq, "$g_encountered_party_faction", "$players_kingdom")], "I have an offer for you.", "merchant_talk_offer",[]],
[anyone,"merchant_talk_offer", [], "What is it?", "merchant_talk_offer_2",[]],
[anyone|plyr,"merchant_talk_offer_2", [(eq,"$talk_context", tc_party_encounter),(eq, "$g_encountered_party_faction", "$players_kingdom")],
"I can escort you to your destination for a price.", "caravan_offer_protection",[]],
## [anyone|plyr,"merchant_talk_offer_2", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"), #he is not a faction leader!
## (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
## (eq, reg0, 0), #he has no castles or towns
## (hero_can_join),
## ],
## "I need capable men like you. Will you join me?", "knight_offer_join",[
## ]],
[anyone|plyr,"merchant_talk_offer_2", [], "Nothing. Forget it", "merchant_pretalk",[]],
[anyone|plyr,"merchant_talk", [(check_quest_active, "qst_track_down_bandits"),
], "I am hunting a group of bandits with the following description... Have you seen them?", "merchant_bandit_information",[]],
[anyone,"merchant_bandit_information", [
(call_script, "script_get_manhunt_information_to_s15", "qst_track_down_bandits"),
], "{s15}", "merchant_pretalk",[]],
[anyone|plyr,"merchant_talk", [(eq,"$talk_context", tc_party_encounter), #TODO: For the moment don't let attacking if merchant has paid toll.
], "Tell me about your journey", "merchant_trip_explanation",[]],
[anyone, "merchant_trip_explanation", [
(party_get_slot, ":origin", "$g_encountered_party", slot_party_last_traded_center),
(party_get_slot, ":destination", "$g_encountered_party", slot_party_ai_object),
(str_store_party_name, s11, ":origin"),
(str_store_party_name, s12, ":destination"),
(str_store_string, s14, "str___we_believe_that_there_is_money_to_be_made_selling_"),
(store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
(assign, ":at_least_one_item_found", 0),
(try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
(store_add, ":cur_goods_price_slot", ":cur_goods", ":item_to_price_slot"),
(party_get_slot, ":origin_price", ":origin", ":cur_goods_price_slot"),
(party_get_slot, ":destination_price", ":destination", ":cur_goods_price_slot"),
(gt, ":destination_price", ":origin_price"),
(store_sub, ":price_dif", ":destination_price", ":origin_price"),
(gt, ":price_dif", 200),
(str_store_item_name, s15, ":cur_goods"),
(str_store_string, s14, "str_s14s15_"),
(assign, ":at_least_one_item_found", 1),
(try_end),
(try_begin),
(eq, ":at_least_one_item_found", 0),
(str_store_string, s14, "str__we_carry_a_selection_of_goods_although_the_difference_in_prices_for_each_is_not_so_great_we_hope_to_make_a_profit_off_of_the_whole"),
(else_try),
(str_store_string, s14, "str_s14and_other_goods"),
(try_end),
], "We are coming from {s11} and heading to {s12}.{s14}", "merchant_pretalk", []],
[anyone|plyr,"merchant_talk", [(eq,"$talk_context", tc_party_encounter), #TODO: For the moment don't let attacking if merchant has paid toll.
(neg|party_slot_ge, "$g_encountered_party", slot_party_last_toll_paid_hours, "$g_current_hours"),
], "I demand something from you!", "merchant_demand",[]],
[anyone,"merchant_demand", [(eq,"$talk_context", tc_party_encounter)], "What do you want?", "merchant_demand_2",[]],
[anyone|plyr,"merchant_demand_2", [(neq,"$g_encountered_party_faction","$players_kingdom")], "There is a toll for free passage here!", "merchant_demand_toll",[]],
[anyone,"merchant_demand_toll", [(gt, "$g_strength_ratio", 70),
(store_div, reg6, "$g_ally_strength", 2),
(val_add, reg6, 40),
(assign, "$temp", reg6),
], "Please, I don't want any trouble. I can give you {reg6} denars, just let us go.", "merchant_demand_toll_2",[]],
[anyone,"merchant_demand_toll", [(store_div, reg6, "$g_ally_strength", 4),
(val_add, reg6, 10),
(assign, "$temp", reg6),
], "I don't want any trouble. I can give you {reg6} denars if you'll let us go.", "merchant_demand_toll_2",[]],
[anyone|plyr,"merchant_demand_toll_2", [], "Agreed, hand it over and you may go in peace.", "merchant_demand_toll_accept",[]],
[anyone,"merchant_demand_toll_accept", [(assign, reg6, "$temp")], "Very well then. Here's {reg6} denars. ", "close_window",
[(assign, "$g_leave_encounter",1),
(call_script, "script_troop_add_gold", "trp_player", "$temp"),
(store_add, ":toll_finish_time", "$g_current_hours", merchant_toll_duration),
(party_set_slot, "$g_encountered_party", slot_party_last_toll_paid_hours, ":toll_finish_time"),
(try_begin),
(ge, "$g_encountered_party_relation", -5),
(store_relation,":rel", "$g_encountered_party_faction","fac_player_supporters_faction"),
(try_begin),
(gt, ":rel", 0),
(val_sub, ":rel", 1),
(try_end),
(val_sub, ":rel", 1),
(call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", ":rel"),
(try_end),
### Troop commentaries changes begin
(call_script, "script_add_log_entry", logent_caravan_accosted, "trp_player", -1, -1, "$g_encountered_party_faction"),
### Troop commentaries changes end
(assign, reg6, "$temp"),
]],
[anyone|plyr,"merchant_demand_toll_2", [], "I changed my mind, I can't take your money.", "merchant_pretalk",[]],
[anyone|plyr,"merchant_demand_toll_2", [], "No, I want everything you have! [Attack]", "merchant_attack",[]],
[anyone|plyr,"merchant_demand_2", [(neq,"$g_encountered_party_faction","$players_kingdom")], "Hand over your gold and valuables now!", "merchant_attack_begin",[]],
[anyone|plyr,"merchant_demand_2", [], "Nothing. Forget it.", "merchant_pretalk",[]],
[anyone,"merchant_attack_begin", [], "Are you robbing us?{s11}", "merchant_attack_verify",[
(str_clear, s11),
(try_begin),
(faction_slot_ge, "$g_encountered_party_faction", slot_faction_truce_days_with_factions_begin, 1),
(str_store_string, s11, "str__have_you_not_signed_a_truce_with_our_lord"),
(try_end),
]],
[anyone|plyr,"merchant_attack_verify", [], "Robbing you? No, no! It was a joke.", "merchant_attack_verify_norob",[]],
[anyone,"merchant_attack_verify_norob", [], "God, don't joke about that, {lad/lass}. For a moment I thought we were in real trouble.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone|plyr,"merchant_attack_verify", [], "Of course I'm robbing you. Now hand over your goods.", "merchant_attack",[
(call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
]],
[anyone,"merchant_attack", [], "Damn you, you won't get anything from us without a fight!", "close_window",
[(store_relation,":rel", "$g_encountered_party_faction","fac_player_supporters_faction"),
(try_begin),
(gt, ":rel", 0),
(val_sub, ":rel", 10),
(try_end),
(val_sub, ":rel", 5),
(call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", ":rel"),
### Troop commentaries changes begin
(call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
### Troop commentaries changes end
]],
[anyone,"caravan_offer_protection", [],
"These roads are dangerous indeed. One can never have enough protection.", "caravan_offer_protection_2",
[(get_party_ai_object,":caravan_destination","$g_encountered_party"),
(store_distance_to_party_from_party, "$caravan_distance_to_target",":caravan_destination","$g_encountered_party"),
(assign,"$caravan_escort_offer","$caravan_distance_to_target"),
(val_sub, "$caravan_escort_offer", 10),
(call_script, "script_party_calculate_strength", "p_main_party",0),
(assign, ":player_strength", reg0),
(val_min, ":player_strength", 200),
(val_add, ":player_strength", 20),
(val_mul,"$caravan_escort_offer",":player_strength"),
(val_div,"$caravan_escort_offer",50),
(val_max, "$caravan_escort_offer", 5),
]],
[anyone,"caravan_offer_protection_2", [[lt,"$caravan_distance_to_target",10]],
"An escort? We're almost there already! Thank you for the offer, though.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone,"caravan_offer_protection_2", [(get_party_ai_object,":caravan_destination","$g_encountered_party"),
(str_store_party_name,1,":caravan_destination"),
(assign,reg(2),"$caravan_escort_offer")],
"We are heading to {s1}. I will pay you {reg2} denars if you escort us there.", "caravan_offer_protection_3",
[]],
[anyone|plyr,"caravan_offer_protection_3", [],
"Agreed.", "caravan_offer_protection_4",[]],
[anyone,"caravan_offer_protection_4", [],
"I want you to stay close to us along the way.\
We'll need your help if we get ambushed by bandits.", "caravan_offer_protection_5",[]],
[anyone|plyr,"caravan_offer_protection_5", [],
"Don't worry, you can trust me.", "caravan_offer_protection_6",[]],
[anyone,"caravan_offer_protection_6", [(get_party_ai_object,":caravan_destination","$g_encountered_party"),
(str_store_party_name,1,":caravan_destination")],
"Good. Come and collect your money when we're within sight of {s1}. For now, let's just get underway.", "close_window",
[(get_party_ai_object,":caravan_destination","$g_encountered_party"),
(assign, "$caravan_escort_destination_town", ":caravan_destination"),
(assign, "$caravan_escort_party_id", "$g_encountered_party"),
(assign, "$caravan_escort_agreed_reward", "$caravan_escort_offer"),
(assign, "$caravan_escort_state", 1),
(assign, "$g_leave_encounter",1)
]],
[anyone|plyr,"caravan_offer_protection_3", [],
"Forget it.", "caravan_offer_protection_4b",[]],
[anyone,"caravan_offer_protection_4b", [],
"Perhaps another time, then.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone|plyr,"merchant_talk", [(eq,"$talk_context", tc_party_encounter),(lt, "$g_talk_troop_faction_relation", 0)],
"Not so fast. First, hand over all your goods and money.", "talk_caravan_enemy_2",[]],
[anyone,"talk_caravan_enemy_2", [],
"Never. It is our duty to protect these goods. You shall have to fight us, brigand!", "close_window",
[
(store_relation,":rel","$g_encountered_party_faction","fac_player_supporters_faction"),
(val_min,":rel",0),
(val_sub,":rel",4),
(call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", ":rel"),
(call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
]],
[anyone|plyr,"merchant_talk", [], "[Leave]", "close_window",[(assign, "$g_leave_encounter",1)]],
# Prison Guards
[anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_prison_guard_troop, "$g_talk_troop"),
(this_or_next|eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
( party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player")
],
"Good day, my {lord/lady}. Will you be visiting the prison?", "prison_guard_players",[]],
[anyone|plyr,"prison_guard_players", [],
"Yes. Unlock the door.", "close_window",[(call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle")]],
[anyone|plyr,"prison_guard_players", [],
"No, not now.", "close_window",[]],
[anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_prison_guard_troop, "$g_talk_troop")],
"Yes? What do you want?", "prison_guard_talk",[]],
[anyone|plyr,"prison_guard_talk", [],
"Who is imprisoned here?", "prison_guard_ask_prisoners",[]],
[anyone|plyr,"prison_guard_talk", [],
"I want to speak with a prisoner.", "prison_guard_visit_prison",[]],
[anyone,"prison_guard_ask_prisoners", [],
"Currently, {s50} {reg1?are:is} imprisoned here.{s49}","prison_guard_talk",[
(party_clear, "p_temp_party"),
(party_clear, "p_temp_party_2"),
(assign, ":num_heroes_in_dungeon", 0),
(assign, ":num_heroes_given_parole", 0),
(party_get_num_prisoner_stacks, ":num_stacks","$g_encountered_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop","$g_encountered_party",":i_stack"),
(troop_is_hero, ":stack_troop"),
(try_begin),
(call_script, "script_cf_prisoner_offered_parole", ":stack_troop"),
(party_add_members, "p_temp_party_2", ":stack_troop", 1),
(val_add, ":num_heroes_given_parole", 1),
(else_try),
(party_add_members, "p_temp_party", ":stack_troop", 1),
(val_add, ":num_heroes_in_dungeon", 1),
(try_end),
(try_end),
(call_script, "script_print_party_members", "p_temp_party"),
(str_store_string, s50, "str_s51"),
(try_begin),
(gt, ":num_heroes_in_dungeon", 1),
(assign, reg1, 1),
(else_try),
(assign, reg1, 0),
(try_end),
(str_clear, s49),
(try_begin),
(ge, ":num_heroes_given_parole", 1),
(call_script, "script_print_party_members", "p_temp_party_2"),
(try_begin),
(ge, ":num_heroes_given_parole", 2),
(assign, reg2, 1),
(else_try),
(assign, reg2, 0),
(try_end),
(str_store_string, s49, "str__meanwhile_s51_reg2areis_being_held_in_the_castle_but_reg2havehas_made_pledges_not_to_escape_and_reg2areis_being_held_in_more_comfortable_quarters" ), #somewhat awkward wording prevents both gender and singular/plural pronoun issues
(try_end)
]],
[anyone,"prison_guard_visit_prison",
[
(this_or_next|faction_slot_eq, "$g_encountered_party_faction", slot_faction_marshall, "trp_player"),
(this_or_next|party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
(eq, "$g_encountered_party_faction", "$players_kingdom"),
],
"Of course, {sir/madam}. Go in.", "close_window",
[
(call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle")
]],
[anyone, "prison_guard_visit_prison",
[
#below condition is added by ozan, please lets discuss if it is needed or not. But I think this condition is needed because if there is nobody in prison
#prison guard should not say you need to get permission, or take me money ext to let player go inside.
(assign, ":num_heroes_in_dungeon", 0),
(party_get_num_prisoner_stacks, ":num_stacks", "$g_encountered_party"),
(assign, ":end_condition", ":num_stacks"),
(try_for_range, ":i_stack", 0, ":end_condition"),
(party_prisoner_stack_get_troop_id, ":stack_troop","$g_encountered_party",":i_stack"),
(troop_is_hero, ":stack_troop"),
(try_begin),
(call_script, "script_cf_prisoner_offered_parole", ":stack_troop"),
(else_try),
(val_add, ":num_heroes_in_dungeon", 1),
(assign, ":end_condition", 0),
(try_end),
(try_end),
(ge, ":num_heroes_in_dungeon", 1),
],
"You need to get permission from the lord to talk to prisoners.", "prison_guard_visit_prison_2",[]],
[anyone, "prison_guard_visit_prison", [], "There is nobody inside, therefore you can freely go inside and look around.", "prison_guard_visit_prison_nobody", []],
[anyone|plyr,"prison_guard_visit_prison_nobody", [], "All right then. I'll take a look at the prison.", "close_window",
[
(call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
]],
[anyone|plyr,"prison_guard_visit_prison_nobody", [], "I have more important business to do.", "close_window",[]],
[anyone|plyr,"prison_guard_visit_prison_2", [], "All right then. I'll try that.", "close_window",[]],
[anyone|plyr,"prison_guard_visit_prison_2", [], "Come on now. I thought you were the boss here.", "prison_guard_visit_prison_3",[]],
[anyone,"prison_guard_visit_prison_3", [], "He-heh. You got that right. Still, I can't let you into the prison.", "prison_guard_visit_prison_4",[]],
[anyone|plyr,"prison_guard_visit_prison_4", [], "All right then. I'll leave now.", "close_window",[]],
[anyone|plyr,"prison_guard_visit_prison_4", [(store_troop_gold,":gold","trp_player"),(ge,":gold",100)],
"I found a purse with 100 denars a few paces away. I reckon it belongs to you.", "prison_guard_visit_prison_5",[]],
[anyone,"prison_guard_visit_prison_5", [], "Ah! I was looking for this all day. How good of you to bring it back {sir/madam}.\
Well, now that I know what an honest {man/lady} you are, there can be no harm in letting you inside for a look. Go in.... Just so you know, though -- I'll be hanging onto the keys, in case you were thinking about undoing anyone's chains.", "close_window",
[(troop_remove_gold, "trp_player",100),(call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle")]],
[anyone|plyr,"prison_guard_visit_prison_4", [],
"Give me the keys to the cells -- now!", "prison_guard_visit_break",[
]],
[anyone,"prison_guard_visit_break", [], "Help! Help! Prison break!", "close_window",[
(call_script, "script_activate_town_guard"),
(assign, "$g_main_attacker_agent", "$g_talk_agent"),
(assign, "$talk_context", tc_prison_break),
# (try_begin),
# (store_relation, ":relation", "fac_player_faction", "$g_encountered_party_faction"),
# Reduce relation with town
# (try_end),
(assign, ":end_cond", kingdom_ladies_end),
(try_for_range, ":prisoner", active_npcs_begin, ":end_cond"),
(troop_set_slot, ":prisoner", slot_troop_mission_participation, 0), #new
(try_end),
]],
[anyone|plyr,"prison_guard_talk", [],
"Never mind.", "close_window",[]],
# Castle Guards
[anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_castle_guard_troop, "$g_talk_troop"),
(this_or_next|eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
( party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player")
],
"Your orders, {Lord/Lady}?", "castle_guard_players",[]],
[anyone|plyr,"castle_guard_players", [],
"Open the door. I'll go in.", "close_window",[(call_script, "script_enter_court", "$current_town")]],
[anyone|plyr,"castle_guard_players", [],
"Never mind.", "close_window",[]],
[anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_castle_guard_troop, "$g_talk_troop"),(eq, "$sneaked_into_town",1),
(gt,"$g_time_since_last_talk",0)],
"Get out of my sight, beggar! You stink!", "castle_guard_sneaked_intro_1",[]],
[anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_castle_guard_troop, "$g_talk_troop"),(eq, "$sneaked_into_town",1)],
"Get lost before I lose my temper you vile beggar!", "close_window",[]],
[anyone|plyr,"castle_guard_sneaked_intro_1", [], "I want to enter the hall and speak to the lord.", "castle_guard_sneaked_intro_2",[]],
[anyone|plyr,"castle_guard_sneaked_intro_1", [], "[Leave]", "close_window",[]],
[anyone,"castle_guard_sneaked_intro_2", [], "Are you out of your mind, {man/woman}?\
Beggars are not allowed into the hall. Now get lost or I'll beat you bloody.", "close_window",[]],
[anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_castle_guard_troop, "$g_talk_troop")],
"What do you want?", "castle_guard_intro_1",[]],
[anyone|plyr,"castle_guard_intro_1", [],
"I want to enter the hall and speak to the lord.", "castle_guard_intro_2",[]],
[anyone|plyr,"castle_guard_intro_1", [],
"Never mind.", "close_window",[]],
[anyone,"castle_guard_intro_2", [
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$current_town"),
(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 50),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 125),
(neq, "$g_player_eligible_feast_center_no", "$current_town"),
(neg|check_quest_active, "qst_wed_betrothed"),
(neg|check_quest_active, "qst_wed_betrothed_female"),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, 1), #Married players always make the cut
], "I'm afraid there is a feast in progress, and you are not invited.", "close_window",
[]],
[anyone,"castle_guard_intro_2", [], "You can go in after leaving your weapons with me. No one is allowed to carry arms into the lord's hall.", "castle_guard_intro_3",
[]],
[anyone|plyr,"castle_guard_intro_3", [], "Here, take my arms. I'll go in.", "close_window", [(call_script, "script_enter_court", "$current_town")]],
[anyone|plyr,"castle_guard_intro_3", [], "No, I give my arms to no one.", "castle_guard_intro_2b", []],
[anyone,"castle_guard_intro_2b", [], "Then you can't go in.", "close_window", []],
## [anyone|plyr,"castle_guard_intro_1", [],
## "Never mind.", "close_window",[]],
## [anyone,"castle_guard_intro_2", [],
## "Does the lord expect you?", "castle_guard_intro_3",[]],
## [anyone|plyr,"castle_guard_intro_3", [], "Yes.", "castle_guard_intro_check",[]],
## [anyone|plyr,"castle_guard_intro_3", [], "No.", "castle_guard_intro_no",[]],
## [anyone,"castle_guard_intro_check", [], "Hmm. All right {sir/madam}.\
## You can go in. But you must leave your weapons with me. Noone's allowed into the court with weapons.", "close_window",[]],
## [anyone,"castle_guard_intro_check", [], "You liar!\
## Our lord would have no business with a filthy vagabond like you. Get lost now before I kick your butt.", "close_window",[]],
## [anyone,"castle_guard_intro_no", [], "Well... What business do you have here then?", "castle_guard_intro_4",[]],
## [anyone|plyr,"castle_guard_intro_4", [], "I wish to present the lord some gifts.", "castle_guard_intro_gifts",[]],
## [anyone|plyr,"castle_guard_intro_4", [], "I have an important matter to discuss with the lord. Make way now.", "castle_guard_intro_check",[]],
## [anyone,"castle_guard_intro_gifts", [], "Really? What gifts?", "castle_guard_intro_5",[]],
## [anyone|plyr,"castle_guard_intro_4", [], "Many gifts. For example, I have a gift of 20 denars here for his loyal servants.", "castle_guard_intro_gifts",[]],
## [anyone|plyr,"castle_guard_intro_4", [], "My gifts are of no concern to you. They are for your lords and ladies..", "castle_guard_intro_check",[]],
## [anyone,"castle_guard_intro_gifts", [], "Oh! you can give those 20 denars to me. I can distribute them for you.\
## You can enter the court and present your gifts to the lord. I'm sure he'll be pleased.\
## But you must leave your weapons with me. Noone's allowed into the court with weapons.", "close_window",[]],
#Kingdom Parties
# [anyone,"start", [(this_or_next|eq,"$g_encountered_party_template","pt_swadian_foragers"),
# (eq,"$g_encountered_party_template","pt_vaegir_foragers"),
## [anyone,"start", [(this_or_next|party_slot_eq,"$g_encountered_party",slot_party_type, spt_forager),
## (this_or_next|party_slot_eq,"$g_encountered_party",slot_party_type, spt_scout),
## (party_slot_eq,"$g_encountered_party",slot_party_type, spt_patrol),
## (str_store_faction_name,5,"$g_encountered_party_faction")],
## "In the name of the {s5}.", "kingdom_party_encounter",[]],
##
## [anyone,"kingdom_party_encounter", [(le,"$g_encountered_party_relation",-10)],
## "Surrender now, and save yourself the indignity of defeat!", "kingdom_party_encounter_war",[]],
## [anyone|plyr,"kingdom_party_encounter_war", [], "[Go to Battle]", "close_window",[(encounter_attack)]],
##
## [anyone,"kingdom_party_encounter", [(ge,"$g_encountered_party_relation",10)],
## "Greetings, fellow warrior.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1)]],
##
## [anyone,"kingdom_party_encounter", [],
## "You can go.", "close_window",[]],
#Player Parties
## [party_tpl|pt_old_garrison,"start", [],
## "They told us to leave the castle to the new garrison {sir/madam}. So we left and came to rejoin you.", "player_old_garrison_encounter",[]],
##
## [anyone|plyr,"player_old_garrison_encounter", [(party_can_join)],
## "You have done well. You'll join my command now.", "close_window",[(assign, "$g_move_heroes", 1),
## (call_script, "script_party_add_party", "p_main_party", "$g_encountered_party"),
## (remove_party, "$g_encountered_party"),
## (assign, "$g_leave_encounter", 1)]],
## [anyone|plyr,"player_old_garrison_encounter", [(assign, reg1, 0),
## (try_begin),
## (neg|party_can_join),
## (assign, reg1, 1),
## (try_end)],
## "You can't join us now{reg1?, I can't command all the lot of you:}. Follow our lead.", "close_window",[(party_set_ai_behavior, "$g_encountered_party", ai_bhvr_attack_party),
## (party_set_ai_object, "$g_encountered_party", "p_main_party"),
## (party_set_flags, "$g_encountered_party", pf_default_behavior, 0),
## (assign, "$g_leave_encounter", 1)]],
##
## [anyone|plyr,"player_old_garrison_encounter", [(assign, reg1, 0),
## (try_begin),
## (neg|party_can_join),
## (assign, reg1, 1),
## (try_end)],
## "You can't join us now{reg1?, I can't command all the lot of you:}. Stay here and wait for me.", "close_window",[
## (party_set_ai_behavior, "$g_encountered_party", ai_bhvr_travel_to_point),
## (party_get_position, pos1, "$g_encountered_party"),
## (party_set_ai_target_position, "$g_encountered_party", pos1),
## (party_set_flags, "$g_encountered_party", pf_default_behavior, 0),
## (assign, "$g_leave_encounter", 1)]],
##
[anyone,"start", [(eq, "$talk_context", tc_castle_gate)],
"What do you want?", "castle_gate_guard_talk",[]],
[anyone,"castle_gate_guard_pretalk", [],
"Yes?", "castle_gate_guard_talk",[]],
[anyone|plyr,"castle_gate_guard_talk", [(ge, "$g_encountered_party_relation", 0)],
"We need shelter for the night. Will you let us in?", "castle_gate_open",[]],
[anyone|plyr,"castle_gate_guard_talk", [(party_slot_ge, "$g_encountered_party", slot_town_lord, 1)], "I want to speak with the lord of the castle.", "request_meeting_castle_lord",[]],
[anyone|plyr,"castle_gate_guard_talk", [], "I want to speak with someone in the castle.", "request_meeting_other",[]],
[anyone|plyr,"castle_gate_guard_talk", [], "[Leave]", "close_window",[]],
[anyone,"request_meeting_castle_lord", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
(call_script, "script_get_troop_attached_party", ":castle_lord"),
(eq, "$g_encountered_party", reg0),
(str_store_troop_name, s2, ":castle_lord"),
(assign, "$lord_requested_to_talk_to", ":castle_lord"),
], "Wait here. {s2} will see you.", "close_window",[]],
[anyone,"request_meeting_castle_lord", [], "My lord is not here now.", "castle_gate_guard_pretalk",[]],
[anyone,"request_meeting_other", [], "Who is that?", "request_meeting_3",[]],
[anyone|plyr|repeat_for_troops,"request_meeting_3", [(store_repeat_object, ":troop_no"),
(troop_is_hero, ":troop_no"),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(call_script, "script_get_troop_attached_party", ":troop_no"),
(eq, "$g_encountered_party", reg0),
(str_store_troop_name, s3, ":troop_no"),
],
"{s3}", "request_meeting_4",[(store_repeat_object, "$lord_requested_to_talk_to")]],
[anyone|plyr,"request_meeting_3", [], "Never mind.", "close_window",[(assign, "$lord_requested_to_talk_to", 0)]],
[anyone,"request_meeting_4", [], "Wait there. I'll send him your request.", "request_meeting_5",[]],
[anyone|plyr,"request_meeting_5", [], "I'm waiting...", "request_meeting_6",[]],
[anyone,"request_meeting_6",
[
(call_script, "script_troop_get_player_relation", "$lord_requested_to_talk_to"),
(assign, ":lord_relation", reg0),
(gt, ":lord_relation", -20),
], "All right. {s2} will talk to you now.", "close_window",[(str_store_troop_name, s2, "$lord_requested_to_talk_to")]],
[anyone,"request_meeting_6", [(str_store_troop_name, s2, "$lord_requested_to_talk_to")], "{s2} says he will not see you. Begone now.", "close_window",[]],
[anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
(call_script, "script_get_troop_attached_party", ":castle_lord"),
(eq, "$g_encountered_party", reg0),
(ge, "$g_encountered_party_relation", 0),
(call_script, "script_troop_get_player_relation", ":castle_lord"),
(assign, ":castle_lord_relation", reg0),
#(troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
(ge, ":castle_lord_relation", 5),
(str_store_troop_name, s2, ":castle_lord")
], "My lord {s2} will be happy to see you {sir/madam}.\
Come on in. I am opening the gates for you.", "close_window",[(assign,"$g_permitted_to_center",1)]],
[anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
(call_script, "script_get_troop_attached_party", ":castle_lord"),
(neq, "$g_encountered_party", reg0),
(ge, "$g_encountered_party_relation", 0),
(call_script, "script_troop_get_player_relation", ":castle_lord"),
(assign, ":castle_lord_relation", reg0),
#(troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
(ge, ":castle_lord_relation", 5),
(str_store_troop_name, s2, ":castle_lord")
], "My lord {s2} is not in the castle now.\
But I think he would approve of you taking shelter here.\
Come on in. I am opening the gates for you.", "close_window",[(assign,"$g_permitted_to_center",1)]],
[anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
(call_script, "script_troop_get_player_relation", ":castle_lord"),
(assign, ":castle_lord_relation", reg0),
#(troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
(ge, ":castle_lord_relation", -2),
], "Come on in. I am opening the gates for you.", "close_window",[(assign,"$g_permitted_to_center",1)]],
[anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
(call_script, "script_troop_get_player_relation", ":castle_lord"),
(assign, ":castle_lord_relation", reg0),
#(troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
(ge, ":castle_lord_relation", -19),
(str_store_troop_name, s2, ":castle_lord")
], "Come on in. But make sure your men behave sensibly within the walls.\
My lord {s2} does not want trouble here.", "close_window",[(assign,"$g_permitted_to_center",1)]],
[anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
(str_store_troop_name, s2, ":castle_lord"),
], "My lord {s2} does not want you here. Begone now.", "close_window",[]],
#Enemy Kingdom Meetings
# [anyone,"start", [(eq, "$talk_context", tc_lord_talk_in_center)],
# "Greetings {playername}.", "request_meeting_1",[]],
# [anyone,"request_meeting_pretalk", [(eq, "$talk_context", tc_lord_talk_in_center)],
# "Yes?", "request_meeting_1",[]],
# [anyone|plyr,"request_meeting_1", [(ge, "$g_encountered_party_faction", 0)], "Open the gates and let me in!", "request_meeting_open_gates",[]],
# [anyone|plyr,"request_meeting_1", [(party_slot_ge, "$g_encountered_party", slot_town_lord, 1)], "I want to speak with the lord of the castle.", "request_meeting_castle_lord",[]],
# [anyone|plyr,"request_meeting_1", [], "I want to speak with someone in the castle.", "request_meeting_other",[]],
##### TODO: QUESTS COMMENT OUT BEGIN
## [anyone|plyr,"request_meeting_1",[(check_quest_active,"qst_bring_prisoners_to_enemy"),
## (neg|check_quest_succeeded, "qst_bring_prisoners_to_enemy"),
## (quest_get_slot, ":quest_giver_troop", "qst_bring_prisoners_to_enemy", slot_quest_giver_troop),
## (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (quest_get_slot, ":quest_object_troop", "qst_bring_prisoners_to_enemy", slot_quest_object_troop),
## (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_target_center, "$g_encountered_party"),
## (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_object_troop"),
## (ge, ":num_prisoners", ":quest_target_amount"),
## (str_store_troop_name,1,":quest_giver_troop"),
## (assign, reg1, ":quest_target_amount"),
## (str_store_troop_name_plural,2,":quest_object_troop")],
## "TODO: Sir, lord {s1} ordered me to bring {reg1} {s2} for ransom.", "guard_prisoners_brought",
## [(quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (quest_get_slot, ":quest_target_center", "qst_bring_prisoners_to_enemy", slot_quest_target_center),
## (quest_get_slot, ":quest_object_troop", "qst_bring_prisoners_to_enemy", slot_quest_object_troop),
## (party_remove_prisoners, "p_main_party", ":quest_object_troop", ":quest_target_amount"),
## (party_add_members, ":quest_target_center", ":quest_object_troop", ":quest_target_amount"),
## (call_script, "script_game_get_join_cost", ":quest_object_troop"),
## (assign, ":reward", reg0),
## (val_mul, ":reward", ":quest_target_amount"),
## (val_div, ":reward", 2),
## (call_script, "script_troop_add_gold", "trp_player", ":reward"),
## (party_get_slot, ":cur_lord", "$g_encountered_party", slot_town_lord),#Removing gold from the town owner's wealth
## (troop_get_slot, ":cur_wealth", ":cur_lord", slot_troop_wealth),
## (val_sub, ":cur_wealth", ":reward"),
## (troop_set_slot, ":cur_lord", slot_troop_wealth, ":cur_wealth"),
## (quest_set_slot, "qst_bring_prisoners_to_enemy", slot_quest_target_amount, ":reward"),
## (succeed_quest, "qst_bring_prisoners_to_enemy"),
## ]],
##
## [anyone|plyr,"request_meeting_1",[(check_quest_active,"qst_bring_prisoners_to_enemy"),
## (neg|check_quest_succeeded, "qst_bring_prisoners_to_enemy"),
## (quest_get_slot, ":quest_giver_troop", "qst_bring_prisoners_to_enemy", slot_quest_giver_troop),
## (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (quest_get_slot, ":quest_object_troop", "qst_bring_prisoners_to_enemy", slot_quest_object_troop),
## (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_target_center, "$g_encountered_party"),
## (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_object_troop"),
## (lt, ":num_prisoners", ":quest_target_amount"),
## (gt, ":num_prisoners", 0),
## (str_store_troop_name,1,":quest_giver_troop"),
## (assign, reg1, ":quest_target_amount"),
## (str_store_troop_name_plural,2,":quest_object_troop")],
## "TODO: Sir, lord {s1} ordered me to bring {reg1} {s2} for ransom, but some of them died during my expedition.", "guard_prisoners_brought_some",
## [(quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
## (quest_get_slot, ":quest_target_center", "qst_bring_prisoners_to_enemy", slot_quest_target_center),
## (quest_get_slot, ":quest_object_troop", "qst_bring_prisoners_to_enemy", slot_quest_object_troop),
## (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_object_troop"),
## (party_remove_prisoners, "p_main_party", ":quest_object_troop", ":num_prisoners"),
## (party_add_members, ":quest_target_center", ":quest_object_troop", ":num_prisoners"),
## (call_script, "script_game_get_join_cost", ":quest_object_troop"),
## (assign, ":reward", reg0),
## (val_mul, ":reward", ":num_prisoners"),
## (val_div, ":reward", 2),
## (call_script, "script_troop_add_gold", "trp_player", ":reward"),
## (party_get_slot, ":cur_lord", "$g_encountered_party", slot_town_lord),#Removing gold from the town owner's wealth
## (troop_get_slot, ":cur_wealth", ":cur_lord", slot_troop_wealth),
## (val_sub, ":cur_wealth", ":reward"),
## (troop_set_slot, ":cur_lord", slot_troop_wealth, ":cur_wealth"),
## (call_script, "script_game_get_join_cost", ":quest_object_troop"),
## (assign, ":reward", reg0),
## (val_mul, ":reward", ":quest_target_amount"),
## (val_div, ":reward", 2),
## (quest_set_slot, "qst_bring_prisoners_to_enemy", slot_quest_current_state, 1),#Some of the prisoners are given, so it's state will change for remembering that.
## (quest_set_slot, "qst_bring_prisoners_to_enemy", slot_quest_target_amount, ":reward"),#Still needs to pay the lord the full price of the prisoners
## (succeed_quest, "qst_bring_prisoners_to_enemy"),
## ]],
##
##
## [anyone,"guard_prisoners_brought", [],
## "TODO: Thank you. Here is the money for prisoners.", "request_meeting_pretalk",[]],
##
## [anyone,"guard_prisoners_brought_some", [],
## "TODO: Thank you, but that's not enough. Here is the money for prisoners.", "request_meeting_pretalk",[]],
# [anyone|plyr,"request_meeting_1", [], "[Leave]", "close_window",[]],
## [anyone,"request_meeting_open_gates", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
## (call_script, "script_get_troop_attached_party", ":castle_lord"),
## (eq, "$g_encountered_party", reg0),
## (str_store_troop_name, 1, ":castle_lord")
## ], "My lord {s1} is in the castle now. You must ask his permission to enter.", "request_meeting_pretalk",[]],
##
## [anyone,"request_meeting_open_gates", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
## (call_script, "script_get_troop_attached_party", ":castle_lord"),
## (neq, "$g_encountered_party", reg0),
## (ge, "$g_encountered_party_relation", 0),
## (troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
## (ge, ":castle_lord_relation", 20),
## (str_store_troop_name, 1, ":castle_lord")
## ], "My lord {s1} is not in the castle now.\
## But I think he would approve of you taking shelter here, {sir/madam}.\
## Come on in. I am opening the gates for you.", "close_window",[]],
##
## [anyone,"request_meeting_open_gates", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),(str_store_troop_name, 1, ":castle_lord")],
## "My lord {s1} is not in the castle now. I can't allow you into the castle without his orders.", "request_meeting_pretalk",[]],
# Quest conversations
##### TODO: QUESTS COMMENT OUT BEGIN
## [party_tpl|pt_peasant_rebels,"start", [],
## "TODO: What.", "peasant_rebel_talk",[]],
## [anyone|plyr, "peasant_rebel_talk", [], "TODO: Die.", "close_window",[]],
## [anyone|plyr, "peasant_rebel_talk", [], "TODO: Nothing.", "close_window",[(assign, "$g_leave_encounter",1)]],
##
## [party_tpl|pt_noble_refugees,"start", [],
## "TODO: What.", "noble_refugee_talk",[]],
## [anyone|plyr, "noble_refugee_talk", [], "TODO: Nothing.", "close_window",[(assign, "$g_leave_encounter",1)]],
##
[anyone,"start", [(eq,"$talk_context",tc_join_battle_ally),
],
"You have come just in time. Let us join our forces now and teach our enemy a lesson.", "close_window",
[]],
[anyone,"start", [(eq,"$talk_context",tc_join_battle_enemy),
],
"You are making a big mistake by fighting against us.", "close_window",
[]],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(troop_is_hero, "$g_talk_troop"),
(eq, "$g_talk_troop_met", 0),
(ge, "$g_talk_troop_relation", 17),
],
"I don't think we have met properly my friend. You just saved my life out there, and I still don't know your name...", "ally_thanks_meet", []],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(troop_is_hero, "$g_talk_troop"),
(eq, "$g_talk_troop_met", 0),
(ge, "$g_talk_troop_relation", 5),
(str_store_troop_name, s1, "$g_talk_troop"),
],
"Your help was most welcome stranger. My name is {s1}. Can I learn yours?", "ally_thanks_meet", []],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(troop_is_hero, "$g_talk_troop"),
(eq, "$g_talk_troop_met", 0),
(ge, "$g_talk_troop_relation", 0),
(str_store_troop_name, s1, "$g_talk_troop"),
],
"Thanks for your help, stranger. We haven't met properly yet, have we? What is your name?", "ally_thanks_meet", []],
[anyone|plyr,"ally_thanks_meet", [], "My name is {playername}.", "ally_thanks_meet_2", []],
[anyone, "ally_thanks_meet_2", [(ge, "$g_talk_troop_relation", 15),(str_store_troop_name, s1, "$g_talk_troop")],
"Well met indeed {playername}. My name is {s1} and I am forever in your debt. If there is ever anything I can help you with, just let me know...", "close_window", []],
[anyone, "ally_thanks_meet_2", [(ge, "$g_talk_troop_relation", 5),], "Well met {playername}. I am in your debt for what you just did. I hope one day I will find a way to repay it.", "close_window", []],
[anyone, "ally_thanks_meet_2", [], "Well met {playername}. I am {s1}. Thanks for your help and I hope we meet again.", "close_window", []],
#Post 0907 changes begin
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(troop_is_hero, "$g_talk_troop"),
(ge, "$g_talk_troop_relation", 30),
(ge, "$g_relation_boost", 10),
],
"Again you save our necks, {playername}! Truly, you are the best of friends. {s43}", "close_window", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_default"),
(try_begin),
(party_stack_get_troop_id, ":enemy_party_leader", "p_encountered_party_backup", 0),
(is_between, ":enemy_party_leader", active_npcs_begin, active_npcs_end),
(call_script, "script_add_log_entry", logent_lord_helped_by_player, "trp_player", -1, ":enemy_party_leader", -1),
(try_end),
]],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(troop_is_hero, "$g_talk_troop"),
(ge, "$g_talk_troop_relation", 20),
(ge, "$g_relation_boost", 5),
],
"You arrived just in the nick of time! {playername}. You have my deepest thanks! {s43}", "close_window", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_default"),
# (try_begin),
# (party_stack_get_troop_id, ":enemy_party_leader", "p_encountered_party_backup", 0),
# (is_between, ":enemy_party_leader", active_npcs_begin, active_npcs_end),
(call_script, "script_add_log_entry", logent_lord_helped_by_player, "trp_player", -1, "$g_talk_troop", -1),
# (try_end),
]],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(troop_is_hero, "$g_talk_troop"),
(ge, "$g_talk_troop_relation", 0),
(ge, "$g_relation_boost", 3),
],
"You turned up just in time, {playername}. I will not forget your help. {s43}", "close_window", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_default"),
# (try_begin),
# (party_stack_get_troop_id, ":enemy_party_leader", "p_encountered_party_backup", 0),
# (is_between, ":enemy_party_leader", active_npcs_begin, active_npcs_end),
(call_script, "script_add_log_entry", logent_lord_helped_by_player, "trp_player", -1, "$g_talk_troop", -1),
# (try_end),
]],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(troop_is_hero, "$g_talk_troop"),
(ge, "$g_talk_troop_relation", -5),
],
"Good to see you here, {playername}. {s43}", "close_window", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_default"),
(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 1),
]],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(troop_is_hero, "$g_talk_troop"),
(ge, "$g_relation_boost", 4),
],
"{s43}", "close_window", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_grudging_default"),
]],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(troop_is_hero, "$g_talk_troop"),
],
"{s43}", "close_window", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_unfriendly_default"),
]],
# [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
# (troop_is_hero, "$g_talk_troop"),
# (ge, "$g_talk_troop_relation", -20),
# ],
# "So, this is {playername}. Well, your help wasn't really needed, but I guess you had nothing better to do, right?", "close_window", []],
# [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
# (troop_is_hero, "$g_talk_troop"),
# ],
# "Who told you to come to our help? I certainly didn't. Begone now. I want nothing from you and I will not let you steal my victory.", "close_window", []],
#Post 0907 changes begin
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(ge, "$g_relation_boost", 10),
(party_get_num_companions, reg1, "$g_encountered_party"),
(val_sub, reg1, 1),
],
"Thank you for your help {sir/madam}. You saved {reg1?our lives:my life} out there.", "close_window", []],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
(ge, "$g_relation_boost", 5),
],
"Thank you for your help {sir/madam}. Things didn't look very well for us but then you came up and everything changed.", "close_window", []],
[anyone,"start", [(eq,"$talk_context",tc_ally_thanks)],
"Thank you for your help, {sir/madam}. It was fortunate to have you nearby.", "close_window", []],
[anyone,"start", [(eq, "$talk_context", tc_hero_freed),
(store_conversation_troop,":cur_troop"),
(eq,":cur_troop","trp_kidnapped_girl"),],
"Oh {sir/madam}. Thank you so much for rescuing me. Will you take me to my family now?", "kidnapped_girl_liberated_battle",[]],
[anyone,"start", [(eq,"$talk_context",tc_hero_freed)],
"I am in your debt for freeing me friend.", "freed_hero_answer",
[]],
[anyone|plyr,"freed_hero_answer", [],
"You're not going anywhere. You'll be my prisoner now!", "freed_hero_answer_1",
[
(store_conversation_troop, ":cur_troop_id"),
(party_add_prisoners, "p_main_party", ":cur_troop_id", 1),#take prisoner
]],
[anyone,"freed_hero_answer_1", [],
"Alas. Will my luck never change?", "close_window",
[]],
[anyone|plyr,"freed_hero_answer", [],
"You're free to go, {s65}.", "freed_hero_answer_2",
[
]],
[anyone,"freed_hero_answer_2", [],
"Thank you, good {sire/lady}. I never forget someone who's done me a good turn.", "close_window",
[]],
[anyone|plyr,"freed_hero_answer", [],
"Would you like to join me?", "freed_hero_answer_3",
[]],
[anyone,"freed_hero_answer_3", [(store_random_in_range, ":random_no",0,2),(eq, ":random_no", 0)],
"All right I will join you.", "close_window",
[
(store_conversation_troop, ":cur_troop_id"),
(party_add_members, "p_main_party", ":cur_troop_id", 1),#join hero
]],
[anyone,"freed_hero_answer_3", [],
"No, I want to go on my own.", "close_window",
[
]],
[anyone,"start", [(eq,"$talk_context",tc_hero_defeated)],
"You'll not live long to enjoy your victory. My kinsmen will soon wipe out the stain of this defeat.", "defeat_hero_answer",
[
]],
[anyone|plyr,"defeat_hero_answer", [],
"You are my prisoner now.", "defeat_hero_answer_1",
[
(party_add_prisoners, "p_main_party", "$g_talk_troop", 1),#take prisoner
#(troop_set_slot, "$g_talk_troop", slot_troop_is_prisoner, 1),
(troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, "p_main_party"),
(call_script, "script_event_hero_taken_prisoner_by_player", "$g_talk_troop"),
]],
[anyone,"defeat_hero_answer_1", [],
"Damn you. You will regret this.", "close_window",
[]],
[anyone|plyr,"defeat_hero_answer", [],
"You're free to go this time, but don't cross my path again.", "defeat_hero_answer_2",
[]],
[anyone,"defeat_hero_answer_2", [],
"We will meet again.", "close_window",
[]],
[anyone,"combined_political_quests", [
(eq, "$political_quest_found", "qst_resolve_dispute"),
],
"{s9}", "political_quest_suggested",
[
(quest_set_slot, "qst_resolve_dispute", slot_quest_target_troop, "$political_quest_target_troop"),
(quest_set_slot, "qst_resolve_dispute", slot_quest_object_troop, "$political_quest_object_troop"),
(quest_get_slot, ":target_troop", "qst_resolve_dispute", slot_quest_target_troop),
(quest_get_slot, ":object_troop", "qst_resolve_dispute", slot_quest_object_troop),
(str_store_troop_name, s4, ":target_troop"),
(str_store_troop_name, s5, ":object_troop"),
(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s7, ":faction_leader"),
(try_begin),
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(str_store_string, s9, "str_you_may_be_aware_my_lord_of_the_quarrel_between_s4_and_s5_which_is_damaging_the_unity_of_this_realm_and_sapping_your_authority_if_you_could_persuade_the_lords_to_reconcile_it_would_boost_your_own_standing_however_in_taking_this_on_you_run_the_risk_of_one_the_lords_deciding_that_you_have_taken_the_rivals_side"),
(else_try),
(str_store_string, s9, "str_you_may_be_aware_my_lord_of_the_quarrel_between_s4_and_s5_which_is_damaging_the_unity_of_this_realm_and_sapping_your_authority_if_you_could_persuade_the_lords_to_reconcile_i_imagine_that_s7_would_be_most_pleased_however_in_taking_this_on_you_run_the_risk_of_one_the_lords_deciding_that_you_have_taken_the_rivals_side"),
(try_end),
]],
[anyone,"political_quest_follow_on", [
(eq, "$political_quest_found", "qst_resolve_dispute"),
],
"I think that is a wise move. Good luck to you.", "close_window",
[
(assign, "$g_leave_encounter", 1),
(setup_quest_text,"qst_resolve_dispute"),
(quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop),
(str_store_troop_name_link, s11, ":lord_1"),
(quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
(str_store_troop_name_link, s12, ":lord_2"),
(str_store_string, s2, "str_resolve_the_dispute_between_s11_and_s12"),
(call_script, "script_start_quest", "qst_resolve_dispute", -1),
(quest_set_slot, "qst_resolve_dispute", slot_quest_expiration_days, 30),
(quest_set_slot, "qst_resolve_dispute", slot_quest_giver_troop, "$g_talk_troop"),
(quest_set_slot, "qst_resolve_dispute", slot_quest_target_state, 0),
(quest_set_slot, "qst_resolve_dispute", slot_quest_object_state, 0),
(quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop), #this block just to check if the slots work
(str_store_troop_name, s11, ":lord_1"),
(quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
(str_store_troop_name, s12, ":lord_2"),
],
],
[anyone,"combined_political_quests", [
(eq, "$political_quest_found", "qst_offer_gift"),
(quest_set_slot, "qst_offer_gift", slot_quest_target_troop, "$political_quest_target_troop"),
(quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
(str_store_troop_name, s4, ":target_troop"),
(troop_get_type, reg4, ":target_troop"),
(call_script, "script_troop_get_family_relation_to_troop", ":target_troop", "$g_talk_troop"),
],
"Your relations with {s4} are not all that they could be. As {reg4?she:he} is my {s11}, I can mediate to attempt to mend your quarrel. Perhaps the best way for me to do this would be to send {reg4?her:him} a gift -- a fur-trimmed velvet robe, perhaps. If you can provide me with a bolt of velvet and a length of furs, I can have one made and sent to {reg4?her:him.}", "political_quest_suggested",
[
(quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
(troop_get_type, reg4, ":target_troop"),
]],
[anyone,"political_quest_follow_on", [
(eq, "$political_quest_found", "qst_offer_gift"),
],
"Splendid. I shall await the materials.", "close_window",
[
(assign, "$g_leave_encounter", 1),
(setup_quest_text,"qst_offer_gift"),
(quest_get_slot, ":lord_1", "qst_offer_gift", slot_quest_target_troop),
(str_store_troop_name, s14, ":lord_1"),
(str_store_troop_name, s12, "$g_talk_troop"),
(troop_get_type, reg4, "$g_talk_troop"),
(str_store_string, s2, "str_you_intend_to_bring_gift_for_s14"),
(call_script, "script_start_quest", "qst_offer_gift", "$g_talk_troop"),
(quest_set_slot, "qst_offer_gift", slot_quest_expiration_days, 30),
]],
[anyone,"combined_political_quests", [
(eq, "$political_quest_found", "qst_denounce_lord"),
(this_or_next|eq, "$g_talk_troop", "$g_player_minister"),
(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(str_store_troop_name, s4, "$political_quest_target_troop"),
(troop_get_type, reg4, "$political_quest_target_troop"),
(str_store_faction_name, s5, "$players_kingdom"),
(troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
(val_add, ":reputation_string", "str_lord_derogatory_default"),
(str_store_string, s7, ":reputation_string"),
(troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
(val_add, ":reputation_string", "str_lord_derogatory_result"),
(str_store_string, s8, ":reputation_string"),
],
"As you may realize, {s4} has many enemies among the lords of the {s5}. In particular, they feel that {reg4?she:he} is {s7}, and worry that {reg4?she:he} will {s8}. Were you to denounce {s4} to {reg4?her:his} face, you may reap much popularity -- although, of course, you would make an enemy of {reg4?her:him}, and risk being challenged to a duel.", "political_quest_suggested",
[
]],
[anyone,"combined_political_quests", [
(eq, "$political_quest_found", "qst_denounce_lord"),
(troop_get_type, reg4, "$political_quest_target_troop"),
(str_clear, s9),
(call_script, "script_troop_get_relation_with_troop", "trp_player", "$g_talk_troop"),
(assign, ":player_relation_with_target", reg0),
(str_store_troop_name, s4, "$political_quest_target_troop"),
(try_begin),
(ge, ":player_relation_with_target", 2),
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
(neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
(str_store_string, s9, "str_i_realize_that_you_are_on_good_terms_with_s4_but_we_ask_you_to_do_this_for_the_good_of_the_realm"),
(else_try),
(ge, ":player_relation_with_target", 2),
(str_store_string, s9, "str_i_realize_that_you_are_on_good_terms_with_s4_but_the_blow_will_hurt_him_more"),
(try_end),
(str_store_faction_name, s5, "$players_kingdom"),
(str_store_troop_name, s4, "$political_quest_target_troop"),
(troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
(val_add, ":reputation_string", "str_lord_derogatory_default"),
(str_store_string, s7, ":reputation_string"),
(troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
(val_add, ":reputation_string", "str_lord_derogatory_result"),
(str_store_string, s8, ":reputation_string"),
],
"As you may realize, many of us in the peerage of the {s5} consider {s4} to be {s7}, and a liability to our cause. We worry that {reg4?she:he} will {s8}. People know my views on {s4} already, but if you were to denounce {reg4?her:him} to {reg4?her:his} face, you would further erode his standing -- and discourage our liege from entrusting {reg4?her:him} with any more power or responsibility. Of course, you would make an enemy of {reg4?her:him}, and risk being challenged to a duel.{s9}", "political_quest_suggested",
[
]],
[anyone,"political_quest_follow_on", [
(eq, "$political_quest_found", "qst_denounce_lord"),
(this_or_next|eq, "$g_talk_troop", "$g_player_minister"),
(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
],
"We appreciate what you are doing. I find such intrigues distasteful, but it is all for the good of the {s5}.", "close_window",
[
(quest_set_slot, "qst_denounce_lord", slot_quest_target_troop, "$political_quest_target_troop"),
(quest_get_slot, ":target_troop", "qst_denounce_lord", slot_quest_target_troop),
(str_store_troop_name_link, s14, ":target_troop"),
(str_store_troop_name_link, s12, "$g_talk_troop"),
(str_store_string, s2, "str_you_intend_to_denounce_s14_to_his_face_on_behalf_of_s14"),
(setup_quest_text, "qst_denounce_lord"),
(call_script, "script_start_quest", "$political_quest_found", "$g_talk_troop"),
(quest_set_slot, "qst_denounce_lord", slot_quest_expiration_days, 60),
(str_store_faction_name, s5, "$players_kingdom"),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"political_quest_follow_on", [
(eq, "$political_quest_found", "qst_denounce_lord"),
],
"Very well. It is always risky to involve yourself in intrigues of this sort, but in this case, I think you will benefit.", "close_window",
[
(quest_set_slot, "qst_denounce_lord", slot_quest_target_troop, "$political_quest_target_troop"),
(quest_get_slot, ":target_troop", "qst_denounce_lord", slot_quest_target_troop),
(str_store_troop_name_link, s14, ":target_troop"),
(str_store_troop_name_link, s12, "$g_talk_troop"),
(str_store_string, s2, "str_you_intend_to_denounce_s14_to_his_face_on_behalf_of_s14"),
(setup_quest_text, "qst_denounce_lord"),
(call_script, "script_start_quest", "$political_quest_found", "$g_talk_troop"),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"combined_political_quests", [
(eq, "$political_quest_found", "qst_intrigue_against_lord"),
(str_store_troop_name, s4, "$political_quest_target_troop"),
(troop_get_type, reg4, "$political_quest_target_troop"),
(str_store_faction_name, s5, "$players_kingdom"),
(troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
(val_add, ":reputation_string", "str_lord_derogatory_default"),
(str_store_string, s7, ":reputation_string"),
(troop_get_slot, ":reputation_string_2", "$political_quest_target_troop", slot_lord_reputation_type),
(val_add, ":reputation_string_2", "str_lord_derogatory_result"),
(str_store_string, s8, ":reputation_string_2"),
(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s9, ":faction_leader"),
],
"You and I have a common interest in seeking to curtail the rise of {s4}. I feel that {reg4?she:he} is {s7}, and worry that {reg4?she:he} will {s8}. Were you to tell our liege {s9} your opinion of {s4}, it might discourage {s9} from granting {s4} any further powers or responsibilities, at least for a while, and I would be much obliged to you.", "political_quest_suggested",
[]],
#Intrigue lord for
[anyone,"political_quest_follow_on", [
(eq, "$political_quest_found", "qst_intrigue_against_lord"),
# (this_or_next|eq, "$g_talk_troop", "$g_player_minister"),
# (troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
(str_store_faction_name, s5, "$players_kingdom"),
],
"We appreciate what you are doing. I find such intrigues distasteful, but it is all for the good of the {s5}.", "close_window",
[
(quest_set_slot, "qst_intrigue_against_lord", slot_quest_target_troop, "$political_quest_target_troop"),
(quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
(store_faction_of_troop, ":target_troop_faction", ":target_troop"),
(faction_get_slot, ":faction_liege", ":target_troop_faction", slot_faction_leader),
(str_store_troop_name_link, s14, ":target_troop"),
(str_store_troop_name_link, s13, ":faction_liege"),
(str_store_troop_name_link, s12, "$g_talk_troop"),
(str_store_string, s2, "str_you_intend_to_denounce_s14_to_s13_on_behalf_of_s12"),
(setup_quest_text, "qst_intrigue_against_lord"),
(call_script, "script_start_quest", "$political_quest_found", "$g_talk_troop"),
(quest_set_slot, "qst_intrigue_against_lord", slot_quest_expiration_days, 60),
(assign, "$g_leave_encounter", 1),
]],
[anyone,"combined_political_quests", [],
"I cannot think of anything right now, but we will have some items of mutual interest in the future.", "political_quest_suggested",
[]],
[anyone|plyr,"political_quest_suggested", [
(gt, "$political_quest_found", 0),
],
"I like that idea.", "political_quest_follow_on",
[
]],
[anyone|plyr,"political_quest_suggested", [
(gt, "$political_quest_found", 0),
],
"Hmm.. Maybe you can think of something else?", "combined_political_quests",
[
(quest_set_slot, "$political_quest_found", slot_quest_dont_give_again_remaining_days, 3),
(call_script, "script_get_political_quest", "$g_talk_troop"),
(assign, "$political_quest_found", reg0),
(assign, "$political_quest_target_troop", reg1),
(assign, "$political_quest_object_troop", reg2),
]],
[anyone|plyr,"political_quest_suggested", [],
"Let us discuss another topic", "political_quests_end",
[]],
[anyone,"political_quests_end", [
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
],
"Very well.", "lord_pretalk",
[]],
[anyone,"political_quests_end", [
(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
],
"Very well.", "spouse_pretalk",
[]],
[anyone,"political_quests_end", [
(eq, "$g_talk_troop", "$g_player_minister"),
],
"Very well.", "minister_pretalk",
[]],
[anyone,"political_quests_end", [
],
"Very well.", "close_window",
[
(assign, "$g_leave_encounter", 1),
]],
# Local merchant
[trp_local_merchant,"start", [], "Mercy! Please don't kill me!", "local_merchant_mercy",[]],
[anyone|plyr,"local_merchant_mercy", [(quest_get_slot, ":quest_giver_troop", "qst_kill_local_merchant", slot_quest_giver_troop),(str_store_troop_name, s2, ":quest_giver_troop")],
"I have nothing against you man. But {s2} wants you dead. Sorry.", "local_merchant_mercy_no",[]],
[anyone,"local_merchant_mercy_no", [], "Damn you! May you burn in Hell!", "close_window",[]],
[anyone|plyr,"local_merchant_mercy", [], "I'll let you live, if you promise me...", "local_merchant_mercy_yes",[]],
[anyone,"local_merchant_mercy_yes", [], "Of course, I promise, I'll do anything. Just spare my life... ", "local_merchant_mercy_yes_2",[]],
[anyone|plyr,"local_merchant_mercy_yes_2", [], "You are going to forget about {s2}'s debt to you.\
And you will sign a paper stating that he owes you nothing.", "local_merchant_mercy_yes_3",[]],
[anyone,"local_merchant_mercy_yes_3", [], "Yes, of course. I'll do as you say.", "local_merchant_mercy_yes_4",[]],
[anyone|plyr,"local_merchant_mercy_yes_4", [], "And if my lord hears so much of a hint of a complaint about this issue, then I'll come back for you,\
and it won't matter how much you scream for mercy then.\
Do you understand me?", "local_merchant_mercy_yes_5",[]],
[anyone,"local_merchant_mercy_yes_5", [], "Yes {sir/madam}. Don't worry. I won't make any complaint.", "local_merchant_mercy_yes_6",[]],
[anyone|plyr,"local_merchant_mercy_yes_6", [], "Good. Go now, before I change my mind.", "close_window",
[(quest_set_slot, "qst_kill_local_merchant", slot_quest_current_state, 2),
(call_script, "script_succeed_quest", "qst_kill_local_merchant"),
(finish_mission),
]],
# Village traitor
[trp_fugitive,"start", [], "What do you want?", "fugitive_1",[]],
[trp_fugitive|plyr,"fugitive_1", [
(quest_get_slot, ":quest_target_dna", "qst_hunt_down_fugitive", slot_quest_target_dna),
(call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
(str_store_string, s4, s50),
], "I am looking for a murderer by the name of {s4}. You fit his description.", "fugitive_2",[]],
[trp_fugitive|plyr,"fugitive_1", [], "Nothing. Sorry to trouble you.", "close_window",[]],
[trp_fugitive,"fugitive_2", [], "I don't understand, {sir/madam}.\
I never killed anyone. I think you've got the wrong man.", "fugitive_3",[]],
[trp_fugitive|plyr,"fugitive_3", [], "Then drop your sword. If you are innocent, you have nothing to fear.\
We'll go now and talk to your neighbours, and if they verify your story, I'll go on my way.", "fugitive_4",[]],
[anyone,"fugitive_4", [], "I'm not going anywhere, friend. You're going to have to fight for your silver, today.", "fugitive_5",
[]],
[trp_fugitive|plyr,"fugitive_5", [], "No problem. I really just need your head, anyway.", "fugitive_fight_start",[]],
[trp_fugitive|plyr,"fugitive_5", [], "I come not for money, but to execute the law!", "fugitive_fight_start",[]],
[trp_fugitive|plyr,"fugitive_5", [], "Alas, that you cannot be made to see reason.", "fugitive_fight_start",[]],
[anyone,"fugitive_fight_start", [], "Die, dog!", "close_window",
[
(set_party_battle_mode),
(quest_set_slot, "qst_hunt_down_fugitive", slot_quest_current_state, 1),
(call_script, "script_activate_tavern_attackers"),
]],
[anyone,"member_chat", [(check_quest_active, "qst_incriminate_loyal_commander"),
(quest_slot_eq, "qst_incriminate_loyal_commander", slot_quest_current_state, 0),
(store_conversation_troop, "$g_talk_troop"),
(eq, "$g_talk_troop", "$incriminate_quest_sacrificed_troop"),
(quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
(store_distance_to_party_from_party, ":distance", "p_main_party", ":quest_target_center"),
(lt, ":distance", 10),
], "Yes {sir/madam}?", "sacrificed_messenger_1",[]],
[anyone|plyr,"sacrificed_messenger_1", [(quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
(str_store_party_name, s1, ":quest_target_center"),
(quest_get_slot, ":quest_object_troop", "qst_incriminate_loyal_commander", slot_quest_object_troop),
(str_store_troop_name, s2, ":quest_object_troop"),],
"Take this letter to {s1} and give it to {s2}.", "sacrificed_messenger_2",[]],
[anyone|plyr,"sacrificed_messenger_1", [],
"Nothing. Nothing at all.", "close_window",[]],
[anyone,"sacrificed_messenger_2", [],
"Yes {sir/madam}. You can trust me. I will not fail you.", "sacrificed_messenger_3",[]],
[anyone|plyr,"sacrificed_messenger_3", [],
"Good. I will not forget your service. You will be rewarded when you return.", "close_window",[(party_remove_members, "p_main_party", "$g_talk_troop", 1),
(set_spawn_radius, 0),
(spawn_around_party, "p_main_party", "pt_sacrificed_messenger"),
(assign, ":new_party", reg0),
(party_add_members, ":new_party", "$g_talk_troop", 1),
(party_set_ai_behavior, ":new_party", ai_bhvr_travel_to_party),
(quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
(party_set_ai_object, ":new_party", ":quest_target_center"),
(party_set_flags, ":new_party", pf_default_behavior, 0),
(quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_current_state, 2),
(quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_target_party, ":new_party")]],
[anyone|plyr,"sacrificed_messenger_3", [], "Arggh! I can't do this. I can't send you to your own death!", "sacrificed_messenger_cancel",[]],
[anyone,"sacrificed_messenger_cancel", [], "What do you mean {sir/madam}", "sacrificed_messenger_cancel_2",[]],
[anyone|plyr,"sacrificed_messenger_cancel_2", [(quest_get_slot, ":quest_giver", "qst_incriminate_loyal_commander", slot_quest_giver_troop),
(str_store_troop_name, s3, ":quest_giver"),
], "There's a trap set up for you in the town.\
{s3} ordered me to sacrifice one of my chosen warriors to fool the enemy,\
but he will just need to find another way.", "sacrificed_messenger_cancel_3",[
(quest_get_slot, ":quest_giver", "qst_incriminate_loyal_commander", slot_quest_giver_troop),
(quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_current_state, 1),
(call_script, "script_change_player_relation_with_troop",":quest_giver",-5),
(call_script, "script_change_player_honor", 3),
(call_script, "script_fail_quest", "qst_incriminate_loyal_commander"),
]],
[anyone,"sacrificed_messenger_cancel_3", [], "Thank you, {sir/madam}.\
I will follow you to the gates of hell. But this would not be a good death.", "close_window",[]],
[party_tpl|pt_sacrificed_messenger,"start", [],
"Don't worry, {sir/madam}, I'm on my way.", "close_window",[(assign, "$g_leave_encounter",1)]],
#Spy
[party_tpl|pt_spy,"start", [], "Good day {sir/madam}. Such fine weather don't you think? If you'll excuse me now I must go on my way.", "follow_spy_talk",[]],
[anyone|plyr, "follow_spy_talk",
[
(quest_get_slot, ":quest_giver", "qst_follow_spy", slot_quest_giver_troop),
(str_store_troop_name, s1, ":quest_giver"),
],
"In the name of {s1}, you are under arrest!", "follow_spy_talk_2", []],
[anyone, "follow_spy_talk_2", [], "You won't get me alive!", "close_window", []],
[anyone|plyr, "follow_spy_talk", [], "Never mind me. I was just passing by.", "close_window", [(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_spy_partners,"start", [], "Greetings.", "spy_partners_talk",[]],
[anyone|plyr,"spy_partners_talk",
[
(quest_get_slot, ":quest_giver", "qst_follow_spy", slot_quest_giver_troop),
(str_store_troop_name, s1, ":quest_giver"),
],
"In the name of {s1} You are under arrest!", "spy_partners_talk_2",[]],
[anyone,"spy_partners_talk_2", [], "You will have to fight us first!", "close_window",[]],
[anyone|plyr,"spy_partners_talk", [], "Never mind me. I was just passing by.", "close_window",[(assign, "$g_leave_encounter",1)]],
###Conspirator
##
## [party_tpl|pt_conspirator_leader,"start", [], "TODO: Hello.", "conspirator_talk",[]],
## [party_tpl|pt_conspirator,"start", [], "TODO: Hello.", "conspirator_talk",[]],
##
## [anyone|plyr,"conspirator_talk", [(gt, "$qst_capture_conspirators_leave_meeting_counter", 0),
## (quest_get_slot,":quest_giver","qst_capture_conspirators",slot_quest_giver_troop),
## (str_store_troop_name,s1,":quest_giver")],
## "TODO: In the name of {s1}, you are under arrest!", "conspirator_talk_2",[]],
##
## [anyone|plyr,"conspirator_talk", [], "TODO: Bye.", "close_window",[(assign, "$g_leave_encounter",1)]],
##
## [anyone,"conspirator_talk_2", [], "You won't get me alive!", "close_window",[]],
##
#Runaway Peasants
[party_tpl|pt_runaway_serfs,"start", [(party_slot_eq, "$g_encountered_party", slot_town_center, 0)],#slot_town_center is used for first time meeting
"Good day {sir/madam}.", "runaway_serf_intro_1",
[(party_set_slot, "$g_encountered_party", slot_town_center, 1)]],
[anyone|plyr,"runaway_serf_intro_1", [(quest_get_slot, ":lord", "qst_bring_back_runaway_serfs", slot_quest_giver_troop),
(str_store_troop_name, s4, ":lord")],
"I have been sent by your {s4} whom you are running from. He will not punish you if you return now.", "runaway_serf_intro_2",[]],
[anyone,"runaway_serf_intro_2", [(quest_get_slot, ":target_center", "qst_bring_back_runaway_serfs", slot_quest_target_center),
(str_store_party_name, s6, ":target_center"),
(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(str_store_party_name, s1, ":quest_object_center")],
"My good {sir/madam}. Our lives at our village {s1} was unbearable. We worked all day long and still went to bed hungry.\
We are going to {s6} to start a new life, where we will be treated like humans.", "runaway_serf_intro_3",[]],
[anyone|plyr,"runaway_serf_intro_3", [(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(str_store_party_name, s1, ":quest_object_center"),],
"You have gone against our laws by running from your bondage. You will go back to {s1} now!", "runaway_serf_go_back",
[(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(call_script, "script_change_player_relation_with_center", ":quest_object_center", -1)]],
[anyone|plyr,"runaway_serf_intro_3", [], "Well, maybe you are right. All right then. If anyone asks, I haven't seen you.", "runaway_serf_let_go",
[(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(call_script, "script_change_player_relation_with_center", ":quest_object_center", 1)]],
[party_tpl|pt_runaway_serfs,"runaway_serf_go_back", [(quest_get_slot, ":home_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(str_store_party_name, s5, ":home_center")],
"All right {sir/madam}. As you wish. We'll head back to {s5} now.", "close_window",
[(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(party_set_ai_object, "$g_encountered_party", ":quest_object_center"),
(assign, "$g_leave_encounter",1)]],
[anyone,"runaway_serf_let_go", [], "God bless you, {sir/madam}. We will not forget your help.", "close_window",
[(party_set_slot, "$g_encountered_party", slot_town_castle, 1),
(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_runaway_serfs,"start", [(party_slot_eq, "$g_encountered_party", slot_town_castle, 1),
],
"Good day {sir/madam}. Don't worry. If anyone asks, we haven't seen you.", "runaway_serf_reconsider",[]],
[anyone|plyr,"runaway_serf_reconsider", [], "I have changed my mind. You must back to your village!", "runaway_serf_go_back",
[(party_set_slot, "$g_encountered_party", slot_town_castle, 0),
(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(call_script, "script_change_player_relation_with_center", ":quest_object_center", -2)]],
[anyone|plyr,"runaway_serf_reconsider", [], "Good. Go quickly now before I change my mind.", "runaway_serf_let_go",[]],
[party_tpl|pt_runaway_serfs,"start", [(party_slot_eq, "$g_encountered_party", slot_town_castle, 0),
(get_party_ai_object, ":cur_ai_object"),
(quest_get_slot, ":home_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(neq, ":home_center", ":cur_ai_object")],
"Good day {sir/madam}. We were heading back to {s5}, but I am afraid we lost our way.", "runaway_serf_talk_caught",[]],
[anyone|plyr,"runaway_serf_talk_caught", [], "Do not test my patience. You are going back now!", "runaway_serf_go_back",[]],
[anyone|plyr,"runaway_serf_talk_caught", [], "Well, if you are that eager to go, then go.", "runaway_serf_let_go",
[(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(call_script, "script_change_player_relation_with_center", ":quest_object_center", 1)]],
[party_tpl|pt_runaway_serfs,"start",
[(quest_get_slot, ":home_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
(str_store_party_name, s5, ":home_center")], "We are on our way back to {s5} {sir/madam}.", "runaway_serf_talk_again_return",[]],
[anyone|plyr,"runaway_serf_talk_again_return", [], "Make haste now. The sooner you return the better.", "runaway_serf_talk_again_return_2",[]],
[anyone|plyr,"runaway_serf_talk_again_return", [], "Good. Keep going.", "runaway_serf_talk_again_return_2",[]],
[anyone|plyr,"runaway_serf_talk_again_return_2", [], "Yes {sir/madam}. As you wish.", "close_window",[(assign, "$g_leave_encounter",1)]],
#Quest bandits
[anyone,"start", [
(check_quest_active, "qst_track_down_bandits"),
(quest_slot_eq, "qst_track_down_bandits", slot_quest_target_party, "$g_encountered_party"),
(neg|is_between, "$g_encountered_party_faction", kingdoms_begin, kingdoms_end), #ie, the party has not respawned as a non-bandit
],
"This must be your unlucky day, mate. We're just about the worst people you could run into, in these parts.", "troublesome_bandits_intro_1",[
]],
[anyone|plyr,"troublesome_bandits_intro_1", [],
"Heh. For me, you are nothing more than walking money bags.\
A merchant in {s1} offered me good money for your heads.",
"troublesome_bandits_intro_2", [(quest_get_slot, ":quest_giver_center", "qst_track_down_bandits", slot_quest_giver_center),
(str_store_party_name, s1, ":quest_giver_center")
]],
[anyone,"troublesome_bandits_intro_2", [],
"A bounty hunter! Kill {him/her}! Kill {him/her} now!", "close_window",[
(encounter_attack)]],
#Deserters
[party_tpl|pt_deserters, "start", [(eq,"$talk_context",tc_party_encounter),
(party_get_slot,":protected_until_hours", "$g_encountered_party",slot_party_ignore_player_until),
(store_current_hours,":cur_hours"),
(store_sub, ":protection_remaining",":protected_until_hours",":cur_hours"),
(gt, ":protection_remaining", 0)], "What do you want?\
You want to pay us some more money?", "deserter_paid_talk",[]],
[anyone|plyr,"deserter_paid_talk", [], "Sorry to trouble you. I'll be on my way now.", "deserter_paid_talk_2a",[]],
[anyone,"deserter_paid_talk_2a", [], "Yeah. Stop fooling around and go make some money.\
I want to see that purse full next time I see you.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone|plyr,"deserter_paid_talk", [], "No. It's your turn to pay me this time.", "deserter_paid_talk_2b",[]],
[anyone,"deserter_paid_talk_2b", [], "What nonsense are you talking about? You want trouble? You got it.", "close_window",[
(party_set_slot,"$g_encountered_party",slot_party_ignore_player_until,0),
(party_ignore_player, "$g_encountered_party", 0),
]],
[party_tpl|pt_deserters,"start", [
(eq,"$talk_context",tc_party_encounter)
], "We are the free brothers.\
We will fight only for ourselves from now on.\
Now give us your gold or taste our steel.", "deserter_talk",[]],
## [anyone|plyr,"deserter_talk", [(check_quest_active, "qst_bring_back_deserters"),
## (quest_get_slot, ":target_deserter_troop", "qst_bring_back_deserters", slot_quest_target_troop),
## (party_count_members_of_type, ":num_deserters", "$g_encountered_party",":target_deserter_troop"),
## (gt, ":num_deserters", 1)],
## "If you surrender to me now, you will rejoin the army of your kingdom without being punished. Otherwise you'll get a taste of my sword.", "deserter_join_as_prisoner",[]],
[anyone|plyr,"deserter_talk", [], "When I'm done with you, you'll regret ever leaving your army.", "close_window",[]],
[anyone|plyr,"deserter_talk", [], "There's no need to fight. I am ready to pay for free passage.", "deserter_barter",[]],
## [anyone,"deserter_join_as_prisoner", [(call_script, "script_party_calculate_strength", "p_main_party"),
## (assign, ":player_strength", reg0),
## (store_encountered_party,":encountered_party"),
## (call_script, "script_party_calculate_strength", ":encountered_party"),
## (assign, ":enemy_strength", reg0),
## (val_mul, ":enemy_strength", 2),
## (ge, ":player_strength", ":enemy_strength")],
## "All right we join you then.", "close_window",[(assign, "$g_enemy_surrenders", 1)]],
## [anyone,"deserter_join_as_prisoner", [], "TODO: We will never surrender!", "close_window",[(encounter_attack)]],
[anyone,"deserter_barter", [], "Good. You are clever. Now, having a look at your baggage, I reckon a fellow like you could pretty easily afford {reg5} denars. We wouldn't want to be too greedy, now would we? Pay us, and then you can go.", "deserter_barter_2",[
(store_troop_gold, ":total_value", "trp_player"),
(troop_get_inventory_capacity, ":inv_size", "trp_player"),
(try_for_range, ":i_slot", 0, ":inv_size"),
(troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
(ge, ":item_id", 0),
(try_begin),
(is_between, ":item_id", trade_goods_begin, trade_goods_end),
(store_item_value, ":item_value", ":item_id"),
(val_add, ":total_value", ":item_value"),
(try_end),
(try_end),
(store_div, "$deserter_tribute", ":total_value", 10), #10000 gold = excellent_target
(val_max, "$deserter_tribute", 10),
(assign,reg(5),"$deserter_tribute")]],
[anyone|plyr,"deserter_barter_2", [(store_troop_gold,reg(2)),(ge,reg(2),"$deserter_tribute"),(assign,reg(5),"$deserter_tribute")],
"All right here's your {reg5} denars.", "deserter_barter_3a",[(troop_remove_gold, "trp_player","$deserter_tribute")]],
[anyone|plyr,"deserter_barter_2", [],
"I don't have that much money with me", "deserter_barter_3b",[]],
[anyone,"deserter_barter_3b", [],
"Too bad. Then we'll have to sell you to the slavers.", "close_window",[]],
[anyone,"deserter_barter_3a", [], "Heh. That wasn't difficult, now, was it? All right. Go now.", "close_window",[
(store_current_hours,":protected_until"),
(val_add, ":protected_until", 72),
(party_set_slot,"$g_encountered_party",slot_party_ignore_player_until,":protected_until"),
(party_ignore_player, "$g_encountered_party", 72),
(assign, "$g_leave_encounter",1)
]],
##### TODO: QUESTS COMMENT OUT END
#Tavernkeepers
[anyone ,"start", [(store_conversation_troop,reg(1)),(ge,reg(1),tavernkeepers_begin),(lt,reg(1),tavernkeepers_end)],
"Good day dear {sir/madam}. How can I help you?", "tavernkeeper_talk",
[
# (store_encountered_party,reg(2)),
# (party_get_slot,"$tavernkeeper_party",reg(2),slot_town_mercs),
]],
[anyone,"tavernkeeper_pretalk", [], "Anything else?", "tavernkeeper_talk",[]],
[anyone|plyr,"tavernkeeper_talk", [(check_quest_active,"qst_deliver_wine"),
(quest_slot_eq, "qst_deliver_wine", slot_quest_target_center, "$g_encountered_party"),
(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
(store_item_kind_count, ":item_count", ":quest_target_item"),
(ge, ":item_count", ":quest_target_amount"),
(assign, reg9, ":quest_target_amount"),
(str_store_item_name, s4, ":quest_target_item"),
],
"I was told to deliver you {reg9} units of {s4}.", "tavernkeeper_deliver_wine",[]],
[anyone,"tavernkeeper_deliver_wine", [],
"At last! My stock was almost depleted.\
I had paid the cost of the {s4} in advance.\
Here, take these {reg5} denars. That should cover your pay.\
And give {s9} my regards.\
I'll put in a good word for you next time I deal with him.", "tavernkeeper_pretalk",
[(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
(quest_get_slot, ":quest_gold_reward", "qst_deliver_wine", slot_quest_gold_reward),
(quest_get_slot, ":quest_giver_troop", "qst_deliver_wine", slot_quest_giver_troop),
(troop_remove_items, "trp_player", ":quest_target_item", ":quest_target_amount"),
(call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
(assign, ":xp_reward", ":quest_gold_reward"),
(val_mul, ":xp_reward", 4),
(add_xp_as_reward, ":xp_reward"),
(assign, reg5, ":quest_gold_reward"),
(str_store_item_name, s4, ":quest_target_item"),
(str_store_troop_name, s9, ":quest_giver_troop"),
(quest_get_slot, ":giver_town", "qst_deliver_wine", slot_quest_giver_center),
(call_script, "script_change_player_relation_with_center", ":giver_town", 2),
(call_script, "script_change_player_relation_with_center", "$current_town", 1),
(call_script, "script_end_quest", "qst_deliver_wine"),
]],
[anyone|plyr,"tavernkeeper_talk", [(check_quest_active,"qst_deliver_wine"),
(quest_slot_eq, "qst_deliver_wine", slot_quest_target_center, "$g_encountered_party"),
(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
(store_item_kind_count, ":item_count", ":quest_target_item"),
(lt, ":item_count", ":quest_target_amount"),
(gt, ":item_count", 0),
(assign, reg9, ":quest_target_amount"),
(str_store_item_name, s4, ":quest_target_item"),
],
"I was told to deliver you {reg9} units of {s4}, but I lost some of the cargo on the way.", "tavernkeeper_deliver_wine_incomplete",[]],
[anyone,"tavernkeeper_deliver_wine_incomplete", [],
"Attacked by bandits eh?\
You are lucky they left you alive.\
Anyway, I can pay you no more than {reg5} denars for this.\
And I will let {s1} know that my order was delivered less than completely,\
so you will probably be charged for this loss.", "tavernkeeper_pretalk",
[(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
(quest_get_slot, ":quest_gold_reward", "qst_deliver_wine", slot_quest_gold_reward),
(quest_get_slot, ":quest_giver_troop", "qst_deliver_wine", slot_quest_giver_troop),
(store_item_kind_count, ":item_count", ":quest_target_item"),
(troop_remove_items, "trp_player", ":quest_target_item", ":item_count"),
(val_mul, ":quest_gold_reward", ":item_count"),
(val_div, ":quest_gold_reward", ":quest_target_amount"),
(call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
(assign, reg5, ":quest_gold_reward"),
(assign, ":xp_reward", ":quest_gold_reward"),
(val_mul, ":xp_reward", 4),
(add_xp_as_reward, ":xp_reward"),
(str_store_troop_name, s1, ":quest_giver_troop"),
(assign, ":debt", "$qst_deliver_wine_debt"),
(store_sub, ":item_left", ":quest_target_amount", ":item_count"),
(val_mul, ":debt", ":item_left"),
(val_div, ":debt", ":quest_target_amount"),
(val_add, "$debt_to_merchants_guild", ":debt"),
(quest_get_slot, ":giver_town", "qst_deliver_wine", slot_quest_giver_center),
(call_script, "script_change_player_relation_with_center", ":giver_town", 1),
(call_script, "script_end_quest", "qst_deliver_wine"),
]],
[anyone|plyr,"tavernkeeper_talk", [(check_quest_active,"qst_deliver_wine"),
(quest_slot_eq, "qst_deliver_wine", slot_quest_target_center, "$g_encountered_party"),
(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(store_item_kind_count, ":item_count", ":quest_target_item"),
(eq, ":item_count", 0),
(quest_get_slot, reg9, "qst_deliver_wine", slot_quest_target_amount),
(str_store_item_name, s4, ":quest_target_item"),
],
"I was told to deliver you {reg9} units of {s4}, but I lost the cargo on the way.", "tavernkeeper_deliver_wine_lost",[]],
[anyone,"tavernkeeper_deliver_wine_lost", [],
"What? I was waiting for that {s4} for weeks!\
And now you are telling me that you lost it?\
You may rest assured that I will let {s1} know about this.", "tavernkeeper_pretalk",
[(add_xp_as_reward, 40),
(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(quest_get_slot, ":quest_giver_troop", "qst_deliver_wine", slot_quest_giver_troop),
(str_store_item_name, s4, ":quest_target_item"),
(str_store_troop_name, s1, ":quest_giver_troop"),
(val_add, "$debt_to_merchants_guild", "$qst_deliver_wine_debt"),
(call_script, "script_end_quest", "qst_deliver_wine"),
]],
## [anyone|plyr,"tavernkeeper_talk", [], "I need to hire some soldiers. Can you help me?", "tavernkeeper_buy_peasants",[]],
## [anyone,"tavernkeeper_buy_peasants",
## [
## (store_encountered_party,reg(3)),
## (store_faction_of_party,reg(4),reg(3)),
## (store_relation,reg(5),"fac_player_supporters_faction",reg(4)),
## (lt, reg(5), -3),
## ], "I don't think anyone from this town will follow somebody like you. Try your luck elsewhere.", "tavernkeeper_buy_peasants_2",[]],
## [anyone,"tavernkeeper_buy_peasants", [], "I know a few fellows who would follow you if you paid for their equipment.", "tavernkeeper_buy_peasants_2",[(set_mercenary_source_party,"$tavernkeeper_party"),[change_screen_buy_mercenaries]]],
## [anyone,"tavernkeeper_buy_peasants_2", [], "Anything else?", "tavernkeeper_talk",[]],
##
## [anyone|plyr,"tavernkeeper_talk", [], "I want to rest for a while.", "tavernkeeper_rest",[]],
### [anyone,"tavernkeeper_rest", [], "Of course... How long do you want to rest?", "tavernkeeper_rest_2",[]],
## [anyone,"tavernkeeper_rest",
## [
## (store_encountered_party,reg(3)),
## (store_faction_of_party,reg(4),reg(3)),
## (store_relation,reg(5),"fac_player_supporters_faction",reg(4)),
## (lt, reg(5), -3),
## ], "You look like trouble stranger. I can't allow you to stay for the night. No.", "close_window",
## []],
## [anyone,"tavernkeeper_rest", [], "Of course... That will be {reg3} denars for the room and food. How long do you want to rest?", "tavernkeeper_rest_2",
## [(store_party_size,reg(3)),
## (val_add,reg(3),1),
## (val_div,reg(3),3),
## (val_max,reg(3),1),
## (assign,"$tavern_rest_cost",reg(3))]],
## [anyone|plyr,"tavernkeeper_rest_2", [(store_time_of_day,reg(1)),
## (val_add,reg(1),7),
## (val_mod,reg(1),24),
## (lt,reg(1),12),
## (store_troop_gold,reg(8),"trp_player"),
## (ge,reg(8),"$tavern_rest_cost"),
## ],
## "I want to rest until morning.", "close_window",
## [(assign, reg(2), 13),(val_sub,reg(2),reg(1)),(assign, "$g_town_visit_after_rest", 1),(rest_for_hours, reg(2)),(troop_remove_gold, "trp_player","$tavern_rest_cost"),(call_script, "script_change_player_party_morale", 2)]],
## [anyone|plyr,"tavernkeeper_rest_2", [(store_time_of_day,reg(1)),
## (val_add,reg(1),7),
## (val_mod,reg(1),24),
## (ge,reg(1),12),
## (store_troop_gold,reg(8),"trp_player"),
## (ge,reg(8),"$tavern_rest_cost"),
## ],
## "I want to rest until evening.", "close_window",
## [(assign, reg(2), 28),(val_sub,reg(2),reg(1)),(assign, "$g_town_visit_after_rest", 1),(rest_for_hours, reg(2)),(troop_remove_gold, "trp_player","$tavern_rest_cost"),(call_script, "script_change_player_party_morale", 2)]],
## [anyone|plyr,"tavernkeeper_rest_2", [], "Forget it.", "close_window",[]],
[anyone|plyr,"tavernkeeper_talk", [
(store_current_hours,":cur_hours"),
(val_sub, ":cur_hours", 24),
(gt, ":cur_hours", "$buy_drinks_last_time"),
], "I'd like to buy every man who comes in here tonight a jar of your best wine.", "tavernkeeper_buy_drinks",[]],
[anyone,"tavernkeeper_buy_drinks",
[
], "Of course, {my lord/my lady}. I reckon {reg5} denars should be enough for that. What should I tell the lads?", "tavernkeeper_buy_drinks_2",[
(assign, "$temp", 1000),
(assign, reg5, "$temp"),
]],
[anyone|plyr,"tavernkeeper_buy_drinks_2",
[
(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", "$temp"),
(str_store_party_name, s10, "$current_town"),
], "Let everyone know of the generosity of {playername} to the people of {s10}.", "tavernkeeper_buy_drinks_end",[
]],
[anyone,"tavernkeeper_buy_drinks_end",
[], "Don't worry {sir/madam}. Your name will be cheered and toasted here all night.", "tavernkeeper_pretalk",
[
(troop_remove_gold, "trp_player", "$temp"),
(call_script, "script_change_player_relation_with_center", "$current_town", 1),
(store_current_hours,":cur_hours"),
(assign, "$buy_drinks_last_time", ":cur_hours"),
]],
[anyone|plyr,"tavernkeeper_buy_drinks_2", [], "Actually, cancel that order.", "tavernkeeper_pretalk",[]],
[anyone|plyr,"tavernkeeper_talk", [
(neq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
],
"Have you heard of anyone in this realm who might have a job for a {man/woman} like myself?", "tavernkeeper_job_ask",[
]],
[anyone,"tavernkeeper_job_ask",
[
(str_store_string, s9, "str__of_course_the_land_is_currently_at_peace_so_you_may_have_better_luck_in_other_realms"),
(try_for_range, ":faction", kingdoms_begin, kingdoms_end),
(store_relation, ":relation", "$g_encountered_party_faction", ":faction"),
(lt, ":relation", 0),
(str_clear, s9),
(try_end),
(faction_get_slot, ":leader", "$g_encountered_party_faction", slot_faction_leader),
(str_store_troop_name, s10, ":leader"),
], "Hmm... Well, {s10} is often looking for mercenaries to fight in his wars.{s9}", "tavernkeeper_job_search",
[
(assign, "$g_troop_list_no", 0),
]],
[anyone, "tavernkeeper_job_search",
[],
"Let me think some more...", "tavernkeeper_job_result",
[
(call_script, "script_npc_find_quest_for_player_to_s11", "$g_encountered_party_faction"),
(assign, ":quest_giver", reg0),
(call_script, "script_get_dynamic_quest", ":quest_giver"),
(assign, ":quest_type", reg0),
(try_begin),
(gt, ":quest_giver", -1),
(str_store_troop_name, s7, ":quest_giver"),
(str_clear, s9), #location string
(assign, ":location", -1),
(try_begin),
(troop_slot_eq, ":quest_giver", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":quest_giver_party", ":quest_giver", slot_troop_leaded_party),
(party_is_active, ":quest_giver_party"),
(party_get_attached_to, ":location", ":quest_giver_party"),
(else_try),
(is_between, ":quest_giver", mayors_begin, mayors_end),
(try_for_range, ":town", towns_begin, towns_end),
(party_slot_eq, ":town", slot_town_elder, ":quest_giver"),
(assign, ":location", ":town"),
(try_end),
(try_end),
(try_begin),
(gt, ":location", -1),
(try_begin),
(eq, ":location", "$g_encountered_party"),
(str_store_string, s8, "str_here"),
(else_try),
(str_store_string, s8, "str_over"),
(try_end),
(str_store_party_name, s12, ":location"),
(str_store_string, s9, "str_s8_in_s12"),
(try_end),
(try_begin),
(eq, ":quest_type", "qst_track_down_bandits"),
(str_store_string, s10, "str__has_put_together_a_bounty_on_some_bandits_who_have_been_attacking_travellers_in_the_area"),
(else_try),
(eq, ":quest_type", "qst_destroy_bandit_lair"),
(str_store_string, s10, "str__has_been_worried_about_bandits_establishing_a_hideout_near_his_home"),
(else_try),
(eq, ":quest_type", "qst_retaliate_for_border_incident"),
(str_store_string, s10, "str__is_looking_for_a_way_to_avoid_an_impending_war"),
(else_try),
(eq, ":quest_type", "qst_rescue_prisoner"),
(str_store_string, s10, "str__may_need_help_rescuing_an_imprisoned_family_member"),
(else_try),
(eq, ":quest_type", "qst_cause_provocation"),
(str_store_string, s10, "str__has_been_asking_around_for_someone_who_might_want_work_id_watch_yourself_with_him_though"),
(else_try),
(str_store_string, s10, "str_tavernkeeper_invalid_quest"),
(try_end),
(troop_get_type, reg4, ":quest_giver"),
(try_end),
]],
[anyone, "tavernkeeper_job_result", [
(store_sub, ":last_troop", mayors_end, 1),
(lt, "$g_troop_list_no", ":last_troop"),
], "I have heard that {s7} {s9}{s10} You may want to speak with {reg4?her:him}.", "tavernkeeper_job_search",
[
]],
[anyone, "tavernkeeper_job_result", [
(store_sub, ":last_troop", mayors_end, 1),
(ge, "$g_troop_list_no", ":last_troop"),
], "There may be other work, of course -- lords and guildmasters often have other tasks which we don't hear about. Also, the villages around here frequently need help, although they'd be more likely to pay you with a wedge of cheese and goodwill than with cold hard denars.", "tavernkeeper_job_result_2",
[
]],
[anyone,"tavernkeeper_job_result_2", [], "I'll keep my ears open for other opportunities. You may want to ask again from time to time.", "close_window",[]],
[anyone|plyr,"tavernkeeper_talk", [], "I guess I should leave now.", "close_window",[]],
#Tavern Talk (with companions)
# [anyone, "companion_recruit_yes", [(neg|hero_can_join, "p_main_party"),], "I don't think can lead any more men than you do now.\
# You need to release someone from service if you want me to join your party.", "close_window", []],
#Tavern Talk (with ransom brokers)
[anyone,"start", [(is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
(eq, "$g_talk_troop_met", 0)],
"Greetings to you, {sir/madam}. You look like someone who should get to know me.", "ransom_broker_intro",[]],
[anyone|plyr,"ransom_broker_intro",[], "Why is that?", "ransom_broker_intro_2",[]],
[anyone, "ransom_broker_intro_2", [], "I broker ransoms for the poor wretches who are captured in these endless wars.\
Normally I travel between the salt mines and the slave markets on the coast, on commission from those whose relatives have gone missing.\
But if I'm out on my errands of mercy, and I come across a fellow dragging around a captive or two,\
well, there's no harm in a little speculative investment, is there?\
And you look like the type who might have a prisoner to sell.", "ransom_broker_info_talk",[(assign, "$ransom_broker_families_told",0),
(assign, "$ransom_broker_prices_told",0),
(assign, "$ransom_broker_ransom_me_told",0),
]],
[anyone|plyr,"ransom_broker_info_talk",[(eq, "$ransom_broker_families_told",0)], "What if their families can't pay?", "ransom_broker_families",[]],
[anyone, "ransom_broker_families", [], "Oh, then I spin them a few heartwarming tales of life on the galleys.\
You'd be surprised what sorts of treasures a peasant can dig out of his cowshed or wheedle out of his cousins,\
assuming he's got the proper motivation!\
And if in the end they cannot come up with the silver, then there are always slave merchants who are looking for galley slaves.\
One cannot do Heaven's work with an empty purse, you see.", "ransom_broker_info_talk",[(assign, "$ransom_broker_families_told",1)]],
[anyone|plyr,"ransom_broker_info_talk",[(eq, "$ransom_broker_prices_told",0)], "What can I get for a prisoner?", "ransom_broker_prices",[]],
[anyone, "ransom_broker_prices", [], "It varies. I fancy that I have a fine eye for assessing a ransom.\
There are a dozen little things about a man that will tell you whether he goes to bed hungry, or dines each night on soft dumplings and goose.\
The real money of course is in the gentry, and if you ever want to do my job you'll want to learn about every landowning family in Calradia,\
their estates, their heraldry, their offspring both lawful and bastard, and, of course, their credit with the merchants.", "ransom_broker_info_talk",[(assign, "$ransom_broker_prices_told",1)]],
[anyone|plyr,"ransom_broker_info_talk",[(eq, "$ransom_broker_ransom_me_told",0)], "Would you be able to ransom me if I were taken?", "ransom_broker_ransom_me",[]],
[anyone, "ransom_broker_ransom_me", [], "Of course. I'm welcome in every court in Calradia.\
There's not many who can say that! So always be sure to keep a pot of denars buried somewhere,\
and a loyal servant who can find it in a hurry.", "ransom_broker_info_talk",[(assign, "$ransom_broker_ransom_me_told",1)]],
[anyone|plyr,"ransom_broker_info_talk",[], "That's all I need to know. Thank you.", "ransom_broker_pretalk",[]],
[anyone,"start", [(is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
],
"Greetings. If you have any prisoners, I will be happy to buy them from you.", "ransom_broker_talk",[]],
[anyone,"ransom_broker_pretalk", [],
"Anyway, if you have any prisoners, I will be happy to buy them from you.", "ransom_broker_talk",[]],
[anyone|plyr,"ransom_broker_talk",
[[store_num_regular_prisoners,reg(0)],[ge,reg(0),1]],
"Then you'd better bring your purse. I have got prisoners to sell.", "ransom_broker_sell_prisoners",[]],
[anyone|plyr,"ransom_broker_talk", [], "Tell me about what you do again.", "ransom_broker_intro_2",[]],
[anyone|plyr,"ransom_broker_talk",[
], "I wish to ransom one of my companions.", "ransom_broker_ransom_companion",[]],
[anyone,"ransom_broker_ransom_companion",[], "Whom do you wish to ransom?", "ransom_broker_ransom_companion_choose",[]],
[anyone|plyr|repeat_for_troops,"ransom_broker_ransom_companion_choose",[
(store_repeat_object, ":imprisoned_companion"),
(neg|troop_slot_eq, ":imprisoned_companion", slot_troop_occupation, slto_kingdom_hero),
(is_between, ":imprisoned_companion", companions_begin, companions_end),
(troop_slot_ge, ":imprisoned_companion", slot_troop_prisoner_of_party, centers_begin),
(str_store_troop_name, s4, ":imprisoned_companion"),
], "{s4}", "ransom_broker_ransom_companion_name_sum",[
(store_repeat_object, "$companion_to_be_ransomed"),
]],
[anyone|plyr,"ransom_broker_ransom_companion_choose",[
], "Never mind", "ransom_broker_pretalk",[]],
[anyone,"ransom_broker_ransom_companion_name_sum",[], "Let me check my ledger, here... Yes. Your friend is being held in the dungeon at {s7}. How interesting! I remember hearing that the rats down there are unusually large -- like mastiffs, they say... Now... For the very reasonable sum of {reg5} denars, which includes both the ransom and my commission and expenses, we can arrange it so that {s5} can once again enjoy {reg4?her:his} freedom. What do you say?", "ransom_broker_ransom_companion_verify",[
(str_store_troop_name, s5, "$companion_to_be_ransomed"),
(troop_get_type, reg4, "$companion_to_be_ransomed"),
(troop_get_slot, ":prison_location", "$companion_to_be_ransomed", slot_troop_prisoner_of_party),
(str_store_party_name, s7, ":prison_location"),
(store_character_level, ":companion_level", "$companion_to_be_ransomed"),
(store_add, "$companion_ransom_amount", ":companion_level", 20),
(val_mul, "$companion_ransom_amount", ":companion_level"),
(val_mul, "$companion_ransom_amount", 5), #Level 1: 110, level 40: 12,000
(assign, reg5, "$companion_ransom_amount"),
]],
[anyone|plyr,"ransom_broker_ransom_companion_verify",[
(store_troop_gold, ":player_gold", "trp_player"),
(ge, ":player_gold", "$companion_ransom_amount"),
], "Here's your money.", "ransom_broker_ransom_companion_accept",[
(troop_remove_gold, "trp_player", "$companion_ransom_amount"),
(troop_set_slot, "$companion_to_be_ransomed", slot_troop_occupation, slto_player_companion),
(troop_set_slot, "$companion_to_be_ransomed", slot_troop_current_mission, npc_mission_rejoin_when_possible),
(troop_set_slot, "$companion_to_be_ransomed", slot_troop_days_on_mission, 1),
(try_begin),
(troop_get_slot, ":held_at_prison", "$companion_to_be_ransomed", slot_troop_prisoner_of_party),
(party_count_prisoners_of_type, ":holding_as_prisoner", ":held_at_prison", "$companion_to_be_ransomed"),
(gt, ":holding_as_prisoner", 0),
(party_remove_prisoners, ":held_at_prison", "$companion_to_be_ransomed", 1),
(try_end),
(troop_set_slot, "$companion_to_be_ransomed", slot_troop_prisoner_of_party, -1),
(troop_set_slot, "$companion_to_be_ransomed", slot_troop_personalityclash_penalties, 0),
(troop_set_slot, "$companion_to_be_ransomed", slot_troop_morality_penalties, 0),
]],
[anyone|plyr,"ransom_broker_ransom_companion_verify",[
], "I can't afford that right now.", "ransom_broker_ransom_companion_refuse",[]],
[anyone,"ransom_broker_ransom_companion_accept",[], "Splendid! In a few days, I would think, you should find {s5} riding to rejoin you, blinking in the sunlight and no doubt very grateful! Is there any other way in which I can help you?", "ransom_broker_talk",[
(str_store_troop_name, s5, "$companion_to_be_ransomed"),
]],
[anyone,"ransom_broker_ransom_companion_refuse",[], "Of course, of course... Never mind what they say about the rats, by the way -- I've never actually seen one myself, on account of the pitch-black darkness. Anyway, I'm sure that {s5} will understand why it's important for you to control expenditures. Now... Was there anything else?", "ransom_broker_talk",[
(str_store_troop_name, s5, "$companion_to_be_ransomed"),
]],
[anyone|plyr,"ransom_broker_talk",[], "Not this time. Good-bye.", "close_window",[]],
[anyone,"ransom_broker_sell_prisoners", [],
"Let me see what you have...", "ransom_broker_sell_prisoners_2",
[[change_screen_trade_prisoners]]],
# [anyone, "ransom_broker_sell_prisoners_2", [], "You take more prisoners, bring them to me. I will pay well.", "close_window",[]],
[anyone, "ransom_broker_sell_prisoners_2", [], "I will be staying here for a few days. Let me know if you need my services.", "close_window",[]],
#Tavern Talk (with travelers)
[anyone, "start", [(is_between, "$g_talk_troop", tavern_travelers_begin, tavern_travelers_end),
(str_store_troop_name, s10, "$g_talk_troop"),
(eq,"$g_talk_troop_met",0),
],
"Greetings, friend. You look like the kind of {man/person} who'd do well to know me.\
I travel a lot all across Calradia and keep an open ear.\
I can provide you information that you might find useful. For a meager price of course.", "tavern_traveler_talk", [(assign, "$traveler_land_asked", 0)]],
[anyone, "start",
[
(is_between, "$g_talk_troop", tavern_travelers_begin, tavern_travelers_end),
(gt, "$last_lost_companion", 0),
(assign, ":companion_found_town", -1),
(troop_get_slot, ":companion_found_town", "$last_lost_companion", slot_troop_cur_center),
(is_between, ":companion_found_town", towns_begin, towns_end),
(str_store_troop_name, s10, "$last_lost_companion"),
(str_store_party_name, s11, ":companion_found_town"),
],
"Greetings, {playername}. I saw your companion {s10} at a tavern in {s11} some days ago. I thought you might like to know.", "tavern_traveler_lost_companion_thanks",
[(assign, "$last_lost_companion", 0)]],
[anyone|plyr, "tavern_traveler_lost_companion_thanks", [(troop_get_type, reg3, "$last_lost_companion")], "Thanks. I'll go and find {reg3?her:him} there.", "tavern_traveler_pretalk", []],
[anyone|plyr, "tavern_traveler_lost_companion_thanks", [], "Thanks, but I don't really care.", "tavern_traveler_pretalk", []],
[anyone, "start", [(is_between, "$g_talk_troop", tavern_travelers_begin, tavern_travelers_end),
],
"Greetings, {playername}.", "tavern_traveler_talk", [(assign, "$traveler_land_asked", 0)]],
[anyone, "tavern_traveler_pretalk", [], "Yes?", "tavern_traveler_talk", []],
[anyone|plyr, "tavern_traveler_talk", [(eq, "$traveler_land_asked", 0)], "What can you tell me about this land?", "tavern_traveler_tell_kingdoms", [(assign, "$traveler_land_asked", 1)]],
[anyone, "tavern_traveler_tell_kingdoms", [], "Calradia is divided into rival kingdoms, which can neither manage to live in peace with their neighbours,\
nor completely eliminate them.\
As a result, there's seldom a break to the bitter wars which plague this land and drain its life blood.\
Well, at least this must be a good place to be for an adventurer such as yourself.\
With some luck and skill, you can make a name for yourself here, amass a fortune perhaps, or gain great power.\
Opportunities are endless and so are the rewards, if you are willing to risk your life for them.", "tavern_traveler_tell_kingdoms_2", []],
[anyone|plyr, "tavern_traveler_tell_kingdoms_2", [], "Tell me more about these opportunities.", "tavern_traveler_tell_kingdoms_3", []],
[anyone|plyr, "tavern_traveler_tell_kingdoms_2", [], "Thank you. That was all I needed to know", "close_window", []],
[anyone, "tavern_traveler_tell_kingdoms_3", [(gt, "$player_has_homage", 0)], "Well, you probably know everything I could tell you already. You seem to be doing pretty well.",
"tavern_traveler_tell_kingdoms_4", []],
[anyone, "tavern_traveler_tell_kingdoms_3", [], "The kingdoms will pay good money for mercenaries if they are engaged in a war.\
If you have done a bit of fighting, speaking with one of their lords will probably result in being offered a mercenary contract.\
However the real rewards come if you can manage to become a vassal to a king.\
A vassal can own villages, castles and towns and get rich with the taxes and revenues of these estates.\
Normally, only nobles of the realm own land in this way,\
but in time of war, a king will not hesitate to accept someone who distinguishes {himself/herself} on the battlefield as a vassal, and grant {him/her} the right to own land.",
"tavern_traveler_tell_kingdoms_4a", []],
[anyone, "tavern_traveler_tell_kingdoms_4a", [], "It is not unheard-of for adventurers to renounce allegiance to a Calradian king altogether, declare themselves kings, and claim land in their own name. This is a difficult path, however, as the great nobles of the land, with their long ancestries, are not likely to accept such upstarts as their monarch. Such rulers would need to be very careful in establishing their right to rule, or they would be set upon from all sides.",
"tavern_traveler_tell_kingdoms_4", []],
[anyone, "tavern_traveler_tell_kingdoms_4", [], "It might be easier for an adventurer like yourself to pledge support to an existing king's rival.\
There are many such pretenders in Calradia -- those who are born to the right family, who go around and stir up trouble saying they have a better claim to the throne than the current king.\
If those claim holders could find supporters, they could easily start civil wars and perhaps even replace the king one day.",
"tavern_traveler_tell_kingdoms_5", []],
[anyone|plyr, "tavern_traveler_tell_kingdoms_5", [], "Interesting. Where can I find these claim holders?", "tavern_traveler_tell_kingdoms_6", []],
[anyone|plyr, "tavern_traveler_tell_kingdoms_5", [], "I guess I heard enough already. Thank you.", "close_window", []],
[anyone, "tavern_traveler_tell_kingdoms_6", [], "A claim holder's life would be in danger in his own country of course.\
Therefore, they usually stay at rival courts, raising support and hoping to find someone willing to champion their cause.\
I usually hear news about some of them, and may be able to tell you their location with some precision.\
But of course, I would ask for a little something for such a service.",
"tavern_traveler_pretalk", [(assign, "$traveller_claimants_mentioned", 1)]],
[anyone|plyr, "tavern_traveler_talk", [(eq, "$traveller_claimants_mentioned", 1)], "I want to know the location of a claimant.", "tavern_traveler_pretender_location", []],
[anyone, "tavern_traveler_pretender_location", [], "Whose location do you want to know?", "tavern_traveler_pretender_location_ask", []],
[anyone|plyr|repeat_for_troops, "tavern_traveler_pretender_location_ask",
[
(store_repeat_object, ":troop_no"),
(is_between, ":troop_no", pretenders_begin, pretenders_end),
(neg|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_ge, ":troop_no", slot_troop_cur_center, 1),
(str_store_troop_name, s11, ":troop_no"),
(neq, ":troop_no", "$supported_pretender"),
], "{s11}", "tavern_traveler_pretender_location_ask_2",
[
(store_repeat_object, "$temp"),
]],
[anyone|plyr, "tavern_traveler_pretender_location_ask",
[], "Never mind.", "tavern_traveler_pretalk", []],
[anyone, "tavern_traveler_pretender_location_ask_2", [], "I can reveal this information to you for a small price, let's say 30 denars.", "tavern_traveler_pretender_location_ask_money", []],
[anyone|plyr, "tavern_traveler_pretender_location_ask_money",
[
(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", 30),
],
"All right. Here is 30 denars.", "tavern_traveler_pretender_location_tell",
[
(troop_remove_gold, "trp_player", 30),
]],
[anyone|plyr, "tavern_traveler_pretender_location_ask_money", [], "Never mind.", "tavern_traveler_pretalk", []],
[anyone, "tavern_traveler_pretender_location_tell", [], "{s15} is currently at {s11}.", "tavern_traveler_pretalk",
[
(str_store_troop_name, s15, "$temp"),
(troop_get_slot, ":cur_center", "$temp", slot_troop_cur_center),
(str_store_party_name, s11, ":cur_center"),
]],
[anyone|plyr, "tavern_traveler_talk", [], "I am looking for one of my companions...", "tavern_traveler_companion_location", []],
[anyone, "tavern_traveler_companion_location", [], "Maybe I can help you. Who are you looking for?", "tavern_traveler_companion_location_ask", []],
[anyone|plyr|repeat_for_troops, "tavern_traveler_companion_location_ask",
[
(store_repeat_object, ":troop_no"),
(is_between, ":troop_no", companions_begin, companions_end),
(troop_slot_ge, ":troop_no", slot_troop_playerparty_history, 1),
(assign, ":continue", 0),
(try_begin),
(this_or_next|troop_slot_ge, ":troop_no", slot_troop_cur_center, 1),
(troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(str_store_troop_name, s11, ":troop_no"),
],
"{s11}", "tavern_traveler_companion_location_ask_2",
[
(store_repeat_object, "$temp"),
]],
[anyone|plyr, "tavern_traveler_companion_location_ask",
[], "Never mind.", "tavern_traveler_pretalk", []],
[anyone, "tavern_traveler_companion_location_ask_2", [(str_store_troop_name, s15, "$temp")], "I guess I know where {s15} is. For 30 denars, I'll tell you.", "tavern_traveler_companion_location_ask_money", []],
[anyone|plyr, "tavern_traveler_companion_location_ask_money",
[
(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", 30),
], "All right. Here is 30 denars.", "tavern_traveler_companion_location_tell",
[
(troop_remove_gold, "trp_player", 30),
]],
[anyone|plyr, "tavern_traveler_companion_location_ask_money", [], "Never mind.", "tavern_traveler_pretalk", []],
[anyone, "tavern_traveler_companion_location_tell", [], "{s15} is currently at {s11}.{s12}", "tavern_traveler_pretalk",
[
(str_store_troop_name, s15, "$temp"),
(try_begin),
(troop_slot_ge, "$temp", slot_troop_cur_center, 1),
(troop_get_slot, ":cur_center", "$temp", slot_troop_cur_center),
(str_store_string, s12, "str_space"),
(else_try),
(troop_get_slot, ":cur_center", "$temp", slot_troop_prisoner_of_party),
(try_begin),
(is_between, ":cur_center", towns_begin, towns_end),
(str_store_string, s13, "str_town"),
(else_try),
(str_store_string, s13, "str_castle"),
(try_end),
(troop_get_type, reg4, "$temp"),
(str_store_string, s12, "str__but_he_is_holding_there_as_a_prisoner_at_dungeon_of_s13"), #[TODO : Control Grammer] New text, control grammer of text later. s13 can be "castle" or "town".
(try_end),
(try_begin),
(party_is_active, ":cur_center"),
(str_store_party_name, s11, ":cur_center"),
(else_try),
(str_store_party_name, s11, "str_prisoner_at_large"),
(try_end),
]],
[anyone|plyr, "tavern_traveler_talk", [],
"Farewell.", "close_window", []],
[anyone, "start", [(is_between, "$g_talk_troop", tavern_travelers_begin, tavern_travelers_end),
(party_get_slot, ":info_faction", "$g_encountered_party", slot_center_traveler_info_faction),
(str_store_faction_name, s17, ":info_faction"),
],
"Greetings. They say you're the kind of {man/woman} who'd be interested to hear that I travel frequently to {s17}. I'll tell you all I know for a mere 100 denars.", "tavern_traveler_answer", []],
[anyone|plyr, "tavern_traveler_answer", [(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", 100)],
"Here's 100 denars. Tell me what you know.", "tavern_traveler_continue", [(party_get_slot, ":info_faction", "$g_encountered_party", slot_center_traveler_info_faction),
(call_script, "script_update_faction_traveler_notes", ":info_faction"),
(change_screen_notes, 2, ":info_faction"),
]],
[anyone|plyr, "tavern_traveler_answer", [],
"Sorry friend. I am not interested.", "close_window", []],
[anyone, "tavern_traveler_continue", [],
"Well, that's all I can tell you. Good bye.", "close_window", [(troop_remove_gold, "trp_player", 100),]],
#Tavern Talk (with book sellers)
[anyone, "start", [(is_between, "$g_talk_troop", tavern_booksellers_begin, tavern_booksellers_end),
],
"Good day {sir/madam}, will you be looking at my books?", "bookseller_talk", []],
[anyone|plyr, "bookseller_talk", [], "Yes. Show me what you have for sale.", "bookseller_buy", []],
[anyone,"bookseller_buy", [], "Of course {sir/madam}.", "book_trade_completed",[[change_screen_trade]]],
[anyone,"book_trade_completed", [], "Anything else?", "bookseller_talk",[]],
[anyone|plyr,"bookseller_talk", [], "Nothing. Thanks.", "close_window",[]],
#Tavern Talk (with minstrels)
[anyone, "start", [(is_between, "$g_talk_troop", tavern_minstrels_begin, tavern_minstrels_end),
],
"Greetings to you, {most noble sir/most noble lady}.", "minstrel_1", []],
[anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 0),],
"What is it you do?", "minstrel_job_description",
[(assign, "$minstrels_introduced", 1), ]],
[anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 1) ],
"I have some questions about courtship in Calradia",
"minstrel_courtship_questions", []],
[anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 1) ],
"Can you teach me any poems?",
"minstrel_courtship_poem", []],
[anyone, "minstrel_courtship_poem", [
(eq, "$allegoric_poem_recitations", 0),
(this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_1"),
(eq, "$g_talk_troop", "trp_tavern_minstrel_5"),
],
"I can teach you the poem, 'The Storming of the Castle of Love.' It is short enough to be easily learned. It is an allegoric poem, replete with symbols and metaphor. It describes how a brave but rough warrior wins the heart of his lady by learning the virtues of chivalry, becoming a true and noble knight. Its theme -- that the role of a woman is to inspire but also civilize a man -- is appreciated by some noble ladies, but not all.",
"minstrel_courtship_poem_teach", [
(assign, "$poem_selected", courtship_poem_allegoric),
]],
[anyone, "minstrel_courtship_poem", [
(eq, "$mystic_poem_recitations", 0),
(this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_3"),
(eq, "$g_talk_troop", "trp_tavern_minstrel_1"),
],
"I can teach you the poem, 'The Heart's Desire.' It is a lyrical poem, which can be interpreted either erotically or spiritually. The lover realizes the majesty of the divine by gazing upon the body of his beloved. I believe that it appeals to women of a certain romantic temperament, but you risk scandalizing or boring others.",
"minstrel_courtship_poem_teach", [
(assign, "$poem_selected", courtship_poem_mystic),
]],
#ashik poem
[anyone, "minstrel_courtship_poem", [
(eq, "$tragic_poem_recitations", 0),
(this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_3"),
(eq, "$g_talk_troop", "trp_tavern_minstrel_2"), ],
"I can teach you the tale of Kais and Layala. It is a sad and simple story -- the shepherd boy Kais and the nobleman's daughter Layala love each other, but they can never marry. The poem is Kais' lament as he wanders alone, unwilling to forget his true love, driving himself mad with longing. Some ladies melt at the sweetness of his sorrows; others glaze over at his self-pity.",
"minstrel_courtship_poem_teach", [
(assign, "$poem_selected", courtship_poem_tragic),
]],
#nord saga
[anyone, "minstrel_courtship_poem", [
(eq, "$heroic_poem_recitations", 0),
(this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_4"),
(eq, "$g_talk_troop", "trp_tavern_minstrel_2"),
],
"I can teach you part of the saga of Helgerad and Kara. It is a heroic tale, full of blood and battle. The shieldmaiden Kara chooses the warrior Helgered as her lover, as he is the only man who can defeat her in combat. Her father, who pledged her to another, comes with his sons and his huscarls to kill Helgered. They fight, and Helgered and Kara slaughter the entire host except for Kara's beloved younger brother -- who, alas, grows up to avenge his father by slaying Helgered. The depiction of warrior and shieldmaiden as equals will appeal to some women, but a mail-wearing, blood-spattered heroine will shock and repulse others.",
"minstrel_courtship_poem_teach", [
(assign, "$poem_selected", courtship_poem_heroic),
]],
[anyone, "minstrel_courtship_poem", [
(eq, "$comic_poem_recitations", 0),
(this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_5"),
(eq, "$g_talk_troop", "trp_tavern_minstrel_4"),
],
"I can teach you the poem, 'An Argument in the Garden.' It is a comic poem, which satirizes the conventions of courtly love. A lover steals into a garden in Veluca, and plies her with lots of witty lines to persuade his lover to submit to his embraces. She shoots down all of his advances one by one, then when he is downcast, she takes him in her arms and tells him that she wanted him all along, except on her terms, not his. A lady with a sense of humor may find it amusing, but others might feel that they are the ones who are being mocked.",
"minstrel_courtship_poem_teach", [
(assign, "$poem_selected", courtship_poem_comic),
]],
[anyone, "minstrel_courtship_poem_teach", [],
"To teach it to you, I will need some hours of your time -- and, of course, a small fee for my services. About 300 denars would suffice.",
"minstrel_courtship_poem_teach_2", []],
[anyone, "minstrel_courtship_poem", [],
"I believe you already know the poems I am best equipped to teach.",
"minstrel_pretalk", []],
[anyone|plyr, "minstrel_courtship_poem_teach_2", [
(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", 300),
],
"Yes -- teach me that one",
"minstrel_courtship_poem_teach_3", []],
[anyone|plyr, "minstrel_courtship_poem_teach_2", [],
"Never mind",
"minstrel_pretalk", []],
[anyone, "minstrel_courtship_poem_teach_3", [
(eq, "$poem_selected", courtship_poem_allegoric),
],
"Very well -- repeat after me:^\
I deflected her skeptical questioning darts^\
with armor made of purest devotion^\
purged in the forge of my heart^\
from the slag of any baser emotion",
"minstrel_courtship_poem_teach_4", []],
[anyone, "minstrel_courtship_poem_teach_3", [
(eq, "$poem_selected", courtship_poem_mystic),
],
"Very well -- repeat after me:^\
You are the first and the last^\
the outer and the inner^\
When I drink from the cup of love^\
I escape the tread of time^\
A moment in solitude with you^\
Would have no beginning and no end",
"minstrel_courtship_poem_teach_4", []],
[anyone, "minstrel_courtship_poem_teach_3", [
(eq, "$poem_selected", courtship_poem_tragic),
],
"Very well -- repeat after me:^\
The wind that blows the dry steppe dust^\
Stirs the curtains in your tower^\
The moon that lights my drunken path home^\
Looks on you sleeping in your bower^\
If I cried out to the wind^\
Could it carry a message from my lips?^\
If I wept before the moon^\
Would it grant me just a glimpse?",
"minstrel_courtship_poem_teach_4", [
]],
[anyone, "minstrel_courtship_poem_teach_3", [
(eq, "$poem_selected", courtship_poem_heroic),
],
"Very well -- repeat after me:^\
A light pierced the gloom over Wercheg cliffs...^\
Where charge of surf broke on shieldwall of shore^\
Grey-helmed and grey-cloaked the maiden stood^\
On wave-steed's prow, the sailcloth snapping^\
Over din of oars, of timbers cracking^\
She cried out to her hearth-brothers, arrayed for war",
"minstrel_courtship_poem_teach_4", [
]],
[anyone, "minstrel_courtship_poem_teach_3", [
(eq, "$poem_selected", courtship_poem_comic),
],
"Very well -- repeat after me:^All the silks of Veluca, all the furs of Khudan^Would buy you not the briefest kiss^What I bestow, I bestow for love^And the sake of my own happiness^But brought you a gift? Let us see! Let us see!^Or should tell my father how you came to see me?",
"minstrel_courtship_poem_teach_4", [
]],
[anyone|plyr, "minstrel_courtship_poem_teach_4", [
(eq, "$poem_selected", courtship_poem_allegoric),
],
"'I deflected her skeptical questioning darts...'",
"minstrel_learn_poem_continue", [
(troop_remove_gold, "trp_player", 300),
(val_add, "$allegoric_poem_recitations", 1),
]],
[anyone|plyr, "minstrel_courtship_poem_teach_4", [
(eq, "$poem_selected", courtship_poem_mystic),
],
"'You are the first and the last..'",
"minstrel_learn_poem_continue", [
(troop_remove_gold, "trp_player", 300),
(val_add, "$mystic_poem_recitations", 1),
]],
[anyone|plyr, "minstrel_courtship_poem_teach_4", [
(eq, "$poem_selected", courtship_poem_tragic),
],
"'The wind that blows the dry steppe dust...'",
"minstrel_learn_poem_continue", [
(troop_remove_gold, "trp_player", 300),
(val_add, "$tragic_poem_recitations", 1),
]],
[anyone|plyr, "minstrel_courtship_poem_teach_4", [
(eq, "$poem_selected", courtship_poem_heroic),
],
"'A light pierced the gloom over Wercheg cliffs...'",
"minstrel_learn_poem_continue", [
(troop_remove_gold, "trp_player", 300),
(val_add, "$heroic_poem_recitations", 1),
]],
[anyone|plyr, "minstrel_courtship_poem_teach_4", [
(eq, "$poem_selected", courtship_poem_comic),
],
"'All the silks of Veluca...'",
"minstrel_learn_poem_continue", [
(troop_remove_gold, "trp_player", 300),
(val_add, "$comic_poem_recitations", 1),
]],
[anyone|plyr, "minstrel_courtship_poem_teach_4", [
],
"Pshaw... What kind of doggerel is that?",
"minstrel_courtship_poem_teach_reject", []],
[anyone, "minstrel_courtship_poem_teach_reject", [
],
"Very well. If the poem is not to your taste, then keep your money. But remember -- with poets and with lovers, what is important is not what pleases you. What is important is what your pleases your audience. If you wish to learn the poem, I am still willing to teach.",
"minstrel_pretalk", []],
[anyone, "minstrel_learn_poem_continue", [
],
"Very good -- but there are many stanzas to go. Now, listen closely...", "close_window",
[
(try_begin),
(try_begin),
(eq, "$poem_selected", courtship_poem_mystic),
(set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 0, 1),
(else_try),
(eq, "$poem_selected", courtship_poem_tragic),
(set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 1, 1),
(else_try),
(eq, "$poem_selected", courtship_poem_heroic),
(set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 2, 1),
(else_try),
(eq, "$poem_selected", courtship_poem_comic),
(set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 3, 1),
(else_try),
(eq, "$poem_selected", courtship_poem_allegoric),
(set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 4, 1),
(try_end),
(assign, ":number_of_poems_player_know", 0),
(try_for_range, ":poem_number", 0, 5),
(get_achievement_stat, ":poem_is_known", ACHIEVEMENT_ROMANTIC_WARRIOR, ":poem_number"),
(eq, ":poem_is_known", 1),
(val_add, ":number_of_poems_player_know", 1),
(try_end),
(try_begin),
(ge, ":number_of_poems_player_know", 3),
(unlock_achievement, ACHIEVEMENT_ROMANTIC_WARRIOR),
(try_end),
(try_end),
(assign, "$g_leave_town",1),
(rest_for_hours, 2, 2, 0),
(finish_mission),
]],
[anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 1) ],
"Can you tell me anything about the eligible maidens in this realm?",
"minstrel_gossip", [
]],
[anyone, "minstrel_gossip",
[],
"About whom did you wish to know?",
"minstrel_gossip_select", []],
[anyone|plyr,"minstrel_gossip_select",
[],
"Just tell me the latest piece of gossip",
"minstrel_gossip_maiden_selected_2", [
(assign, "$lady_selected", -1),
(assign, "$romantic_rival", -1),
(try_for_range, ":log_entry", 0, "$num_log_entries"),
(troop_get_slot, ":lady", "trp_log_array_actor", ":log_entry"),
(is_between, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, ":lady"),
(troop_get_slot, ":type", "trp_log_array_entry_type", ":log_entry"),
(is_between, ":type", 50, 65), #excludes log entries in which a party is an actor
(store_faction_of_troop, ":lady_faction", ":lady"),
(store_faction_of_party, ":town_faction", "$g_encountered_party"),
(eq, ":lady_faction", ":town_faction"),
(assign, "$lady_selected", ":lady"),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_troop_name, s4, ":lady"),
(troop_get_slot, reg4, "trp_log_array_entry_type", ":log_entry"),
(assign, reg5, "$num_log_entries"),
(display_message, "str_log_entry_type_reg4_for_s4_total_entries_reg5"),
(try_end),
(try_end),
]],
[anyone|plyr|repeat_for_troops,"minstrel_gossip_select",
[
(store_repeat_object, "$temp"),
(troop_slot_eq, "$temp", slot_troop_occupation, slto_kingdom_lady),
(troop_slot_eq, "$temp", slot_troop_spouse, -1),
(store_faction_of_troop, ":lady_faction", "$temp"),
(store_faction_of_party, ":town_faction", "$g_encountered_party"),
(eq, ":lady_faction", ":town_faction"),
(str_store_troop_name, s10, "$temp"),
],
"{s10}",
"minstrel_gossip_maiden_selected", [
(store_repeat_object, "$lady_selected"),
]],
[anyone|plyr,"minstrel_gossip_select",
[], "Never mind", "minstrel_pretalk", []],
[anyone,"minstrel_gossip_maiden_selected",
[
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg3, "$lady_selected"),
(display_message, "@{!}DEBUG: Gossip for troop {reg3}"),
(gt, reg3, -1),
(display_message, "@{!}DEBUG: {s3}"),
(try_end),
(try_begin),
(gt, "$lady_selected", -1),
(str_store_troop_name, s9, "$lady_selected"), #lady
(str_store_string, s10, "str_error__reputation_type_for_s9_not_within_range"),
(try_begin),
(troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_conventional),
(str_store_string, s16, "str_they_say_that_s9_is_a_most_conventional_maiden__devoted_to_her_family_of_a_kind_and_gentle_temperament_a_lady_in_all_her_way"),
(else_try),
(troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_otherworldly),
(str_store_string, s16, "str_they_say_that_s9_is_a_bit_of_a_romantic_a_dreamer__of_a_gentle_temperament_yet_unpredictable_she_is_likely_to_be_led_by_her_passions_and_will_be_trouble_for_her_family_ill_wager"),
(else_try),
(troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_ambitious),
(str_store_string, s16, "str_they_say_that_s9_is_determined_to_marry_well_and_make_her_mark_in_the_world_she_may_be_a_tremendous_asset_for_her_husband__provided_he_can_satisfy_her_ambition"),
(else_try),
(troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_adventurous),
(str_store_string, s16, "str_they_say_that_s9_loves_to_hunt_and_ride_maybe_she_wishes_she_were_a_man_whoever_she_marries_will_have_a_tough_job_keeping_the_upper_hand_i_would_say"),
(else_try),
(troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_moralist),
(str_store_string, s16, "str_they_say_that_s9_is_a_lady_of_the_highest_moral_standards_very_admirable_very_admirable__and_very_hard_to_please_ill_warrant"),
(try_end),
(call_script, "script_add_rumor_string_to_troop_notes", "$lady_selected", -1, 16),
(try_end),
],
"{s16}",
"minstrel_gossip_maiden_selected_2", [
]],
[anyone,"minstrel_gossip_maiden_selected_2",
[
(troop_slot_eq, "trp_player", slot_troop_spouse, "$lady_selected"),
(is_between, "$lady_selected", kingdom_ladies_begin, kingdom_ladies_end),
],
"She is married to you, of course! Clearly, no one would dream that she would do anything to engender gossip.",
"minstrel_postgossip",
[]],
[anyone,"minstrel_gossip_maiden_selected_2",
[
(gt, "$lady_selected", -1),
(assign, ":lady", "$lady_selected"),
(neg|troop_slot_ge, ":lady", slot_troop_spouse, active_npcs_begin),
(troop_get_slot, ":betrothed", ":lady", slot_troop_betrothed),
(is_between, ":betrothed", active_npcs_begin, active_npcs_end),
(str_store_troop_name, s9, ":lady"),
(str_store_troop_name, s11, ":betrothed"),
(str_store_string, s12, "str_s9_is_now_betrothed_to_s11_soon_we_believe_there_shall_be_a_wedding"),
(try_begin),
(troop_slot_eq, ":lady", slot_troop_met, 2),
(assign, "$romantic_rival", ":betrothed"),
(try_end),
],
"{s12}.",
"minstrel_postgossip", []],
[anyone,"minstrel_gossip_maiden_selected_2",
[
(try_begin),
(is_between, "$lady_selected", kingdom_ladies_begin, kingdom_ladies_end),
(str_store_string, s12, "str_i_have_not_heard_any_news_about_her"),
(str_store_troop_name, s9, "$lady_selected"), #lady
(try_begin),
(eq, "$cheat_mode", 1), #for some reason, speaking to tavern merchant does not yield rumor. Try for Lady Baoth, Lord Etr
(display_message, "str_searching_for_rumors_for_s9"),
(try_end),
(assign, "$romantic_rival", -1),
(assign, ":last_lady_noted", 0),
(try_for_range, ":log_entry", 0, "$num_log_entries"),
(troop_slot_eq, "trp_log_array_actor", ":log_entry", "$lady_selected"),
#Presumably possible for some events involving a lady to not involve troops
(troop_get_slot, ":suitor", "trp_log_array_troop_object", ":log_entry"),
(str_clear, s11),
(try_begin),
(is_between, ":suitor", 0, kingdom_ladies_end),
(str_store_troop_name, s11, ":suitor"),
(try_end),
(troop_get_slot, ":third_party", "trp_log_array_center_object", ":log_entry"),
(str_clear, s10),
(try_begin),
(is_between, ":third_party", 0, kingdom_ladies_end),
(str_store_troop_name, s10, ":third_party"),
(try_end),
(assign, ":lady", "$lady_selected"),
(try_begin),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry", logent_lady_favors_suitor),
(str_store_string, s12, "str_they_say_that_s9_has_shown_favor_to_s11_perhaps_it_will_not_be_long_until_they_are_betrothed__if_her_family_permits"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(try_begin),
(troop_slot_eq, ":lady", slot_troop_met, 2),
(this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_1, ":lady"),
(this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_2, ":lady"),
(troop_slot_eq, ":suitor", slot_troop_love_interest_3, ":lady"),
(assign, "$romantic_rival", ":suitor"),
(try_end),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry", logent_lady_betrothed_to_suitor_by_family),
(str_store_string, s12, "str_they_say_that_s9_has_been_forced_by_her_family_into_betrothal_with_s11"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(try_begin),
(troop_slot_eq, ":lady", slot_troop_met, 2),
(assign, "$romantic_rival", ":suitor"),
(try_end),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry", logent_lady_betrothed_to_suitor_by_choice),
(str_store_string, s12, "str_they_say_that_s9_has_agreed_to_s11s_suit_and_the_two_are_now_betrothed"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(try_begin),
(troop_slot_eq, ":lady", slot_troop_met, 2),
(this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_1, ":lady"),
(this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_2, ":lady"),
(troop_slot_eq, ":suitor", slot_troop_love_interest_3, ":lady"),
(assign, "$romantic_rival", ":suitor"),
(try_end),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry", logent_lady_betrothed_to_suitor_by_pressure),
(str_store_string, s12, "str_they_say_that_s9_under_pressure_from_her_family_has_agreed_to_betrothal_with_s11"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(try_begin),
(troop_slot_eq, ":lady", slot_troop_met, 2),
(this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_1, ":lady"),
(this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_2, ":lady"),
(troop_slot_eq, ":suitor", slot_troop_love_interest_3, ":lady"),
(assign, "$romantic_rival", ":suitor"),
(try_end),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry", logent_lady_rejects_suitor),
(str_store_string, s12, "str_they_say_that_s9_has_refused_s11s_suit"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry", logent_lady_rejected_by_suitor),
(str_store_string, s12, "str_they_say_that_s11_has_tired_of_pursuing_s9"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry", logent_lady_father_rejects_suitor),
(str_store_string, s12, "str_they_say_that_s9s_family_has_forced_her_to_renounce_s11_whom_she_much_loved"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry", logent_lady_elopes_with_lord),
(str_store_string, s12, "str_they_say_that_s9_has_run_away_with_s11_causing_her_family_much_grievance"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(else_try),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry", logent_lady_marries_lord),
(str_store_string, s12, "str_they_say_that_s9_and_s11_have_wed"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(else_try),
(troop_get_slot, ":suitor", ":lady", slot_lady_last_suitor),
(is_between, ":suitor", active_npcs_begin, active_npcs_end),
(str_store_troop_name, s11, ":suitor"),
(str_store_string, s12, "str_they_say_that_s9_was_recently_visited_by_s11_who_knows_where_that_might_lead"),
(assign, ":last_lady_noted", ":lady"),
(assign, ":last_suitor_noted", ":suitor"),
(try_begin),
(troop_slot_eq, ":lady", slot_troop_met, 2),
(this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_1, ":lady"),
(this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_2, ":lady"),
(troop_slot_eq, ":suitor", slot_troop_love_interest_3, ":lady"),
(assign, "$romantic_rival", ":suitor"),
(try_end),
(try_end),
(try_end),
(try_begin),
(neq, ":last_suitor_noted", "$romantic_rival"),
(assign, "$romantic_rival", -1),
(try_end),
(try_begin),
(gt, ":last_lady_noted", 0),
(call_script, "script_add_rumor_string_to_troop_notes", ":last_lady_noted", ":last_suitor_noted", 12),
(try_end),
(else_try),
(eq, "$lady_selected", -1),
(str_store_string, s12, "str_there_is_not_much_to_tell_but_it_is_still_early_in_the_season"),
(else_try),
(assign, reg4, "$lady_selected"),
(str_store_troop_name, s9, "$lady_selected"),
(str_store_string, s12, "str_error_lady_selected_=_s9"),
(try_end),
],
"{s12}.",
"minstrel_postgossip", []],
[anyone|plyr, "minstrel_postgossip", [],
"Very interesting -- but let us speak of something else.",
"minstrel_pretalk", []],
[anyone|plyr, "minstrel_postgossip", [],
"Very interesting -- is there any more news?",
"minstrel_gossip", []],
[anyone|plyr, "minstrel_postgossip", [
(is_between, "$romantic_rival", active_npcs_begin, active_npcs_end),
(neg|check_quest_active, "qst_duel_courtship_rival"),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, kingdom_ladies_begin),
],
"What? I'll make that miscreant face my sword",
"minstrel_duel_confirm", []],
[anyone, "minstrel_duel_confirm", [
(str_store_troop_name, s11, "$romantic_rival"),
],
"Do you mean that? {s11} will be honor-bound to fight you, but challenging a lord to duel over a woman is seen as a bit hot-headed, even in this warlike age.",
"minstrel_duel_confirm_2", []],
[anyone|plyr, "minstrel_duel_confirm_2", [
(str_store_troop_name, s11, "$romantic_rival"),
(str_store_troop_name, s12, "$lady_selected"),
],
"Yes -- I intend to force {s11} to relinquish his suit of {s12}",
"minstrel_duel_issued", []],
[anyone|plyr, "minstrel_duel_confirm_2", [
],
"No -- I let my passions run away with me, there",
"minstrel_pretalk", []],
[anyone, "minstrel_duel_issued", [
],
"As you wish. I'll spead the word of your intentions, so that {s13} does not try to back out...",
"minstrel_pretalk", [
(str_store_troop_name, s11, "$lady_selected"),
(str_store_troop_name_link, s13, "$romantic_rival"),
(str_store_string, s2, "str_you_intend_to_challenge_s13_to_force_him_to_relinquish_his_suit_of_s11"),
(setup_quest_text, "qst_duel_courtship_rival"),
(call_script, "script_start_quest", "qst_duel_courtship_rival", "$lady_selected"),
(quest_set_slot, "qst_duel_courtship_rival", slot_quest_giver_troop, "$lady_selected"),
(quest_set_slot, "qst_duel_courtship_rival", slot_quest_target_troop, "$romantic_rival"),
(quest_set_slot, "qst_duel_courtship_rival", slot_quest_xp_reward, 400),
(quest_set_slot, "qst_duel_courtship_rival", slot_quest_expiration_days, 60),
(quest_set_slot, "qst_duel_courtship_rival", slot_quest_current_state, 0),
]],
[anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 1) ],
"Do you know of any ongoing feasts?",
"minstrel_courtship_locations", []],
[anyone, "minstrel_courtship_locations", [
(str_clear, s12),
(assign, ":feast_found", 0),
(try_for_range, ":kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":kingdom", slot_faction_ai_state, sfai_feast),
(assign, ":feast_found", 1),
(faction_get_slot, ":feast_venue", ":kingdom", slot_faction_ai_object),
(str_store_party_name, s4, ":feast_venue"),
(str_store_faction_name, s3, ":kingdom"),
(store_current_hours, ":hour"),
(store_sub, ":hours_since_start", ":hour", 72),
(faction_get_slot, ":feast_time", ":kingdom", slot_faction_last_feast_start_time),
(val_add, ":hours_since_start", ":feast_time"),
(try_begin),
(gt, ":hours_since_start", 48),
(str_store_string, s12, "str_s12there_is_a_feast_of_the_s3_in_progress_at_s4_but_it_has_been_going_on_for_a_couple_of_days_and_is_about_to_end_"),
(else_try),
(gt, ":hours_since_start", 24),
(str_store_string, s12, "str_s12there_is_a_feast_of_the_s3_in_progress_at_s4_which_should_last_for_at_least_another_day_"),
(else_try),
(str_store_string, s12, "str_s12there_is_a_feast_of_the_s3_in_progress_at_s4_which_has_only_just_begun_"),
(try_end),
(try_end),
(try_begin),
(eq, ":feast_found", 0),
(str_store_string, s12, "str_not_at_this_time_no"),
(else_try),
(str_store_string, s12, "str_s12the_great_lords_bring_their_daughters_and_sisters_to_these_occasions_to_see_and_be_seen_so_they_represent_an_excellent_opportunity_to_make_a_ladys_acquaintance"),
(try_end),
],
"{s12}",
"minstrel_pretalk", []],
[anyone|plyr, "minstrel_1", [],
"Good-bye.", "close_window", []],
[anyone, "minstrel_courtship_questions", [],
"What do you wish to know?",
"minstrel_courtship_questions_2", []],
[anyone, "minstrel_courtship_prequestions", [],
"Can I answer any other questions for you?",
"minstrel_courtship_questions_2", []],
[anyone|plyr, "minstrel_courtship_questions_2", [
(eq, "$minstrels_discussed_love", 1),
],
"Is there a place for me in the game of love?",
"minstrel_player_role", [
(assign, "$minstrels_discussed_player_role", 1),
]],
[anyone|plyr, "minstrel_courtship_questions_2", [
(eq, "$minstrels_discussed_player_role", 1),
],
"How would a suitor meet a lady?",
"minstrel_player_advice_meet", [
(assign, "$minstrels_discussed_meetings", 1),
]],
[anyone|plyr, "minstrel_courtship_questions_2", [
(eq, "$minstrels_discussed_meetings", 1),
],
"Having met a lady, how would the suitor woo her?",
"minstrel_player_advice_woo", [
]],
[anyone|plyr, "minstrel_courtship_questions_2", [],
"Tell me about marriage and love among the nobility of Calradia",
"minstrel_nobles", [
(assign, "$minstrels_discussed_love", 1),
]],
[anyone, "minstrel_nobles", [],
"Nobles are an odd lot. In Calradia, a daughter is a political asset, to be given away to a lord with whom her father wishes to make an alliance. Yet the great families of this land idealize pure love between man and woman, and I have seen many a hardened warrior weep copious tears at the doomed ardour of Sahira and Janun in the songs -- even as he made plans to break his own daughter's heart.",
"minstrel_nobles_2", []],
[anyone, "minstrel_nobles_2", [],
"Fathers differ, of course. Some Calradian nobles will let their daughters choose a husband who pleases them. Others, however, feel that to allow their daughters any choice at all would be to diminish their own authority, and insist on imposing a groom whether she likes it or not.",
"minstrel_nobles_3", []],
[anyone, "minstrel_nobles_3", [], "But the majority will steer a middle course -- they will want to make the final decision about a groom, but will weigh their daughter's preferences heavily. Among other factors, a happy marriage is more likely to produce heirs. So, there is a place for courtship, and for the use of skill and passion to win a lady's heart.",
"minstrel_prequestions", []],
[anyone|plyr, "minstrel_courtship_questions_2", [
(eq, "$minstrels_discussed_love", 1),
],
"What if a lady and her father disagree about a suitor?",
"minstrel_daughter_father", []],
[anyone, "minstrel_daughter_father", [], "It happens sometimes that a bride elopes. This is a major blow to the father's prestige, leading to lasting enmities. Indeed, it is possible that a war may be fought over a woman. Now, that is a fine topic for a song.",
"minstrel_daughter_father_2", []],
[anyone, "minstrel_daughter_father_2", [], "In the end, however, most brides will submit to their parents' choice. A noblewoman's family is everything to her, and few are brave enough to risk its disapproval for the sake of man she barely knows. She may pine for her lover, but still accept the groom -- and without tragic love, what would we have to sing about?",
"minstrel_prequestions", []],
[anyone, "minstrel_player_role", [
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 0),
], "Of course! Calradian lords make a great deal of lineage, but in the end, lands and money speak louder than one's ancestors. Even though you are a foreigner, if you are coming up in the world, then many parents will consider you a fine catch.",
"minstrel_player_role_2", []],
[anyone, "minstrel_player_role_2", [
], "You will have to compete with many other lords of your realm, however, who will have an advantage -- they have known these ladies from childhood, and will have been sized up as grooms by carefully discerning mothers and aunts. Some ladies may be fascinated by the stranger, yet opt for the familiar.",
"minstrel_player_role_3", []],
[anyone, "minstrel_player_role_3", [
], "So know this -- you may have your heart broken. But to enter the arena of love fearing heartbreak is like entering the battlefield fearing the enemy's arrows. Be brave, and shrug off the sting of rejection, and victory may yet be yours.",
"minstrel_prequestions", []],
[anyone, "minstrel_player_role", [
], "Lady -- I will speak bluntly. Most of the lords of this land are looking for a demure maiden, whose skin as fair as snow -- and your skin is burnt brown by the sun. They want a maiden whose voice is soft as bells -- and your voice is hoarse from commanding men in battle. Also, athough the lords of Calradia appreciate poems about love, most also want heirs, and few women can ride and fight while with child.",
"minstrel_female_player_3", []],
[anyone, "minstrel_female_player_3", [
], "However, not all lords will be so conventionally minded. We poets sing of shield maidens and of huntresses, of women who forged their own path without having sacrificed the chance for love. I would not tell you that it would be easy for you to find a devoted husband who will accept your ways, but I would not say that it is impossible.",
"minstrel_prequestions", []],
[anyone|plyr, "minstrel_courtship_questions_2", [
(eq, "$minstrels_discussed_love", 1),
],
"What advantage is there in seeking a {wife/husband}?",
"minstrel_spouse_benefits", []],
[anyone, "minstrel_spouse_benefits", [
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 0),
],
"Ah! You are quite the romantic, I see! Well, aside from the obvious benefits of love, companionship and other, em, domestic matters, to marry among the nobility brings great assets. You may forge a strong alliance with the bride's family, and a wife may also assist you in manipulating the politics of the realm to your advantage.",
"minstrel_wife_benefits_2", []],
[anyone, "minstrel_wife_benefits_2", [
],
"What's more, most of the great families of Calradia have at some point intermarried with royalty, which would boost your own claim to rule -- should you ever choose to assert it...",
"minstrel_prequestions", []],
[anyone, "minstrel_spouse_benefits", [
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 1),
],
"Ah! You are quite the romantic, I see! Well, aside from the obvious benefits of love, companionship and other, em, domestic matters, to marry among the nobility brings great assets. You may have access to the groom's castles and properties, and be able to work with him to advance both of your standings in the realm.",
"minstrel_wife_benefits_2", []],
[anyone, "minstrel_player_advice_meet", [
], "Every so often, a king or great lord of Calradia will hold a feast. In towns they will often be accompanied by tournaments, and in castles they will be accompanied by hunts. The feasts provide a chance for the lords to repair some of the rivalries that may undermine the strength of the realm. They also provide an opportunity for families to show off their eligible daughters, and ladies will often be allowed to mingle unsupervised with the guests.",
"minstrel_player_advice_meet_2", []],
[anyone, "minstrel_player_advice_meet_2", [
], "If you have the opportunity, you may attempt to pay the lady a compliment. This indicates to her that you are a potential suitor, and she will usually know if she wishes you to continue your suit. Incidentally, if you come to her fresh from having distinguished yourself in the tournament or in the hunt, then you may make a stronger first impression than otherwise.",
"minstrel_prequestions", []],
[anyone, "minstrel_player_advice_woo", [
], "To woo a lady takes a certain amount of time and patience, and several meetings spaced over a period of months. A lady who is interested in you will often find ways of letting you know if she wishes you to come visit her. Alternately, you may simply go and ask her father or brother for permission. If you do not have permission from her guardian, it may be possible to arrange an assignation through other means.",
"minstrel_player_advice_woo_2", []],
[anyone, "minstrel_player_advice_woo_2", [
], "Having arranged an assignment, you may then attempt to charm her and win her favor. Perhaps one of the most difficult aspects of this is finding a topic of conversation. Most Calradian noblewomen lead a cloistered life, at least until they are married, and thus will have little to say that will interest you. On other hand, she will soon tire of hearing of your own deeds in the outside world.",
"minstrel_player_advice_woo_3", []],
[anyone, "minstrel_player_advice_woo_3", [
], "One time-tested mode of courtship is simply to recite a popular poem, and discuss it. This way, you are both on an equal footing, and neither will have an advantage in knowledge or experience. Of course, different ladies will have different tastes in poetry.",
"minstrel_player_advice_woo_4", []],
[anyone, "minstrel_player_advice_woo_4", [
], "At some point, you will be able to discuss directly the issue of marriage. She will then let you know if you measure up to what she wants in a husband. Some ladies will coolly assess who is the most prestigious of her suitors, others will be guided by their passions. Some will look to your companions, to see whether you are the kind of husband who will treat her as an equal, while others will follow the lead of their fathers.",
"minstrel_player_advice_woo_5", []],
[anyone, "minstrel_player_advice_woo_5", [
], "At any rate, it is a challenging business -- and do not forget, you may find that your suit prospers with a lady, only to have it falter on a father's political ambitions. So you must ask yourself: are you willing to risk disappointment and heartbreak? Alternately, are you willing to throw away your standing in society, to make enemies of allies, in pursuit of a forbidden love? Because if you are, then perhaps some day we will write poems about you.",
"minstrel_prequestions", []],
[anyone|plyr, "minstrel_courtship_questions_2", [],
"What is it that you poets and musicians do again?",
"minstrel_job_description", []],
[anyone, "minstrel_job_description", [],
"I compose and write songs for the lords of the land, and their ladies. Sometimes I sing about war, sometimes about the virtues of kings, and sometimes, for the more sophisticated audiences, about the virtues of wine. For most audiences, however, I sing of love.", "minstrel_courtship_prequestions", []],
[anyone|plyr, "minstrel_courtship_questions_2", [],
"No, that is all.",
"minstrel_pretalk", []],
[anyone, "minstrel_prequestions", [
], "Do you have any other questions?",
"minstrel_courtship_questions_2", []],
[anyone, "minstrel_pretalk", [],
"Is there anything else?",
"minstrel_1", []],
#Tavern Talk (with farmers)
[anyone, "start", [(eq, "$talk_context", tc_tavern_talk),
(eq, "$g_talk_troop", "trp_farmer_from_bandit_village"),
(neg|check_quest_active, "qst_eliminate_bandits_infesting_village"),
(neg|check_quest_active, "qst_deal_with_bandits_at_lords_village"),
(assign, ":end_cond", villages_end),
(try_for_range, ":cur_village", villages_begin, ":end_cond"),
(party_slot_eq, ":cur_village", slot_village_bound_center, "$g_encountered_party"),
(party_slot_ge, ":cur_village", slot_village_infested_by_bandits, 1),
(str_store_party_name, s1, ":cur_village"),
(quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_target_center, ":cur_village"),
(quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_current_state, 0),
(party_get_slot, ":village_elder", ":cur_village", slot_town_elder),
(quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_giver_troop, ":village_elder"),
(quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_giver_center, ":cur_village"),
(assign, ":end_cond", 0),
(try_end),
],
"{My lord/Madam}, you look like a {man/lady} of the sword and someone who could help us.\
Will you hear my plea?", "farmer_from_bandit_village_1", []],
[anyone|plyr, "farmer_from_bandit_village_1", [],
"What is the matter, my good man?", "farmer_from_bandit_village_2", []],
[anyone|plyr, "farmer_from_bandit_village_1", [],
"What are you burbling about peasant? Speak out.", "farmer_from_bandit_village_2", []],
[anyone, "farmer_from_bandit_village_2", [],
"A band of brigands have taken refuge in our village. They take everything we have, force us to serve them, and do us much evil.\
If one of us so much as breathes a word of protest, they kill the poor soul on the spot right away.\
Our lives have become unbearable. I risked my skin and ran away to find someone who can help us.", "farmer_from_bandit_village_3", []],
[anyone|plyr, "farmer_from_bandit_village_3", [],
"Why don't you go to the lord of your village? He should take care of the vermin.", "farmer_from_bandit_village_4", []],
[anyone, "farmer_from_bandit_village_4", [],
"I did, {sir/madam}, but our lord's men did not let me see him and said he was occupied with more important matters and that we should deal with our own problem ourselves.\
Please {sir/madam}, you look like a {man/lady} of valor and a fearsome warrior, and you have no doubt many friends and soldiers at your service.\
If there is anyone who can help us, it's you.", "farmer_from_bandit_village_5", [(assign, "$temp", 0)]],
[anyone|plyr, "farmer_from_bandit_village_5", [],
"Very well, I'll help you. Where is this village?", "farmer_from_bandit_village_accepted", []],
[anyone|plyr, "farmer_from_bandit_village_5", [],
"I can't be bothered with this right now.", "farmer_from_bandit_village_denied", []],
[anyone|plyr, "farmer_from_bandit_village_5", [(eq, "$temp", 0)],
"Why would I fight these bandits? What's in it for me?", "farmer_from_bandit_village_barter", []],
[anyone, "farmer_from_bandit_village_accepted", [],
"God bless you, {sir/madam}. Our village is {s7}. It is not too far from here.", "close_window",
[(quest_get_slot, ":target_center", "qst_eliminate_bandits_infesting_village", slot_quest_target_center),
(str_store_party_name_link,s7,":target_center"),
(setup_quest_text, "qst_eliminate_bandits_infesting_village"),
(str_store_string, s2, "@A villager from {s7} begged you to save their village from the bandits that took refuge there."),
(call_script, "script_start_quest", "qst_eliminate_bandits_infesting_village", "$g_talk_troop"),
]],
[anyone, "farmer_from_bandit_village_denied", [],"As you say {sir/madam}. Forgive me for bothering you.", "close_window", []],
[anyone, "farmer_from_bandit_village_barter", [],
"We are but poor farmers {sir/madam}, and the bandits have already got most of what we have on this world.\
but we'll be glad to share with you whatever we have got.\
And we'll always be in your gratitude if you help us.", "farmer_from_bandit_village_5", [(assign, "$temp", 1)]],
[anyone, "start", [(eq, "$talk_context", tc_tavern_talk),
(eq, "$g_talk_troop", "trp_farmer_from_bandit_village"),
(check_quest_active, "qst_eliminate_bandits_infesting_village"),
],
"Thank you for helping us {sir/madam}. Crush those bandits!", "close_window", []],
#Tavern Talk (with troops)
[anyone, "start", [
(eq, "$talk_context", tc_tavern_talk),
(neg|troop_is_hero, "$g_talk_troop"),
(neg|is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
(party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
(gt, ":mercenary_amount", 0),
(store_sub, reg3, ":mercenary_amount", 1),
(store_sub, reg4, reg3, 1),
(call_script, "script_game_get_join_cost", ":mercenary_troop"),
(assign, ":join_cost", reg0),
(store_mul, reg5, ":mercenary_amount", reg0),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":mercenary_amount", ":free_capacity"),
(store_troop_gold, ":cur_gold", "trp_player"),
(try_begin),
(gt, ":join_cost", 0),
(val_div, ":cur_gold", ":join_cost"),
(val_min, ":mercenary_amount", ":cur_gold"),
(try_end),
(assign, "$temp", ":mercenary_amount"),
],
"Do you have a need for mercenaries, {sir/madam}?\
{reg3?Me and {reg4?{reg3} of my mates:one of my mates} are:I am} looking for a master.\
We'll join you for {reg5} denars.", "mercenary_tavern_talk", []],
[anyone, "start", [
(eq, "$talk_context", tc_tavern_talk),
],
"Any orders, {sir/madam}?", "mercenary_after_recruited", []],
[anyone|plyr, "mercenary_after_recruited", [],
"Make your preparations. We'll be moving at dawn.", "mercenary_after_recruited_2", []],
[anyone|plyr, "mercenary_after_recruited", [],
"Take your time. We'll be staying in this town for a while.", "mercenary_after_recruited_2", []],
[anyone, "mercenary_after_recruited_2", [], "Yes {sir/madam}. We'll be ready when you tell us to leave.", "close_window", []],
[anyone|plyr, "mercenary_tavern_talk", [(party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
(eq, ":mercenary_amount", "$temp"),
(party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
(call_script, "script_game_get_join_cost", ":mercenary_troop"),
(store_mul, reg5, "$temp", reg0),
],
"All right. I will hire all of you. Here is {reg5} denars.", "mercenary_tavern_talk_hire", []],
[anyone|plyr, "mercenary_tavern_talk", [(party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
(lt, "$temp", ":mercenary_amount"),
(gt, "$temp", 0),
(assign, reg6, "$temp"),
(party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
(call_script, "script_game_get_join_cost", ":mercenary_troop"),
(store_mul, reg5, "$temp", reg0),
],
"All right. But I can only hire {reg6} of you. Here is {reg5} denars.", "mercenary_tavern_talk_hire", []],
[anyone, "mercenary_tavern_talk_hire", [(store_random_in_range, ":rand", 0, 4),
(try_begin),
(eq, ":rand", 0),
(gt, "$temp", 1),
(str_store_string, s17,
"@You chose well, {sir/madam}. My lads know how to keep their word and earn their pay."),
(else_try),
(eq, ":rand", 1),
(str_store_string, s17,
"@Well done, {sir/madam}. Keep the money and wine coming our way, and there's no foe in Calradia you need fear."),
(else_try),
(eq, ":rand", 2),
(str_store_string, s17,
"@We are at your service, {sir/madam}. Point us in the direction of those who need hurting, and we'll do the rest."),
(else_try),
(str_store_string, s17,
"str_you_will_not_be_disappointed_sirmadam_you_will_not_find_better_warriors_in_all_calradia"),
(try_end),],
"{s17}", "close_window", [
(party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
(call_script, "script_game_get_join_cost", ":mercenary_troop"),
(store_mul, ":total_cost", "$temp", reg0),
(troop_remove_gold, "trp_player", ":total_cost"),
(party_add_members, "p_main_party", ":mercenary_troop", "$temp"),
(party_set_slot, "$g_encountered_party", slot_center_mercenary_troop_amount, 0),
]],
[anyone|plyr, "mercenary_tavern_talk", [(eq, "$temp", 0),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(ge, ":free_capacity", 1)],
"That sounds good. But I can't afford to hire any more men right now.", "tavern_mercenary_cant_lead", []],
[anyone, "tavern_mercenary_cant_lead", [], "That's a pity. Well, {reg3?we will:I will} be lingering around here for a while,\
if you need to hire anyone.", "close_window", []],
[anyone|plyr, "mercenary_tavern_talk", [(eq, "$temp", 0),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(eq, ":free_capacity", 0)],
"That sounds good. But I can't lead any more men right now.", "tavern_mercenary_cant_lead", []],
[anyone|plyr, "mercenary_tavern_talk", [],
"Sorry. I don't need any other men right now.", "close_window", []],
#Trainers
[anyone,"start", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end),
(eq, "$g_talk_troop_met", 0)],
"Good day to you {lad/lass}. You look like another adventurer who has come to try {his/her} chance in these lands.\
Well, trust my word, you won't be able to survive long here unless you know how to fight yourself out of a tight spot.", "trainer_intro_1",[]],
[anyone|plyr, "trainer_intro_1", [],
"Thank you for your advice. This place looks like a training field. Maybe I can learn about fighting here?", "trainer_intro_2", []],
[anyone,"trainer_intro_2", [],
"Indeed you can. I am a veteran soldier... fought a good deal in the wars in my time. But these days, I train young novices in this area.\
I can find you some opponents to practice with if you like. Or if you have any questions about the theory of combat, feel free to ask.", "trainer_intro_3",[]],
[anyone|plyr, "trainer_intro_3", [],
"Yes, I do have a few questions.", "trainer_intro_4a", []],
[anyone|plyr, "trainer_intro_3", [],
"Actually, I can move on to practice.", "trainer_intro_4b", []],
[anyone, "trainer_intro_4a", [],
"Well, ask anything you like.", "trainer_talk_combat", []],
[anyone, "trainer_intro_4b", [],
"Good. It's good to find someone eager for practice. Let's see what you will do.", "trainer_practice_1", []],
[anyone,"start", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end),
(neq,"$waiting_for_training_fight_result", 0),
(neq,"$training_fight_won", 0)],
"That was a good fight. ", "trainer_practice_1",
[(val_sub, "$num_opponents_to_beat_in_a_row", 1),
(assign,"$waiting_for_training_fight_result",0),
]],
[anyone,"start", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end),
(neq, "$waiting_for_training_fight_result", 0)],
"Ha! Looks like you've developed a bit of a limp there. Don't worry, even losses have their value, provided you learn from them. Shake the stars out of your eyes and get back in there. There's no other way to win.", "trainer_practice_1",
[(assign,"$num_opponents_to_beat_in_a_row",3),(assign,"$waiting_for_training_fight_result",0)]],
[anyone,"start", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end)],
"Good day. Ready for some training today?", "trainer_talk",[]],
[anyone,"trainer_pretalk", [],
"Ah, are you ready for some training?", "trainer_talk",[]],
[anyone|plyr,"trainer_talk", [],
"I am ready for some practice.", "trainer_practice_1",[]],
[anyone|plyr,"trainer_talk", [],
"First, tell me something about combat...", "trainer_combat_begin",[]],
## [anyone|plyr,"trainer_talk", [],
## "I have some novice soldiers with me. Can you train them?", "trainer_train_novices_1",[]],
[anyone|plyr,"trainer_talk", [],
"I need to leave now. Farewell.", "close_window",[]],
[anyone,"trainer_combat_begin", [],
"What do you want to know?", "trainer_talk_combat",[]],
[anyone,"trainer_combat_pretalk", [],
"What else do you want to know?", "trainer_talk_combat",[]],
[anyone|plyr,"trainer_talk_combat", [], "Tell me about defending myself.", "trainer_explain_defense",[]],
[anyone|plyr,"trainer_talk_combat", [], "Tell me about attacking with weapons.", "trainer_explain_attack",[]],
[anyone|plyr,"trainer_talk_combat", [], "Tell me about fighting on horseback.", "trainer_explain_horseback",[]],
# [anyone|plyr,"trainer_talk_combat", [], "Tell me about using ranged weapons.", "trainer_explain_ranged",[]],
# [anyone|plyr,"trainer_talk_combat", [], "Tell me about weapon types.", "trainer_explain_weapon_types",[]],
[anyone|plyr,"trainer_talk_combat", [], "I guess I know all the theory I need. Let's talk about something else.", "trainer_pretalk",[]],
[anyone,"trainer_explain_defense", [], "Good question. The first thing you should know as a fighter is how to defend yourself.\
Keeping yourself out of harm's way is the first rule of combat, and it is much more important than giving harm to others.\
Everybody can swing a sword around and hope to cut some flesh, but only those fighters that are experts at defense live to tell of it.",
"trainer_explain_defense_2",[]],
[anyone,"trainer_explain_defense_2", [], "Now. Defending yourself is easiest if you are equipped with a shield.\
Just block with your shield. [Hold down the right mouse button to defend yourself with the shield.] In this state, you will be able to deflect all attacks that come from your front. However, you will still be open to strikes from your sides or your back.", "trainer_explain_defense_3",[]],
[anyone|plyr,"trainer_explain_defense_3", [], "What if I don't have a shield?", "trainer_explain_defense_4",[]],
[anyone,"trainer_explain_defense_4", [], "Then you will have to use your weapon to block your opponent.\
This is a bit more difficult than defending with a shield.\
Defending with a weapon, you can block against only ONE attack direction.\
That is, you block against either overhead swings, side swings or thrusts.\
Therefore you must watch your opponent carefully and start to block AFTER he starts his attack.\
In this way you will be able to block against the direction of his current attack.\
If you start to block BEFORE he makes his move, he may just attack in another direction than the one you are blocking against and score a hit.", "trainer_combat_pretalk",[]],
[anyone,"trainer_explain_attack", [], "Good question. Attacking is the best defence, they say.\
A tactic many fighters find useful is taking an offensive stance and readying your weapon for attack, waiting for the right moment for swinging it.\
[You can ready your weapon for attack by pressing and holding down the left mouse button.]", "trainer_explain_attack_2",[]],
[anyone|plyr,"trainer_explain_attack_2", [], "That sounds useful.", "trainer_explain_attack_3",[]],
[anyone,"trainer_explain_attack_3", [], "It is a good tactic, but remember that, your opponent may see that and take a defensive stance against the direction you are swinging your weapon.\
If that happens, you must break your attack and quickly attack from another direction\
[You may cancel your current attack by quickly tapping the right mouse button].", "trainer_explain_attack_4",[]],
[anyone|plyr,"trainer_explain_attack_4", [], "If my opponent is defending against the direction I am attacking from, I will break and use another direction.", "trainer_explain_attack_5",[]],
[anyone,"trainer_explain_attack_5", [], "Yes, selecting the direction you swing your weapon is a crucial skill.\
There are four main directions you may use: right swing, left swing, overhead swing and thrust. You must use each one wisely.\
[to control your swing direction with default controls, move your mouse in the direction you want to swing from as you press the left mouse button].", "trainer_combat_pretalk",[]],
[anyone,"trainer_explain_horseback", [], "Very good question. A horse may be a warrior's most powerful weapon in combat.\
It gives you speed, height, power and initiative. A lot of deadly weapons will become even deadlier on horseback.\
However you must pay particular attention to horse-mounted enemies couching their lances, as they may take down any opponent in one hit.\
[To use the couched lance yourself, wield a lance or similar weapon, and speed up your horse without pressing attack or defense buttons.\
after you reach a speed, you'll lower your lance. Then try to target your enemies by maneuvering your horse.]", "trainer_combat_pretalk",[]],
[anyone,"trainer_practice_1", [(eq,"$training_system_explained", 0)],
"I train novices in four stages, each tougher than the one before.\
To finish a stage and advance to the next one, you have to win three fights in a row.", "trainer_practice_1",
[
(assign, "$num_opponents_to_beat_in_a_row", 3),
(assign, "$novicemaster_opponent_troop", "trp_novice_fighter"),
(assign, "$training_system_explained", 1),
]],
[anyone,"trainer_practice_1",
[(ge,"$novice_training_difficulty",4)],
"You have passed all stages of training. But if you want you can still practice. Are you ready?", "novicemaster_are_you_ready",
[(assign,"$num_opponents_to_beat_in_a_row",99999)]],
[anyone,"trainer_practice_1",
[(eq,"$num_opponents_to_beat_in_a_row",0),(eq,"$novice_training_difficulty",0)],
"Way to go {lad/lass}. With this victory, you have advanced to the next training level. From now on your opponents will be regular fighters, not the riff-raff off the street, so be on your toes.",
"trainer_practice_1",
[[assign,"$num_opponents_to_beat_in_a_row",3],
[val_add,"$novice_training_difficulty",1],
[add_xp_to_troop,100],
[assign,"$novicemaster_opponent_troop","trp_regular_fighter"]]],
[anyone,"trainer_practice_1",
[[eq,"$num_opponents_to_beat_in_a_row",0],[eq,"$novice_training_difficulty",1]],
"Way to go {lad/lass}. Welcome to the third training level. From now on your opponents will be veteran fighters; soldiers and arena regulars and the like. These guys know some dirty tricks, so keep your defense up.",
"trainer_practice_1",
[[assign,"$num_opponents_to_beat_in_a_row",3],
[val_add,"$novice_training_difficulty",1],
[add_xp_to_troop,100],
[assign,"$novicemaster_opponent_troop","trp_veteran_fighter"]]],
[anyone,"trainer_practice_1",
[[eq,"$num_opponents_to_beat_in_a_row",0],[eq,"$novice_training_difficulty",2]],
"You've got the heart of a champion, {lad/lass}, and the sword arm to match. From now on your opponents will be champion fighters.\
These are the cream of the crop, the finest warriors I have trained. If you can best three of them in a row, you will join their ranks.",
"trainer_practice_1",
[[assign,"$num_opponents_to_beat_in_a_row",3],
[val_add,"$novice_training_difficulty",1],
[add_xp_to_troop,100],
[assign,"$novicemaster_opponent_troop","trp_champion_fighter"]]],
[anyone,"trainer_practice_1",
[[eq,"$num_opponents_to_beat_in_a_row",0],[eq,"$novice_training_difficulty",3]],
"It does my heart good to see such a promising talent. You have passed all tiers of training. You can now tell everyone that you have been trained by the master of the training field.",
"novicemaster_finish_training",
[[assign,"$num_opponents_to_beat_in_a_row",3],
[val_add,"$novice_training_difficulty",1],
[add_xp_to_troop,300]]],
[anyone|plyr,"novicemaster_finish_training", [], "Thank you master.", "novicemaster_finish_training_2",[]],
[anyone,"novicemaster_finish_training_2", [], "I wish you good luck in the tournaments. And, don't forget,\
if you want to practice your swordwork anytime, just come and say the word.", "close_window",[]],
[anyone,"trainer_practice_1",
[
(assign, reg8, "$num_opponents_to_beat_in_a_row"),
(str_store_troop_name, s9, "$novicemaster_opponent_troop"),
],
"Your next opponent will be a {s9}. You need to win {reg8} more\
fights in a row to advance to the next stage. Are you ready?", "novicemaster_are_you_ready",
[]],
[anyone|plyr,"novicemaster_are_you_ready", [], "Yes I am.", "novicemaster_ready_to_fight",[]],
[anyone,"novicemaster_ready_to_fight", [], "Here you go then. Good luck.", "close_window",
[
(assign, "$training_fight_won", 0),
(assign, "$waiting_for_training_fight_result", 1),
(modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
(reset_visitors),
(assign, reg0, 0),
(assign, reg1, 1),
(assign, reg2, 2),
(assign, reg3, 3),
(shuffle_range, 0, 4),
(set_visitor, reg0, "trp_player"),
(set_visitor, reg1, "$novicemaster_opponent_troop"),
(set_visitor, 4, "$g_talk_troop"),
(set_jump_mission, "mt_training_ground_trainer_training"),
(jump_to_scene, "$g_training_ground_melee_training_scene"),
]],
[anyone|plyr,"novicemaster_are_you_ready", [], "Just a minute. I am not ready yet.", "novicemaster_not_ready",[]],
[anyone,"novicemaster_not_ready", [], "Hey, You will never make it if you don't practice.", "close_window",[]],
#Crooks
## [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end),(eq,"$g_talk_troop_met",0),(eq,"$sneaked_into_town",0),(store_random_in_range, reg2, 2)],
## "You {reg2?looking for:want} something?:", "crook_intro_1",[]],
## [anyone|plyr,"crook_intro_1",[],"I am trying to learn my way around the town.", "crook_intro_2",[]],
##
## [anyone,"crook_intro_2",[(eq,"$crook_talk_order",0),(val_add,"$crook_talk_order",1),(str_store_troop_name,s1,"$g_talk_troop")],
##"Then you came to the right guy. My name is {s1}, and I know everyone and everything that goes around in this town.\
## Anyone you want to meet, I can arrange it. Anything you need to know, I can find out. For the the right price, of course. Do you have gold?", "crook_intro_2a",[]],
## [anyone|plyr,"crook_intro_2a",[],"I have gold. Plenty of it.", "crook_intro_2a_1a",[]],
## [anyone|plyr,"crook_intro_2a",[],"Not really.", "crook_intro_2a_1b",[]],
## [anyone,"crook_intro_2a_1a",[],"Good. That means you and I will be great friends.", "crook_talk",[]],
## [anyone,"crook_intro_2a_1b",[],"Then you should look into earning some. Listen to me now, for I'll give you some free advice.\
## The easiest way to make money is to fight in the tournaments and bet on yourself. If you are good, you'll quickly get yourself enough money to get going.", "crook_talk",[]],
##
## [anyone,"crook_intro_2",[(eq,"$crook_talk_order",1),(val_add,"$crook_talk_order",1),(str_store_troop_name,s1,"$g_talk_troop")],
##"Then you need to go no further. I am {s1}, and I can provide you anything... For the the right price.", "crook_intro_2b",[]],
## [anyone|plyr,"crook_intro_2b",[],"Are you a dealer?", "crook_intro_2b_1",[]],
## [anyone,"crook_intro_2b_1",[],"A dealer? Yes. I deal in knowledge... connections.. lies... secrets... Those are what I deal in. Interested?", "crook_talk",[]],
##
## [anyone,"crook_intro_2",[(eq,"$crook_talk_order",2),(val_add,"$crook_talk_order",1),(str_store_troop_name,s1,"$g_talk_troop")],
##"Then this is your lucky day. Because you are talking to {s1}, and I know every piss-stained brick of this wicked town.\
##I know every person, every dirty little secret. And all that knowledge can be yours. For a price.", "crook_talk",[]],
##
## [anyone,"crook_intro_2",[(val_add,"$crook_talk_order",1),(str_store_troop_name,s1,"$g_talk_troop")],
## "Then {s1} is at your service {sir/madam}. If you want to know what's really going on in this town, or arrange a meeting in secret, then come to me. I can help you.", "crook_talk",[]],
##
## [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end),(eq,"$g_talk_troop_met",0),(eq,"$sneaked_into_town",1),(eq,"$crook_sneak_intro_order",0),(val_add,"$crook_sneak_intro_order",1)],
## "Good day. {playername} right?", "crook_intro_sneak_1",[]],
## [anyone|plyr,"crook_intro_sneak_1", [], "You must be mistaken. I'm just a poor pilgrim. I don't answer to that name.", "crook_intro_sneak_2",[]],
## [anyone,"crook_intro_sneak_2", [(str_store_troop_name,s1,"$g_talk_troop")], "Of course you do. And if the town guards knew you were here, they'd be upon you this minute.\
## But don't worry. Noone knows it is {playername} under that hood. Except me of course. But I am {s1}. It is my business to know things.", "crook_intro_sneak_3",[]],
## [anyone|plyr,"crook_intro_sneak_3", [], "You won't tip off the guards about my presence?", "crook_intro_sneak_4",[]],
## [anyone,"crook_intro_sneak_4", [], "What? Of course not! Well, maybe I would, but the new captain of the guards is a dung-eating cheat.\
## I led him to this fugitive, and the man was worth his weight in silver as prize money. But I swear, I didn't see a penny of it.\
## The bastard took it all to himself. So your secret is safe with me.", "crook_intro_sneak_5",[]],
## [anyone,"crook_intro_sneak_5", [], "Besides, I heard you have a talent for surviving any kind of ordeal.\
## I wouldn't want you to survive this one as well and then come after me with a sword. Ha-hah.", "crook_talk",[]],
##
##
## [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end),(eq,"$g_talk_troop_met",0),(eq,"$sneaked_into_town",1),(str_store_troop_name,s1,"$g_talk_troop")],
## "{s1} is at your service {sir/madam}. If you want to know what's really going on in this town, or arrange a meeting in secret, then come to me. I can help you.", "crook_talk",[]],
##
## [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end),(store_character_level, ":cur_level", "trp_player"),(lt,":cur_level",8)],
## "{You again?/Delighted to see you again my pretty.}", "crook_talk",[]],
## [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end)],
## "I see that you need my services {sir/madam}...", "crook_talk",[]],
## [anyone ,"crook_pretalk", [],
## "Is that all?", "crook_talk",[]],
## [anyone|plyr,"crook_talk", [], "I'm looking for a person...", "crook_search_person",[]],
## [anyone|plyr,"crook_talk", [], "I want you to arrange me a meeting with someone...", "crook_request_meeting",[]],
## [anyone|plyr,"crook_talk", [], "[Leave]", "close_window",[]],
# [anyone,"crook_enter_dungeon", [],
# "Alright but this will cost you 50 denars.", "crook_enter_dungeon_2", []],
# [anyone|plyr, "crook_enter_dungeon_2", [(store_troop_gold, ":cur_gold", "trp_player"),
# (ge, ":cur_gold", 50)],
# "TODO: Here it is. 50 denars.", "crook_enter_dungeon_3_1",[(troop_remove_gold, "trp_player", 50)]],
# [anyone|plyr, "crook_enter_dungeon_2", [(store_troop_gold, ":cur_gold", "trp_player"),
# (ge, ":cur_gold", 50)],
# "Never mind then.", "crook_pretalk",[]],
# [anyone|plyr, "crook_enter_dungeon_2", [(store_troop_gold, ":cur_gold", "trp_player"),
# (lt, ":cur_gold", 50)],
# "TODO: I don't have that much money.", "crook_enter_dungeon_3_2",[]],
# [anyone,"crook_enter_dungeon_3_1", [],
# "TODO: There you go.", "close_window", [(call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle")]],
# [anyone,"crook_enter_dungeon_3_2", [],
# "TODO: Come back later then.", "crook_pretalk",[]],
## [anyone, "crook_request_meeting", [],
## "Who do you want to meet with?", "crook_request_meeting_2",[]],
## [anyone|plyr|repeat_for_troops,"crook_request_meeting_2", [(store_encountered_party, ":center_no"),
## (store_repeat_object, ":troop_no"),
## (is_between, ":troop_no", heroes_begin, heroes_end),
## (troop_get_slot, ":cur_center", ":troop_no", slot_troop_cur_center),
## (call_script, "script_get_troop_attached_party", ":troop_no"),
## (assign, ":cur_center_2", reg0),
## (this_or_next|eq, ":cur_center", ":center_no"),
## (eq, ":cur_center_2", ":center_no"),
## (neg|party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),#Neglect the ruler of the center
## (str_store_troop_name, s1, ":troop_no")],
## "{s1}", "crook_request_meeting_3", [(store_repeat_object, "$selected_troop")]],
##
## [anyone|plyr,"crook_request_meeting_2", [], "Never mind.", "crook_pretalk", []],
##
## [anyone,"crook_request_meeting_3", [],
## "Alright but this will cost you 50 denars.", "crook_request_meeting_4", []],
##
## [anyone|plyr, "crook_request_meeting_4", [(store_troop_gold, ":cur_gold", "trp_player"),
## (ge, ":cur_gold", 50)],
## "TODO: Here it is. 50 denars.", "crook_search_person_5_1",[(troop_remove_gold, "trp_player", 50)]],
##
## [anyone|plyr, "crook_request_meeting_4", [(store_troop_gold, ":cur_gold", "trp_player"),
## (ge, ":cur_gold", 50)],
## "Never mind then.", "crook_pretalk",[]],
##
## [anyone|plyr, "crook_request_meeting_4", [(store_troop_gold, ":cur_gold", "trp_player"),
## (lt, ":cur_gold", 50)],
## "TODO: I don't have that much money.", "crook_search_person_5_2",[]],
##
## [anyone, "crook_search_person_5_1", [],
## "TODO: Ok.", "close_window",[(party_get_slot, ":town_alley", "$g_encountered_party", slot_town_alley),
## (modify_visitors_at_site,":town_alley"),(reset_visitors),
## (set_visitor,0,"trp_player"),
## (set_visitor,17,"$selected_troop"),
## (set_jump_mission,"mt_conversation_encounter"),
## (jump_to_scene,":town_alley"),
## (assign, "$talk_context", tc_back_alley),
## (change_screen_map_conversation, "$selected_troop")]],
##
## [anyone, "crook_search_person_5_2", [],
## "TODO: Come back later then.", "crook_pretalk",[]],
##
## [anyone, "crook_search_person", [],
## "TODO: Who are you searching for?", "crook_search_person_2",[]],
## [anyone|plyr|repeat_for_factions,"crook_search_person_2", [(store_repeat_object, ":faction_no"),
## (is_between, ":faction_no", kingdoms_begin, kingdoms_end),
## (str_store_faction_name, s1, ":faction_no")],
## "TODO: I'm looking for a {s1}.", "crook_search_person_3", [(store_repeat_object, "$selected_faction")]],
##
## [anyone|plyr,"crook_search_person_2", [], "Never mind.", "crook_pretalk", []],
##
##
## [anyone, "crook_search_person_3", [],
## "TODO: Who?", "crook_search_person_4",[]],
##
## [anyone|plyr|repeat_for_troops,"crook_search_person_4", [(store_repeat_object, ":troop_no"),
## (is_between, ":troop_no", heroes_begin, heroes_end),
## (store_troop_faction, ":faction_no", ":troop_no"),
## (eq, ":faction_no", "$selected_faction"),
## (str_store_troop_name, s1, ":troop_no")],
## "{s1}", "crook_search_person_5", [(store_repeat_object, "$selected_troop")]],
##
## [anyone|plyr,"crook_search_person_4", [], "Never mind.", "crook_pretalk", []],
##
## [anyone, "crook_search_person_5", [(call_script, "script_get_information_about_troops_position", "$selected_troop", 0),
## (eq, reg0, 1),
## (str_store_troop_name, s1, "$selected_troop")],
## "TODO: I know where {s1} is at the moment, but hearing it will cost you 50 denars.", "crook_search_person_6",[]],
##
## [anyone, "crook_search_person_5", [],
## "TODO: Sorry I don't know anything.", "crook_pretalk",[]],
##
## [anyone|plyr, "crook_search_person_6", [(store_troop_gold, ":cur_gold", "trp_player"),
## (ge, ":cur_gold", 50)],
## "TODO: Here it is. 50 denars.", "crook_search_person_7_1",[(troop_remove_gold, "trp_player", 50)]],
##
## [anyone|plyr, "crook_search_person_6", [(store_troop_gold, ":cur_gold", "trp_player"),
## (ge, ":cur_gold", 50)],
## "Never mind then.", "crook_pretalk",[]],
##
## [anyone|plyr, "crook_search_person_6", [(store_troop_gold, ":cur_gold", "trp_player"),
## (lt, ":cur_gold", 50)],
## "TODO: I don't have that much money.", "crook_search_person_7_2",[]],
##
## [anyone, "crook_search_person_7_1", [(call_script, "script_get_information_about_troops_position", "$selected_troop", 0)],
## "{s1}", "crook_pretalk",[]],
##
## [anyone, "crook_search_person_7_2", [],
## "TODO: Come back later then.", "crook_pretalk",[]],
##
[anyone|auto_proceed,"start", [
(is_between,"$g_talk_troop","trp_town_1_master_craftsman", "trp_zendar_chest"),
(party_get_slot, ":days_until_complete", "$g_encountered_party", slot_center_player_enterprise_days_until_complete),
(ge, ":days_until_complete", 2),
(assign, reg4, ":days_until_complete"),
],
"{!}.", "start_craftsman_soon",[]],
[anyone,"start_craftsman_soon", [
],
"Good day, my {lord/lady}. We hope to begin production in about {reg4} days", "close_window",[]],
[anyone,"start", [
(is_between,"$g_talk_troop","trp_town_1_master_craftsman", "trp_zendar_chest"),
],
"Good day, my {lord/lady}. We are honored that you have chosen to visit us. What do you require?", "master_craftsman_talk",[]],
[anyone,"master_craftsman_pretalk", [],
"Very good, my {lord/lady}. Do you require anything else?", "master_craftsman_talk",[]],
[anyone|plyr,"master_craftsman_talk", [],
"Let's go over the accounts.", "master_craftsman_accounts",[]],
[anyone|plyr,"master_craftsman_talk", [],
"Let's check the inventories.", "master_craftsman_pretalk",[
(change_screen_loot, "$g_talk_troop"),
]],
[anyone|plyr,"master_craftsman_talk", [
(party_slot_eq, "$g_encountered_party", slot_center_player_enterprise_production_order, 1),
],
"I'd like you to sell goods as they are produced.", "master_craftsman_pretalk",[
(party_set_slot, "$g_encountered_party", slot_center_player_enterprise_production_order, 0),
]],
[anyone|plyr,"master_craftsman_talk", [
(party_slot_eq, "$g_encountered_party", slot_center_player_enterprise_production_order, 0),
],
"I'd like you to keep all goods in the warehouse until I arrive.", "master_craftsman_pretalk",[
(party_set_slot, "$g_encountered_party", slot_center_player_enterprise_production_order, 1),
]],
[anyone,"master_craftsman_accounts", [
], "We currently produce {s3} worth {reg1} denars each week, while the quantity of {s4} needed to manufacture it costs {reg2}, and labor and upkeep are {reg3}.{s9} This means that we theoretically make a {s12} of {reg0} denars a week, assuming that we have no raw materials in the inventories, and that we sell directly to the market.", "master_craftsman_pretalk",
[
(party_get_slot, ":item_produced", "$g_encountered_party", slot_center_player_enterprise),
(call_script, "script_process_player_enterprise", ":item_produced", "$g_encountered_party"),
(try_begin),
(ge, reg0, 0),
(str_store_string, s12, "str_profit"),
(else_try),
(str_store_string, s12, "str_loss"),
(try_end),
(str_store_item_name, s3, ":item_produced"),
(item_get_slot, ":primary_raw_material", ":item_produced", slot_item_primary_raw_material),
(str_store_item_name, s4, ":primary_raw_material"),
(item_get_slot, ":secondary_raw_material", ":item_produced", slot_item_secondary_raw_material),
(str_clear, s9),
(try_begin),
(gt, ":secondary_raw_material", 0),
(str_store_item_name, s11, ":secondary_raw_material"),
(str_store_string, s9, "str_describe_secondary_input"),
(try_end),
]],
[anyone|plyr,"master_craftsman_talk", [
], "Could you explain my options related to production?", "master_craftsman_production_options",[]],
[anyone,"master_craftsman_production_options", [
(str_store_party_name, s5, "$g_encountered_party"),
], "Certainly, my {lord/lady}. Most of the time, the most profitable thing for you to do would be to let us buy raw materials and sell the finished goods directly to the market. Because of our longstanding relations with the local merchants, we can usually get a very good price.", "master_craftsman_production_options_2",[]],
[anyone,"master_craftsman_production_options_2", [
(str_store_party_name, s5, "$g_encountered_party"),
], "However, if you find that you can acquire raw materials cheaper outside {s5}, you may place them in the inventories, and we will use them instead of buying from the market. Likewise, if you feel that you can get a better price for the finished goods elsewhere, then you may ask us to deposit what we produce in our warehouses for you to take.", "master_craftsman_pretalk",[]],
[anyone|plyr,"master_craftsman_talk", [
], "It will no longer be possible for me to continue operating this enterprise.", "master_craftsman_auction_price",[]],
[anyone,"master_craftsman_auction_price", [
(party_get_slot, ":item_produced", "$g_encountered_party", slot_center_player_enterprise),
(item_get_slot, ":base_price",":item_produced", slot_item_base_price),
(item_get_slot, ":number_runs", ":item_produced", slot_item_output_per_run),
(store_mul, "$liquidation_price", ":base_price", ":number_runs"),
(val_mul, "$liquidation_price", 4),
(troop_get_inventory_capacity, ":total_capacity", "$g_talk_troop"),
(try_for_range, ":capacity_iterator", 0, ":total_capacity"),
(troop_get_inventory_slot, ":item_in_slot", "$g_talk_troop", ":capacity_iterator"),
(gt, ":item_in_slot", 0),
(item_get_slot, ":price_for_inventory_item", ":item_in_slot", slot_item_base_price),
# (troop_inventory_slot_get_item_amount, ":item_ammo", "$g_talk_troop", ":capacity_iterator"),
# (troop_inventory_slot_get_item_max_amount, ":item_max_ammo", "$g_talk_troop", ":capacity_iterator"),
# (try_begin),
# (lt, ":item_ammo", ":item_max_ammo"),
# (val_mul, ":price_for_inventory_item", ":item_ammo"),
# (val_div, ":price_for_inventory_item", ":item_max_ammo"),
# (try_end),
(store_sub, ":item_slot_no", ":item_in_slot", trade_goods_begin),
(val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
(party_get_slot, ":index", "$g_encountered_party", ":item_slot_no"),
(val_mul, ":price_for_inventory_item", ":index"),
(val_div, ":price_for_inventory_item", 1200),
#modify by site
#divide by 1200 not 1000
(val_add, "$liquidation_price", ":price_for_inventory_item"),
(try_end),
(assign, reg4, "$liquidation_price"),
], "A pity, my {lord/lady}. If we sell the land and the equipment, and liquidate the inventories, I estimate that we can get {reg4} denars.", "master_craftsman_auction_decide",[]],
[anyone|plyr,"master_craftsman_auction_decide", [
], "That sounds reasonable. Please proceed with the sale.", "master_craftsman_liquidation",[
(troop_add_gold, "trp_player", "$liquidation_price"),
(troop_clear_inventory, "$g_talk_troop"),
(party_set_slot, "$g_encountered_party", slot_center_player_enterprise, 0),
(party_set_slot, "$g_encountered_party", slot_center_player_enterprise_production_order, 0),
]],
[anyone|plyr,"master_craftsman_auction_decide", [
], "Hmm. Let's hold off on that.", "master_craftsman_pretalk",[]],
[anyone,"master_craftsman_liquidation", [
], "As you wish. It was an honor to have been in your employ.", "close_window",[
(finish_mission),
]],
[anyone|plyr,"master_craftsman_talk", [
(eq, 1, 0),
], "{!}As you wish, {sir/my lady}. It was an honor to work in your employ.", "close_window",[]],
[anyone|plyr,"master_craftsman_talk", [],
"That is all for now.", "close_window",[]],
#Mayor talk (town elder)
[anyone ,"start", [(is_between,"$g_talk_troop",mayors_begin,mayors_end),(eq,"$g_talk_troop_met",0),
(this_or_next|eq, "$players_kingdom", "$g_encountered_party_faction"),
( eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),],
"Good day, my lord.", "mayor_begin",[]],
[anyone ,"start", [(is_between,"$g_talk_troop",mayors_begin,mayors_end),(eq,"$g_talk_troop_met",0),
(str_store_party_name, s9, "$current_town")],
"Hello stranger, you seem to be new to {s9}. I am the guild master of the town.", "mayor_talk",[]],
[anyone ,"start", [(is_between,"$g_talk_troop",mayors_begin,mayors_end)],
"Good day, {playername}.", "mayor_begin",
[
#Delete last offered quest if peace is formed.
(try_begin),
(eq, "$merchant_offered_quest", "qst_persuade_lords_to_make_peace"),
(party_get_slot, ":target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
(party_get_slot, ":object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
(store_relation, ":reln", ":target_faction", ":object_faction"),
(ge, ":reln", 0),
(assign, "$merchant_quest_last_offerer", -1),
(assign, "$merchant_offered_quest", -1),
(try_end),
]],
[anyone,"mayor_begin", [(check_quest_active, "qst_persuade_lords_to_make_peace"),
(quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_giver_troop, "$g_talk_troop"),
(check_quest_succeeded, "qst_persuade_lords_to_make_peace"),
(quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
(quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
(val_mul, ":quest_target_troop", -1),
(val_mul, ":quest_object_troop", -1),
(quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
(quest_get_slot, ":quest_object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
(str_store_troop_name, s12, ":quest_target_troop"),
(str_store_troop_name, s13, ":quest_object_troop"),
(str_store_faction_name, s14, ":quest_target_faction"),
(str_store_faction_name, s15, ":quest_object_faction"),
(str_store_party_name, s19, "$current_town"),
],
"{playername}, it was an incredible feat to get {s14} and {s15} make peace, and you made it happen.\
Your involvement has not only saved our town from disaster, but it has also saved thousands of lives, and put an end to all the grief this bitter war has caused.\
As the townspeople of {s19}, know that we'll be good on our word, and we are ready to pay the {reg12} denars we promised.", "lord_persuade_lords_to_make_peace_completed",
[(quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
(quest_get_slot, ":quest_object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
#Forcing 2 factions to make peace within 72 hours.
(assign, "$g_force_peace_faction_1", ":quest_target_faction"),
(assign, "$g_force_peace_faction_2", ":quest_object_faction"),
(quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
(assign, reg12, ":quest_reward"),
#TODO: Change these values
(add_xp_as_reward, 4000),
]],
[anyone|plyr,"lord_persuade_lords_to_make_peace_completed", [],
"Thank you. Let me have the money.", "lord_persuade_lords_to_make_peace_pay",[]],
[anyone|plyr,"lord_persuade_lords_to_make_peace_completed", [],
"No need for a payment. I only did what was right.", "lord_persuade_lords_to_make_peace_no_pay",[]],
[anyone ,"lord_persuade_lords_to_make_peace_pay", [],
"Oh, yes, of course. We had already got the money for you.\
Here, please accept these {reg12} denars together with our most sincere thanks.\
Me and the people of our town will not forget your help.", "close_window",
[(quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
(call_script, "script_troop_add_gold", "trp_player", ":quest_reward"),
(call_script, "script_change_player_relation_with_center", "$current_town", 5),
(call_script, "script_end_quest", "qst_persuade_lords_to_make_peace"),
(quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
(assign, reg12, ":quest_reward")
]],
[anyone ,"lord_persuade_lords_to_make_peace_no_pay", [],
"You are indeed an extraordenary person, {sir/madame}, and it is an honour for me to have known you.\
You not only did what was impiossible and put an end to this terrible war, but you won't even accept a reward for it.\
Very well, I will not insist on the matter, but please know that you will have our eternal respect and gratitude.", "close_window",
[
(call_script, "script_change_player_honor", 3),
(call_script, "script_change_player_relation_with_center", "$current_town", 8),
(call_script, "script_end_quest", "qst_persuade_lords_to_make_peace"),
]],
[anyone,"mayor_begin", [(check_quest_active, "qst_deal_with_night_bandits"),
(quest_slot_eq, "qst_deal_with_night_bandits", slot_quest_giver_troop, "$g_talk_troop"),
(check_quest_succeeded, "qst_deal_with_night_bandits"),
],
"Very nice work, {playername}, you made short work of those lawless curs.\
Thank you kindly for all your help, and please accept this bounty of 150 denars.", "lord_deal_with_night_bandits_completed",
[
(add_xp_as_reward,200),
(call_script, "script_troop_add_gold", "trp_player", 150),
(call_script, "script_change_player_relation_with_center", "$current_town", 1),
(call_script, "script_end_quest", "qst_deal_with_night_bandits"),
]],
[anyone|plyr,"lord_deal_with_night_bandits_completed", [],
"It was my pleasure, {s65}.", "close_window",[]],
# Ryan BEGIN
[anyone,"mayor_begin", [(check_quest_active, "qst_deal_with_looters"),
(quest_slot_eq, "qst_deal_with_looters", slot_quest_giver_troop, "$g_talk_troop"),
],
"Ah, {playername}. Have you any progress to report?", "mayor_looters_quest_response",
[
]],
[anyone|plyr,"mayor_looters_quest_response",
[
(store_num_parties_destroyed_by_player, ":num_looters_destroyed", "pt_looters"),
(party_template_get_slot,":previous_looters_destroyed","pt_looters",slot_party_template_num_killed),
(val_sub,":num_looters_destroyed",":previous_looters_destroyed"),
(quest_get_slot,":looters_paid_for","qst_deal_with_looters",slot_quest_current_state),
(lt,":looters_paid_for",":num_looters_destroyed"),
],
"I've killed some looters.", "mayor_looters_quest_destroyed",[]],
[anyone|plyr,"mayor_looters_quest_response", [(eq,1,0)
],
"I've brought you some goods.", "mayor_looters_quest_goods",[]],
[anyone|plyr,"mayor_looters_quest_response", [
],
"Not yet, sir. Farewell.", "close_window",[]],
[anyone,"mayor_looters_quest_destroyed", [],
"Aye, my scouts saw the whole thing. That should make anyone else think twice before turning outlaw!\
The bounty is 40 denars for every band, so that makes {reg1} in total. Here is your money, as promised.",
"mayor_looters_quest_destroyed_2",[
(store_num_parties_destroyed_by_player, ":num_looters_destroyed", "pt_looters"),
(party_template_get_slot,":previous_looters_destroyed","pt_looters",slot_party_template_num_killed),
(val_sub,":num_looters_destroyed",":previous_looters_destroyed"),
(quest_get_slot,":looters_paid_for","qst_deal_with_looters",slot_quest_current_state),
(store_sub,":looter_bounty",":num_looters_destroyed",":looters_paid_for"),
(val_mul,":looter_bounty",40),
(assign,reg1,":looter_bounty"),
(call_script, "script_troop_add_gold", "trp_player", ":looter_bounty"),
(assign,":looters_paid_for",":num_looters_destroyed"),
(quest_set_slot,"qst_deal_with_looters",slot_quest_current_state,":looters_paid_for"),
]],
[anyone,"mayor_looters_quest_destroyed_2", [
(quest_get_slot,":total_looters","qst_deal_with_looters",slot_quest_target_amount),
(quest_slot_ge,"qst_deal_with_looters",slot_quest_current_state,":total_looters"), # looters paid for >= total looters
(quest_get_slot,":xp_reward","qst_deal_with_looters",slot_quest_xp_reward),
(quest_get_slot,":gold_reward","qst_deal_with_looters",slot_quest_gold_reward),
(add_xp_as_reward, ":xp_reward"),
(call_script, "script_troop_add_gold", "trp_player", ":gold_reward"),
(call_script, "script_change_troop_renown", "trp_player", 1),
(call_script, "script_change_player_relation_with_center", "$current_town", 5),
(call_script, "script_end_quest", "qst_deal_with_looters"),
(try_for_parties, ":cur_party_no"),
(party_get_template_id, ":cur_party_template", ":cur_party_no"),
(eq, ":cur_party_template", "pt_looters"),
(party_set_flags, ":cur_party_no", pf_quest_party, 0),
(try_end),
],
"And that's not the only good news! Thanks to you, the looters have ceased to be a threat. We've not had a single attack reported for some time now.\
If there are any of them left, they've either run off or gone deep into hiding. That's good for business,\
and what's good for business is good for the town!\
I think that concludes our arrangement, {playername}. Please accept this silver as a token of my gratitude. Thank you, and farewell.",
"close_window",[
]],
[anyone,"mayor_looters_quest_destroyed_2", [],
"Anything else you need?",
"mayor_looters_quest_response",[
]],
[anyone,"mayor_looters_quest_goods", [
(quest_get_slot,reg1,"qst_deal_with_looters",slot_quest_target_item),
],
"Hah, I knew I could count on you! Just tell me which item to take from your baggage, and I'll send some men to collect it.\
I still need {reg1} denars' worth of goods.",
"mayor_looters_quest_goods_response",[
]],
[anyone|plyr|repeat_for_100,"mayor_looters_quest_goods_response", [
(store_repeat_object,":goods"),
(val_add,":goods",trade_goods_begin),
(is_between,":goods",trade_goods_begin,trade_goods_end),
(player_has_item,":goods"),
(str_store_item_name,s5,":goods"),
],
"{s5}.", "mayor_looters_quest_goods_2",[
(store_repeat_object,":goods"),
(val_add,":goods",trade_goods_begin),
(troop_remove_items,"trp_player",":goods",1),
(assign,":value",reg0),
(call_script, "script_troop_add_gold", "trp_player", ":value"),
(quest_get_slot,":gold_num","qst_deal_with_looters",slot_quest_target_item),
(val_sub,":gold_num",":value"),
(quest_set_slot,"qst_deal_with_looters",slot_quest_target_item,":gold_num"),
(str_store_item_name,s6,":goods"),
]],
[anyone|plyr,"mayor_looters_quest_goods_response", [
],
"Nothing at the moment, sir.", "mayor_looters_quest_goods_3",[]],
[anyone,"mayor_looters_quest_goods_3", [
],
"Anything else you need?",
"mayor_looters_quest_response",[
]],
[anyone,"mayor_looters_quest_goods_2", [
(quest_slot_ge,"qst_deal_with_looters",slot_quest_target_item,1),
(quest_get_slot,reg1,"qst_deal_with_looters",slot_quest_target_item),
],
"Excellent, here is the money for your {s6}. Do you have any more goods to give me? I still need {reg1} denars' worth of goods.",
"mayor_looters_quest_goods_response",[
]],
[anyone,"mayor_looters_quest_goods_2", [
(neg|quest_slot_ge,"qst_deal_with_looters",slot_quest_target_item,1),
(quest_get_slot,":xp_reward","qst_deal_with_looters",slot_quest_xp_reward),
(quest_get_slot,":gold_reward","qst_deal_with_looters",slot_quest_gold_reward),
(add_xp_as_reward, ":xp_reward"),
(call_script, "script_troop_add_gold", "trp_player", ":gold_reward"),
# (call_script, "script_change_troop_renown", "trp_player", 1),
(call_script, "script_change_player_relation_with_center", "$current_town", 3),
(call_script, "script_end_quest", "qst_deal_with_looters"),
(try_for_parties, ":cur_party_no"),
(party_get_template_id, ":cur_party_template", ":cur_party_no"),
(eq, ":cur_party_template", "pt_looters"),
(party_set_flags, ":cur_party_no", pf_quest_party, 0),
(try_end),
],
"Well done, {playername}, that's the last of the goods I need. Here is the money for your {s6}, and a small bonus for helping me out.\
I'm afraid I won't be paying for any more goods, nor bounties on looters, but you're welcome to keep hunting the bastards if any remain.\
Thank you for your help, I won't forget it.",
"close_window",[
]],
# Ryan END
[anyone,"mayor_begin", [(check_quest_active, "qst_move_cattle_herd"),
(quest_slot_eq, "qst_move_cattle_herd", slot_quest_giver_troop, "$g_talk_troop"),
(check_quest_succeeded, "qst_move_cattle_herd"),
],
"Good to see you again {playername}. I have heard that you have delivered the cattle successfully.\
I will tell the merchants how reliable you are.\
And here is your pay, {reg8} denars.", "close_window",
[(quest_get_slot, ":quest_gold_reward", "qst_move_cattle_herd", slot_quest_gold_reward),
(call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
(store_div, ":xp_reward", ":quest_gold_reward", 3),
(add_xp_as_reward, ":xp_reward"),
(call_script, "script_change_troop_renown", "trp_player", 1),
(call_script, "script_change_player_relation_with_center", "$current_town", 3),
(call_script, "script_end_quest", "qst_move_cattle_herd"),
(assign, reg8, ":quest_gold_reward"),
]],
[anyone,"mayor_begin", [(check_quest_active, "qst_move_cattle_herd"),
(quest_slot_eq, "qst_move_cattle_herd", slot_quest_giver_troop, "$g_talk_troop"),
(check_quest_failed, "qst_move_cattle_herd"),
],
"I heard that you have lost the cattle herd on your way to {s9}.\
I had a very difficult time explaining your failure to the owner of that herd, {sir/madam}.\
Do you have anything to say?", "move_cattle_herd_failed",
[]],
[anyone|plyr ,"move_cattle_herd_failed", [],
"I am sorry. But I was attacked on the way.", "move_cattle_herd_failed_2",[]],
[anyone|plyr ,"move_cattle_herd_failed", [],
"I am sorry. The stupid animals wandered off during the night.", "move_cattle_herd_failed_2",[]],
[anyone,"move_cattle_herd_failed_2", [],
"Well, it was your responsibility to deliver that herd safely, no matter what.\
You should know that the owner of the herd demanded to be compensated for his loss, and I had to pay him 1000 denars.\
So you now owe me that money.", "merchant_ask_for_debts",
[(assign, "$debt_to_merchants_guild", 1000),
(call_script, "script_end_quest", "qst_move_cattle_herd"),]],
[anyone,"mayor_begin", [(check_quest_active, "qst_kidnapped_girl"),
(quest_slot_eq, "qst_kidnapped_girl", slot_quest_current_state, 4),
(quest_slot_eq, "qst_kidnapped_girl", slot_quest_giver_troop, "$g_talk_troop"),
],
"{playername} -- I am in your debt for bringing back my friend's daughter.\
Please take these {reg8} denars that I promised you.\
My friend wished he could give more but paying that ransom brought him to his knees.", "close_window",
[(quest_get_slot, ":quest_gold_reward", "qst_kidnapped_girl", slot_quest_gold_reward),
(call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
(assign, reg8, ":quest_gold_reward"),
(assign, ":xp_reward", ":quest_gold_reward"),
(val_mul, ":xp_reward", 2),
(val_add, ":xp_reward", 100),
(add_xp_as_reward, ":xp_reward"),
(call_script, "script_change_troop_renown", "trp_player", 3),
(call_script, "script_change_player_relation_with_center", "$current_town", 2),
(call_script, "script_end_quest", "qst_kidnapped_girl"),
]],
[anyone,"mayor_begin", [(check_quest_active, "qst_track_down_bandits"),
(check_quest_succeeded, "qst_track_down_bandits"),
(quest_slot_eq, "qst_track_down_bandits", slot_quest_giver_troop, "$g_talk_troop"),
],
"Well -- it sounds like you were able to track down the bandits, and show them what happens to those who would disrupt the flow of commerce.\
Here is your reward: {reg5} denars.\
It is well earned, and we are most grateful.",
"mayor_friendly_pretalk", [(quest_get_slot, ":quest_gold_reward", "qst_track_down_bandits", slot_quest_gold_reward),
(call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
(assign, ":xp_reward", ":quest_gold_reward"),
(val_mul, ":xp_reward", 2),
(add_xp_as_reward, ":xp_reward"),
(call_script, "script_change_player_relation_with_center", "$current_town", 2),
(call_script, "script_change_troop_renown", "trp_player", 3),
(call_script, "script_end_quest", "qst_track_down_bandits"),
(assign, reg5, ":quest_gold_reward"),
]],
[anyone,"mayor_begin", [(check_quest_active, "qst_troublesome_bandits"),
(check_quest_succeeded, "qst_troublesome_bandits"),
(quest_slot_eq, "qst_troublesome_bandits", slot_quest_giver_troop, "$g_talk_troop"),
],
"I have heard about your deeds. You have given those bandits the punishment they deserved.\
You are really as good as they say.\
Here is your reward: {reg5} denars.\
I would like to give more but those bandits almost brought me to bankruptcy.",
"mayor_friendly_pretalk", [(quest_get_slot, ":quest_gold_reward", "qst_troublesome_bandits", slot_quest_gold_reward),
(call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
(assign, ":xp_reward", ":quest_gold_reward"),
(val_mul, ":xp_reward", 2),
(add_xp_as_reward, ":xp_reward"),
(call_script, "script_change_player_relation_with_center", "$current_town", 2),
(call_script, "script_change_troop_renown", "trp_player", 3),
(call_script, "script_end_quest", "qst_troublesome_bandits"),
(assign, reg5, ":quest_gold_reward"),
]],
#destroy lair quest end dialogs taken from here
[anyone,"mayor_begin", [(ge, "$debt_to_merchants_guild", 50)],
"According to my accounts, you owe the merchants guild {reg1} denars.\
I'd better collect that now.", "merchant_ask_for_debts",[(assign,reg(1),"$debt_to_merchants_guild")]],
[anyone|plyr,"merchant_ask_for_debts", [[store_troop_gold,reg(5),"trp_player"],[ge,reg(5),"$debt_to_merchants_guild"]],
"Alright. I'll pay my debt to you.", "merchant_debts_paid",[[troop_remove_gold, "trp_player","$debt_to_merchants_guild"],
[assign,"$debt_to_merchants_guild",0]]],
[anyone, "merchant_debts_paid", [], "Excellent. I'll let my fellow merchants know that you are clear of any debts.", "mayor_pretalk",[]],
[anyone|plyr, "merchant_ask_for_debts", [], "I'm afraid I can't pay that sum now.", "merchant_debts_not_paid",[]],
[anyone, "merchant_debts_not_paid", [(assign,reg(1),"$debt_to_merchants_guild")], "In that case, I am afraid, I can't deal with you. Guild rules...\
Come back when you can pay the {reg1} denars.\
And know that we'll be charging an interest to your debt.\
So the sooner you pay it, the better.", "close_window",[]],
[anyone,"mayor_begin", [], "What can I do for you?", "mayor_talk", []],
[anyone,"mayor_friendly_pretalk", [], "Now... What else may I do for you?", "mayor_talk",[]],
[anyone,"mayor_pretalk", [], "Yes?", "mayor_talk",[]],
[anyone|plyr,"mayor_talk", [], "Can you tell me about what you do?", "mayor_info_begin",[]],
[anyone|plyr,"mayor_talk", [(store_partner_quest, ":partner_quest"),
(lt, ":partner_quest", 0),
(neq, "$merchant_quest_last_offerer", "$g_talk_troop")],
"Do you happen to have a job for me?", "merchant_quest_requested",[
(assign,"$merchant_quest_last_offerer", "$g_talk_troop"),
(call_script, "script_get_quest", "$g_talk_troop"),
(assign, "$random_merchant_quest_no", reg0),
(assign,"$merchant_offered_quest","$random_merchant_quest_no"),
]],
[anyone|plyr,"mayor_talk", [(store_partner_quest, ":partner_quest"),
(lt, ":partner_quest", 0),
(eq,"$merchant_quest_last_offerer", "$g_talk_troop"),
(gt,"$merchant_offered_quest", 0) #not sure why was zero
],
"About that job you offered me...", "merchant_quest_last_offered_job",[]],
[anyone|plyr,"mayor_talk", [(store_partner_quest,reg(2)),(ge,reg(2),0)],
"About the job you gave me...", "merchant_quest_about_job",[]],
[anyone|plyr,"mayor_talk",[], "I have some questions of a political nature.", "mayor_political_talk",[]],
[anyone|plyr,"mayor_talk",[], "How is trade around here?", "mayor_economy_report_1",[
(call_script, "script_merchant_road_info_to_s42", "$g_encountered_party"), #also does items to s32
]],
[anyone|plyr,"mayor_talk",[
], "How does the wealth of this region compare with the rest of Calradia?", "mayor_wealth_comparison_1",[
]],
[anyone|plyr,"mayor_talk",[
(item_slot_ge, "itm_velvet", slot_item_secondary_raw_material, "itm_raw_dyes"), #ie, the item information has been updated, to ensure savegame compatibility
], "I wish to buy land in this town for a productive enterprise", "mayor_investment_possible",[
]],
[anyone,"mayor_investment_possible",[
(party_slot_ge, "$g_encountered_party", slot_center_player_enterprise, 1),
(party_get_slot, ":item_produced", "$g_encountered_party", slot_center_player_enterprise),
(call_script, "script_get_enterprise_name", ":item_produced"),
(str_store_string, s4, reg0),
], "You already operate a {s4} here. There probably aren't enough skilled tradesmen to start a second enterprise.", "mayor_pretalk",[
]],
[anyone,"mayor_investment_possible",[
(ge, "$cheat_mode", 3)
], "{!}CHEAT: Yes, we're playtesting this feature, and you're in cheat mode. Go right ahead.", "mayor_investment_advice",[
]],
[anyone,"mayor_investment_possible",[
(lt,"$g_encountered_party_relation",0),
(str_store_string, s9, "str_enterprise_enemy_realm"),
], "{s9}", "mayor_pretalk",[
]],
[anyone,"mayor_investment_possible",[
(party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
], "Of course, {sir/my lady}. You are the lord of this town, and no one is going to stop you.", "mayor_investment_advice",[
]],
[anyone,"mayor_investment_possible",[
(party_get_slot, ":town_liege", "$g_encountered_party", slot_town_lord),
(is_between, ":town_liege", active_npcs_begin, active_npcs_end),
(call_script, "script_troop_get_relation_with_troop", "trp_player", ":town_liege"),
(assign, ":relation", reg0),
(lt, ":relation", 0),
(str_store_troop_name, s4, ":town_liege"),
], "Well... Given your relationship with our liege, {s4}, I think that you will not find many here who are brave enough to sell you any land.", "mayor_investment",[
]],
[anyone|auto_proceed,"mayor_investment",[], "{!}.", "mayor_pretalk",[]],
[anyone,"mayor_investment_possible",[
(neg|party_slot_ge, "$current_town", slot_center_player_relation, 0),
], "Well... To be honest, I think that we in the guild would like to know you a little better. We can be very particular about outsiders coming in here and buying land.", "mayor_pretalk",[
]],
[anyone,"mayor_investment_possible",[
], "Very good, {sir/my lady}. We in the guild know and trust you, and I think I could find someone to sell you the land you need.", "mayor_investment_advice",[]],
[anyone,"mayor_investment_advice",[], "A couple of things to keep in mind -- skilled laborers are always at a premium, so I doubt that you will be able to open up more than one enterprise here. In order to make a profit for yourself, you should choose a commodity which is in relatively short supply, but for which the raw materials are cheap. What sort of enterprise would you like to start?", "investment_choose_enterprise",[
]],
[anyone|plyr,"investment_choose_enterprise",[], "A mill and bakery, to make bread from grain", "investment_summary",[
(assign, "$enterprise_production", "itm_bread"),
]],
[anyone|plyr,"investment_choose_enterprise",[], "A brewery, to make ale from grain", "investment_summary",[
(assign, "$enterprise_production", "itm_ale"),
]],
[anyone|plyr,"investment_choose_enterprise",[], "A tannery, to make leather from hides", "investment_summary",[
(assign, "$enterprise_production", "itm_leatherwork"),
]],
[anyone|plyr,"investment_choose_enterprise",[], "A wine press, to make wine from grapes", "investment_summary",[
(assign, "$enterprise_production", "itm_wine"),
]],
[anyone|plyr,"investment_choose_enterprise",[], "An oil press, to make oil from olives", "investment_summary",[
(assign, "$enterprise_production", "itm_oil"),
]],
[anyone|plyr,"investment_choose_enterprise",[], "An ironworks, to make tools from iron", "investment_summary",[
(assign, "$enterprise_production", "itm_tools"),
]],
[anyone|plyr,"investment_choose_enterprise",[], "A weavery and dyeworks, to make velvet from silk and dye", "investment_summary",[
(assign, "$enterprise_production", "itm_velvet"),
]],
[anyone|plyr,"investment_choose_enterprise",[], "A weavery, to make wool cloth from wool", "investment_summary",[
(assign, "$enterprise_production", "itm_wool_cloth"),
]],
[anyone|plyr,"investment_choose_enterprise",[], "A weavery, to make linen from flax", "investment_summary",[
(assign, "$enterprise_production", "itm_linen"),
]],
[anyone|plyr,"investment_choose_enterprise",[], "Never mind", "mayor_pretalk",[
]],
[anyone,"investment_summary",[], "Very good, sir. The land and the materials on which you may build your {s3} will cost you {reg7} denars. Right now, your {s3} will produce {s4} worth {reg1} denars each week, while the {s6} needed to manufacture that batch will be {reg2} and labor and upkeep will be {reg3}.{s9} I should guess that your profit would be {reg0} denars a week. This assumes of course that prices remain constant -- which, I can virtually guarantee you, they will not. Do you wish to proceed?", "mayor_investment_confirm",
[
#(item_get_slot, ":base_price", "$enterprise_production", slot_item_base_price),
#(item_get_slot, ":number_runs", "$enterprise_production", slot_item_output_per_run),
#(store_mul, "$enterprise_cost", ":base_price", ":number_runs"),
#(val_mul, "$enterprise_cost", 5),
(item_get_slot, "$enterprise_cost", "$enterprise_production", slot_item_enterprise_building_cost),
(assign, reg7, "$enterprise_cost"),
(str_store_item_name, s4, "$enterprise_production"),
(call_script, "script_get_enterprise_name", "$enterprise_production"),
(str_store_string, s3, reg0),
(call_script, "script_process_player_enterprise", "$enterprise_production", "$g_encountered_party"),
#reg0: Profit per cycle
#reg1: Selling price of total goods
#reg2: Selling price of total goods
(item_get_slot, ":primary_raw_material", "$enterprise_production", slot_item_primary_raw_material),
(str_store_item_name, s6, ":primary_raw_material"),
(str_clear, s9),
(assign, ":cost_of_secondary_input", reg10),
(try_begin),
(gt, ":cost_of_secondary_input", 0),
(item_get_slot, ":secondary_raw_material", "$enterprise_production", slot_item_secondary_raw_material),
(str_store_item_name, s11, ":secondary_raw_material"),
(str_store_string, s9, "str_describe_secondary_input"),
(try_end),
]],
[anyone|plyr,"mayor_investment_confirm",[
(store_troop_gold, ":player_gold", "trp_player"),
(ge, ":player_gold","$enterprise_cost"),
], "Yes. Here is money for the land.", "mayor_investment_purchase",[
(party_set_slot, "$g_encountered_party", slot_center_player_enterprise, "$enterprise_production"),
(party_set_slot, "$g_encountered_party", slot_center_player_enterprise_days_until_complete, 7),
(troop_remove_gold, "trp_player", "$enterprise_cost"),
(store_sub, ":current_town_order", "$current_town", towns_begin),
(store_add, ":craftsman_troop", ":current_town_order", "trp_town_1_master_craftsman"),
(try_begin),
(eq, "$enterprise_production", "itm_bread"),
(troop_set_name, ":craftsman_troop", "str_master_miller"),
(else_try),
(eq, "$enterprise_production", "itm_ale"),
(troop_set_name, ":craftsman_troop", "str_master_brewer"),
(else_try),
(eq, "$enterprise_production", "itm_oil"),
(troop_set_name, ":craftsman_troop", "str_master_presser"),
(else_try),
(eq, "$enterprise_production", "itm_tools"),
(troop_set_name, ":craftsman_troop", "str_master_smith"),
(else_try),
(eq, "$enterprise_production", "itm_wool_cloth"),
(troop_set_name, ":craftsman_troop", "str_master_weaver"),
(else_try),
(eq, "$enterprise_production", "itm_linen"),
(troop_set_name, ":craftsman_troop", "str_master_weaver"),
(else_try),
(eq, "$enterprise_production", "itm_leatherwork"),
(troop_set_name, ":craftsman_troop", "str_master_tanner"),
(else_try),
(eq, "$enterprise_production", "itm_velvet"),
(troop_set_name, ":craftsman_troop", "str_master_dyer"),
(else_try),
(eq, "$enterprise_production", "itm_wine"),
(troop_set_name, ":craftsman_troop", "str_master_vinter"),
(try_end),
]],
[anyone|plyr,"mayor_investment_confirm",[], "No -- that's not economical for me at the moment.", "mayor_pretalk",[
]],
[anyone,"mayor_investment_purchase",[], "Very good. Your enterprise should be up and running in about a week. When next you come, and thereafter, you should speak to your {s4} about its operations.", "mayor_pretalk",[
(store_sub, ":current_town_order", "$current_town", towns_begin),
(store_add, ":craftsman_troop", ":current_town_order", "trp_town_1_master_craftsman"),
(str_store_troop_name, s4, ":craftsman_troop"),
]],
[anyone|plyr,"mayor_talk", [], "[Leave]", "close_window",[]],
[anyone, "mayor_info_begin", [(str_store_party_name, s9, "$current_town")],
"I am the guildmaster of {s9}. You can say I am the leader of the good people of {s9}.\
I can help you find a job if you are looking for some honest work.", "mayor_info_talk",[(assign, "$mayor_info_lord_told",0)]],
[anyone|plyr,"mayor_info_talk",[(eq, "$mayor_info_lord_told",0)], "Who rules this town?", "mayor_info_lord",[]],
[anyone, "mayor_info_lord", [(party_get_slot, ":town_lord","$current_town",slot_town_lord),(str_store_troop_name, s10, ":town_lord")],
"Our town's lord and protector is {s10}. He owns the castle and sometimes resides there, and collects taxes from the town.\
However we regulate ourselves in most of the matters that concern ourselves.\
As the town's guildmaster I have the authority to decide those things.", "mayor_info_talk",[(assign, "$mayor_info_lord_told",1)]],
[anyone|plyr,"mayor_info_talk",[], "That's all I need to know. Thanks.", "mayor_pretalk",[]],
[anyone, "mayor_political_talk", [(faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
(str_store_troop_name, s10, ":faction_leader"),
(party_get_slot, ":town_lord","$current_town",slot_town_lord),
(try_begin),
(eq, ":town_lord", "trp_player"),
(str_store_string, s10, "str_your_excellency"),
(else_try),
(is_between, ":town_lord", active_npcs_begin, active_npcs_end),
(neq, ":town_lord", ":faction_leader"),
(str_store_troop_name, s11, ":town_lord"),
(neq, ":town_lord", ":faction_leader"),
(str_store_string, s10, "str_s10_and_s11"),
(try_end),
],
"Politics? Good heaven, the guild has nothing to do with politics. We are loyal servants of {s10}. We merely govern our own affairs, and pass on the townspeople's concerns to our lords and masters, and maybe warn them from time to time against evil advice. Anyway, what did you wish to ask?", "mayor_political_questions",[]],
[anyone,"mayor_prepolitics",[ (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
(try_begin),
(eq, ":faction_leader", "trp_player"),
(str_store_string, s9, "str_your_loyal_subjects"),
(else_try),
(str_store_troop_name, s10, ":faction_leader"),
(str_store_string, s9, "str_loyal_subjects_of_s10"),
(try_end),
], "Did I mention that we here are all {s9}? Because I can't stress that enough... Anyway... Is there anything else?", "mayor_political_questions",[]],
[anyone|plyr,"mayor_political_questions",[], "What is the cause of all these wars in Calradia?", "mayor_war_description_1",[
]],
[anyone,"mayor_war_description_1",[ (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
(str_store_troop_name, s10, ":faction_leader"),
(str_store_string, s22, "str_the"),
(try_begin),
(eq, "$g_encountered_party_faction", "fac_kingdom_5"),
(str_store_string, s22, "str_we"),
(try_end),
(val_max, "$g_mayor_given_political_dialog", 1),
], "Well, to answer your question generally, each monarch claims to be the rightful heir to the old Calradic emperors. Some of these claims are based on forgotten dynastic marriages and others are based on obscure promises, while {s22} Rhodoks invoke the empire's unwritten constitution. So in theory, any one realm has the right to declare war on any other realm at any time.", "mayor_war_description_2",[]],
[anyone,"mayor_war_description_2",[ (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
(str_store_troop_name, s10, ":faction_leader"),
(troop_get_type, reg4, ":faction_leader"),
], "In practice, to make war is exhausting work. It is easy enough to lay waste to the enemy's farmland, but crops will grow back, and it is a far different matter to capture an enemy stronghold and to hold it. So the monarchs of Calradia will fight a little, sign a truce, fight a little more, and so on and so forth. Often, a monarch will go to war when another realm provokes them. At such times, some bad influences who look to enrich themselves with ransoms and pillage will clamor for retribution, and thus the damage caused by war to a monarch's treasury is less than the damage caused by doing nothing would be to his authority... I'm of course not talking about {s10}, as no one would ever question {reg4?her:his} authority", "mayor_war_description_3",[]],
[anyone,"mayor_war_description_3",[
(faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
(troop_get_type, reg4, ":faction_leader"),
], "I would stress again that we in the guild have nothing to do with politics. But if {s10} were to ask for my advice on these matters, as a loyal subject, I would tell {reg4?her:him} that while {reg4?her:his} claim to all of Calradia is truly just, even the most legitimate claim must be backed by armed men, and armed men want money, and money comes from trade, and war ruins trade, so sometimes the best way to push a claim is not to push it, if you know what I mean...", "mayor_war_description_4",[]],
[anyone,"mayor_war_description_4",[
(str_store_party_name, s4, "$g_encountered_party"),
(faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
(troop_get_type, reg4, ":faction_leader"),
], "You may tell {s10} this if you see {reg4?her:him}. Don't mention my name specifically -- just say 'the people of {s4}' told you this. Our personal opinion, of course, as to what would be in {s10}'s best interests. None of us would ever dream of questioning a monarch's sovereign right to push {reg4?her:his} legitimate claims.", "mayor_prepolitics",[
]],
[anyone|plyr,"mayor_political_questions",[
(faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
(str_store_troop_name, s10, ":faction_leader"),
(ge, "$g_mayor_given_political_dialog", 1),
], "What is {s10}'s policy in regards to the other realms of Calradia?", "mayor_politics_assess",[
]],
[anyone,"mayor_politics_assess",[], "Which realm did you have in mind?", "mayor_politics_assess_realm",[
]],
[anyone|plyr|repeat_for_factions,"mayor_politics_assess_realm",[
(store_repeat_object, ":faction"),
(is_between, ":faction", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":faction", slot_faction_state, sfs_active),
(neq, ":faction", "$g_encountered_party_faction"),
(str_store_faction_name, s11, ":faction"),
], "{s11}", "mayor_politics_give_realm_assessment",[
(store_repeat_object, "$faction_selected"),
]],
[anyone,"mayor_politics_give_realm_assessment",[], "{s14}", "mayor_prepolitics",[
(call_script, "script_npc_decision_checklist_peace_or_war", "$g_encountered_party_faction", "$faction_selected", -1),
]],
[anyone|plyr,"mayor_political_questions",[], "What can you say about the internal politics of the realms?", "mayor_internal_politics",[
]],
[anyone,"mayor_internal_politics",[
(str_store_faction_name, s4, "$g_encountered_party_faction"),
(faction_get_slot, ":leader", "$g_encountered_party_faction", slot_faction_leader),
(str_store_troop_name, s5, ":leader"),
(troop_get_type, reg4, ":leader"),
], "Well, here in the {s4} we are all united by our love for {s5} and support for {reg4?her:his} legitimate claim to the rulership of all Calradia. But I have heard some talk of internal bickering in other realms...", "mayor_internal_politics_2",[
]],
[anyone,"mayor_internal_politics_2",[], "The lords of a realm often have very different ideas about honor, strategy, and the way a nobleman should behave. In addition, they compete with each other for the ruler's favor, and are constantly weighing up their position -- how they stand, how their friends and family stand, and how their enemies stand.", "mayor_internal_politics_3", []],
[anyone,"mayor_internal_politics_3",[], "Underlying all the tensions is the possibility that a lord may abandon his liege, and pledge vassalhood to another. In theory, each lord has sworn an oath of vassalage, but in practice, a vassal can always find an excuse to absolve himself. The vassal may claim that the liege has failed to hold up his end of the bargain, to protect the vassal and treat him justly. Or, the vassal may claim that his liege is in fact a usurper, and another has a better claim to the kingship.", "mayor_internal_politics_4", []],
[anyone,"mayor_internal_politics_4",[], "Lieges and vassals still watch each other carefully. If a king believes that his vassal is going to change sides or rebel, he may indict the vassal for treason and seize his properties. Likewise, if a vassal fears that he will be indicted, he may rebel. Usually, whoever makes the first move will be able to control the vassal's fortresses.", "mayor_internal_politics_5", []],
[anyone,"mayor_internal_politics_5",[], "Now, men do not trust a vassal who turns coat easily, nor do they trust a king who lightly throws around charges of treason. Those two factors can keep a realm together. But if relations between a vassal and a liege deteriorate far enough, things can become very tense indeed... In other lands, of course. These things could never happen here in the {s4}.", "mayor_prepolitics", []],
[anyone|plyr, "mayor_political_questions", [], "That is all. Thank you.", "mayor_pretalk", []],
[anyone,"merchant_quest_about_job", [], "What about it?", "merchant_quest_about_job_2",[]],
[anyone|plyr,"merchant_quest_about_job_2", [], "What if I can't finish it?", "merchant_quest_what_if_fail",[]],
[anyone|plyr,"merchant_quest_about_job_2", [], "Well, I'm still working on it.", "merchant_quest_about_job_working",[]],
[anyone,"merchant_quest_about_job_working", [], "Good. I'm sure you will handle it.", "mayor_pretalk",[]],
[anyone,"merchant_quest_last_offered_job", [], "Eh, you want to reconsider that. Good...", "merchant_quest_brief",
[[assign,"$random_merchant_quest_no","$merchant_offered_quest"]]],
[anyone,"merchant_quest_what_if_fail", [(store_partner_quest,":partner_quest"),(eq,":partner_quest","qst_deliver_wine")],
"I hope you don't fail. In that case, I'll have to ask for the price of the cargo you were carrying.", "mayor_pretalk",[]],
[anyone,"merchant_quest_what_if_fail", [], "Well, just do your best to finish it.", "mayor_pretalk",[]],
[anyone,"merchant_quest_taken", [], "Excellent. I am counting on you then. Good luck.", "mayor_pretalk",
[]],
[anyone,"merchant_quest_stall", [], "Well, the job will be available for a few more days I guess. Tell me if you decide to take it.", "mayor_pretalk",[]],
[anyone,"mayor_economy_report_1", [], "{s32}", "mayor_economy_report_2",
[]],
[anyone,"mayor_economy_report_2", [], "{s42}", "mayor_economy_report_3",
[]],
[anyone,"mayor_economy_report_3", [], "{s47}", "mayor_pretalk",
[]],
###################################################################3
# Random Merchant quests....
##############################
# Ryan BEGIN
# deal with looters
[anyone,"merchant_quest_requested",
[
(eq,"$random_merchant_quest_no","qst_deal_with_looters"),
],
"Well, you look able enough. I think I might have something you could do.", "merchant_quest_brief", []],
[anyone,"merchant_quest_brief",
[
(eq,"$random_merchant_quest_no","qst_deal_with_looters"),
(try_begin),
(party_slot_eq,"$g_encountered_party",slot_party_type,spt_town),
(str_store_string,s5,"@town"),
(else_try),
(party_slot_eq,"$g_encountered_party",slot_party_type,spt_village),
(str_store_string,s5,"@village"),
(try_end),
],
"We've had some fighting near the {s5} lately, with all the chaos that comes with it,\
and that's led some of our less upstanding locals to try and make their fortune out of looting the shops and farms during the confusion.\
A lot of valuable goods were taken. I need somebody to teach those bastards a lesson.\
Sound like your kind of work?", "merchant_quest_looters_choice", []],
[anyone|plyr,"merchant_quest_looters_choice", [], "Aye, I'll do it.", "merchant_quest_looters_brief", []],
[anyone|plyr,"merchant_quest_looters_choice", [], "I'm afraid I can't take the job at the moment.", "merchant_quest_stall",[]],
[anyone,"merchant_quest_looters_brief", [
(try_begin),
(party_slot_eq,"$g_encountered_party",slot_party_type,spt_town),
(str_store_string,s5,"@town"),
(else_try),
(party_slot_eq,"$g_encountered_party",slot_party_type,spt_village),
(str_store_string,s5,"@village"),
(try_end),
# (party_get_slot,":merchant","$current_town",slot_town_merchant),
# (troop_clear_inventory,":merchant"),
(store_random_in_range,":random_num_looters",3,7),
(quest_set_slot,"qst_deal_with_looters",slot_quest_target_amount,":random_num_looters"),
(try_for_range,":unused",0,":random_num_looters"),
(store_random_in_range,":random_radius",5,14),
(set_spawn_radius,":random_radius"),
(spawn_around_party,"$g_encountered_party","pt_looters"),
(party_set_flags, reg0, pf_quest_party, 1),
(party_set_ai_behavior, reg0, ai_bhvr_patrol_location),
(party_set_ai_patrol_radius, reg0, 2),
(party_get_position, pos0, reg0),
(party_set_ai_target_position, reg0, pos0),
(try_end),
(str_store_troop_name_link, s9, "$g_talk_troop"),
(str_store_party_name_link, s13, "$g_encountered_party"),
(str_store_party_name, s4, "$g_encountered_party"),
(setup_quest_text, "qst_deal_with_looters"),
(str_store_string, s2, "@The Guildmaster of {s13} has asked you to deal with looters in the surrounding countryside."),
(call_script, "script_start_quest", "qst_deal_with_looters", "$g_talk_troop"),
(assign, "$g_leave_encounter",1),
],
"Excellent! You'll find the looters roaming around the countryside, probably trying to rob more good people.\
Kill or capture the bastards, I don't care what you do with them.\
I'll pay you a bounty of 40 denars on every band of looters you destroy,\
until all the looters are dealt with.", "close_window",
[]],
# Ryan END
#The following few quests are non-random -- they will be checked every time a player asks for a job. If circumstances allow it, then the player will
[anyone,"merchant_quest_requested", [
(eq,"$random_merchant_quest_no","qst_retaliate_for_border_incident"),
(quest_get_slot, ":target_faction", "qst_retaliate_for_border_incident", slot_quest_target_faction),
(call_script, "script_faction_get_adjective_to_s10", ":target_faction"),
(faction_get_slot, ":leader", "$g_encountered_party_faction", slot_faction_leader),
(str_store_troop_name, s5, ":leader"),
], "Well, there is a very great favor which you could do us... As you may have heard, some {s10}s have come across the border to attack our people. {s5} is under great pressure from some of the more bellicose of his vassals to respond with a declaration of war. Unfortunately, while the great lords of this land grow rich from bloodshed, we of the commons will be caught in the middle, and will suffer.",
"merchant_quest_explain_2", []],
[anyone,"merchant_quest_explain_2", [
(eq,"$random_merchant_quest_no","qst_retaliate_for_border_incident"),
(quest_get_slot, ":target_troop", "qst_retaliate_for_border_incident", slot_quest_target_troop),
(str_store_troop_name, s7, ":target_troop"),
],
"We are not saying that {s5} should overlook this aggression -- far from it! But if he charges one of his own lords to respond, then the cycle of provocation will necessarily lead to a full-fledged confrontation. Now, if an outsider were to step in and defeat a {s10} lord in battle, then honor would be done, and it would defuse the clamor for war. If the defeated lord were a known troublemaker -- {s7} -- then the {s10}s might be able to overlook it.",
"merchant_quest_brief",[]],
[anyone,"merchant_quest_brief", [
(eq,"$random_merchant_quest_no","qst_retaliate_for_border_incident"),
(quest_get_slot, ":target_troop", "qst_retaliate_for_border_incident", slot_quest_target_troop),
(str_store_troop_name, s7, ":target_troop"),
],
"We need you to attack and defeat {s7}. This will not be an easy task, and that outsider would damage {his/her} relationship with the {s10}s, but we would be very grateful. We could not acknowledge a connection with that outsider, but we could be sure that {he/she} would be handsomely rewarded... Could you do this?",
"merchant_quest_retaliate_confirm",[]],
[anyone|plyr,"merchant_quest_retaliate_confirm", [], "Aye, I can do it.", "merchant_quest_track_bandits_brief", [
# (quest_set_slot, "qst_retaliate_for_border_incident", slot_quest_target_troop, "$g_target_leader"),
# (quest_set_slot, "qst_retaliate_for_border_incident", slot_quest_target_faction, "$g_target_faction"),
(str_store_faction_name, s11, "$g_encountered_party_faction"),
(setup_quest_text, "qst_retaliate_for_border_incident"),
(str_store_string, s2, "str_track_down_s7_and_defeat_him_defusing_calls_for_war_within_the_s11"),
(call_script, "script_start_quest", "qst_retaliate_for_border_incident", "$g_talk_troop"),
]],
[anyone|plyr,"merchant_quest_retaliate_confirm", [], "I would prefer not to get mixed up in such things", "merchant_pretalk", [
(quest_set_slot, "qst_retaliate_for_border_incident", slot_quest_dont_give_again_remaining_days, 5),
]],
[anyone,"destroy_lair_quest_brief", [
(eq,"$random_quest_no", "qst_destroy_bandit_lair"),
(quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
(party_get_template_id, ":bandit_type", ":bandit_lair"),
(eq, ":bandit_type", "pt_sea_raider_lair"),
],
"The raiders are likely to have laid up their ships in a well-concealed cove, somewhere along the coastline, preferably next to a small stream where they have some water. The best way to discover its location would be to find a group of sea raiders who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
[]],
[anyone,"destroy_lair_quest_brief", [
(eq,"$random_quest_no", "qst_destroy_bandit_lair"),
(quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
(party_get_template_id, ":bandit_type", ":bandit_lair"),
(eq, ":bandit_type", "pt_desert_bandit_lair"),
],
"Bandits such as these usually establish their hideouts in the foothills on the edge of the desert, often in a canyon near a spring. This gives them both water and concealment. The best way to discover its location would be to find a group of desert bandits who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
[]],
[anyone,"destroy_lair_quest_brief", [
(eq,"$random_quest_no", "qst_destroy_bandit_lair"),
(quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
(party_get_template_id, ":bandit_type", ":bandit_lair"),
(eq, ":bandit_type", "pt_mountain_bandit_lair"),
],
"Bandits such as these will usually establish a base in the highlands, often on an steep ledge where they have a view of the surrounding countryside. This makes them difficult to surprise. The best way to discover its location would be to find a group of mountain bandits who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
[]],
[anyone,"destroy_lair_quest_brief", [
(eq,"$random_quest_no", "qst_destroy_bandit_lair"),
(quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
(party_get_template_id, ":bandit_type", ":bandit_lair"),
(eq, ":bandit_type", "pt_forest_bandit_lair"),
],
"Bandits such as these will usually set up their encampments deep in the woods, sometimes in the middle of a swamp. The best way to discover its location would be to find a group of forest bandits who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
[]],
[anyone,"destroy_lair_quest_brief", [
(eq,"$random_quest_no", "qst_destroy_bandit_lair"),
(quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
(party_get_template_id, ":bandit_type", ":bandit_lair"),
(eq, ":bandit_type", "pt_steppe_bandit_lair"),
],
"Bandits such as these will usually set up their encampments in the woodland on the steppe, where they have some concealment. The best way to discover its location would be to find a group of steppe bandits who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
[]],
[anyone,"destroy_lair_quest_brief", [
(eq,"$random_quest_no", "qst_destroy_bandit_lair"),
(quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
(party_get_template_id, ":bandit_type", ":bandit_lair"),
(eq, ":bandit_type", "pt_taiga_bandit_lair"),
],
"Bandits such as these will usually set up their encampments deep in the woods. The best way to discover its location would be to find a group of tundra bandits who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
[]],
[anyone|plyr,"merchant_quest_track_bandit_lair_choice", [], "Aye, I'll do it.", "merchant_quest_destroy_lair_brief", [
(quest_get_slot, ":target_party", "qst_destroy_bandit_lair", slot_quest_target_party),
(party_set_flags, ":target_party", pf_quest_party, 1),
# (quest_set_slot, "qst_track_down_bandits", slot_quest_target_party, "$g_bandit_party_for_bounty"), #WHY IS THIS COMMENTED OUT?
(quest_set_slot, "qst_destroy_bandit_lair", slot_quest_giver_troop, "$g_talk_troop"),
(quest_set_slot, "qst_destroy_bandit_lair", slot_quest_giver_center, "$g_encountered_party"),
(str_store_troop_name_link, s11, "$g_talk_troop"),
(str_store_party_name, s9, ":target_party"),
(setup_quest_text, "qst_destroy_bandit_lair"),
(str_store_string, s2, "str_bandit_lair_quest_description"),
(call_script, "script_start_quest", "qst_destroy_bandit_lair", "$g_talk_troop"),
]],
[anyone|plyr,"merchant_quest_track_bandit_lair_choice", [], "I'm afraid I can't take the job at the moment.", "lord_pretalk",[
(quest_set_slot, "qst_destroy_bandit_lair", slot_quest_dont_give_again_remaining_days, 1),
]],
[anyone,"merchant_quest_destroy_lair_brief", [
], "Very good. We will await word of your success.", "close_window",
[
(assign, "$g_leave_encounter", 1),
]],
[anyone,"merchant_quest_requested", [
(eq,"$random_merchant_quest_no", "qst_track_down_bandits"),
], "We have heard that {s4}, some travellers on the road {reg4?to:from} {s5} were attacked by {s7}.", "merchant_quest_brief",
[
(call_script,"script_merchant_road_info_to_s42", "$g_encountered_party"),
(assign, "$g_bandit_party_for_bounty", reg0),
(assign, ":origin", reg1),
(assign, ":destination", reg2),
(assign, ":hours_ago", reg3),
(try_begin),
(lt, ":hours_ago", 24),
(str_store_string, s4, "str_a_short_while_ago"),
(else_try),
(lt, ":hours_ago", 48),
(str_store_string, s4, "str_one_day_ago"),
(else_try),
(lt, ":hours_ago", 72),
(str_store_string, s4, "str_two_days_day_ago"),
(else_try),
(lt, ":hours_ago", 144),
(str_store_string, s4, "str_earlier_this_week"),
(else_try),
(str_store_string, s4, "str_about_a_week_ago"),
(try_end),
(try_begin),
(eq, ":origin", "$g_encountered_party"),
(str_store_party_name, s5, ":destination"),
(assign, reg4, 0),
(else_try),
(eq, ":destination", "$g_encountered_party"),
(str_store_party_name, s5, ":origin"),
(assign, reg4, 1),
(try_end),
(str_store_party_name, s7, "$g_bandit_party_for_bounty"),
###
(quest_set_slot, "qst_track_down_bandits", slot_quest_target_party, "$g_bandit_party_for_bounty"),
]],
[anyone,"merchant_quest_brief", [
(eq,"$random_merchant_quest_no", "qst_track_down_bandits"),
(quest_get_slot, ":target_party", "qst_track_down_bandits", slot_quest_target_party),
(str_store_party_name, s4, ":target_party"),
],
"We would like you to track these {s4} down. The merchants of the town were able to get a description of their leader, and have put together a bounty. If you can hunt them down and destroy them, we'll make it worth your while...", "merchant_quest_track_bandits_choice",
[]],
[anyone|plyr,"merchant_quest_track_bandits_choice", [], "Aye, I'll do it.", "merchant_quest_track_bandits_brief", [
(assign, "$merchant_offered_quest", 0),
(assign,"$merchant_quest_last_offerer", "$g_talk_troop"),
(quest_get_slot, ":target_party", "qst_track_down_bandits", slot_quest_target_party),
(party_set_flags, ":target_party", pf_quest_party, 1),
# (quest_set_slot, "qst_track_down_bandits", slot_quest_target_party, "$g_bandit_party_for_bounty"), #WHY IS THIS COMMENTED OUT?
(quest_set_slot, "qst_track_down_bandits", slot_quest_giver_troop, "$g_talk_troop"),
(quest_set_slot, "qst_track_down_bandits", slot_quest_giver_center, "$g_encountered_party"),
(str_store_party_name_link, s8, "$g_encountered_party"),
(str_store_party_name, s9, ":target_party"),
(setup_quest_text, "qst_track_down_bandits"),
(str_store_string, s2, "str_track_down_the_s9_who_attacked_travellers_near_s8_then_report_back_to_the_town"),
(call_script, "script_start_quest", "qst_track_down_bandits", "$g_talk_troop"),
]],
[anyone,"merchant_quest_track_bandits_brief", [
], "Very good. The band may not have lingered long in the area, but chances are that they will be spotted by other travellers on the road.", "close_window",
[
(assign, "$g_leave_encounter", 1),
]],
[anyone|plyr,"merchant_quest_track_bandits_choice", [], "I'm afraid I can't take the job at the moment.", "merchant_quest_stall",[
(quest_set_slot, "qst_track_down_bandits", slot_quest_dont_give_again_remaining_days, 1),
]],
#Random quests begin here. Deliver wine:
[anyone,"merchant_quest_requested", [(eq,"$random_merchant_quest_no","qst_deliver_wine"),], "You're looking for a job?\
Actually I was looking for someone to deliver some {s4}.\
Perhaps you can do that...", "merchant_quest_brief",
[(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(str_store_item_name, s4, ":quest_target_item"),
]],
[anyone,"merchant_quest_brief", [(eq,"$random_merchant_quest_no","qst_deliver_wine")],
"I have a cargo of {s6} that needs to be delivered to the tavern in {s4}.\
If you can take {reg5} units of {s6} to {s4} in 7 days, you may earn {reg8} denars.\
What do you say?", "merchant_quest_brief_deliver_wine",
[(quest_get_slot, reg5, "qst_deliver_wine", slot_quest_target_amount),
(quest_get_slot, reg8, "qst_deliver_wine", slot_quest_gold_reward),
(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(quest_get_slot, ":quest_target_center", "qst_deliver_wine", slot_quest_target_center),
(str_store_troop_name, s9, "$g_talk_troop"),
(str_store_party_name_link, s3, "$g_encountered_party"),
(str_store_party_name_link, s4, ":quest_target_center"),
(str_store_item_name, s6, ":quest_target_item"),
(setup_quest_text,"qst_deliver_wine"),
(str_store_string, s2, "@{s9} of {s3} asked you to deliver {reg5} units of {s6} to the tavern in {s4} in 7 days."),
#s2 should not be changed until the decision is made
]],
[anyone|plyr,"merchant_quest_brief_deliver_wine", [(store_free_inventory_capacity,":capacity"),
(quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
(ge, ":capacity", ":quest_target_amount"),
],
"Alright. I will make the delivery.", "merchant_quest_taken",
[(quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(troop_add_items, "trp_player", ":quest_target_item",":quest_target_amount"),
(call_script, "script_start_quest", "qst_deliver_wine", "$g_talk_troop"),
]],
[anyone|plyr,"merchant_quest_brief_deliver_wine", [], "I am afraid I can't carry all that cargo now.", "merchant_quest_stall",[]],
#escort merchant caravan:
[anyone,"merchant_quest_requested", [(eq,"$random_merchant_quest_no","qst_escort_merchant_caravan")], "You're looking for a job?\
Actually I was looking for someone to escort a caravan.\
Perhaps you can do that...", "merchant_quest_brief",
[]],
[anyone,"merchant_quest_brief", [(eq, "$random_merchant_quest_no", "qst_escort_merchant_caravan")],
"I am going to send a caravan of goods to {s8}.\
However with all those bandits and deserters on the roads, I don't want to send them out without an escort.\
If you can lead that caravan to {s8} in 15 days, you will earn {reg8} denars.\
Of course your party needs to be at least {reg4} strong to offer them any protection.", "escort_merchant_caravan_quest_brief",
[(quest_get_slot, reg8, "qst_escort_merchant_caravan", slot_quest_gold_reward),
(quest_get_slot, reg4, "qst_escort_merchant_caravan", slot_quest_target_amount),
(quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
(str_store_party_name, s8, ":quest_target_center"),
]],
[anyone|plyr,"escort_merchant_caravan_quest_brief", [(store_party_size_wo_prisoners, ":party_size", "p_main_party"),
(quest_get_slot, ":quest_target_amount", "qst_escort_merchant_caravan", slot_quest_target_amount),
(ge,":party_size",":quest_target_amount"),
],
"Alright. I will escort the caravan.", "merchant_quest_taken",
[(quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
(set_spawn_radius, 1),
(spawn_around_party,"$g_encountered_party","pt_merchant_caravan"),
(assign, ":quest_target_party", reg0),
(party_set_ai_behavior, ":quest_target_party", ai_bhvr_track_party),
(party_set_ai_object, ":quest_target_party", "p_main_party"),
(party_set_flags, ":quest_target_party", pf_default_behavior, 0),
(quest_set_slot, "qst_escort_merchant_caravan", slot_quest_target_party, ":quest_target_party"),
(quest_set_slot, "qst_escort_merchant_caravan", slot_quest_current_state, 0),
(str_store_party_name_link, s8, ":quest_target_center"),
(setup_quest_text, "qst_escort_merchant_caravan"),
(str_store_string, s2, "@Escort the merchant caravan to the town of {s8}."),
(call_script, "script_start_quest", "qst_escort_merchant_caravan", "$g_talk_troop"),
]],
[anyone|plyr,"escort_merchant_caravan_quest_brief", [(store_party_size_wo_prisoners, ":party_size", "p_main_party"),
(quest_get_slot, ":quest_target_amount", "qst_escort_merchant_caravan", slot_quest_target_amount),
(lt,":party_size",":quest_target_amount"),],
"I am afraid I don't have that many soldiers with me.", "merchant_quest_stall",[]],
[anyone|plyr,"escort_merchant_caravan_quest_brief", [(store_party_size_wo_prisoners, ":party_size", "p_main_party"),
(quest_get_slot, ":quest_target_amount", "qst_escort_merchant_caravan", slot_quest_target_amount),
(ge,":party_size",":quest_target_amount"),],
"Sorry. I can't do that right now", "merchant_quest_stall",[]],
[party_tpl|pt_merchant_caravan,"start", [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
(eq,"$g_encountered_party",":quest_target_party"),
(quest_slot_eq,"qst_escort_merchant_caravan", slot_quest_current_state, 2),
],
"We can cover the rest of the way ourselves. Thanks.", "close_window",[(assign, "$g_leave_encounter", 1)]],
[party_tpl|pt_merchant_caravan,"start", [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
(eq,"$g_encountered_party",":quest_target_party"),
(quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
(store_distance_to_party_from_party, ":dist", ":quest_target_center",":quest_target_party"),
(lt,":dist",4),
(quest_slot_eq, "qst_escort_merchant_caravan", slot_quest_current_state, 1),
],
"Well, we have almost reached {s21}. We can cover the rest of the way ourselves.\
Here's your pay... {reg14} denars.\
Thanks for escorting us. Good luck.", "close_window",[(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
(quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
(quest_get_slot, ":quest_giver_center", "qst_escort_merchant_caravan", slot_quest_giver_center),
(quest_get_slot, ":quest_gold_reward", "qst_escort_merchant_caravan", slot_quest_gold_reward),
(party_set_ai_behavior, ":quest_target_party", ai_bhvr_travel_to_party),
(party_set_ai_object, ":quest_target_party", ":quest_target_center"),
(party_set_flags, ":quest_target_party", pf_default_behavior, 0),
(str_store_party_name, s21, ":quest_target_center"),
(call_script, "script_change_player_relation_with_center", ":quest_giver_center", 1),
(call_script, "script_end_quest","qst_escort_merchant_caravan"),
(quest_set_slot, "qst_escort_merchant_caravan", slot_quest_current_state, 2),
(call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
(assign, ":xp_reward", ":quest_gold_reward"),
(val_mul, ":xp_reward", 5),
(val_add, ":xp_reward", 100),
(add_xp_as_reward, ":xp_reward"),
(call_script, "script_change_troop_renown", "trp_player", 2),
(assign, reg14, ":quest_gold_reward"),
(assign, "$g_leave_encounter", 1),
]],
[party_tpl|pt_merchant_caravan,"start", [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
(eq,"$g_encountered_party",":quest_target_party"),
(quest_slot_eq, "qst_escort_merchant_caravan", slot_quest_current_state, 0),
],
"Greetings. You must be our escort, right?", "merchant_caravan_intro_1",[(quest_set_slot, "qst_escort_merchant_caravan", slot_quest_current_state, 1),]],
[anyone|plyr,"merchant_caravan_intro_1", [], "Yes. My name is {playername}. I will lead you to {s1}.",
"merchant_caravan_intro_2",[(quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
(str_store_party_name, s1, ":quest_target_center"),
]],
[anyone,"merchant_caravan_intro_2", [], "Well, It is good to know we won't travel alone. What do you want us to do now?", "escort_merchant_caravan_talk",[]],
[party_tpl|pt_merchant_caravan,"start", [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
(eq, "$g_encountered_party", ":quest_target_party"),
],
"Eh. We've made it this far... What do you want us to do?", "escort_merchant_caravan_talk",[]],
[anyone|plyr,"escort_merchant_caravan_talk", [], "You follow my lead. I'll take you through a safe route.", "merchant_caravan_follow_lead",[]],
[anyone,"merchant_caravan_follow_lead", [], "Alright. We'll be right behind you.", "close_window",[(assign, "$escort_merchant_caravan_mode", 0),
(assign, "$g_leave_encounter", 1)]],
[anyone|plyr,"escort_merchant_caravan_talk", [], "You stay here for a while. I'll go ahead and check the road.", "merchant_caravan_stay_here",[]],
[anyone,"merchant_caravan_stay_here", [], "Alright. We'll be waiting here for you.", "close_window",[(assign, "$escort_merchant_caravan_mode", 1),
(assign, "$g_leave_encounter", 1)]],
# [anyone|plyr,"escort_merchant_caravan_talk", [], "You go ahead to {s1}. I'll catch up with you.", "merchant_caravan_go_to_destination",[]],
# [anyone,"merchant_caravan_go_to_destination", [], "Alright. But stay close.", "close_window",[[assign,"escort_merchant_caravan_mode",2]]],
# Troublesome bandits:
[anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_troublesome_bandits")],
"Actually, I was looking for an able adventurer like you.\
There's this group of particularly troublesome bandits.\
They have infested the vicinity of our town and are preying on my caravans.\
They have avoided all the soldiers and the militias up to now.\
If someone doesn't stop them soon, I am going to be ruined...", "merchant_quest_brief",
[]],
[anyone,"merchant_quest_brief", [(eq,"$random_merchant_quest_no", "qst_troublesome_bandits")],
"I will pay you {reg8} denars if you hunt down those troublesome bandits.\
It's dangerous work. But I believe that you are the {man/one} for it.\
What do you say?", "troublesome_bandits_quest_brief",[(quest_get_slot, reg8, "qst_troublesome_bandits", slot_quest_gold_reward),
]],
[anyone|plyr,"troublesome_bandits_quest_brief", [],
"Very well. I will hunt down those bandits.", "merchant_quest_taken_bandits",
[(set_spawn_radius,7),
(quest_get_slot, ":quest_giver_center", "qst_troublesome_bandits", slot_quest_giver_center),
(spawn_around_party,":quest_giver_center","pt_troublesome_bandits"),
(quest_set_slot, "qst_troublesome_bandits", slot_quest_target_party, reg0),
(store_num_parties_destroyed,"$qst_troublesome_bandits_eliminated","pt_troublesome_bandits"),
(store_num_parties_destroyed_by_player, "$qst_troublesome_bandits_eliminated_by_player", "pt_troublesome_bandits"),
(str_store_troop_name, s9, "$g_talk_troop"),
(str_store_party_name_link, s4, "$g_encountered_party"),
(setup_quest_text,"qst_troublesome_bandits"),
(str_store_string, s2, "@Merchant {s9} of {s4} asked you to hunt down the troublesome bandits in the vicinity of the town."),
(call_script, "script_start_quest", "qst_troublesome_bandits", "$g_talk_troop"),
]],
[anyone,"merchant_quest_taken_bandits", [], "You will? Splendid. Good luck to you.", "close_window",
[]],
[anyone|plyr,"troublesome_bandits_quest_brief", [],
"Sorry. I don't have time for this right now.", "merchant_quest_stall",[]],
# Kidnapped girl:
[anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_kidnapped_girl")],
"Actually, I was looking for a reliable {man/helper} that can undertake an important mission.\
A group of bandits have kidnapped the daughter of a friend of mine and are holding her for ransom.\
My friend is ready to pay them, but we still need\
someone to take the money to those rascals and bring the girl back to safety.", "merchant_quest_brief",
[]],
[anyone,"merchant_quest_brief", [(eq, "$random_merchant_quest_no", "qst_kidnapped_girl")],
"The amount the bandits ask as ransom is {reg12} denars.\
I will give you that money once you accept to take the quest.\
You have 15 days to take the money to the bandits who will be waiting near the village of {s4}.\
Those bastards said that they are going to kill the poor girl if they don't get the money by that time.\
You will get your pay of {reg8} denars when you bring the girl safely back here.",
"kidnapped_girl_quest_brief",[(quest_get_slot, ":quest_target_center", "qst_kidnapped_girl", slot_quest_target_center),
(str_store_party_name, s4, ":quest_target_center"),
(quest_get_slot, reg8, "qst_kidnapped_girl", slot_quest_gold_reward),
(quest_get_slot, reg12, "qst_kidnapped_girl", slot_quest_target_amount),
]],
[anyone|plyr,"kidnapped_girl_quest_brief", [],
"All right. I will take the ransom money to the bandits and bring back the girl.",
"kidnapped_girl_quest_taken",[(set_spawn_radius, 4),
(quest_get_slot, ":quest_target_center", "qst_kidnapped_girl", slot_quest_target_center),
(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
(spawn_around_party,":quest_target_center","pt_bandits_awaiting_ransom"),
(assign, ":quest_target_party", reg0),
(quest_set_slot, "qst_kidnapped_girl", slot_quest_target_party, ":quest_target_party"),
(party_set_ai_behavior, ":quest_target_party", ai_bhvr_hold),
(party_set_ai_object, ":quest_target_party", "p_main_party"),
(party_set_flags, ":quest_target_party", pf_default_behavior, 0),
(call_script, "script_troop_add_gold", "trp_player", ":quest_target_amount"),
(assign, reg12, ":quest_target_amount"),
(str_store_troop_name, s1, "$g_talk_troop"),
(str_store_party_name_link, s4, "$g_encountered_party"),
(str_store_party_name_link, s3, ":quest_target_center"),
(setup_quest_text, "qst_kidnapped_girl"),
(str_store_string, s2, "@Guildmaster of {s4} gave you {reg12} denars to pay the ransom of a girl kidnapped by bandits.\
You are to meet the bandits near {s3} and pay them the ransom fee.\
After that you are to bring the girl back to {s4}."),
(call_script, "script_start_quest", "qst_kidnapped_girl", "$g_talk_troop"),
]],
[anyone,"kidnapped_girl_quest_taken", [], "Good. I knew we could trust you at this.\
Here is the ransom money, {reg12} denars.\
Count it before taking it.\
And please, don't attempt to do anything rash.\
Keep in mind that the girl's well being is more important than anything else...", "close_window",
[]],
[anyone|plyr,"kidnapped_girl_quest_brief", [],
"Sorry. I don't have time for this right now.", "merchant_quest_stall",[]],
[trp_kidnapped_girl,"start",
[
(eq, "$talk_context", tc_entering_center_quest_talk),
],
"Thank you so much for bringing me back!\
I can't wait to see my family. Good-bye.",
"close_window",
[(remove_member_from_party, "trp_kidnapped_girl"),
(quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 4),
]],
[trp_kidnapped_girl|plyr,"kidnapped_girl_liberated_map", [], "Yes. Come with me. We are going home.", "kidnapped_girl_liberated_map_2a",[]],
[trp_kidnapped_girl,"kidnapped_girl_liberated_map_2a", [(neg|party_can_join)], "Unfortunately. You do not have room in your party for me.", "close_window",[(assign, "$g_leave_encounter",1)]],
[trp_kidnapped_girl,"kidnapped_girl_liberated_map_2a", [], "Oh really? Thank you so much!",
"close_window", [(party_join),
(quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 3),
(assign, "$g_leave_encounter",1)]],
[trp_kidnapped_girl|plyr,"kidnapped_girl_liberated_map", [], "Wait here a while longer. I'll come back for you.", "kidnapped_girl_liberated_map_2b",[]],
[trp_kidnapped_girl,"kidnapped_girl_liberated_map_2b", [], "Oh, please {sir/madam}, do not leave me here all alone!", "close_window",[(assign, "$g_leave_encounter",1)]],
[trp_kidnapped_girl,"start", [],
"Oh {sir/madam}. Thank you so much for rescuing me. Will you take me to my family now?", "kidnapped_girl_liberated_map",[]],
[trp_kidnapped_girl|plyr,"kidnapped_girl_liberated_battle", [], "Yes. Come with me. We are going home.", "kidnapped_girl_liberated_battle_2a",[]],
[trp_kidnapped_girl,"kidnapped_girl_liberated_battle_2a", [(neg|hero_can_join, "p_main_party")], "Unfortunately. You do not have room in your party for me.", "kidnapped_girl_liberated_battle_2b",[]],
[trp_kidnapped_girl,"kidnapped_girl_liberated_battle_2a", [], "Oh really? Thank you so much!",
"close_window",[(party_add_members, "p_main_party","trp_kidnapped_girl",1),
(quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 3),
]],
[trp_kidnapped_girl|plyr,"kidnapped_girl_liberated_battle", [], "Wait here a while longer. I'll come back for you.", "kidnapped_girl_liberated_battle_2b",[]],
[trp_kidnapped_girl,"kidnapped_girl_liberated_battle_2b", [], "Oh, please {sir/madam}, do not leave me here all alone!",
"close_window", [(add_companion_party,"trp_kidnapped_girl"),
(assign, "$g_leave_encounter",1)]],
[trp_kidnapped_girl,"start", [], "Can I come with you now?", "kidnapped_girl_liberated_map",[]],
[party_tpl|pt_bandits_awaiting_ransom,"start", [(quest_slot_eq, "qst_kidnapped_girl", slot_quest_current_state, 0),],
"Are you the one that brought the ransom?\
Quick, give us the money now.", "bandits_awaiting_ransom_intro_1",[(quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 1),]],
[party_tpl|pt_bandits_awaiting_ransom,"start", [(quest_slot_eq, "qst_kidnapped_girl", slot_quest_current_state, 1),],
"You came back?\
Quick, give us the money now.", "bandits_awaiting_ransom_intro_1",[]],
[party_tpl|pt_bandits_awaiting_ransom|plyr, "bandits_awaiting_ransom_intro_1", [(store_troop_gold, ":cur_gold"),
(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
(ge, ":cur_gold", ":quest_target_amount")
],
"Here, take the money. Just set the girl free.", "bandits_awaiting_ransom_pay",[]],
[party_tpl|pt_bandits_awaiting_ransom, "bandits_awaiting_ransom_pay", [],
"Heh. You've brought the money all right.\
You can take the girl now.\
It was a pleasure doing business with you...", "close_window",
[(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
(quest_get_slot, ":quest_target_party", "qst_kidnapped_girl", slot_quest_target_party),
(quest_get_slot, ":quest_target_center", "qst_kidnapped_girl", slot_quest_target_center),
(troop_remove_gold, "trp_player", ":quest_target_amount"),
(remove_member_from_party, "trp_kidnapped_girl", ":quest_target_party"),
(set_spawn_radius, 1),
(spawn_around_party, ":quest_target_party", "pt_kidnapped_girl"),
(assign, ":girl_party", reg0),
(party_set_ai_behavior, ":girl_party", ai_bhvr_hold),
(party_set_flags, ":girl_party", pf_default_behavior, 0),
(quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 2),
(party_set_ai_behavior, ":quest_target_party", ai_bhvr_travel_to_party),
(party_set_ai_object, ":quest_target_party", ":quest_target_center"),
(party_set_flags, ":quest_target_party", pf_default_behavior, 0),
(add_gold_to_party, ":quest_target_amount", ":quest_target_party"),
(assign, "$g_leave_encounter",1),
]],
[anyone|plyr, "bandits_awaiting_ransom_intro_1", [],
"No way! You release the girl first.", "bandits_awaiting_ransom_b",[]],
[anyone, "bandits_awaiting_ransom_b", [],
"You fool! Stop playing games and give us the money! ", "bandits_awaiting_ransom_b2",[]],
[anyone|plyr, "bandits_awaiting_ransom_b2", [(store_troop_gold, ":cur_gold"),
(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
(ge, ":cur_gold", ":quest_target_amount")],
"All right. Here's your money. Let the girl go now.", "bandits_awaiting_ransom_pay",[]],
[anyone|plyr, "bandits_awaiting_ransom_b2", [],
"I had left the money in a safe place. Let me go fetch it.", "bandits_awaiting_ransom_no_money",[]],
[anyone, "bandits_awaiting_ransom_no_money", [],
"Are you testing our patience or something? Go and bring that money here quickly.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone|plyr, "bandits_awaiting_ransom_b2", [],
"I have no intention to pay you anything. I demand that you release the girl now!", "bandits_awaiting_ransom_fight",[]],
[anyone, "bandits_awaiting_ransom_fight", [],
"You won't be demanding anything when you're dead.", "close_window",[(encounter_attack),]],
[party_tpl|pt_bandits_awaiting_ransom,"start", [(quest_slot_ge, "qst_kidnapped_girl", slot_quest_current_state, 2),],
"What's it? You have given us the money. We have no more business.", "bandits_awaiting_remeet",[]],
[anyone|plyr,"bandits_awaiting_remeet", [],
"Sorry to bother you. I'll be on my way now.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone|plyr,"bandits_awaiting_remeet", [],
"We have one more business. You'll give the money back to me.", "bandits_awaiting_remeet_2",[]],
[anyone,"bandits_awaiting_remeet_2", [],
"Oh, that business! Of course. Let us get down to it.", "close_window",[(encounter_attack)]],
[party_tpl|pt_kidnapped_girl,"start", [],
"Oh {sir/madam}. Thank you so much for rescuing me. Will you take me to my family now?", "kidnapped_girl_encounter_1",[]],
[anyone|plyr,"kidnapped_girl_encounter_1", [], "Yes. Come with me. I'll take you home.", "kidnapped_girl_join",[]],
[anyone,"kidnapped_girl_join", [(neg|party_can_join)], "Unfortunately. You do not have room in your party for me.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone,"kidnapped_girl_join", [], "Oh, thank you so much!",
"close_window",[(party_join),
(quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 3),
(assign, "$g_leave_encounter",1)]],
[anyone|plyr,"kidnapped_girl_encounter_1", [], "Wait here a while longer. I'll come back for you.", "kidnapped_girl_wait",[]],
[anyone,"kidnapped_girl_wait", [], "Oh, please {sir/madam}, do not leave me here all alone!", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone|plyr,"merchant_quest_about_job_2", [(store_partner_quest, ":partner_quest"),
(eq, ":partner_quest", "qst_kidnapped_girl"),
(quest_slot_eq, "qst_kidnapped_girl", slot_quest_current_state, 3),
(neg|main_party_has_troop, "trp_kidnapped_girl")],
"Unfortunately I lost the girl on the way here...", "lost_kidnapped_girl",[]],
[anyone,"lost_kidnapped_girl", [],
"Oh no! How am I going to tell this to my friend?", "lost_kidnapped_girl_2",[]],
[anyone|plyr,"lost_kidnapped_girl_2", [],
"I'm sorry. I could do nothing about it.", "lost_kidnapped_girl_3",[]],
[anyone,"lost_kidnapped_girl_3", [],
"You let me down {playername}. I had trusted you.\
I will let people know of your incompetence at this task.\
Also, I want back that {reg8} denars I gave you as the ransom fee.", "lost_kidnapped_girl_4",
[(quest_get_slot, reg8, "qst_kidnapped_girl", slot_quest_target_amount),
(try_for_parties, ":cur_party"),
(party_count_members_of_type, ":num_members", ":cur_party", "trp_kidnapped_girl"),
(gt, ":num_members", 0),
(party_remove_members, ":cur_party", "trp_kidnapped_girl", 1),
(party_remove_prisoners, ":cur_party", "trp_kidnapped_girl", 1),
(try_end),
(call_script, "script_end_quest", "qst_kidnapped_girl"),
(call_script, "script_change_troop_renown", "trp_player", -5),
]],
[anyone|plyr, "lost_kidnapped_girl_4", [(store_troop_gold,":gold"),
(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
(ge,":gold",":quest_target_amount"),
],
"Of course. Here you are...", "merchant_quest_about_job_5a",[(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
(troop_remove_gold, "trp_player",":quest_target_amount"),
]],
[anyone,"merchant_quest_about_job_5a", [],
"At least you have the decency to return the money.", "close_window",[]],
[anyone|plyr,"lost_kidnapped_girl_4", [],
"Sorry. I don't have that amount with me.", "merchant_quest_about_job_5b",[]],
[anyone,"merchant_quest_about_job_5b", [],
"Do you expect me to believe that? You are going to pay that ransom fee back! Go and bring the money now!",
"close_window",[(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
(val_add, "$debt_to_merchants_guild", ":quest_target_amount"),
]],
# Give us the money now. Quick.
# Here, take the money. Just set the girl free.
# Heh, It was a pleasure doing business with you.
# You set the girl free first. You'll have the money afterwards.
# Stop playing games.
#persuade_lords_to_make_peace
[anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_persuade_lords_to_make_peace"),
(quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
(quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
(quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
(str_store_troop_name_link, s12, ":quest_object_troop"),
(str_store_troop_name_link, s13, ":quest_target_troop"),
(str_store_faction_name_link, s14, ":quest_target_faction"),
(str_store_faction_name_link, s15, "$g_encountered_party_faction"),],
"This war between {s15} and {s14} has brought our town to the verge of ruin.\
Our caravans get raided before they can reach their destination.\
Our merchants are afraid to leave the safety of the town walls.\
And as if those aren't enough, the taxes to maintain the war take away the last bits of our savings.\
If peace does not come soon, we can not hold on for much longer.", "merchant_quest_persuade_peace_1",
[]],
[anyone|plyr,"merchant_quest_persuade_peace_1", [], "You are right. But who can stop this madness called war?", "merchant_quest_brief",[]],
[anyone|plyr,"merchant_quest_persuade_peace_1", [], "It is your duty to help the nobles in their war effort. You shouldn't complain about it.", "merchant_quest_persuade_peace_reject",[]],
[anyone,"merchant_quest_persuade_peace_reject", [], "Hah. The nobles fight their wars for their greed and their dreams of glory.\
And it is poor honest folk like us who have to bear the real burden.\
But you obviously don't want to hear about that.", "close_window",[]],
[anyone,"merchant_quest_brief", [(eq,"$random_merchant_quest_no","qst_persuade_lords_to_make_peace")],
"There have been attempts to reconcile the two sides and reach a settlement.\
However, there are powerful lords on both sides whose interests lie in continuing the war.\
These men urge all others not to heed to the word of sensible men, but to keep fighting.\
While these leaders remain influential, no peace settlement can be reached.", "merchant_quest_persuade_peace_3",[]],
[anyone|plyr,"merchant_quest_persuade_peace_3", [], "Who are these warmongers who block the way of peace?", "merchant_quest_persuade_peace_4",[]],
[anyone|plyr,"merchant_quest_persuade_peace_3", [], "Who are these lords you speak of?", "merchant_quest_persuade_peace_4",[]],
[anyone,"merchant_quest_persuade_peace_4", [], "They are {s12} from {s15} and {s13} from {s14}. Until they change their mind or lose their influence,\
there will be no chance of having peace between the two sides.", "merchant_quest_persuade_peace_5",[
(quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
(quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
(quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
(str_store_troop_name_link, s12, ":quest_object_troop"),
(str_store_troop_name_link, s13, ":quest_target_troop"),
(str_store_faction_name_link, s14, ":quest_target_faction"),
(str_store_faction_name_link, s15, "$g_encountered_party_faction"),
]],
[anyone|plyr,"merchant_quest_persuade_peace_5", [], "What can be done about this?", "merchant_quest_persuade_peace_6",[]],
[anyone|plyr,"merchant_quest_persuade_peace_5", [], "Alas, it seems nothing can be done about it.", "merchant_quest_persuade_peace_6",[]],
[anyone,"merchant_quest_persuade_peace_6", [], "There is a way to resolve the issue.\
A particularly determined person can perhaps persuade one or both of these lords to accept making peace.\
And even if that fails, it can be possible to see that these lords are defeated by force and taken prisoner.\
If they are captive, they will lose their influence and they can no longer oppose a settlement... What do you think? Can you do it?",
"merchant_quest_persuade_peace_7",[]],
[anyone|plyr,"merchant_quest_persuade_peace_7", [], "It seems difficult. But I will try.", "merchant_quest_persuade_peace_8",[]],
[anyone|plyr,"merchant_quest_persuade_peace_7", [], "If the price is right, I may.", "merchant_quest_persuade_peace_8",[]],
[anyone|plyr,"merchant_quest_persuade_peace_7", [], "Forget it. This is not my problem.", "merchant_quest_persuade_peace_8",[]],
[anyone,"merchant_quest_persuade_peace_8", [], "Most of the merchants in the town will gladly open up their purses to support such a plan.\
I think we can collect {reg12} denars between ourselves.\
We will be happy to reward you with that sum, if you can work this out.\
Convince {s12} and {s13} to accept a peace settlement,\
and if either of them proves too stubborn, make sure he falls captive and can not be ransomed until a peace deal is settled.",
"merchant_quest_persuade_peace_9",[
(quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
(quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
(str_store_troop_name_link, s12, ":quest_object_troop"),
(str_store_troop_name_link, s13, ":quest_target_troop"),
(quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
(assign, reg12, ":quest_reward")]],
[anyone|plyr,"merchant_quest_persuade_peace_9", [], "All right. I will do my best.", "merchant_quest_persuade_peace_10",[]],
[anyone|plyr,"merchant_quest_persuade_peace_9", [], "Sorry. I can not do this.", "merchant_quest_persuade_peace_no",[]],
[anyone,"merchant_quest_persuade_peace_10", [], "Excellent. You will have our blessings.\
I hope you can deal with those two old goats.\
We will be waiting and hoping for the good news.", "close_window",[
(str_store_party_name_link, s4, "$g_encountered_party"),
(quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
(quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
(quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
(quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
(assign, reg12, ":quest_reward"),
(str_store_troop_name_link, s12, ":quest_object_troop"),
(str_store_troop_name_link, s13, ":quest_target_troop"),
(str_store_faction_name_link, s14, ":quest_target_faction"),
(str_store_faction_name_link, s15, "$g_encountered_party_faction"),
(setup_quest_text,"qst_persuade_lords_to_make_peace"),
(str_store_string, s2, "@Guildmaster of {s4} promised you {reg12} denars if you can make sure that\
{s12} and {s13} no longer pose a threat to a peace settlement between {s15} and {s14}.\
In order to do that, you must either convince them or make sure they fall captive and remain so until a peace agreement is made."),
(call_script, "script_start_quest", "qst_persuade_lords_to_make_peace", "$g_talk_troop"),
(quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
(quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
(call_script, "script_report_quest_troop_positions", "qst_persuade_lords_to_make_peace", ":quest_object_troop", 3),
(call_script, "script_report_quest_troop_positions", "qst_persuade_lords_to_make_peace", ":quest_target_troop", 4),
]],
[anyone,"merchant_quest_persuade_peace_no", [], "Don't say no right away. Think about this for some time.\
If there is a {man/lady} who can manage to do this, it is you.",
"close_window",[]],
#deal with night bandits
[anyone,"merchant_quest_requested",
[
(eq, "$random_merchant_quest_no", "qst_deal_with_night_bandits"),
],
"Do I indeed! There's a group of bandits infesting the town, and I'm at the end of my rope as to how to deal with them.\
They've been ambushing and robbing townspeople under the cover of night,\
and then fading away quick as lightning when the guards finally show up. We've not been able to catch a one of them.\
They only attack lone people, never daring to show themselves when there's a group about.\
I need someone who can take on these bandits alone and win. That seems to be the only way of bringing them to justice.\
Are you up to the task?", "merchant_quest_deal_with_night_bandits",
[]],
[anyone,"merchant_quest_brief",
[
(eq,"$random_merchant_quest_no","qst_deal_with_night_bandits"),
],
"There's a group of bandits infesting the town, and I'm at the end of my rope as to how to deal with them.\
They've been ambushing and robbing townspeople under the cover of night,\
and then fading away quick as lightning when the guards finally show up. We've not been able to catch a one of them.\
They only attack lone people, never daring to show themselves when there's a group about.\
I need someone who can take on these bandits alone and win. That seems to be the only way of bringing them to justice.\
Are you up to the task?", "merchant_quest_deal_with_night_bandits",
[]],
[anyone|plyr,"merchant_quest_deal_with_night_bandits", [],
"Killing bandits? Why, certainly!",
"deal_with_night_bandits_quest_taken",
[
(str_store_party_name_link, s14, "$g_encountered_party"),
(setup_quest_text, "qst_deal_with_night_bandits"),
(str_store_string, s2, "@The Guildmaster of {s14} has asked you to deal with a group of bandits terrorising the streets of {s14}. They only come out at night, and only attack lone travellers on the streets."),
(call_script, "script_start_quest", "qst_deal_with_night_bandits", "$g_talk_troop"),
]],
[anyone|plyr, "merchant_quest_deal_with_night_bandits", [],
"My apologies, I'm not interested.", "merchant_quest_stall",[]],
[anyone,"deal_with_night_bandits_quest_taken", [], "That takes a weight off my shoulders, {playername}.\
You can expect a fine reward if you come back successful. Just don't get yourself killed, eh?", "mayor_pretalk",[]],
#move cattle herd
[anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_move_cattle_herd"),
(quest_get_slot, ":target_center", "qst_move_cattle_herd", slot_quest_target_center),
(str_store_party_name,s13,":target_center"),],
"One of the merchants here is looking for herdsmen to take his cattle to the market at {s13}.", "merchant_quest_brief",
[]],
[anyone,"merchant_quest_brief",
[
(eq,"$random_merchant_quest_no","qst_move_cattle_herd"),
(quest_get_slot, reg8, "qst_move_cattle_herd", slot_quest_gold_reward),
(quest_get_slot, ":target_center", "qst_move_cattle_herd", slot_quest_target_center),
(str_store_party_name, s13, ":target_center"),
],
"The cattle herd must be at {s13} within 30 days. Sooner is better, much better,\
but it must be absolutely no later than 30 days.\
If you can do that, I'd be willing to pay you {reg8} denars for your trouble. Interested?", "move_cattle_herd_quest_brief",
[]],
[anyone|plyr,"move_cattle_herd_quest_brief", [], "Aye, I can take the herd to {s13}.",
"move_cattle_herd_quest_taken",
[
(call_script, "script_create_cattle_herd", "$g_encountered_party", 0),
(quest_set_slot, "qst_move_cattle_herd", slot_quest_target_party, reg0),
(str_store_party_name_link, s10,"$g_encountered_party"),
(quest_get_slot, ":target_center", "qst_move_cattle_herd", slot_quest_target_center),
(str_store_party_name_link, s13, ":target_center"),
(quest_get_slot, reg8, "qst_move_cattle_herd", slot_quest_gold_reward),
(setup_quest_text, "qst_move_cattle_herd"),
(str_store_string, s2, "@Guildmaster of {s10} asked you to move a cattle herd to {s13}. You will earn {reg8} denars in return."),
(call_script, "script_start_quest", "qst_move_cattle_herd", "$g_talk_troop"),
]],
[anyone|plyr,"move_cattle_herd_quest_brief", [],
"I am sorry, but no.", "merchant_quest_stall",[]],
[anyone,"move_cattle_herd_quest_taken", [], "Splendid. You can find the herd right outside the town.\
After you take the animals to {s13}, return back to me and I will give you your pay.", "mayor_pretalk",[]],
#################################################
#################### Random merchant quests end
[anyone,"merchant_quest_requested", [], "I am afraid I can't offer you a job right now.", "mayor_pretalk",[]],
#Village elders
[anyone,"start", [(is_between,"$g_talk_troop",village_elders_begin,village_elders_end),
(store_partner_quest,":elder_quest"),
(eq,":elder_quest","qst_deliver_cattle"),
(check_quest_succeeded, ":elder_quest"),
(quest_get_slot, reg5, "qst_deliver_cattle", slot_quest_target_amount)],
"My good {sir/madam}. Our village is grateful for your help. Thanks to the {reg5} heads of cattle you have brought, we can now raise our own herd.", "village_elder_deliver_cattle_thank",
[(add_xp_as_reward, 400),
# (quest_get_slot, ":num_cattle", "qst_deliver_cattle", slot_quest_target_amount),
# (party_set_slot, "$current_town", slot_village_number_of_cattle, ":num_cattle"),
(call_script, "script_change_center_prosperity", "$current_town", 4),
(call_script, "script_change_player_relation_with_center", "$current_town", 5),
(call_script, "script_end_quest", "qst_deliver_cattle"),
#Troop commentaries begin
(call_script, "script_add_log_entry", logent_helped_peasants, "trp_player", "$current_town", -1, -1),
#Troop commentaries end
]],
[anyone,"village_elder_deliver_cattle_thank", [],
"My good {lord/lady}, please, is there anything I can do for you?", "village_elder_talk",[]],
## [anyone,"start",
## [
## (is_between, "$g_talk_troop", village_elders_begin, village_elders_end),
## (store_partner_quest, ":elder_quest"),
## (eq, ":elder_quest", "qst_train_peasants_against_bandits"),
## (check_quest_succeeded, ":elder_quest"),
## (quest_get_slot, reg5, "qst_train_peasants_against_bandits", slot_quest_target_amount)],
## "Oh, thank you so much for training our men. Now we may stand a chance against those accursed bandits if they come again.", "village_elder_train_peasants_against_bandits_thank",
## [
## (add_xp_as_reward, 400),
## (call_script, "script_change_player_relation_with_center", "$current_town", 5),
## (call_script, "script_end_quest", "qst_train_peasants_against_bandits"),
## (call_script, "script_add_log_entry", logent_helped_peasants, "trp_player", "$current_town", -1, -1),
## ]],
# [anyone,"village_elder_train_peasants_against_bandits_thank", [],
# "Now, good {sire/lady}, is there anything I can do for you?", "village_elder_talk",[]],
[anyone,"start", [(is_between,"$g_talk_troop", village_elders_begin, village_elders_end),(eq,"$g_talk_troop_met",0),
(str_store_party_name, s9, "$current_town")],
"Good day, {sir/madam}, and welcome to {s9}. I am the elder of this village.", "village_elder_talk",[]],
[anyone,"start", [(is_between,"$g_talk_troop", village_elders_begin, village_elders_end),(eq,"$g_talk_troop_met",0),
(str_store_party_name, s9, "$current_town"),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player")],
"Welcome to {s9}, my {lord/lady}. We were rejoiced by the news that you are the new {lord/lady} of our humble village.\
I am the village elder and I will be honoured to serve you in any way I can.", "village_elder_talk",[]],
[anyone ,"start", [(is_between,"$g_talk_troop",village_elders_begin,village_elders_end),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player")],
"{My lord/My lady}, you honour our humble village with your presence.", "village_elder_talk",[]],
[anyone ,"start", [(is_between,"$g_talk_troop",village_elders_begin,village_elders_end)],
"Good day, {sir/madam}.", "village_elder_talk",[]],
[anyone ,"village_elder_pretalk", [],
"Is there anything else I can do for you?", "village_elder_talk",[]],
[anyone|plyr,"village_elder_talk", [(check_quest_active, "qst_hunt_down_fugitive"),
(neg|check_quest_concluded, "qst_hunt_down_fugitive"),
(quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_target_center, "$current_town"),
(quest_get_slot, ":quest_target_dna", "qst_hunt_down_fugitive", slot_quest_target_dna),
(call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
(str_store_string, s4, s50),
],
"I am looking for a man by the name of {s4}. I was told he may be hiding here.", "village_elder_ask_fugitive",[]],
[anyone ,"village_elder_ask_fugitive", [(is_currently_night)],
"Strangers come and go to our village, {sir/madam}. But I doubt you'll run into him at this hour of the night. You would have better luck during the day.", "village_elder_pretalk",[]],
[anyone ,"village_elder_ask_fugitive", [],
"Strangers come and go to our village, {sir/madam}. If he is hiding here, you will surely find him if you look around.", "close_window",[]],
[anyone|plyr,"village_elder_talk", [(store_partner_quest,":elder_quest"),(ge,":elder_quest",0)],
"About the task you asked of me...", "village_elder_active_mission_1",[]],
[anyone|plyr,"village_elder_talk", [(ge, "$g_talk_troop_faction_relation", 0),(store_partner_quest,":elder_quest"),(lt,":elder_quest",0)],
"Do you have any tasks I can help you with?", "village_elder_request_mission_ask",[]],
[anyone|plyr,"village_elder_talk", [(party_slot_eq, "$current_town", slot_village_state, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),],
"I want to buy some supplies. I will pay with gold.", "village_elder_trade_begin",[]],
[anyone ,"village_elder_trade_begin", [], "Of course, {sir/madam}. Do you want to buy goods or cattle?", "village_elder_trade_talk",[]],
[anyone|plyr,"village_elder_trade_talk", [], "I want to buy food and supplies.", "village_elder_trade",[]],
[anyone ,"village_elder_trade", [],
"We have some food and other supplies in our storehouse. Come have a look.", "village_elder_pretalk",[(change_screen_trade, "$g_talk_troop"),]],
[anyone|plyr,"village_elder_trade_talk", [(party_slot_eq, "$current_town", slot_village_state, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(assign, ":quest_village", 0),
(try_begin),
(check_quest_active, "qst_deliver_cattle"),
(quest_slot_eq, "qst_deliver_cattle", slot_quest_target_center, "$current_town"),
(assign, ":quest_village", 1),
(try_end),
(eq, ":quest_village", 0),
],
"I want to buy some cattle.", "village_elder_buy_cattle",[]],
[anyone|plyr,"village_elder_trade_talk", [], "I changed my mind. I don't need to buy anything.", "village_elder_pretalk",[]],
[anyone|plyr,"village_elder_talk",
[
],
"Have you seen any enemies around here recently?", "village_elder_ask_enemies",[]],
[anyone,"village_elder_ask_enemies",
[
(assign, ":give_report", 0),
(party_get_slot, ":original_faction", "$g_encountered_party", slot_center_original_faction),
(store_relation, ":original_faction_relation", ":original_faction", "fac_player_supporters_faction"),
(try_begin),
(gt, ":original_faction_relation", 0),
(party_slot_ge, "$g_encountered_party", slot_center_player_relation, 0),
(assign, ":give_report", 1),
(else_try),
(party_slot_ge, "$g_encountered_party", slot_center_player_relation, 30),
(assign, ":give_report", 1),
(try_end),
(eq, ":give_report", 0),
],
"I am sorry, {sir/madam}. We have neither seen nor heard of any war parties in this area.", "village_elder_pretalk",
[]],
[anyone,"village_elder_ask_enemies",
[],
"Hmm. Let me think about it...", "village_elder_tell_enemies",
[
(assign, "$temp", 0),
]],
[anyone,"village_elder_tell_enemies",
[
(assign, ":target_hero_index", "$temp"),
(assign, ":end_cond", active_npcs_end),
(try_for_range, ":cur_troop", active_npcs_begin, ":end_cond"),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(gt, ":cur_party", 0),
(store_troop_faction, ":cur_faction", ":cur_troop"),
(store_relation, ":reln", ":cur_faction", "fac_player_supporters_faction"),
(lt, ":reln", 0),
(store_distance_to_party_from_party, ":dist", "$g_encountered_party", ":cur_party"),
(lt, ":dist", 10),
(call_script, "script_get_information_about_troops_position", ":cur_troop", 0),
(eq, reg0, 1), #Troop's location is known.
(val_sub, ":target_hero_index", 1),
(lt, ":target_hero_index", 0),
(assign, ":end_cond", 0),
(str_store_string, s2, "@He is not commanding any men at the moment."),
(assign, ":num_troops", 0),
(assign, ":num_wounded_troops", 0),
(party_get_num_companion_stacks, ":num_stacks", ":cur_party"),
(try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", ":cur_party", ":i_stack"),
(neg|troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size", ":cur_party", ":i_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":cur_party", ":i_stack"),
(val_add, ":num_troops", ":stack_size"),
(val_add, ":num_wounded_troops", ":num_wounded"),
(try_end),
(gt, ":num_troops", 0),
(call_script, "script_round_value", ":num_wounded_troops"),
(assign, reg1, reg0),
(call_script, "script_round_value", ":num_troops"),
(str_store_string, s2, "@He currently commands {reg0} men{reg1?, of which around {reg1} are wounded:}."),
(try_end),
(eq, ":end_cond", 0),
],
"{s1} {s2}", "village_elder_tell_enemies",
[
(val_add, "$temp", 1),
]],
[anyone,"village_elder_tell_enemies",
[(eq, "$temp", 0)],
"No, {sir/madam}. We haven't seen any war parties in this area for some time.", "village_elder_pretalk",
[]],
[anyone,"village_elder_tell_enemies",
[],
"Well, I guess that was all.", "village_elder_pretalk",
[]],
#(fire set up dialogs begin) Asking village elder to set up fire for making prison break easier.
[anyone|plyr,"village_elder_talk",
[
(party_get_slot, ":bound_center", "$current_town", slot_village_bound_center),
(assign, ":num_heroes_in_dungeon", 0),
(assign, ":num_heroes_given_parole", 0),
(party_get_num_prisoner_stacks, ":num_stacks", ":bound_center"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop",":bound_center",":i_stack"),
(troop_is_hero, ":stack_troop"),
(try_begin),
(call_script, "script_cf_prisoner_offered_parole", ":stack_troop"),
(party_add_members, "p_temp_party_2", ":stack_troop", 1),
(val_add, ":num_heroes_given_parole", 1),
(else_try),
(party_add_members, "p_temp_party", ":stack_troop", 1),
(val_add, ":num_heroes_in_dungeon", 1),
(try_end),
(try_end),
(ge, ":num_heroes_in_dungeon", 1),
],
"I need you to set a large fire on the outskirts of this village.", "village_elder_ask_set_fire",[]],
[anyone,"village_elder_ask_set_fire",
[
(eq, "$g_village_elder_did_not_liked_money_offered", 0),
(party_get_slot, ":bound_center", "$current_town", slot_village_bound_center),
(party_get_slot, ":fire_time", ":bound_center", slot_town_last_nearby_fire_time),
(store_current_hours, ":cur_time"),
(ge, ":fire_time", ":cur_time"),
],
"We have already agreed upon this, {sir/my lady}. I will do my best. You can trust me.", "close_window",[]],
[anyone,"village_elder_ask_set_fire",
[
(eq, "$g_village_elder_did_not_liked_money_offered", 0),
],
"A fire, {sir/madam}! Fires are dangerous! Why would you want such a thing?", "village_elder_ask_set_fire_1",[]],
[anyone,"village_elder_ask_set_fire", #elder did not accepted 100 denars before
[
(eq, "$g_village_elder_did_not_liked_money_offered", 1),
],
"I believe that we have already discussed this issue, {sir/my lady}.", "village_elder_ask_set_fire_5",[]],
[anyone,"village_elder_ask_set_fire", #elder did not accepted 100 and 200 denars before
[
(eq, "$g_village_elder_did_not_liked_money_offered", 2),
],
"We talked about this {sir/madam} before and your previous offers were low compared to risk you want me to take.", "village_elder_ask_set_fire_5",[]],
[anyone|plyr,"village_elder_ask_set_fire_1",[],
"I have my reasons, and you will have yours -- a purse of silver. Will you do it, or not?", "village_elder_ask_set_fire_2",[]],
[anyone|plyr,"village_elder_ask_set_fire_1",[],
"Given the risk you are taking, you are entitled to know my plan.", "village_elder_ask_set_fire_explain_plan",[]],
[anyone|plyr,"village_elder_ask_set_fire_explain_plan",[
(party_get_slot, ":bound_center", "$g_encountered_party", slot_village_bound_center),
(str_store_party_name, s4, ":bound_center"),
],
"I wish to rescue a prisoner from {s4}. When you light the fire, the guards in {s4} will see the smoke, and some of them will rush outside to see what is going on. ", "village_elder_ask_set_fire_2",[]],
[anyone,"village_elder_ask_set_fire_2",[
(gt, "$g_talk_troop_effective_relation", 9),
],
"As you wish, {sir/my lady}. You have been a good friend to this village, and, even though there is a risk, we should be glad to return the favor. When do you want this fire to start?", "village_elder_ask_set_fire_9",[]],
[anyone,"village_elder_ask_set_fire_2",[
(lt, "$g_talk_troop_relation", 0),
],
"I'm sorry, {sir/my lady}. You will forgive me for saying this, but we don't exactly have good reason to trust you. This is too dangerous.", "close_window",[]],
[anyone,"village_elder_ask_set_fire_2",[],
"As you say, {sir/my lady}. But in doing this, we are taking a very great risk. What's in it for us?", "village_elder_ask_set_fire_3",[]],
[anyone|plyr,"village_elder_ask_set_fire_3",
[
(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", 100),
],
"I can give you 100 denars.", "village_elder_ask_set_fire_4",[(assign, "$g_last_money_offer_to_elder", 100),]],
[anyone|plyr,"village_elder_ask_set_fire_3",
[
(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", 200),
],
"I can give you 200 denars.", "village_elder_ask_set_fire_6",[(assign, "$g_last_money_offer_to_elder", 200),]],
[anyone|plyr,"village_elder_ask_set_fire_3",
[
(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", 300),
],
"I can give you 300 denars.", "village_elder_ask_set_fire_6",[(assign, "$g_last_money_offer_to_elder", 300),]],
[anyone|plyr,"village_elder_ask_set_fire_3",[],
"Never mind.", "close_window",[]],
[anyone,"village_elder_ask_set_fire_4",
[
(eq, "$g_village_elder_did_not_liked_money_offered", 0),
],
"This is madness. I cannot take such a risk.", "village_elder_talk",
[
(assign, "$g_village_elder_did_not_liked_money_offered", 1),
]],
[anyone|plyr,"village_elder_ask_set_fire_5",
[
(eq, "$g_village_elder_did_not_liked_money_offered", 1),
(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", 200),
],
"Then let's increase your reward to 200 denars.", "village_elder_ask_set_fire_7", [(assign, "$g_last_money_offer_to_elder", 200),]],
[anyone|plyr,"village_elder_ask_set_fire_5",
[
(eq, "$g_village_elder_did_not_liked_money_offered", 1),
(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", 300),
],
"Then let's increase your reward to 300 denars.", "village_elder_ask_set_fire_6",[(assign, "$g_last_money_offer_to_elder", 300),]],
[anyone|plyr,"village_elder_ask_set_fire_5",
[
(eq, "$g_village_elder_did_not_liked_money_offered", 2),
(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", 300),
],
"Then let's increase your reward to 300 denars. This is my last offer.", "village_elder_ask_set_fire_6",[(assign, "$g_last_money_offer_to_elder", 300),]],
[anyone|plyr,"village_elder_ask_set_fire_5",[],
"Never mind.", "close_window",[]],
[anyone,"village_elder_ask_set_fire_6",[],
"Very well. You are asking me to take a very great risk, but I will do it. When do you want this fire to start?", "village_elder_ask_set_fire_9",
[
(troop_remove_gold, "trp_player", "$g_last_money_offer_to_elder"),
]],
[anyone,"village_elder_ask_set_fire_7",[],
"I cannot do such a dangerous thing for 200 denars.", "village_elder_talk",
[
(assign, "$g_village_elder_did_not_liked_money_offered", 2),
]],
[anyone|plyr,"village_elder_ask_set_fire_9",[],
"Continue with your preparations. One hour from now, I need that fire.", "village_elder_ask_set_fire_10",
[
(party_get_slot, ":bound_center", "$current_town", slot_village_bound_center),
(store_current_hours, ":cur_time"),
(val_add, ":cur_time", 1),
(assign, ":fire_time", ":cur_time"),
(party_set_slot, ":bound_center", slot_town_last_nearby_fire_time, ":fire_time"),
(try_begin),
(is_between, "$next_center_will_be_fired", villages_begin, villages_end),
(party_get_slot, ":is_there_already_fire", "$next_center_will_be_fired", slot_village_smoke_added),
(eq, ":is_there_already_fire", 0),
(party_get_slot, ":fire_time", "$next_center_will_be_fired", slot_town_last_nearby_fire_time),
(store_current_hours, ":cur_hours"),
(store_sub, ":cur_time_sub_fire_duration", ":cur_hours", fire_duration),
(val_sub, ":cur_time_sub_fire_duration", 1),
(ge, ":fire_time", ":cur_time_sub_fire_duration"),
(party_clear_particle_systems, "$next_center_will_be_fired"),
(try_end),
(assign, "$next_center_will_be_fired", "$current_town"),
(assign, "$g_village_elder_did_not_liked_money_offered", 0),
]],
[anyone|plyr,"village_elder_ask_set_fire_9",
[
(store_time_of_day, ":cur_day_hour"),
(ge, ":cur_day_hour", 6),
(lt, ":cur_day_hour", 23),
],
"Do this in at the stroke of midnight. I will wait exactly one hour.", "village_elder_ask_set_fire_11",
[
(party_get_slot, ":bound_center", "$current_town", slot_village_bound_center),
(store_time_of_day, ":cur_day_hour"),
(store_current_hours, ":cur_time"),
(store_sub, ":difference", 24, ":cur_day_hour"), #fire will be at 24 midnight today
(store_add, ":fire_time", ":cur_time", ":difference"),
(party_set_slot, ":bound_center", slot_town_last_nearby_fire_time, ":fire_time"),
(try_begin),
(is_between, "$next_center_will_be_fired", villages_begin, villages_end),
(party_get_slot, ":is_there_already_fire", "$next_center_will_be_fired", slot_village_smoke_added),
(eq, ":is_there_already_fire", 0),
(party_get_slot, ":fire_time", "$next_center_will_be_fired", slot_town_last_nearby_fire_time),
(store_current_hours, ":cur_hours"),
(store_sub, ":cur_time_sub_fire_duration", ":cur_hours", fire_duration),
(val_sub, ":cur_time_sub_fire_duration", 1),
(ge, ":fire_time", ":cur_time_sub_fire_duration"),
(party_clear_particle_systems, "$next_center_will_be_fired"),
(try_end),
(assign, "$next_center_will_be_fired", "$current_town"),
(assign, "$g_village_elder_did_not_liked_money_offered", 0),
]],
[anyone,"village_elder_ask_set_fire_10",[],
"Very well, {sir/my lady}. We will make our preparations. Now you make yours.", "close_window",
[
(assign, ":maximum_distance", -1),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":troop_id", ":cur_agent"),
(is_between, ":troop_id", village_elders_begin, village_elders_end),
(agent_get_position, pos0, ":cur_agent"),
(try_for_range, ":entry_point_id", 0, 64),
(entry_point_get_position, pos1, ":entry_point_id"),
(get_distance_between_positions, ":dist", pos0, pos1),
(gt, ":dist", ":maximum_distance"),
(assign, ":maximum_distance", ":dist"),
(copy_position, pos2, pos1),
(assign, ":village_elder_agent", ":cur_agent"),
(try_end),
(try_begin),
(gt, ":maximum_distance", -1),
(agent_set_scripted_destination, ":village_elder_agent", pos2),
(try_end),
(try_end),
]],
[anyone,"village_elder_ask_set_fire_11",[],
"As you wish, {sir/my lady}. May the heavens protect you.", "close_window",[]],
#(fire set up dialogs end)
[anyone|plyr,"village_elder_talk", [(call_script, "script_cf_village_recruit_volunteers_cond"),],
"Are there any lads from this village who might want to seek their fortune in the wars?", "village_elder_recruit_start",[]],
[anyone|plyr,"village_elder_talk", [],
"[Leave]", "close_window",[]],
[anyone ,"village_elder_buy_cattle", [(party_get_slot, reg5, "$g_encountered_party", slot_village_number_of_cattle),
(gt, reg5, 0),
(store_item_value, ":cattle_cost", "itm_cattle_meat"),
(call_script, "script_game_get_item_buy_price_factor", "itm_cattle_meat"),
(val_mul, ":cattle_cost", reg0),
#Multiplied by 2 and divided by 100
(val_div, ":cattle_cost", 50),
(assign, "$temp", ":cattle_cost"),
(assign, reg6, ":cattle_cost"),
],
"We have {reg5} heads of cattle, each for {reg6} denars. How many do you want to buy?", "village_elder_buy_cattle_2",[]],
[anyone ,"village_elder_buy_cattle", [],
"I am afraid we have no cattle left in the village {sir/madam}.", "village_elder_buy_cattle_2",[]],
[anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
(ge, ":num_cattle", 1),
(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", "$temp"),],
"One.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 1, "$temp"),
]],
[anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
(ge, ":num_cattle", 2),
(store_troop_gold, ":gold", "trp_player"),
(store_mul, ":cost", "$temp", 2),
(ge, ":gold", ":cost"),],
"Two.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 2, "$temp"),
]],
[anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
(ge, ":num_cattle", 3),
(store_troop_gold, ":gold", "trp_player"),
(store_mul, ":cost", "$temp", 3),
(ge, ":gold", ":cost"),],
"Three.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 3, "$temp"),
]],
[anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
(ge, ":num_cattle", 4),
(store_troop_gold, ":gold", "trp_player"),
(store_mul, ":cost", "$temp", 4),
(ge, ":gold", ":cost"),],
"Four.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 4, "$temp"),
]],
[anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
(ge, ":num_cattle", 5),
(store_troop_gold, ":gold", "trp_player"),
(store_mul, ":cost", "$temp", 5),
(ge, ":gold", ":cost"),],
"Five.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 5, "$temp"),
]],
[anyone|plyr,"village_elder_buy_cattle_2", [],
"Forget it.", "village_elder_pretalk",[]],
[anyone ,"village_elder_buy_cattle_complete", [],
"I will tell the herders to round up the animals and bring them to you, {sir/madam}. I am sure you will be satisfied with your purchase.", "village_elder_pretalk",[]],
[anyone ,"village_elder_recruit_start", [(party_get_slot, ":num_volunteers", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":num_volunteers", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 10),#10 denars per man
(val_min, ":num_volunteers", ":gold_capacity"),
(eq, ":num_volunteers", 0),
],
"I don't think anyone would be interested, {sir/madam}. Is there anything else I can do for you?", "village_elder_talk",[]],
[anyone ,"village_elder_recruit_start", [(party_get_slot, ":num_volunteers", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":num_volunteers", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 10),#10 denars per man
(val_min, ":num_volunteers", ":gold_capacity"),
(assign, "$temp", ":num_volunteers"),
(assign, reg5, ":num_volunteers"),
(store_add, reg7, ":num_volunteers", -1),
],
"I can think of {reg5} whom I suspect would jump at the chance. If you could pay 10 denars {reg7?each for their equipment:for his equipment}.\
Does that suit you?", "village_elder_recruit_decision",[]],
#not used:
## [anyone|plyr,"village_elder_recruit_decision", [(party_get_slot, ":num_volunteers", "$current_town", slot_center_volunteer_troop_amount),
## (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
## (val_min, ":num_volunteers", ":free_capacity"),
## (store_troop_gold, ":gold", "trp_player"),
## (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
## (val_min, ":num_volunteers", ":gold_capacity"),
## (eq, ":num_volunteers", 0),],
## "So be it.", "village_elder_pretalk",
## [
## (try_begin),
## (party_slot_eq, "$current_town", slot_center_volunteer_troop_amount, 0), #do not change the value if it is above 0
## (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
## (try_end),]],
[anyone|plyr,"village_elder_recruit_decision", [(assign, ":num_volunteers", "$temp"),
(ge, ":num_volunteers", 1),
(store_add, reg7, ":num_volunteers", -1)],
"Tell {reg7?them:him} to make ready.", "village_elder_pretalk",[(call_script, "script_village_recruit_volunteers_recruit"),]],
[anyone|plyr,"village_elder_recruit_decision", [(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 1)],
"No, not now.", "village_elder_pretalk",[]],
[anyone,"village_elder_active_mission_1", [], "Yes {sir/madam}, have you made any progress on it?", "village_elder_active_mission_2",[]],
[anyone|plyr,"village_elder_active_mission_2",[(store_partner_quest,":elder_quest"),
(eq, ":elder_quest", "qst_deliver_grain"),
(quest_get_slot, ":quest_target_amount", "qst_deliver_grain", slot_quest_target_amount),
(call_script, "script_get_troop_item_amount", "trp_player", "itm_grain"),
(assign, ":cur_amount", reg0),
(ge, ":cur_amount", ":quest_target_amount"),
(assign, reg5, ":quest_target_amount"),
],
"Indeed. I brought you {reg5} packs of grain.", "village_elder_deliver_grain_thank",
[]],
[anyone,"village_elder_deliver_grain_thank", [(str_store_party_name, s13, "$current_town")],
"My good {lord/lady}. You have saved us from hunger and desperation. We cannot thank you enough, but you'll always be in our prayers.\
The village of {s13} will not forget what you have done for us.", "village_elder_deliver_grain_thank_2",
[(quest_get_slot, ":quest_target_amount", "qst_deliver_grain", slot_quest_target_amount),
(troop_remove_items, "trp_player", "itm_grain", ":quest_target_amount"),
(add_xp_as_reward, 400),
(call_script, "script_change_center_prosperity", "$current_town", 4),
(call_script, "script_change_player_relation_with_center", "$current_town", 5),
(call_script, "script_end_quest", "qst_deliver_grain"),
#Troop commentaries begin
(call_script, "script_add_log_entry", logent_helped_peasants, "trp_player", "$current_town", -1, -1),
#Troop commentaries end
]],
[anyone,"village_elder_deliver_grain_thank_2", [],
"My good {lord/lady}, please, is there anything I can do for you?", "village_elder_talk",[]],
[anyone|plyr,"village_elder_active_mission_2", [], "I am still working on it.", "village_elder_active_mission_3",[]],
[anyone|plyr,"village_elder_active_mission_2", [], "I am afraid I won't be able to finish it.", "village_elder_mission_failed",[]],
[anyone,"village_elder_active_mission_3", [], "Thank you, {sir/madam}. We are praying for your success everyday.", "village_elder_pretalk",[]],
[anyone,"village_elder_mission_failed", [], "Ah, I am sorry to hear that {sir/madam}. I'll try to think of something else.", "village_elder_pretalk",
[(store_partner_quest,":elder_quest"),
(call_script, "script_abort_quest", ":elder_quest", 1)]],
##
## [anyone,"village_elder_generic_mission_thank", [],
## "You have been so helpful {sir/madam}. I do not know how to thank you.", "village_elder_generic_mission_completed",[]],
##
## [anyone|plyr,"village_elder_generic_mission_completed", [],
## "Speak not of it. I only did what needed to be done.", "village_elder_pretalk",[]],
# Currently not needed.
## [anyone|plyr,"village_elder_generic_mission_failed", [],
## "TODO: I'm sorry I failed you sir. It won't happen again.", "village_elder_pretalk",
## [(store_partner_quest,":elder_quest"),
## (call_script, "script_finish_quest", ":elder_quest", 0),
## ]],
[anyone,"village_elder_request_mission_ask", [(store_partner_quest,":elder_quest"),(ge,":elder_quest",0)],
"Well {sir/madam}, you are already engaged with a task helping us. We cannot ask more from you.", "village_elder_pretalk",[]],
[anyone,"village_elder_request_mission_ask", [(troop_slot_eq, "$g_talk_troop", slot_troop_does_not_give_quest, 1)],
"No {sir/madam}, We don't have any other tasks for you.", "village_elder_pretalk",[]],
[anyone|auto_proceed,"village_elder_request_mission_ask", [], "A task?", "village_elder_tell_mission",
[
(call_script, "script_get_quest", "$g_talk_troop"),
(assign, "$random_quest_no", reg0),
]],
[anyone,"village_elder_tell_mission", [(eq,"$random_quest_no","qst_deliver_grain")],
"{My good sir/My good lady}, our village has been going through such hardships lately.\
The harvest has been bad, and recently some merciless bandits took away our seed grain that we had reserved for the planting season.\
If we cannot find some grain soon, we will not be able to plant our fields and then we will have nothing to eat for the coming year.\
If you can help us, we would be indebted to you forever.", "village_elder_tell_deliver_grain_mission",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_party_name_link,s3,":quest_target_center"),
(quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@The elder of the village of {s3} asked you to bring them {reg5} packs of grain."),
]],
[anyone|plyr,"village_elder_tell_deliver_grain_mission", [],
"Hmmm. How much grain do you need?", "village_elder_tell_deliver_grain_mission_2",[]],
[anyone|plyr,"village_elder_tell_deliver_grain_mission", [],
"I can't be bothered with this. Ask help from someone else.", "village_elder_deliver_grain_mission_reject",[]],
[anyone,"village_elder_tell_deliver_grain_mission_2", [(quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount)],
"I think {reg5} packs of grain will let us start the planting. Hopefully, we can find charitable people to help us with the rest.", "village_elder_tell_deliver_grain_mission_3",[]],
[anyone|plyr,"village_elder_tell_deliver_grain_mission_3", [],
"Then I will go and find you the grain you need.", "village_elder_deliver_grain_mission_accept",[]],
[anyone|plyr,"village_elder_tell_deliver_grain_mission_3", [],
"I am afraid I don't have time for this. You'll need to find help elsewhere.", "village_elder_deliver_grain_mission_reject",[]],
[anyone,"village_elder_deliver_grain_mission_accept", [], "Thank you, {sir/madam}. We'll be praying for you night and day.", "close_window",
[(assign, "$g_leave_encounter",1),
(call_script, "script_change_player_relation_with_center", "$current_town", 5),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
]],
[anyone,"village_elder_deliver_grain_mission_reject", [], "Yes {sir/madam}, of course. I am sorry if I have bothered you with our troubles.", "close_window",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
]],
[anyone,"village_elder_tell_mission", [(eq,"$random_quest_no", "qst_train_peasants_against_bandits")],
"We are suffering greatly at the hands of a group of bandits. They take our food and livestock,\
and kill anyone who doesn't obey them immediately. Our men are angry that we cannot defend ourselves, but we are only simple farmers...\
However, with some help, I think that some of the people here could be more than that.\
We just need an experienced warrior to teach us how to fight.",
"village_elder_tell_train_peasants_against_bandits_mission",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_party_name_link, s13, ":quest_target_center"),
(quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount),
(setup_quest_text, "$random_quest_no"),
(str_store_string, s2, "@The elder of the village of {s13} asked you to train {reg5} peasants to fight against local bandits."),
]],
[anyone|plyr, "village_elder_tell_train_peasants_against_bandits_mission", [],
"I can teach you how to defend yourself.", "village_elder_train_peasants_against_bandits_mission_accept",[]],
[anyone|plyr, "village_elder_tell_train_peasants_against_bandits_mission", [],
"You peasants have no business taking up arms. Just pay the bandits and be off with it.", "village_elder_train_peasants_against_bandits_mission_reject",[]],
[anyone,"village_elder_train_peasants_against_bandits_mission_accept", [], "You will? Oh, splendid!\
We would be deeply indebted to you, {sir/madam}.\
I'll instruct the village folk to assemble here and receive your training.\
If you can teach us how to defend ourselves, I promise you'll receive everything we can give you in return for your efforts.", "close_window",
[
(assign, "$g_leave_encounter",1),
#TODO: Change this value
(call_script, "script_change_player_relation_with_center", "$current_town", 3),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
]],
[anyone,"village_elder_train_peasants_against_bandits_mission_reject", [], "Yes, of course {sir/madam}.\
Thank you for your counsel.", "close_window",
[
(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
]],
[anyone,"village_elder_tell_mission", [(eq,"$random_quest_no","qst_deliver_cattle")],
"Bandits have driven away our cattle. Our pastures are empty. If we had just a few heads of cattle we could start to raise a herd again.",
"village_elder_tell_deliver_cattle_mission",
[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
(str_store_party_name_link,s3,":quest_target_center"),
(quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount),
(setup_quest_text,"$random_quest_no"),
(str_store_string, s2, "@The elder of the village of {s3} asked you to bring them {reg5} heads of cattle."),
]],
[anyone|plyr,"village_elder_tell_deliver_cattle_mission", [],
"How many animals do you need?", "village_elder_tell_deliver_cattle_mission_2",[]],
[anyone|plyr,"village_elder_tell_deliver_cattle_mission", [],
"I don't have time for this. Ask help from someone else.", "village_elder_deliver_cattle_mission_reject",[]],
[anyone,"village_elder_tell_deliver_cattle_mission_2", [(quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount)],
"I think {reg5} heads will suffice for a small herd.", "village_elder_tell_deliver_cattle_mission_3",[]],
[anyone|plyr,"village_elder_tell_deliver_cattle_mission_3", [],
"Then I will bring you the cattle you need.", "village_elder_deliver_cattle_mission_accept",[]],
[anyone|plyr,"village_elder_tell_deliver_cattle_mission_3", [],
"I am afraid I don't have time for this. You'll need to find help elsewhere.", "village_elder_deliver_cattle_mission_reject",[]],
[anyone,"village_elder_deliver_cattle_mission_accept", [], "Thank you, {sir/madam}. We'll be praying for you night and day.", "close_window",
[(assign, "$g_leave_encounter",1),
(call_script, "script_change_player_relation_with_center", "$current_town", 3),
(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
]],
[anyone,"village_elder_deliver_cattle_mission_reject", [], "Yes {sir/madam}, of course. I am sorry if I have bothered you with our troubles.", "close_window",
[(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
]],
[anyone,"village_elder_tell_mission", [], "Thank you, {sir/madam}, but we do not really need anything right now.", "village_elder_pretalk",[]],
## [anyone|plyr,"village_elder_mission_told", [], "TODO: As you wish sir. You can count on me.", "village_elder_mission_accepted",[]],
## [anyone|plyr,"village_elder_mission_told", [], "TODO: I'm afraid I can't carry out this mission right now, sir.", "village_elder_mission_rejected",[]],
##
## [anyone,"village_elder_mission_accepted", [], "TODO: Excellent. Do this {playername}. I really have high hopes for you.", "close_window",
## [(assign, "$g_leave_encounter",1),
## (try_begin),
## #TODO: Add quest initializations here
## (try_end),
## (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
## ]],
## [anyone,"village_elder_mission_rejected", [], "TODO: Is that so? Perhaps you are not up for the task anyway...", "close_window",
## [(assign, "$g_leave_encounter",1),
## (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
## (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
## ]],
#Goods Merchants
[anyone ,"start", [(is_between,"$g_talk_troop",goods_merchants_begin,goods_merchants_end),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player")],
"{My lord/my lady}, you honour my humble shop with your presence.", "goods_merchant_talk",[]],
[anyone ,"start", [(is_between,"$g_talk_troop",goods_merchants_begin,goods_merchants_end)],
"Welcome {sir/madam}. What can I do for you?", "goods_merchant_talk",[]],
# [trp_salt_mine_merchant,"start", [], "Hello.", "goods_merchant_talk",[]],
# [anyone,"merchant_begin", [], " What can I do for you?", "goods_merchant_talk",[]],
[anyone,"goods_merchant_pretalk", [], "Anything else?", "goods_merchant_talk",[]],
[anyone|plyr,"goods_merchant_talk", [], "I want to buy a few items... and perhaps sell some.", "goods_trade_requested",[]],
[anyone,"goods_trade_requested", [], "Sure, sure... Here, have a look at my stock...", "goods_trade_completed",[[change_screen_trade]]],
[anyone,"goods_trade_completed", [], "Anything else?", "goods_merchant_talk",[]],
[anyone|plyr,"goods_merchant_talk", [], "What goods should I buy here to trade with other towns?", "trade_info_request",[]],
[anyone|plyr,"goods_merchant_talk", [], "Nothing. Thanks.", "close_window",[]],
[anyone,"trade_info_request", [], "That information can be best obtained from caravan masters\
and travelling merchants. If you want I can send you to the district where foreign merchants stay at when they come to the town.\
If you spend some time there and listen to the talk,\
you can learn a lot about what to buy and where to sell it.", "trade_info_request_2",[]],
[anyone|plyr,"trade_info_request_2", [], "Then I'll go and spend some time with these merchants.", "close_window",
[
(jump_to_menu,"mnu_town_trade_assessment_begin"),
(finish_mission),
]],
[anyone|plyr,"trade_info_request_2", [], "I have no time for this right now.", "goods_merchant_pretalk",[]],
# [anyone|plyr,"goods_merchant_talk", [], "What do caravans buy and sell in this town?", "goods_merchant_town_info",[]],
# [anyone,"goods_merchant_town_info_completed", [], "Anything else?", "goods_merchant_talk",[]],
## [anyone,"goods_merchant_town_info", [],
## "TODO: We produce {s1}, and we consume {s2}.", "goods_merchant_town_info_completed",
## [(call_script, "script_print_productions_above_or_below_50", "$g_encountered_party", 1),
## (str_store_string_reg, s1, s51),
## (call_script, "script_print_productions_above_or_below_50", "$g_encountered_party", -1),
## (str_store_string_reg, s2, s51)]],
##
## [anyone,"goods_merchant_town_info", [(store_encountered_party,reg(1)),(eq,reg(1),"p_zendar")],
##"You can buy tools from here at a very good price.\
## The best place to sell them would be Tulga. Heard they pay quite well for tools over there.\
## And next time you come here bring some salt. I will pay well for salt.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [(store_encountered_party,reg(1)),(eq,reg(1),"p_town_1")],
##"Sargoth is famous for its fine linen. Many caravans come here to buy that.\
## I heard you can sell it at Halmar and make a nice profit.\
## And next time you come here bring some iron. I will pay well for iron.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_2"]],
##"I can sell you some smoked fish with a special price.\
## I heard that caravans take smoked fish to Uxkhal and make a good profit.\
## And next time you come here bring some wool. I will pay you well for wool.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_3"]],
##"I can sell you some wine with a special price.\
## I heard that caravans buy wine from here and sell it at Wercheg, making a good profit.\
## And next time you come here, bring some dried meat. I will pay you well for dried meat.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_4"]],
##"I have a stock of oil which I can sell you with a good price.\
## They say they offer a fortune for oil in Rivacheg, so maybe you can sell it there.\
## And next time you come here, bring some furs. I will pay you well for furs.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_5"]],
##"Jelkala is famous for its velvet. Many caravans come here to buy that.\
## They say merchants will buy it at insane prices in Reyvadin, so maybe you can take it there.\
## And next time you come here, bring some pottery. I will pay you well for pottery.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_6"]],
##"We produce some excellent ale here in Praven. Most caravans come here to buy that.\
## They say that the folks at Khudan will sell their right arms for ale, so maybe you can take it there.\
## And next time you come here, bring some spice. I have sold out my stock of spice and I will pay you well for it.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_7"]],
##"We produce mostly wheat here in Uxkhal. I would suggest you buy that.\
## I heard you can sell it with a good profit in Tulga, so maybe you can take it there.\
## And next time you come here, bring some smoked fish. I will pay you well for it.", "goods_merchant_town_info_completed",[]],
##
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_8"]],
##"Most caravans come to Reyvadin to buy wool.\
## I heard that they take it to Tihr where they pay well for wool.\
## And next time you come here, bring some velvet. I will buy it from you at a good price.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_9"]],
##"Most caravans come to Khudan to buy furs.\
## I heard that they take it to Suno where they pay well for it.\
## And next time you come here, bring some ale. I will buy it from you at a good price.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_10"]],
##"Most caravans come to Tulga to buy spice.\
## They say that in Praven they pay well for spice, so you may think of selling it to the mechants there.\
## And next time you come here, bring some wheat. I will buy it from you at a good price.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_11"]],
##"We mine a lot of iron here in Curaw. I would suggest you buy that.\
## I heard you can take it to Sargoth and sell it with a good profit.\
## And next time you come here, bring some dried meat. I will pay you well for it.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_12"]],
##"I can sell you some smoked fish with a special price.\
## I heard that caravans take smoked fish to Uxkhal and make a good profit.\
## And next time you come here bring some wine. I will pay you well for wine.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_13"]],
##"I have a stock of dried meat which I can sell you with a good price.\
## They say they pay very well for dried meat in Veluca, so maybe you can sell it there.\
## And next time you come here, bring some oil. I have sold out my stock of oil and I will pay you well for it.", "goods_merchant_town_info_completed",[]],
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_14"]],
##"We produce some good quality pottery here in Halmar. Most caravans come here to buy that.\
## I heard that caravans buy pottery from here and sell it at Jelkala, making a good profit.\
## And next time you come here, bring some linen. I have sold out my stock of linen and I will pay you well for it.", "goods_merchant_town_info_completed",[]],
##
## [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_salt_mine"]],
##"Heh. Are you joking with me? This is the salt mine. Merchants come here to buy salt.", "goods_merchant_town_info_completed",[]],
##
## [anyone,"goods_merchant_town_info", [
## (store_encountered_party,reg(9)),
## (party_get_slot,reg(5),reg(9),slot_town_export_good),
## (party_get_slot,reg(6),reg(9),slot_town_import_good),
## (ge,reg(5),1),
## (ge,reg(6),1),
## (str_store_item_name,1,reg(5)),
## (str_store_item_name,2,reg(6)),
## ],
## "I can sell you some {s1} with a special price.\
##And next time you come here bring some {s2}. I will pay you well for that.", "goods_merchant_town_info_completed",[]],
##
## [anyone,"goods_merchant_town_info", [
## (store_encountered_party,reg(9)),
## (party_get_slot,reg(5),reg(9),slot_town_export_good),
## (ge,reg(5),1),
## (str_store_item_name,1,reg(5)),
## ],
## "I can sell you some {s1} with a special price.", "goods_merchant_town_info_completed",[]],
##
## [anyone,"goods_merchant_town_info", [
## (store_encountered_party,reg(9)),
## (party_get_slot,reg(6),reg(9),slot_town_import_good),
## (ge,reg(6),1),
## (str_store_item_name,2,reg(6)),
## ],
## "If you have some {s2} with you, I am ready to pay you good money for it.", "goods_merchant_town_info_completed",[]],
##
## [anyone,"goods_merchant_town_info", [],
##"Sorry. Caravans hardly ever trade anything here.", "goods_merchant_town_info_completed",[]],
#############################################################################
#### ARENA MASTERS
#############################################################################
[anyone ,"start", [(store_conversation_troop,reg(1)),
(is_between,reg(1),arena_masters_begin,arena_masters_end),
(assign, "$arena_reward_asked", 0), #set some variables.
(assign, "$arena_tournaments_asked", 0),
(eq,1,0),
],
"{!}.", "arena_intro_1",[]],
[anyone ,"start", [(store_conversation_troop,reg(1)),
(is_between,reg(1),arena_masters_begin,arena_masters_end),
(eq,"$arena_master_first_talk", 0),
],
"Good day friend. If you came to watch the tournaments you came in vain. There won't be a tournament here anytime soon.", "arena_intro_1",[(assign,"$arena_master_first_talk", 1)]],
[anyone|plyr,"arena_intro_1", [], "Tournaments? So they hold the tournaments here...", "arena_intro_2",[]],
[anyone,"arena_intro_2", [], "Yes. You should see this place during one of the tournament fights.\
Everyone from the town and nearby villages comes here. The crowd becomes mad with excitement.\
Anyway, as I said, there won't be an event here soon, so there isn't much to see.\
Except, there is an official duel every now and then, and of course we have melee fights almost every day.", "arena_intro_3",[]],
[anyone|plyr,"arena_intro_3", [], "Tell me about the melee fights.", "arena_training_melee_intro",[]],
[anyone,"arena_training_melee_intro", [], "The fighters and knights get bored waiting for the next tournament,\
so they have invented the training melee. It is a simple idea really.\
Fighters jump into the arena with a weapon. There are no rules, no teams.\
Everyone beats at each other until there is only one fighter left standing.\
Sounds like fun, eh?", "arena_training_melee_intro_2",[]],
[anyone|plyr,"arena_training_melee_intro_2", [(eq, "$arena_reward_asked", 0)], "Is there a reward?", "arena_training_melee_intro_reward",[(assign, "$arena_reward_asked", 1)]],
[anyone,"arena_training_melee_intro_reward", [(assign, reg1, arena_tier1_opponents_to_beat),(assign, reg11, arena_tier1_prize),
(assign, reg2, arena_tier2_opponents_to_beat),(assign, reg12, arena_tier2_prize),
(assign, reg3, arena_tier3_opponents_to_beat),(assign, reg13, arena_tier3_prize),
(assign, reg4, arena_tier4_opponents_to_beat),(assign, reg14, arena_tier4_prize),
(assign, reg15, arena_grand_prize)
], "There is, actually. Some of the wealthy townsmen offer prizes for those fighters who show great skill in the fights.\
If you can beat {reg1} opponents before going down, you'll earn {reg11} denars. You'll get {reg12} denars for striking down at least {reg2} opponents,\
{reg13} denars if you can defeat {reg3} opponents, and {reg14} denars if you can survive long enough to beat {reg4} opponents.\
If you can manage to be the last {man/fighter} standing, you'll earn the great prize of the fights, {reg15} denars. Sounds good, eh?", "arena_training_melee_intro_2",[(assign, "$arena_tournaments_asked", 1),]],
[anyone,"arena_training_melee_explain_reward", [
(assign, reg1, arena_tier1_opponents_to_beat),(assign, reg11, arena_tier1_prize),
(assign, reg2, arena_tier2_opponents_to_beat),(assign, reg12, arena_tier2_prize),
(assign, reg3, arena_tier3_opponents_to_beat),(assign, reg13, arena_tier3_prize),
(assign, reg4, arena_tier4_opponents_to_beat),(assign, reg14, arena_tier4_prize),
(assign, reg15, arena_grand_prize)
], "Some of the wealthy townsmen offer prizes for those fighters who show great skill in the fights.\
If you can beat {reg1} opponents before going down, you'll earn {reg11} denars. You'll get {reg12} denars for striking down at least {reg2} opponents,\
{reg13} denars if you can defeat {reg3} opponents, and {reg14} denars if you can survive long enough to beat {reg4} opponents.\
If you can manage to be the last {man/fighter} standing, you'll earn the great prize of the fights, {reg15} denars. Sounds good, eh?", "arena_master_melee_pretalk",[]],
[anyone|plyr,"arena_training_melee_intro_2", [], "Can I join too?", "arena_training_melee_intro_3",[]],
[anyone,"arena_training_melee_intro_3", [], "Ha ha. You would have to be out of your mind not to. Of course. The melee fights are open to all.\
Actually there is going to be a fight soon. You can go and hop in if you want to.", "arena_master_melee_talk",[]],
[anyone ,"start", [(store_conversation_troop,reg(1)),
(is_between,reg(1),arena_masters_begin,arena_masters_end),
(eq,"$g_talk_troop_met", 0),
],
"Hello. You seem to be new here. Care to share your name?", "arena_master_intro_1",[]],
[anyone|plyr,"arena_master_intro_1", [], "I am {playername}.", "arena_master_intro_2",[]],
[anyone,"arena_master_intro_2", [(store_encountered_party,reg(2)),(str_store_party_name,1,reg(2))],
"Well met {playername}. I am the master of the tournaments here at {s1}. Talk to me if you want to join the fights.", "arena_master_pre_talk",[]],
[anyone|auto_proceed ,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end),
(eq, "$last_training_fight_town", "$current_town"),
(store_current_hours,":cur_hours"),
(val_add, ":cur_hours", -4),
(lt, ":cur_hours", "$training_fight_time")],
".", "arena_master_fight_result",[(assign, "$arena_reward_asked", 0)]],
[anyone ,"arena_master_fight_result",
[
(eq, "$g_arena_training_won", 0),
(eq, "$g_arena_training_kills", 0)
],
"Ha-ha, that's quite the bruise you're sporting. But don't worry; everybody gets trounced once in awhile. The important thing is to pick yourself up, dust yourself off and keep fighting. That's what champions do.", "arena_master_pre_talk",[(assign, "$last_training_fight_town", -1)]],
[anyone ,"arena_master_fight_result",
[
(eq, "$g_arena_training_won", 0),
(lt, "$g_arena_training_kills", arena_tier1_opponents_to_beat),
(assign, reg8, "$g_arena_training_kills")
],
"Hey, you managed to take down {reg8} opponents. Not bad. But that won't bring you any prize money.\
Now, if I were you, I would go back there and show everyone what I can do...", "arena_master_pre_talk",[(assign, "$last_training_fight_town", -1)]],
[anyone ,"arena_master_fight_result",
[
(eq, "$g_arena_training_won", 0),
(lt, "$g_arena_training_kills", arena_tier2_opponents_to_beat),
(assign, reg8, "$g_arena_training_kills"),
(assign, reg10, arena_tier1_prize),
],
"You put up quite a good fight there. Good moves. You definitely show promise.\
And you earned a prize of {reg10} denars for knocking down {reg8} opponents.", "arena_master_pre_talk",[
(call_script, "script_troop_add_gold", "trp_player", arena_tier1_prize),
(add_xp_to_troop,5,"trp_player"),
(assign, "$last_training_fight_town", -1)]],
[anyone ,"arena_master_fight_result",
[
(eq, "$g_arena_training_won", 0),
(lt, "$g_arena_training_kills", arena_tier3_opponents_to_beat),
(assign, reg8, "$g_arena_training_kills"),
(assign, reg10, arena_tier2_prize),
(assign, reg12, arena_tier2_opponents_to_beat),
],
"That was a good fight you put up there. You managed to take down no less than {reg8} opponents.\
And of course, you earned a prize money of {reg10} denars.", "arena_master_pre_talk",[
(call_script, "script_troop_add_gold", "trp_player", arena_tier2_prize),
(add_xp_to_troop,10,"trp_player"),
(assign, "$last_training_fight_town", -1)]],
[anyone ,"arena_master_fight_result",
[
(eq, "$g_arena_training_won", 0),
(lt, "$g_arena_training_kills", arena_tier4_opponents_to_beat),
(assign, reg8, "$g_arena_training_kills"),
(assign, reg10, arena_tier3_prize)
],
"Your performance was amazing! You are without doubt a very skilled fighter.\
Not everyone can knock down {reg8} people in the fights. Of course you deserve a prize with that performance: {reg10} denars. Nice, eh?", "arena_master_pre_talk",[
(call_script, "script_troop_add_gold", "trp_player", arena_tier3_prize),
(add_xp_to_troop,10,"trp_player"),
(assign, "$last_training_fight_town", -1)]],
[anyone ,"arena_master_fight_result",
[
(eq, "$g_arena_training_won", 0),
(assign, reg8, "$g_arena_training_kills"),
(assign, reg10, arena_tier4_prize),
],
"That was damned good fighting, {playername}. You have very good moves, excellent tactics.\
And you earned a prize of {reg10} denars for knocking down {reg8} opponents.", "arena_master_pre_talk",
[
(call_script, "script_troop_add_gold", "trp_player", arena_tier4_prize),
(add_xp_to_troop,10,"trp_player"),
(assign, "$last_training_fight_town", -1),
]],
[anyone ,"arena_master_fight_result", [(assign, reg10, arena_grand_prize)],
"Congratulations champion! Your fight there was something to remember! You managed to be the last fighter standing beating down everyone else. And of course you won the grand prize of the fights: {reg10} denars.", "arena_master_pre_talk",[
(call_script, "script_troop_add_gold", "trp_player", arena_grand_prize),
(add_xp_to_troop,200,"trp_player"),
(assign, "$last_training_fight_town", -1)]],
[anyone ,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end)],
"Hello {playername}. Good to see you again.", "arena_master_pre_talk",[(assign, "$arena_reward_asked", 0)]],
[anyone,"arena_master_pre_talk", [], "What would you like to do?", "arena_master_talk",[]],
# [anyone|plyr,"arena_master_talk", [], "About the arena fights...", "arena_master_melee",[]],
[anyone|plyr,"arena_master_talk", [], "About the melee fights...", "arena_master_melee_pretalk",[]],
[anyone|plyr,"arena_master_talk", [(eq, "$arena_tournaments_asked", 0)], "Will there be a tournament in nearby towns soon?", "arena_master_ask_tournaments",[(assign, "$arena_tournaments_asked", 1)]],
[anyone|plyr,"arena_master_talk", [], "I need to leave now. Good bye.", "close_window",[]],
[anyone,"arena_master_ask_tournaments", [], "{reg2?There won't be any tournaments any time soon.:{reg1?Tournaments are:A tournament is} going to be held at {s15}.}", "arena_master_talk",
[
(assign, ":num_tournaments", 0),
(try_for_range_backwards, ":town_no", towns_begin, towns_end),
(party_slot_ge, ":town_no", slot_town_has_tournament, 1),
(val_add, ":num_tournaments", 1),
(try_begin),
(eq, ":num_tournaments", 1),
(str_store_party_name, s15, ":town_no"),
(else_try),
(str_store_party_name, s16, ":town_no"),
(eq, ":num_tournaments", 2),
(str_store_string, s15, "@{s16} and {s15}"),
(else_try),
(str_store_string, s15, "@{!}{s16}, {s15}"),
(try_end),
(try_end),
(try_begin),
(eq, ":num_tournaments", 0),
(assign, reg2, 1),
(else_try),
(assign, reg2, 0),
(store_sub, reg1, ":num_tournaments", 1),
(try_end),
]],
[anyone,"arena_master_melee_pretalk", [], "There will be a fight here soon. You can go and jump in if you like.", "arena_master_melee_talk",[]],
[anyone|plyr,"arena_master_melee_talk", [], "Good. That's what I am going to do.", "close_window",
[
(assign, "$last_training_fight_town", "$current_town"),
(store_current_hours,"$training_fight_time"),
(assign, "$g_mt_mode", abm_training),
(party_get_slot, ":scene","$current_town",slot_town_arena),
(modify_visitors_at_site,":scene"),
(reset_visitors),
(store_random_in_range, "$g_player_entry_point", 32, 40),
(set_visitor, "$g_player_entry_point", "trp_player"),
(set_jump_mission,"mt_arena_melee_fight"),
(jump_to_scene, ":scene"),
]],
[anyone|plyr,"arena_master_melee_talk", [], "Thanks. But I will give my bruises some time to heal.", "arena_master_melee_reject",[]],
[anyone,"arena_master_melee_reject", [], "Good {man/girl}. That's clever of you.", "arena_master_pre_talk",[]],
[anyone|plyr,"arena_master_melee_talk", [(eq, "$arena_reward_asked", 0)], "Actually, can you tell me about the rewards again?", "arena_training_melee_explain_reward",[(assign, "$arena_reward_asked", 1)]],
# [anyone,"arena_master_pre_talk",
# [(eq,"$arena_join_or_watch",1),
# (ge,"$arena_bet_amount",1),
# (eq,"$arena_bet_team","$arena_winner_team"),
# (assign,reg(5),"$arena_win_amount")],
# "You've won the bet, eh? Let me see. The sum you have earned amounts to {reg5} denars. Here you go.", "arena_master_pre_talk",
# [(call_script, "script_troop_add_gold", "trp_player", "$arena_win_amount"),
# (assign,"$arena_bet_amount",0),
# (assign,"$arena_win_amount",0),
# ]],
# [anyone,"arena_master_pre_talk",
# [(eq,"$arena_join_or_watch",0),
# (ge,"$arena_bet_amount",1),
# (eq,"$arena_fight_won",1),
# (assign,reg(5),"$arena_win_amount"),
# ],
# "And you had the good sense to bet on yourself too. Hmm let me see. You have won yourself some {reg5} denars. Here you are.", "arena_master_pre_talk",
# [(call_script, "script_troop_add_gold", "trp_player", "$arena_win_amount"),
# (assign,"$arena_bet_amount",0),
# (assign,"$arena_win_amount",0)]],
# [anyone,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end),(eq,"$waiting_for_arena_fight_result",1),(eq,"$arena_join_or_watch",0),(eq,"$arena_fight_won",1)],
# "Congratulations champion. You made some pretty good moves out there. Here is your share of share of the prize money, 2 denars.", "arena_master_pre_talk",
# [(assign,"$waiting_for_arena_fight_result",0),(add_xp_to_troop,20,"trp_player"),(call_script, "script_troop_add_gold", "trp_player",2)]],
# [anyone,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end),(eq,"$waiting_for_arena_fight_result",1),(eq,"$arena_join_or_watch",0)],
# "That's quite the bruise you're sporting. But don't worry; everybody gets trounced once in awhile. The important thing is to pick yourself up, dust yourself off and keep fighting. That's what champions do.", "arena_master_pre_talk",[[assign,"$waiting_for_arena_fight_result"]]],
# [anyone,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end),(eq,"$waiting_for_arena_fight_result",1)],
# "That was exciting wasn't it? Nothing like a good fight to get the blood flowing.", "arena_master_pre_talk",[(assign,"$waiting_for_arena_fight_result",0)]],
## [anyone,"arena_master_melee", [], "The next arena fight will start in a while. Hurry up if you want to take part in it.", "arena_master_melee_talk",[
## (party_get_slot, ":arena_cur_tier","$current_town",slot_town_arena_melee_cur_tier),
## (try_begin), #reg3 = num teams, reg4 = team size
## (eq, ":arena_cur_tier", 0),
## (party_get_slot, "$_num_teams","$current_town",slot_town_arena_melee_1_num_teams),
## (party_get_slot, "$_team_size","$current_town",slot_town_arena_melee_1_team_size),
## (else_try),
## (eq, ":arena_cur_tier", 1),
## (party_get_slot, "$_num_teams","$current_town",slot_town_arena_melee_2_num_teams),
## (party_get_slot, "$_team_size","$current_town",slot_town_arena_melee_2_team_size),
## (else_try),
## (party_get_slot, "$_num_teams","$current_town",slot_town_arena_melee_3_num_teams),
## (party_get_slot, "$_team_size","$current_town",slot_town_arena_melee_3_team_size),
## (try_end),
## ]],
## [anyone|plyr,"arena_master_melee_talk", [], "I want to join the next fight", "arena_master_next_melee_join",[(assign,"$arena_join_or_watch",0)]],
## [anyone|plyr,"arena_master_melee_talk", [], "I would like to watch the next fight", "arena_master_next_melee_watch",
## [(assign,"$arena_join_or_watch",1)]],
## [anyone|plyr,"arena_master_melee_talk", [], "No. perhaps later.", "arena_master_we_will_fight_not",[]],
## [anyone,"arena_master_we_will_fight_not", [], "Alright. Talk to me when you are ready.", "close_window",[]],
## [anyone,"arena_master_next_melee_join", [
## (assign,"$arena_bet_amount"),
## (assign,"$arena_bet_team",0),
## (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
## (store_div, ":divider", ":player_odds", 20),
## (store_mul, ":odds_simple", ":divider", 20),
## (val_sub, ":odds_simple", ":player_odds"),
## (try_begin),
## (lt, ":odds_simple", 0),
## (val_add, ":divider", 1),
## (try_end),
## (val_max, ":divider", 50),
## (store_div, ":odds_player", ":player_odds", ":divider"),
## (store_div, ":odds_other", 1000, ":divider"),
## (try_for_range, ":unused", 0, 5),
## (assign, ":last_divider", 21),
## (try_for_range, ":cur_divider", 2, ":last_divider"),
## (store_div, ":odds_player_test", ":odds_player", ":cur_divider"),
## (val_mul, ":odds_player_test", ":cur_divider"),
## (eq, ":odds_player_test", ":odds_player"),
## (store_div, ":odds_other_test", ":odds_other", ":cur_divider"),
## (val_mul, ":odds_other_test", ":cur_divider"),
## (eq, ":odds_other_test", ":odds_other"),
## (val_div, ":odds_player", ":cur_divider"),
## (val_div, ":odds_other", ":cur_divider"),
## (assign, ":last_divider", 0),
## (try_end),
## (try_end),
## (assign, reg5, ":odds_player"),
## (assign, reg6, ":odds_other"),], "Do you want to place a bet on yourself? The odds against you are {reg5} to {reg6}.", "arena_master_will_you_bet",
## []],
##
## [anyone|plyr,"arena_master_will_you_bet", [], "No.", "arena_master_start_fight",[]],
## [anyone|plyr,"arena_master_will_you_bet", [(store_troop_gold,reg(0)),(ge,reg(0),10)], "I want to bet 10 denars.",
## "arena_master_bet_placed",[(assign,"$arena_bet_amount",10),(troop_remove_gold, "trp_player",10)]],
## [anyone|plyr,"arena_master_will_you_bet", [(store_troop_gold,reg(0)),(ge,reg(0),50)], "I want to bet 50 denars.",
## "arena_master_bet_placed",[(assign,"$arena_bet_amount",50),(troop_remove_gold, "trp_player",50)]],
## [anyone|plyr,"arena_master_will_you_bet", [(store_troop_gold,reg(0)),(ge,reg(0),100)], "I want to bet 100 denars.",
## "arena_master_bet_placed",[(assign,"$arena_bet_amount",100),(troop_remove_gold, "trp_player",100)]],
## [anyone,"arena_master_next_melee_watch", [], "Do you want to place a bet?", "arena_master_will_you_bet",[]],
## [anyone,"arena_master_bet_placed", [(eq,"$arena_join_or_watch",1)], "Hmm. That's good. If you win, you'll get {reg5} denars. And which team do you want to place your bet on?", "arena_master_select_team",
## [(store_mul, "$arena_win_amount", "$arena_bet_amount", "$_num_teams"),
## (val_mul, "$arena_win_amount", 9),
## (val_div, "$arena_win_amount", 10),
## (assign, reg5, "$arena_win_amount"),
## ]],
## [anyone|plyr,"arena_master_select_team", [], "The red team. I have a feeling they will win this one.",
## "arena_master_start_fight",[(assign,"$arena_bet_team",0)]],
## [anyone|plyr,"arena_master_select_team", [], "The blue team. They will sweep the ground with the reds.",
## "arena_master_start_fight",[(assign,"$arena_bet_team",1)]],
## [anyone|plyr,"arena_master_select_team", [(ge,"$_num_teams",3)], "The green team. My money is on them this time.",
## "arena_master_start_fight",[(assign,"$arena_bet_team",2)]],
## [anyone|plyr,"arena_master_select_team", [(ge,"$_num_teams",4)], "The yellow team. They will be victorious.",
## "arena_master_start_fight",[(assign,"$arena_bet_team",3)]],
## [anyone,"arena_master_bet_placed", [], "That's good. Let me record that. If you win, you'll get {reg5} denars.", "arena_master_start_fight",
## [(store_mul,"$arena_win_amount", "$arena_bet_amount", "$_num_teams"),
## (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
## (val_sub, "$arena_win_amount", "$arena_bet_amount"),
## (val_mul, "$arena_win_amount", ":player_odds"),
## (val_div, "$arena_win_amount", 1000),
## (val_add, "$arena_win_amount", "$arena_bet_amount"),
## (val_mul, "$arena_win_amount", 9),
## (val_div, "$arena_win_amount", 10),
## (assign, reg5, "$arena_win_amount"),
## ]],
##
## [anyone,"arena_master_start_fight", [], "Very well. The fight starts in a moment. Good luck.", "close_window",
## [
## (store_encountered_party,"$current_town"),
## (party_get_slot, ":arena_scene","$current_town",slot_town_arena),
## (modify_visitors_at_site,":arena_scene"),
## (reset_visitors),
##
## #Assemble participants
## (assign, ":slot_no", 0),
## (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_xerina"),
## (val_add, ":slot_no", 1),
## (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_dranton"),
## (val_add, ":slot_no", 1),
## (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_kradus"),
## (val_add, ":slot_no", 1),
## (try_for_range, reg(4), 0, 10),
## (lt, ":slot_no", 48),
## (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_regular_fighter"),
## (val_add, ":slot_no", 1),
## (try_end),
## (try_for_range, reg(4), 0, 10),
## (lt, ":slot_no", 48),
## (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_veteran_fighter"),
## (val_add, ":slot_no", 1),
## (try_end),
## (try_for_range, reg(4), 0, 10),
## (lt, ":slot_no", 48),
## (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_champion_fighter"),
## (val_add, ":slot_no", 1),
## (try_end),
## (try_for_range, reg(4), 0, 5),
## (lt, ":slot_no", 48),
## (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_sword_sister"),
## (val_add, ":slot_no", 1),
## (try_end),
## (try_for_range, reg(4), 0, 10),
## (lt, ":slot_no", 48),
## (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_hired_blade"),
## (val_add, ":slot_no", 1),
## (try_end),
## (try_for_range, reg(4), 0, 10),
## (lt, ":slot_no", 48),
## (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_mercenary"),
## (val_add, ":slot_no", 1),
## (try_end),
## (assign, "$pin_troop", "trp_temp_array_a"),
## (call_script, "script_shuffle_troop_slots", 0, 48),
##
## (try_for_range, reg(12), 0, 48),
## (troop_set_slot, "trp_temp_array_b", reg(12),reg(12)), #Initialize temp_array_b such that temp_array_b[i] = i
## (try_end),
##
## (store_random_in_range, "$arena_player_team", 0, "$_num_teams"),
## (try_for_range, ":i_team", 0, "$_num_teams"), # repeat for num_teams; reg(55) = cur_team
## (assign, ":team_slots_start", ":i_team"),
## (val_mul, ":team_slots_start", 8),
## (assign, ":team_slots_end", ":team_slots_start"),
## (val_add, ":team_slots_end", 8),
## (assign, "$pin_troop", "trp_temp_array_b"),
## (call_script, "script_shuffle_troop_slots", ":team_slots_start", ":team_slots_end"),
## (assign, ":cur_slot", ":team_slots_start"),
## (try_for_range, reg(6), 0, "$_team_size"), # repeat for team_size;
## (troop_get_slot, ":cur_slot_troop", "trp_temp_array_a", ":cur_slot"),
## (try_begin), #place player
## (eq,"$arena_join_or_watch",0),
## (eq, ":i_team", "$arena_player_team"),
## (eq, reg(6), 0),
## (assign, ":cur_slot_troop", "trp_player"),
## (try_end),
## (troop_get_slot, ":cur_entry_no", "trp_temp_array_b", ":cur_slot"),
## (set_visitor,":cur_entry_no",":cur_slot_troop"),
## (val_add, ":cur_slot", 1),
## (try_end),
## (try_end),
##
## (try_begin),
## (eq, "$arena_join_or_watch", 1),
## (set_visitor, 33, "trp_player"),#entry point 51
## (try_end),
## (assign, "$arena_fight_won", 0),
## (assign, "$arena_winner_team", -1),
## (assign, "$waiting_for_arena_fight_result", 1),
## (assign, "$g_mt_mode", abm_fight),
## (party_get_slot, reg(6),"$current_town",slot_town_arena_melee_cur_tier),
## (val_add,reg(6),1),
## (val_mod,reg(6),3),
## (party_set_slot, "$current_town",slot_town_arena_melee_cur_tier, reg(6)),
### (set_jump_mission,"mt_arena_melee_fight"),
## (party_get_slot, ":arena_mission_template", "$current_town", slot_town_arena_template),
## (set_jump_mission, ":arena_mission_template"),
## (party_get_slot, reg(7), "$current_town", slot_town_arena),
## (jump_to_scene, reg(7)),
## ]],
######################################################################################
[trp_galeas,"start", [], "Hello {boy/girl}. If you have any prisoners, I will be happy to buy them from you.", "galeas_talk",[]],
[trp_galeas|plyr,"galeas_talk",
[[store_num_regular_prisoners,reg(0)],[ge,reg(0),1]],
"Then you'd better bring your purse. I have got prisoners to sell.", "galeas_sell_prisoners",[]],
[trp_galeas|plyr,"galeas_talk",[], "Not this time. Good-bye.", "close_window",[]],
[trp_galeas,"galeas_sell_prisoners", [],
"Let me see what you have...", "galeas_sell_prisoners_2",
[[change_screen_trade_prisoners]]],
[trp_galeas, "galeas_sell_prisoners_2", [], "You take more prisoners, bring them to me. I will pay well.", "close_window",[]],
## [party_tpl|pt_refugees,"start", [], "We have been driven out of our homes because of this war.", "close_window",[(assign, "$g_leave_encounter",1)]],
## [party_tpl|pt_farmers,"start", [], "We are just simple farmers.", "close_window",[(assign, "$g_leave_encounter",1)]],
# Random Quest related conversations
# [trp_nobleman, "start", [],
# "Who are you? What do you want? Be warned, we are fully armed and more than capable to defend ourselves. Go to your way now or you will regret it.", "nobleman_talk_1",
# [(play_sound,"snd_encounter_nobleman")]],
# [trp_nobleman|plyr, "nobleman_talk_1", [],
# "I demand that you surrender to me.", "nobleman_talk_2",[]],
# [trp_nobleman|plyr, "nobleman_talk_1", [],
# "I am sorry sir. You may go.", "close_window",[(assign, "$g_leave_encounter",1)]],
# [trp_nobleman, "nobleman_talk_2", [],
# "Surrender to a puny peasant like you? Hah. Not likely.", "close_window",[[encounter_attack]]],
#
# [trp_nobleman,"enemy_defeated", [], "Parley! I am of noble birth, and I ask for my right to surrender.", "nobleman_defeated_1",[]],
# [trp_nobleman|plyr,"nobleman_defeated_1", [], "And I will grant you that. If you can be ransomed of course...", "nobleman_defeated_2",[]],
# [trp_nobleman,"nobleman_defeated_2", [], "Oh, you need not worry about that. My family would pay a large ransom for me.", "nobleman_defeated_3",[]],
# [trp_nobleman|plyr,"nobleman_defeated_3", [[str_store_troop_name,1,"$nobleman_quest_giver"]], "Hmm. {s1} will be happy about this... Then you are my prisoner.", "close_window",
# [[assign,"$nobleman_quest_succeeded",1],[assign,"$nobleman_quest_nobleman_active",0]]],
# Prisoner Trains
## [anyone,"start", [(eq,"$g_encountered_party_type",spt_prisoner_train)],
## "What do you want?", "prisoner_train_talk",[]],
##
## [anyone|plyr,"prisoner_train_talk", [],
## "Set those prisoners free now!", "prisoner_train_talk_ultimatum",[]],
## [anyone,"prisoner_train_talk_ultimatum", [],
## "Or what? Are you going to attack us?", "prisoner_train_talk_ultimatum_2",[]],
## [anyone|plyr,"prisoner_train_talk_ultimatum_2", [],
## "Yes I will. Consider yourself warned!", "prisoner_train_talk_ultimatum_2a",[]],
## [anyone,"prisoner_train_talk_ultimatum_2a", [],
## "We'll see that.", "close_window",[
## (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
## ]],
##
## [anyone|plyr,"prisoner_train_talk_ultimatum_2", [],
## "Attack you? Hell no! I just took pity on those poor souls.", "prisoner_train_talk_ultimatum_2b",[]],
## [anyone,"prisoner_train_talk_ultimatum_2b", [],
## "Find something else to take pity on.", "close_window",[(assign, "$g_leave_encounter",1)]],
## [anyone|plyr,"prisoner_train_talk", [],
## "Better watch those prisoners well. They may try to run away.", "prisoner_train_smalltalk",[]],
## [anyone,"prisoner_train_smalltalk", [],
## "Don't worry. They aren't going anywhere.", "close_window",[(assign, "$g_leave_encounter",1)]],
## [anyone,"start", [(eq, "$g_encountered_party_type", spt_forager), (is_between, "$g_encountered_party_relation", -9, 1)],
## "Hold it right there. Who are you?", "soldiers_interrogation",[(play_sound,"snd_encounter_vaegirs_neutral")]],
## [anyone,"start", [(eq, "$g_encountered_party_type", spt_forager), (le, "$g_encountered_party_relation", -10)],
## "You will not survive this!", "close_window",
## [(store_relation, reg(5),"$g_encountered_party_faction"), (val_sub,reg(5),1), (set_relation,"$g_encountered_party_faction",0,reg(5)),(encounter_attack,0)]],
## [anyone,"start", [(eq, "$g_encountered_party_type", spt_forager),(ge, "$g_encountered_party_relation", 1)],
## "Our lands have been invaded. But we will drive them back.", "close_window",[(assign, "$g_leave_encounter",1),(play_sound,"snd_encounter_vaegirs_ally"),]],
##
## [anyone,"start", [(eq, "$g_encountered_party_type", spt_scout),(is_between, "$g_encountered_party_relation", -9, 1)],
## "Hold it right there. Who are you?", "soldiers_interrogation",[]],
## [anyone,"start", [(eq, "$g_encountered_party_type", spt_scout),(le, "$g_encountered_party_relation", -10)],
## "You deserve to die a thousand deaths!", "close_window",
## [(store_relation, reg(5),"$g_encountered_party_faction"), (val_sub,reg(5),2), (set_relation,"$g_encountered_party_faction",0,reg(5)),(encounter_attack,0)]],
## [anyone,"start", [(eq, "$g_encountered_party_type", spt_scout),(ge, "$g_encountered_party_relation", 1)],
## "Venture deep into the enemy territory and find myself a caravan to raid. That's the way I will get rich.", "close_window",[(assign, "$g_leave_encounter",1)]],
##
## [anyone,"start", [(this_or_next|eq, "$g_encountered_party_type", spt_patrol),(eq, "$g_encountered_party_type", spt_war_party),(is_between, "$g_encountered_party_relation", -9, 1)],
## "Hold it right there. Who are you?", "soldiers_interrogation",[]],
## [anyone,"start", [(this_or_next|eq, "$g_encountered_party_type", spt_patrol),(eq, "$g_encountered_party_type", spt_war_party),(le, "$g_encountered_party_relation", -10)],
## "You will not survive this!", "close_window",
## [(store_relation, reg(5),"$g_encountered_party_type"), (val_sub,reg(5),3), (set_relation,"$g_encountered_party_type",0,reg(5)),(encounter_attack,0)]],
## [anyone,"start", [(this_or_next|eq, "$g_encountered_party_type", spt_patrol),(eq, "$g_encountered_party_type", spt_war_party),(ge, "$g_encountered_party_relation", 1)],
## "Sooner or later, friend. Victory will belong to us.", "close_window",[(assign, "$g_leave_encounter",1)]],
#swadian parties
## [anyone|plyr,"soldiers_interrogation", [], "I am {playername}.", "soldiers_interrogation_2",[]],
## [anyone,"soldiers_interrogation_2", [], "What are you doing here?", "soldiers_interrogation_3",[]],
## [anyone|plyr,"soldiers_interrogation_3", [], "I am carrying some merchandise.", "soldiers_interrogation_4",[]],
## [anyone|plyr,"soldiers_interrogation_3", [], "I am just admiring the sights.", "soldiers_interrogation_4",[]],
## [anyone,"soldiers_interrogation_4", [], "Hmm. All right. You may go now. But be careful. There is a war going on. The roads are not safe for travellers.", "close_window",[(assign, "$g_leave_encounter",1)]],
# Bandits
## [party_tpl|pt_mountain_bandits,"start", [(this_or_next|eq, "$g_encountered_party_template", "pt_mountain_bandits"),(eq, "$g_encountered_party_template", "pt_forest_bandits"),
## (eq,"$talk_context",tc_party_encounter),
## (party_get_slot,":protected_until_hours", "$g_encountered_party",slot_party_ignore_player_until),
## (store_current_hours,":cur_hours"),
## (store_sub, ":protection_remaining",":protected_until_hours",":cur_hours"),
## (ge, ":protection_remaining", 0)], "What do you want?\
## You want to pay us some more money?", "bandit_paid_talk",[]],
##
## [anyone|plyr,"bandit_paid_talk", [], "Sorry to trouble you. I'll be on my way now.", "bandit_paid_talk_2a",[]],
## [anyone,"bandit_paid_talk_2a", [], "Yeah. Stop fooling around and go make some money.\
## I want to see that purse full next time I see you.", "close_window",[(assign, "$g_leave_encounter",1)]],
## [anyone|plyr,"bandit_paid_talk", [], "No. It's your turn to pay me this time.", "bandit_paid_talk_2b",[]],
## [anyone,"bandit_paid_talk_2b", [], "What nonsense are you talking about? You want trouble? You got it.", "close_window",[
## (party_set_slot,"$g_encountered_party",slot_party_ignore_player_until,0),
## (party_ignore_player, "$g_encountered_party", 0),
## ]],
# Ryan BEGIN
[party_tpl|pt_mountain_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
"{!}Warning: This line should never display.", "bandit_introduce",[]],
[party_tpl|pt_forest_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
"{!}Warning: This line should never display.", "bandit_introduce",[]],
[party_tpl|pt_taiga_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
"{!}Warning: This line should never display.", "bandit_introduce",[]],
[party_tpl|pt_steppe_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
"{!}Warning: This line should never display.", "bandit_introduce",[]],
[party_tpl|pt_desert_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
"{!}Warning: This line should never display.", "bandit_introduce",[]],
[anyone,"bandit_introduce", [
(store_random_in_range, ":rand", 11, 15),
(str_store_string, s11, "@I can smell a fat purse a mile away. Methinks yours could do with some lightening, eh?"),
(str_store_string, s12, "@Why, it be another traveller, chance met upon the road! I should warn you, country here's a mite dangerous for a good {fellow/woman} like you. But for a small donation my boys and I'll make sure you get rightways to your destination, eh?"),
(str_store_string, s13, "@Well well, look at this! You'd best start coughing up some silver, friend, or me and my boys'll have to break you."),
(str_store_string, s14, "@There's a toll for passin' through this land, payable to us, so if you don't mind we'll just be collectin' our due from your purse..."),
(str_store_string_reg, s5, ":rand"),
], "{s5}", "bandit_talk",[(play_sound,"snd_encounter_bandits")]],
[anyone|plyr,"bandit_talk", [], "I'll give you nothing but cold steel, you scum!", "close_window",[[encounter_attack]]],
[anyone|plyr,"bandit_talk", [], "There's no need to fight. I can pay for free passage.", "bandit_barter",[]],
[anyone,"bandit_barter",
[(store_relation, ":bandit_relation", "fac_player_faction", "$g_encountered_party_faction"),
(ge, ":bandit_relation", -50),
(store_troop_gold, ":total_value", "trp_player"),
(troop_get_inventory_capacity, ":inv_size", "trp_player"),
(try_for_range, ":i_slot", 0, ":inv_size"),
(troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
(ge, ":item_id", 0),
(try_begin),
(is_between, ":item_id", trade_goods_begin, trade_goods_end),
(store_item_value, ":item_value", ":item_id"),
(val_add, ":total_value", ":item_value"),
(try_end),
(try_end),
(store_div, "$bandit_tribute", ":total_value", 10), #10000 gold = excellent_target
(val_max, "$bandit_tribute", 10),
(assign, reg5, "$bandit_tribute")
], "Silver without blood, that's our favourite kind! Hmm, having a look at you, I reckon you could easily come up with {reg5} denars. Pay it, and we'll let you be on your way.", "bandit_barter_2",[]],
[anyone|plyr,"bandit_barter_2", [[store_troop_gold,reg(2)],[ge,reg(2),"$bandit_tribute"],[assign,reg(5),"$bandit_tribute"]],
"Very well, take it.", "bandit_barter_3a",[[troop_remove_gold, "trp_player","$bandit_tribute"]]],
[anyone|plyr,"bandit_barter_2", [],
"I don't have that much money with me", "bandit_barter_3b",[]],
[anyone,"bandit_barter_3b", [],
"That's too bad. I guess we'll just have to sell you into slavery. Take {him/her}, lads!", "close_window",[[encounter_attack]]],
[anyone,"bandit_barter", [],
"Hey, I've heard of you! You slaughter us freebooters like dogs, and now you expect us to let you go for a few stinking coins?\
Forget it. You gave us no quarter, and you'll get none from us.", "close_window",[]],
[anyone,"bandit_barter_3a", [], "Heh, that wasn't so hard, was it? All right, we'll let you go now. Be off.", "close_window",[
(store_current_hours,":protected_until"),
(val_add, ":protected_until", 72),
(party_set_slot,"$g_encountered_party",slot_party_ignore_player_until,":protected_until"),
(party_ignore_player, "$g_encountered_party", 72),
(assign, "$g_leave_encounter",1)
]],
[anyone,"start", [(this_or_next|eq, "$g_encountered_party_template", "pt_mountain_bandits"),(eq, "$g_encountered_party_template", "pt_forest_bandits")],
"Eh? What is it?", "bandit_meet",[]],
[anyone|plyr,"bandit_meet", [], "Your luck has run out, wretch. Prepare to die!", "bandit_attack",
[(store_relation, ":bandit_relation", "fac_player_faction", "$g_encountered_party_faction"),
(val_sub, ":bandit_relation", 3),
(val_max, ":bandit_relation", -100),
(set_relation, "fac_player_faction", "$g_encountered_party_faction", ":bandit_relation"),
(party_ignore_player, "$g_encountered_party", 0),
(party_set_slot,"$g_encountered_party",slot_party_ignore_player_until, 0),
]],
[anyone,"bandit_attack", [
(store_random_in_range, ":rand", 11, 15),
(str_store_string, s11, "@Another fool come to throw {him/her}self on my weapon, eh? Fine, let's fight!"),
(str_store_string, s12, "@We're not afraid of you, {sirrah/wench}. Time to bust some heads!"),
(str_store_string, s13, "@That was a mistake. Now I'm going to have to make your death long and painful."),
(str_store_string, s14, "@Brave words. Let's see you back them up with deeds, cur!"),
(str_store_string_reg, s5, ":rand"),
], "{s5}", "close_window",[]],
[anyone|plyr,"bandit_meet", [], "Never mind, I have no business with you.", "close_window",[(assign, "$g_leave_encounter", 1)]],
# Ryan END
[party_tpl|pt_rescued_prisoners,"start", [(eq,"$talk_context",tc_party_encounter)], "Do you want us to follow you?", "disbanded_troop_ask",[]],
[anyone|plyr,"disbanded_troop_ask", [], "Yes. Let us ride together.", "disbanded_troop_join",[]],
[anyone|plyr,"disbanded_troop_ask", [], "No. Not at this time.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone,"disbanded_troop_join", [[neg|party_can_join]], "Unfortunately. You do not have room in your party for us.", "close_window",[(assign, "$g_leave_encounter",1)]],
[anyone,"disbanded_troop_join", [], "We are at your command.", "close_window",[[party_join],(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_enemy,"start", [(eq,"$talk_context",tc_party_encounter)], "You will not capture me again. Not this time.", "enemy_talk_1",[]],
[party_tpl|pt_enemy|plyr,"enemy_talk_1", [], "You don't have a chance against me. Give up.", "enemy_talk_2",[]],
[party_tpl|pt_enemy,"enemy_talk_2", [], "I will give up when you are dead!", "close_window",[[encounter_attack]]],
######################################
# ROUTED WARRIORS
######################################
[party_tpl|pt_routed_warriors, "start", [(eq,"$talk_context",tc_party_encounter)],
"I beg you, please leave us alone.", "party_encounter_routed_agents_are_caught",
[]],
[party_tpl|pt_routed_warriors|plyr, "party_encounter_routed_agents_are_caught", [],
"Do you think you can run away from me? You will be my prisoner or die!", "party_encounter_routed_agents_are_caught2",
[]],
[party_tpl|pt_routed_warriors|plyr,"party_encounter_routed_agents_are_caught", [],
"Ok. We'll leave you in peace for this time, do not face with us again.", "close_window", [(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_routed_warriors, "party_encounter_routed_agents_are_caught2",
[
#(store_party_size_wo_prisoners, ":routed_party_size", "$g_encountered_party"),
#(store_party_size_wo_prisoners, ":main_party_size", "p_main_party"),
# calculate power of routed party
(assign, ":routed_party_power", 0),
(party_get_num_companion_stacks, ":num_stacks", "$g_encountered_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "$g_encountered_party", ":i_stack"),
(store_character_level, ":troop_level", ":stack_troop"),
(try_begin),
(troop_is_mounted, ":stack_troop"),
(val_add, ":troop_level", 5),
(try_end),
(party_stack_get_size, ":stack_size", "$g_encountered_party", ":i_stack"),
(val_mul, ":troop_level", ":stack_size"),
(val_add, ":routed_party_power", ":troop_level"),
(try_end),
# calculate power of our party
(assign, ":main_party_power", 0),
(party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "p_main_party", ":i_stack"),
(store_character_level, ":troop_level", ":stack_troop"),
(try_begin),
(troop_is_mounted, ":stack_troop"),
(val_add, ":troop_level", 5),
(try_end),
(party_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
(val_mul, ":troop_level", ":stack_size"),
(val_add, ":main_party_power", ":troop_level"),
(try_end),
(store_div, ":main_party_power_divided_by_5", ":main_party_power", 5),
#find num attached parties to routed warriors
(party_get_num_attached_parties, ":num_attached_parties", "$g_encountered_party"),
(this_or_next|gt, ":num_attached_parties", 0), #always fight
(ge, ":routed_party_power", ":main_party_power_divided_by_5"),
],
"Haven't you got any mercy? Ok, we will fight you to the last man!", "close_window",
[]],
[party_tpl|pt_routed_warriors, "party_encounter_routed_agents_are_caught2",
[
#(store_party_size_wo_prisoners, ":routed_party_size", "$g_encountered_party"),
#(store_party_size_wo_prisoners, ":main_party_size", "p_main_party"),
# calculate power of routed party
(assign, ":routed_party_population", 0),
(assign, ":routed_party_power", 0),
(party_get_num_companion_stacks, ":num_stacks", "$g_encountered_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "$g_encountered_party", ":i_stack"),
(store_character_level, ":troop_level", ":stack_troop"),
(try_begin),
(troop_is_mounted, ":stack_troop"),
(val_add, ":troop_level", 5),
(try_end),
(party_stack_get_size, ":stack_size", "$g_encountered_party", ":i_stack"),
(val_mul, ":troop_level", ":stack_size"),
(val_add, ":routed_party_power", ":troop_level"),
(val_add, ":routed_party_population", ":stack_size"),
(try_end),
# calculate power of our party
(assign, ":main_party_power", 0),
(party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "p_main_party", ":i_stack"),
(store_character_level, ":troop_level", ":stack_troop"),
(try_begin),
(troop_is_mounted, ":stack_troop"),
(val_add, ":troop_level", 5),
(try_end),
(party_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
(val_mul, ":troop_level", ":stack_size"),
(val_add, ":main_party_power", ":troop_level"),
(try_end),
(store_div, ":main_party_power_divided_by_5", ":main_party_power", 5),
(lt, ":routed_party_power", ":main_party_power_divided_by_5"),
(store_party_size_wo_prisoners, ":routed_party_size", "$g_encountered_party"),
(assign, reg3, ":routed_party_size"),
(try_begin),
(gt, ":routed_party_population", 1),
(str_store_string, s1, "str_we_resign"),
(else_try),
(str_store_string, s1, "str_i_resign"),
(try_end),
],
"{s1}", "close_window",
[(assign,"$g_enemy_surrenders", 1),
(call_script, "script_party_wound_all_members", "$g_encountered_party"),
(call_script, "script_party_copy", "p_total_enemy_casualties", "$g_encountered_party"),
#(change_screen_exchange_with_party, "$g_encountered_party"),
]],
#[party_tpl|pt_routed_warriors,"close_window_anythink_else", [],
# "Anythink else.", "close_window", [(assign, "$g_leave_encounter",1)]],
# Ryan BEGIN
[anyone,"sell_prisoner_outlaws", [[store_troop_kind_count,0,"trp_looter"],[ge,reg(0),1],[assign,reg(1),reg(0)],[val_mul,reg(1),10],[val_mul,reg(2),reg(0)],[val_mul,reg(2),10]],
"Hmmm. 10 denars for each looter makes {reg1} denars for all {reg0} of them.", "sell_prisoner_outlaws",
[[call_script, "script_troop_add_gold", "trp_player", reg(1)],[add_xp_to_troop,reg(2)],[remove_member_from_party,"trp_looter"]]],
[anyone,"sell_prisoner_outlaws", [[store_troop_kind_count,0,"trp_bandit"],[ge,reg(0),1],[assign,reg(1),reg(0)],[val_mul,reg(1),20],[assign,reg(2),reg(0)],[val_mul,reg(2),20]],
"Let me see. You've brought {reg0} bandits, so 20 denars for each comes up to {reg1} denars.", "sell_prisoner_outlaws",
[[call_script, "script_troop_add_gold", "trp_player", reg(1)],[add_xp_to_troop,reg(2)],[remove_member_from_party,"trp_bandit"]]],
[anyone,"sell_prisoner_outlaws", [[store_troop_kind_count,0,"trp_brigand"],[ge,reg(0),1],[assign,reg(1),reg(0)],[val_mul,reg(1),30],[assign,reg(2),reg(0)],[val_mul,reg(2),30]],
"Well well, you've captured {reg0} brigands. Each one is worth 30 denars, so I'll give you {reg1} for them in total.", "sell_prisoner_outlaws",
[[call_script, "script_troop_add_gold", "trp_player", reg(1)],[add_xp_to_troop,reg(2)],[remove_member_from_party,"trp_brigand"]]],
[anyone,"sell_prisoner_outlaws", [], "I suppose that'll be all, then.", "sell_prisoner_outlaws_finished",[]],
# Ryan END
[anyone|plyr,"prisoner_chat", [], "Do not try running away or trying something stupid. I will be watching you.", "prisoner_chat_2",[]],
[anyone,"prisoner_chat_2", [], "No, I swear I won't.", "close_window",[]],
[anyone,"start", [(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(this_or_next|is_between,"$g_talk_troop",weapon_merchants_begin,weapon_merchants_end),
(this_or_next|is_between,"$g_talk_troop",armor_merchants_begin, armor_merchants_end),
( is_between,"$g_talk_troop",horse_merchants_begin, horse_merchants_end),
],
"Greetings, {your lordship/my lady}. How can I serve you today?", "town_merchant_talk",[]],
[anyone,"start", [(this_or_next|is_between,"$g_talk_troop",weapon_merchants_begin,weapon_merchants_end),
(this_or_next|is_between,"$g_talk_troop",armor_merchants_begin, armor_merchants_end),
( is_between,"$g_talk_troop",horse_merchants_begin, horse_merchants_end)], "Good day. What can I do for you?", "town_merchant_talk",[]],
[anyone|plyr,"town_merchant_talk", [(is_between,"$g_talk_troop",weapon_merchants_begin,weapon_merchants_end)],
"I want to buy a new weapon. Show me your wares.", "trade_requested_weapons",[]],
[anyone|plyr,"town_merchant_talk", [(is_between,"$g_talk_troop",armor_merchants_begin,armor_merchants_end)],
"I am looking for some equipment. Show me what you have.", "trade_requested_armor",[]],
[anyone|plyr,"town_merchant_talk", [(is_between,"$g_talk_troop",horse_merchants_begin,horse_merchants_end)],
"I am thinking of buying a horse.", "trade_requested_horse",[]],
[anyone,"trade_requested_weapons", [], "Ah, yes {sir/madam}. These arms are the best you'll find anywhere.", "merchant_trade",[[change_screen_trade]]],
[anyone,"trade_requested_armor", [], "Of course, {sir/madam}. You won't find better quality armour than these in all Calradia.", "merchant_trade",[[change_screen_trade]]],
[anyone,"trade_requested_horse", [], "You have a fine eye for horses, {sir/madam}. You won't find better beasts than these anywhere else.", "merchant_trade",[[change_screen_trade]]],
[anyone,"merchant_trade", [], "Anything else?", "town_merchant_talk",[]],
[anyone|plyr,"town_merchant_talk", [], "Tell me. What are people talking about these days?", "merchant_gossip",[]],
[anyone,"merchant_gossip", [], "Well, nothing new lately. Prices, weather, the war, the same old things.", "town_merchant_talk",[]],
[anyone|plyr,"town_merchant_talk", [], "Good-bye.", "close_window",[]],
## [anyone,"start", [(eq, "$talk_context", 0),
## (is_between,"$g_talk_troop",walkers_begin, walkers_end),
## (eq, "$sneaked_into_town",1),
## ], "Stay away beggar!", "close_window",[]],
[anyone,"start", [(eq, "$talk_context", 0),
(is_between,"$g_talk_troop",walkers_begin, walkers_end),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
], "My {lord/lady}?", "town_dweller_talk",[(assign, "$welfare_inquired",0),(assign, "$rumors_inquired",0),(assign, "$info_inquired",0)]],
[anyone,"start", [(eq, "$talk_context", 0),
(is_between,"$g_talk_troop",walkers_begin, walkers_end),
], "Good day, {sir/madam}.", "town_dweller_talk",[(assign, "$welfare_inquired", 0),(assign, "$rumors_inquired",0),(assign, "$info_inquired",0)]],
[anyone|plyr,"town_dweller_talk", [(check_quest_active, "qst_hunt_down_fugitive"),
(neg|check_quest_concluded, "qst_hunt_down_fugitive"),
(quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_target_center, "$current_town"),
(quest_get_slot, ":quest_target_dna", "qst_hunt_down_fugitive", slot_quest_target_dna),
(call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
(str_store_string, s4, s50),
],
"I am looking for a man by the name of {s4}. I was told he may be hiding here.", "town_dweller_ask_fugitive",[]],
[anyone ,"town_dweller_ask_fugitive", [],
"Strangers come and go to our village, {sir/madam}. If he is hiding here, you will surely find him if you look around.", "close_window",[]],
# Ryan BEGIN
[anyone|plyr,"town_dweller_talk",
[
(eq, 1, 0),
(check_quest_active, "qst_meet_spy_in_enemy_town"),
(neg|check_quest_succeeded, "qst_meet_spy_in_enemy_town"),
(quest_slot_eq, "qst_meet_spy_in_enemy_town", slot_quest_target_center, "$current_town"),
(str_store_item_name,s5,"$spy_item_worn"),
],
"Pardon me, but is that a {s5} you're wearing?", "town_dweller_quest_meet_spy_in_enemy_town_ask_item",
[
]],
[anyone, "town_dweller_quest_meet_spy_in_enemy_town_ask_item", [
(str_store_item_name,s5,"$spy_item_worn"),
(try_begin),
(troop_has_item_equipped,"$g_talk_troop","$spy_item_worn"),
(str_store_string,s6,"@A {s5}? Well... Yes, I suppose it is. What a strange thing to ask."),
(else_try),
(str_store_string,s6,"@Eh? No, it most certainly is not a {s5}. I'd start questioning my eyesight if I were you."),
(try_end),
],
"{s6}", "town_dweller_talk",[]],
[anyone|plyr|repeat_for_100,"town_dweller_talk",
[
(store_repeat_object,":object"),
(lt,":object",4), # repeat only 4 times
(check_quest_active, "qst_meet_spy_in_enemy_town"),
(neg|check_quest_succeeded, "qst_meet_spy_in_enemy_town"),
(quest_slot_eq, "qst_meet_spy_in_enemy_town", slot_quest_target_center, "$current_town"),
(store_add,":string",":object","str_secret_sign_1"),
(str_store_string, s4, ":string"),
],
"{s4}", "town_dweller_quest_meet_spy_in_enemy_town",
[
(store_repeat_object,":object"),
(assign, "$temp", ":object"),
]],
[anyone ,"town_dweller_quest_meet_spy_in_enemy_town",
[
(call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
(assign, ":walker_type", reg0),
(eq, ":walker_type", walkert_spy),
(quest_get_slot, ":secret_sign", "qst_meet_spy_in_enemy_town", slot_quest_target_amount),
(val_sub, ":secret_sign", secret_signs_begin),
(eq, ":secret_sign", "$temp"),
(store_add, ":countersign", ":secret_sign", countersigns_begin),
(str_store_string, s4, ":countersign"),
],
"{s4}", "town_dweller_quest_meet_spy_in_enemy_town_know",[]],
[anyone, "town_dweller_quest_meet_spy_in_enemy_town", [],
"Eh? What kind of gibberish is that?", "town_dweller_quest_meet_spy_in_enemy_town_dont_know",[]],
[anyone|plyr, "town_dweller_quest_meet_spy_in_enemy_town_dont_know", [],
"Never mind.", "close_window",[]],
[anyone|plyr, "town_dweller_quest_meet_spy_in_enemy_town_know", [
(quest_get_slot, ":quest_giver", "qst_meet_spy_in_enemy_town", slot_quest_giver_troop),
(str_store_troop_name, s4, ":quest_giver"),
],
"{s4} sent me to collect your reports. Do you have them with you?", "town_dweller_quest_meet_spy_in_enemy_town_chat",[]],
[anyone, "town_dweller_quest_meet_spy_in_enemy_town_chat", [
(quest_get_slot, ":quest_giver", "qst_meet_spy_in_enemy_town", slot_quest_giver_troop),
(str_store_troop_name, s4, ":quest_giver"),
],
"I've been expecting you. Here they are, make sure they reach {s4} intact and without delay.", "town_dweller_quest_meet_spy_in_enemy_town_chat_2",[
(call_script, "script_succeed_quest", "qst_meet_spy_in_enemy_town"),
(call_script, "script_center_remove_walker_type_from_walkers", "$current_town", walkert_spy),
]],
[anyone|plyr, "town_dweller_quest_meet_spy_in_enemy_town_chat_2", [],
"Farewell.", "close_window",
[
]],
# Ryan END
[anyone|plyr,"town_dweller_talk", [(party_slot_eq, "$current_town", slot_party_type, spt_village),
(eq, "$info_inquired", 0)], "What can you tell me about this village?", "town_dweller_ask_info",[(assign, "$info_inquired", 1)]],
[anyone|plyr,"town_dweller_talk", [(party_slot_eq, "$current_town", slot_party_type, spt_town),
(eq, "$info_inquired", 0)], "What can you tell me about this town?", "town_dweller_ask_info",[(assign, "$info_inquired", 1)]],
[anyone,"town_dweller_ask_info", [(str_store_party_name, s5, "$current_town"),
(assign, reg4, 0),
(try_begin),
(party_slot_eq, "$current_town", slot_party_type, spt_town),
(assign, reg4, 1),
(try_end),
(str_store_string, s6, "@This is the {reg4?town:village} of {s5}, {sir/madam}."),
(str_clear, s10),
(try_begin),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(str_store_string, s10, "@{s6} Our {reg4?town:village} and the surrounding lands belong to you of course, my {lord/lady}."),
(else_try),
(party_get_slot, ":town_lord", "$current_town", slot_town_lord),
(ge, ":town_lord", 0),
(str_store_troop_name, s7, ":town_lord"),
(store_troop_faction, ":town_lord_faction", ":town_lord"),
(str_store_faction_name, s8, ":town_lord_faction"),
(str_store_string, s10, "@{s6} Our {reg4?town:village} and the surrounding lands belong to {s7} of {s8}."),
(try_end),
(str_clear, s5),
(assign, ":number_of_goods", 0),
(try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
(store_sub, ":cur_good_slot", ":cur_good", trade_goods_begin),
(val_add, ":cur_good_slot", slot_town_trade_good_productions_begin),
(party_get_slot, ":production", "$g_encountered_party", ":cur_good_slot"),
(ge, ":production", 5),
(str_store_item_name, s3, ":cur_good"),
(try_begin),
(eq, ":number_of_goods", 0),
(str_store_string, s5, s3),
(else_try),
(eq, ":number_of_goods", 1),
(str_store_string, s5, "@{s3} and {s5}"),
(else_try),
(str_store_string, s5, "@{!}{s3}, {s5}"),
(try_end),
(val_add, ":number_of_goods", 1),
(try_end),
(try_begin),
(gt, ":number_of_goods", 0),
(assign, reg20, 1),
(else_try),
(assign, reg20, 0),
(try_end),
(str_store_string, s11, "@{reg20?We mostly produce {s5} here:We don't produce much here these days}.\
If you would like to learn more, you can speak with our {reg4?guildmaster:village elder}. He is nearby, right over there."),
],
"{s10} {s11}", "close_window",[]],
[anyone|plyr,"town_dweller_talk", [(party_slot_eq, "$current_town", slot_party_type, spt_village),
(eq, "$welfare_inquired", 0)], "How is life here?", "town_dweller_ask_situation",[(assign, "$welfare_inquired", 1)]],
[anyone|plyr,"town_dweller_talk", [(party_slot_eq, "$current_town", slot_party_type, spt_town),
(eq, "$welfare_inquired", 0)], "How is life here?", "town_dweller_ask_situation",[(assign, "$welfare_inquired", 1)]],
[anyone,"town_dweller_ask_situation", [(call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
(assign, ":walker_type", reg0),
(eq, ":walker_type", walkert_needs_money),
(party_slot_eq, "$current_town", slot_party_type, spt_village)],
"Disaster has struck my family, {sir/madam}. We have no land of our own, and the others have no money to pay for our labor, or even to help us. My poor children lie at home hungry and sick. I don't know what we'll do.", "town_dweller_poor",[]],
[anyone,"town_dweller_ask_situation", [(call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
(assign, ":walker_type", reg0),
(eq, ":walker_type", walkert_needs_money)],
"My life is miserable, {sir/madam}. I haven't been able to find a job for months, and my poor children go to bed hungry each night.\
My neighbours are too poor themselves to help me.", "town_dweller_poor",[]],
[anyone|plyr,"town_dweller_poor", [(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", 300),
],
"Then take these 300 denars. I hope this will help you and your family.", "town_dweller_poor_paid",
[(troop_remove_gold, "trp_player", 300),
]],
[anyone|plyr,"town_dweller_poor", [],
"Then clearly you must travel somewhere else, or learn another trade.", "town_dweller_poor_not_paid",[]],
[anyone,"town_dweller_poor_not_paid", [], "Yes {sir/madam}. I will do as you say.", "close_window",[]],
[anyone,"town_dweller_poor_paid", [], "{My lord/My good lady}. \
You are so good and generous. I will tell everyone how you helped us.", "close_window",
[(call_script, "script_change_player_relation_with_center", "$g_encountered_party", 1),
(call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
(assign, ":walker_no", reg2),
(call_script, "script_center_set_walker_to_type", "$g_encountered_party", ":walker_no", walkert_needs_money_helped),
]],
[anyone,"town_dweller_ask_situation", [(call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
(assign, ":walker_type", reg0),
(eq, ":walker_type", walkert_needs_money_helped)
],
"Thank you for your kindness {sir/madam}. With your help our lives will be better. I will pray for you everyday.", "close_window",[]],
[anyone,"town_dweller_ask_situation", [(neg|party_slot_ge, "$current_town", slot_town_prosperity, 30)],
"Times are hard, {sir/madam}. We work hard all day and yet we go to sleep hungry most nights.", "town_dweller_talk",[]],
[anyone,"town_dweller_ask_situation", [(neg|party_slot_ge, "$current_town", slot_town_prosperity, 70)],
"Times are hard, {sir/madam}. But we must count our blessings.", "town_dweller_talk",[]],
[anyone,"town_dweller_ask_situation", [],
"We are not doing too badly {sir/madam}. We must count our blessings.", "town_dweller_talk",[]],
[anyone|plyr,"town_dweller_talk", [], "What is your trade?", "town_dweller_ask_trade",[]],
[anyone,"town_dweller_ask_trade", [
(call_script, "script_town_walker_occupation_string_to_s14", "$g_talk_agent"),
],
"{s14}", "town_dweller_talk",[]],
[anyone|plyr,"town_dweller_talk", [(eq, "$rumors_inquired", 0)], "What is the latest rumor around here?", "town_dweller_ask_rumor",[(assign, "$rumors_inquired", 1)]],
[anyone,"town_dweller_ask_rumor", [(neg|party_slot_ge, "$current_town", slot_center_player_relation, -5)], "I don't know anything that would be of interest to you.", "town_dweller_talk",[]],
[anyone,"town_dweller_ask_rumor", [(store_mul, ":rumor_id", "$current_town", 197),
(val_add, ":rumor_id", "$g_talk_agent"),
(call_script, "script_get_rumor_to_s61", ":rumor_id"),
(gt, reg0, 0)], "{s61}", "town_dweller_talk",[]],
[anyone,"town_dweller_ask_rumor", [], "I haven't heard anything interesting lately.", "town_dweller_talk",[]],
[anyone|plyr,"town_dweller_talk", [], "[Leave]", "close_window",[]],
[anyone,"start", [(eq, "$talk_context", 0),
(is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
(party_slot_eq,"$current_town",slot_town_lord, "trp_player"),
], "Yes {sir/madam}?", "player_castle_guard_talk",[]],
[anyone|plyr,"player_castle_guard_talk", [], "How goes the watch, soldier?", "player_castle_guard_talk_2",[]],
[anyone,"player_castle_guard_talk_2", [], "All is quiet {sir/madam}. Nothing to report.", "player_castle_guard_talk_3",[]],
[anyone|plyr,"player_castle_guard_talk_3", [], "Good. Keep your eyes open.", "close_window",[]],
[anyone,"start", [(eq, "$talk_context", 0),
(is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
(is_between,"$g_encountered_party_faction",kingdoms_begin, kingdoms_end),
(eq, "$players_kingdom", "$g_encountered_party_faction"),
(troop_slot_ge, "trp_player", slot_troop_renown, 100),
(str_store_party_name, s10, "$current_town"),
], "Good day, {sir/madame}. Always an honor to have you here in {s10}.", "close_window",[]],
[anyone,"start", [(eq, "$talk_context", 0),
(is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
(is_between,"$g_encountered_party_faction",kingdoms_begin, kingdoms_end),
], "Mind your manners within the walls and we'll have no trouble.", "close_window",[]],
[anyone,"start", [(eq, "$talk_context", tc_court_talk),
(is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
(is_between,"$g_encountered_party_faction",kingdoms_begin, kingdoms_end),
(party_slot_eq,"$current_town",slot_town_lord, "trp_player"),
], "Your orders, {my lord/my lady}?", "hall_guard_talk",[]],
[anyone,"start", [(eq, "$talk_context", tc_court_talk),
(is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
(is_between,"$g_encountered_party_faction",kingdoms_begin, kingdoms_end),
], "We are not supposed to talk while on guard, {sir/madam}.", "close_window",[]],
[anyone|plyr,"hall_guard_talk", [], "Stay on duty and let me know if anyone comes to see me.", "hall_guard_duty",[]],
[anyone,"hall_guard_duty", [], "Yes, {my lord/my lady}. As you wish.", "close_window",[]],
[anyone|plyr,"hall_guard_talk", [
(eq, 1, 0),
], "I want you to arrest this man immediately!", "hall_guard_arrest",[]],
[anyone,"hall_guard_arrest", [], "Who do you want arrested {sir/madam}?", "hall_guard_arrest_2",[]],
[anyone|plyr,"hall_guard_arrest_2", [], "Ah, never mind my high spirits lads.", "close_window",[]],
[anyone|plyr,"hall_guard_arrest_2", [], "Forget it. I will find another way to deal with this.", "close_window",[]],
[anyone,"enemy_defeated", [], "Arggh! I hate this.", "close_window",[]],
[anyone,"party_relieved", [], "Thank you for helping us against those bastards.", "close_window",[]],
[anyone,"start", [(eq,"$talk_context", tc_party_encounter),(store_encountered_party, reg(5)),(party_get_template_id,reg(7),reg(5)),(eq,reg(7),"pt_sea_raiders")],
"I will drink from your skull!", "battle_reason_stated",[(play_sound,"snd_encounter_sea_raiders")]],
######################################
# GENERIC MEMBER CHAT
######################################
[anyone,"member_chat", [], "Your orders {sir/madam}?", "regular_member_talk",[]],
[anyone|plyr,"regular_member_talk", [], "Tell me about yourself", "view_regular_char_requested",[]],
[anyone,"view_regular_char_requested", [], "Aye {sir/madam}. Let me tell you all there is to know about me.", "do_regular_member_view_char",[[change_screen_view_character]]],
[anyone,"do_regular_member_view_char", [], "Anything else?", "regular_member_talk",[]],
[anyone|plyr,"regular_member_talk", [], "Nothing. Keep moving.", "close_window",[]],
######################################
# GENERIC PARTY ENCOUNTER
######################################
[anyone,"start", [(eq,"$talk_context",tc_party_encounter),
(gt,"$encountered_party_hostile",0),
(encountered_party_is_attacker),
],
"You have no chance against us. Surrender now or we will kill you all...", "party_encounter_hostile_attacker",
[(try_begin),
(eq,"$g_encountered_party_template","pt_steppe_bandits"),
(play_sound, "snd_encounter_steppe_bandits"),
(try_end)]],
# [anyone|plyr,"party_encounter_hostile_attacker", [
# ],
# "I will pay you 1000 denars if you just let us go.", "close_window", []],
[anyone|plyr,"party_encounter_hostile_attacker", [
],
"We will fight you to the end!", "close_window", []],
[anyone|plyr,"party_encounter_hostile_attacker", [
],
"Don't attack! We surrender.", "close_window", [(assign,"$g_player_surrenders",1)]],
[anyone,"start", [(eq,"$talk_context",tc_party_encounter),
(neg|encountered_party_is_attacker),
],
"What do you want?", "party_encounter_hostile_defender",
[]],
[anyone|plyr,"party_encounter_hostile_defender", [],
"Surrender or die!", "party_encounter_hostile_ultimatum_surrender", [
]],
#post 0907 changes begin
[anyone,"party_encounter_hostile_ultimatum_surrender", [],
"{s43}", "close_window", [
(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_challenged_default"),
]],
#post 0907 changes end
[anyone|plyr,"party_encounter_hostile_defender", [],
"Nothing. We'll leave you in peace.", "close_window", [(assign, "$g_leave_encounter",1)]],
[anyone|auto_proceed, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(check_quest_active, "qst_collect_men"),
#(neq, "$talk_context", tc_tavern_talk),
#(neq, "$talk_context", tc_back_alley),
(eq, "$talk_context", tc_merchants_house),
],
"{!}.", "merchant_end", []],
[anyone, "merchant_end", [],
"Heh! I must really be in a tight spot, to place my hopes in a passing stranger. However, something about you tells me that my trust is not misplaced. Now, go see if you can round up some volunteers.", "close_window", []],
[anyone, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(eq, "$talk_context", tc_merchants_house),
(check_quest_active, "qst_save_town_from_bandits"),
(store_div, ":number_of_civilian_loses_div_2", "$number_of_civilian_loses", 2),
(try_begin),
(eq, "$g_killed_first_bandit", 1),
(store_add, ":player_success", "$number_of_bandits_killed_by_player", 1),
(else_try),
(store_add, ":player_success", "$number_of_bandits_killed_by_player", 0),
(try_end),
(val_sub, ":player_success", ":number_of_civilian_loses_div_2"),
(val_max, ":player_success", 0),
(call_script, "script_change_player_relation_with_center", "$g_starting_town", ":player_success"),
(try_begin),
(eq, "$g_killed_first_bandit", 1),
(gt, "$number_of_bandits_killed_by_player", 2),
(str_store_string, s3, "str_you_fought_well_at_town_fight_survived"),
(troop_add_gold, "trp_player", 200),
(else_try),
(eq, "$g_killed_first_bandit", 1),
(gt, "$number_of_bandits_killed_by_player", 0),
(str_store_string, s3, "str_you_fought_normal_at_town_fight_survived"),
(troop_add_gold, "trp_player", 200),
(else_try),
(eq, "$g_killed_first_bandit", 1),
(eq, "$number_of_bandits_killed_by_player", 0),
(str_store_string, s3, "str_you_fought_bad_at_town_fight_survived"),
(troop_add_gold, "trp_player", 100),
(else_try),
(eq, "$g_killed_first_bandit", 0),
(ge, "$number_of_bandits_killed_by_player", 2),
(str_store_string, s3, "str_you_fought_well_at_town_fight"),
(troop_add_gold, "trp_player", 100),
(else_try),
(str_store_string, s3, "str_you_wounded_at_town_fight"),
(troop_add_gold, "trp_player", 100),
(try_end),
(try_begin),
(ge, "$number_of_civilian_loses", 1),
(assign, reg0, "$number_of_civilian_loses"),
(str_store_string, s2, "str_unfortunately_reg0_civilians_wounded_during_fight_more"),
(else_try),
(eq, "$number_of_civilian_loses", 1),
(assign, reg0, "$number_of_civilian_loses"),
(str_store_string, s2, "str_unfortunately_reg0_civilians_wounded_during_fight"),
(else_try),
(str_store_string, s2, "str_also_one_another_good_news_is_any_civilians_did_not_wounded_during_fight"),
(try_end),
(call_script, "script_succeed_quest", "qst_save_town_from_bandits"),
(call_script, "script_end_quest", "qst_save_town_from_bandits"),
],
"{s3}{s2}", "merchant_quest_4e",
[]],
[anyone|plyr,"merchant_quest_4e",
[
(try_begin),
(eq, "$g_killed_first_bandit", 1),
(gt, "$number_of_bandits_killed_by_player", 2),
(str_store_string, s1, "str_you_fought_well_at_town_fight_survived_answer"),
(else_try),
(eq, "$g_killed_first_bandit", 1),
(gt, "$number_of_bandits_killed_by_player", 0),
(str_store_string, s1, "str_you_fought_normal_at_town_fight_survived_answer"),
(else_try),
(eq, "$g_killed_first_bandit", 1),
(eq, "$number_of_bandits_killed_by_player", 0),
(str_store_string, s1, "str_you_fought_bad_at_town_fight_survived_answer"),
(else_try),
(eq, "$g_killed_first_bandit", 0),
(ge, "$number_of_bandits_killed_by_player", 2),
(str_store_string, s1, "str_you_fought_well_at_town_fight_answer"),
(else_try),
(str_store_string, s1, "str_you_wounded_at_town_fight_answer"),
(try_end),
],
"{s1}", "merchant_finale",
[
(assign, "$dialog_with_merchant_ended", 1),
]],
#[anyone|auto_proceed, "start",
#[
# (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
# (eq, "$talk_context", tc_merchants_house),
# (check_quest_finished, "qst_save_town_from_bandits"),
#],
#"{!}.", "merchant_all_quest_completed",
#[
#]],
[anyone|plyr,"merchant_quest_4e",
[
],
"The Heavens alone grant us victory.", "merchant_finale",
[ (assign, "$dialog_with_merchant_ended", 1),
]],
[anyone|plyr,"merchant_quest_4e",
[],
"I'm glad to see that you're alive, too.", "merchant_finale",
[
(assign, "$dialog_with_merchant_ended", 1),
]],
[anyone,"merchant_finale", [
(faction_get_slot, ":faction_leader", "$g_encountered_party_faction", slot_faction_leader),
(str_store_troop_name, s5, ":faction_leader"),
],
"Yes, yes... Now, a couple of my boys have the watch captain pinned down in a back room, with a knife at his throat. I''ll need to go drag him before {s5} and explain what this breach of the peace is all about. You don't need to be part of that, though. I'll tell you what -- if all goes well, I'll meet you in the tavern again shortly, and let you know how it all came out. If you don't see me in the tavern, but instead see my head on a spike over the city gate, I'll assume you know enough to stay out of town for a while and forget this whole episode ever happened. So -- hopefully we'll meet again!", "close_window",
[
(assign, "$g_do_one_more_meeting_with_merchant", 2),
# (assign, "$g_do_one_more_meeting_with_merchant", 1), no need to this, do not open this line, it is already assigning while leaving mission.
# (jump_to_menu, "mnu_town"),
# (finish_mission, 0),
]],
[anyone, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(eq, "$talk_context", tc_merchants_house),
(neg|check_quest_finished, "qst_collect_men"),
(eq, "$current_startup_quest_phase", 1),
(try_begin),
(eq, "$g_killed_first_bandit", 1),
(str_store_string, s1, "str_are_you_all_right"),
(else_try),
(str_store_string, s1, "str_you_are_awake"),
(try_end),
],
"{s1}", "merchant_quest_1_prologue_1",
[]],
[anyone,"merchant_quest_1_prologue_1",
[
],
"We've always had brigands in the hills, driven to banditry by war, debt, or love of violence. Recently, however, they've been getting bolder -- leaving their camps in the wild and venturing into town, looking for unwary prey. The watch commander tells us it's because of all the fighting on the frontiers -- fewer men to keep an eye on the streets -- but I'm not sure what to make of that. It seems to me that the most logical explanation is that these bandits have an ally inside the walls, who helps them enter unnoticed and helps them identify particularly tempting targets... Last week, you see, they took my brother.", "merchant_quest_1_prologue_2",
[]],
[anyone,"merchant_quest_1_prologue_2",
[],
"I don't know what my brother was thinking -- a lad from a prominent house, out alone after dark in times like these... Well, I suppose you were too, but you're a stranger here, and didn't know how bad things have become. He had no such excuse. But he's family, so what can you do? If you don't protect your kin, then people will start thinking that you can't protect your investements, either, and I can't have that... No doubt the gang will soon send word about a ransom, but I don't care to pay it.", "merchant_quest_1_prologue_3",[]],
[anyone,"merchant_quest_1_prologue_3",
[],
"So here's my proposition. You look like you've had a bit of experience with a blade -- and more importantly, you must have a bit of fire in your belly, or you wouldn't be coming to Calradia to seek your fortune. So here's what I'm asking you to do: gather a small party, track down these bandits to their lair, teach them a lesson they won't forget, and get my brother back safe. In return, you'll earn my lasting gratitude and a bit of silver. What do you say?", "merchant_quest_1a",[]],
[anyone|plyr,"merchant_quest_1a",
[
],
"I am interested.", "merchant_quest_1b",[]],
[anyone|plyr,"merchant_quest_1a",
[
],
"I am not interested, have more important business to do.", "close_window",
[
(assign, "$dialog_with_merchant_ended", 1),
]],
[anyone,"merchant_quest_1b",
[
],
"You won't be able to do this by yourself, though. If you try and take on the whole gang singlehandedly, the hunter will become the hunted, I'll warrant. You'll first want to round up a group of volunteers. There's always a few lads in the villages around here, looking for a bit of work that's more interesting than tilling the soil or hauling water. They'll follow you if you pay. So... Take this purse of 100 denars. Consider it an advance on your reward. Go round to the villages, and use the money to hire some help. I'll reckon that you need at least five men to take on these bandits.", "merchant_quest_1c",
[
(call_script, "script_troop_add_gold", "trp_player", 100),
(str_store_troop_name, s9, "$g_talk_troop"),
(str_store_party_name, s1, "$g_starting_town"),
(str_store_string, s2, "str_start_up_quest_message_1"),
(call_script, "script_start_quest", "qst_collect_men", "$g_talk_troop"),
(party_get_position, pos1, "$current_town"),
]],
[anyone|plyr,"merchant_quest_1c",
[
],
"Very good, sir. I'll go collect some men from around the villages.", "merchant_quest_1d",[]],
[anyone,"merchant_quest_1d",
[
(str_store_party_name, s1, "$current_town"),
],
"Good. You can find me again in the tavern here in {s1} after you've got your group together. Then we'll speak about what we do next.", "close_window",
[
(assign, "$dialog_with_merchant_ended", 1),
]],
#[anyone, "merchant_all_quest_completed",
#[
#],
#"TODO-STARTUP : You can leave now.", "close_window",
#[
#]],
[anyone,"start", [], "Surrender or die. Make your choice", "battle_reason_stated",[]],
[anyone|plyr,"battle_reason_stated", [], "I am not afraid of you. I will fight.", "close_window",[[encounter_attack]]],
[anyone,"start", [], "Hello. What can I do for you?", "free",[]],
[anyone|plyr,"free", [[neg|in_meta_mission]], "Tell me about yourself", "view_char_requested",[]],
[anyone,"view_char_requested", [], "Very well, listen to this...", "view_char",[[change_screen_view_character]]],
[anyone,"view_char", [], "Anything else?", "free",[]],
[anyone|plyr,"end", [], "[Done]", "close_window",[]],
[anyone|plyr,"start", [], "Drop your weapons and surrender if you want to live", "threaten_1",[]],
[anyone,"threaten_1", [], "We will fight you first", "end",[[encounter_attack]]],
# [anyone|plyr,"free", [[partner_is_mercmaster]], "I need to hire some mercenaries.", "mercenaries_requested",[]],
# [anyone,"mercenaries_requested", [], "I have the toughest fighters in all Calradia.", "buy_mercenaries",[[change_screen_buy_mercenaries]]],
# [anyone,"buy_mercenaries", [], "Anything else?", "free",[]],
# [anyone|plyr,"free", [[partner_is_recruitable]], "I need a capable sergeant like yourself. How much do you ask to work for me?", "employ_mercenary_requested",[]],
# [anyone,"employ_mercenary_requested", [[store_mercenary_price,0],[store_mercenary_wage,1]], "I want {reg0} denars now and {reg1} denars as monthly payment.", "employ_mercenary_2",[]],
# [anyone|plyr,"employ_mercenary_2", [], "I see I need to think of this.", "employ_mercenary_giveup",[]],
# [anyone|plyr,"employ_mercenary_2", [[neg|hero_can_join]], "I don't have any more room in my party right now. I will talk to you again later.", "employ_mercenary_giveup",[]],
# [anyone|plyr,"employ_mercenary_2", [[player_gold_ge,reg(0)],[hero_can_join]], "That's fine. Here's the {reg0} denars. From now on you work for me.", "employ_mercenary_commit",[[troop_remove_gold, "trp_player",reg(0)],[recruit_mercenary]]],
# [anyone,"employ_mercenary_giveup", [], "Suits me.", "free",[]],
# [anyone,"employ_mercenary_commit", [], "You got yourself the best fighter in the land.", "end",[]],
[anyone,"member_direct_campaign", [], "Yes, {my lord/my lady}. Which message do you wish to send to the vassals?", "member_direct_campaign_choice",
[]],
[anyone|plyr,"member_direct_campaign_choice",
[
# (eq, "$g_talk_troop_faction", "$players_kingdom"),
(this_or_next|neg|faction_slot_ge, "$players_kingdom", slot_faction_marshall, active_npcs_begin),
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(this_or_next|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
(faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
],
"I want to start a new campaign. Let us assemble the army here.", "member_direct_campaign_call_to_arms_verify",
[
(faction_get_slot, ":old_marshall", "$players_kingdom", slot_faction_marshall),
(try_begin),
(ge, ":old_marshall", 0),
(troop_get_slot, ":old_marshall_party", ":old_marshall", slot_troop_leaded_party),
(party_is_active, ":old_marshall_party"),
(party_set_marshall, ":old_marshall_party", 0),
(try_end),
(faction_set_slot, "$players_kingdom", slot_faction_marshall, "trp_player"),
]],
[anyone|plyr,"member_direct_campaign_choice",
[
# (eq, "$g_talk_troop_faction", "$players_kingdom"),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
],
"I want to end the campaign and let everyone return home.", "member_give_order_disband_army_verify", []],
[anyone|plyr,"member_direct_campaign_choice",
[
# (eq, "$g_talk_troop_faction", "$players_kingdom"),
(faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
(check_quest_active, "qst_organize_feast"),
(quest_get_slot, ":venue", "qst_organize_feast", slot_quest_target_center),
(store_faction_of_party, ":venue_faction", ":venue"),
(eq, ":venue_faction", "$players_kingdom"),
(str_store_party_name, s4, ":venue"),
],
"I wish to invite the vassals of the realm to a feast at {s4}.", "member_give_order_invite_feast_verify", []],
[anyone|plyr,"member_direct_campaign_choice",
[
],
"Never mind", "member_pretalk",
[]],
[anyone,"member_give_order_invite_feast_verify", [],
"You wish to invite the lords of the realm to a feast?", "member_give_order_invite_feast_verify_2",[]],
[anyone|plyr,"member_give_order_invite_feast_verify_2", [], "Yes. It is time for us to strengthen the bonds that bring us together.", "member_give_order_invite_feast",[]],
[anyone|plyr,"member_give_order_invite_feast_verify_2", [], "On second thought, this is perhaps not the time.", "member_pretalk",[]],
[anyone,"member_give_order_invite_feast",
[
(quest_get_slot, ":venue", "qst_organize_feast", slot_quest_target_center),
(str_store_party_name, s4, ":venue"),
],
"All right then. I shall dispatch messengers informing the lords of the realm of your feast at {s4}.", "member_pretalk",
[
(quest_get_slot, ":venue", "qst_organize_feast", slot_quest_target_center),
(assign, "$player_marshal_ai_state", sfai_feast),
(assign, "$player_marshal_ai_object", ":venue"),
(call_script, "script_decide_faction_ai", "$players_kingdom"),
(assign, "$g_recalculate_ais", 1),
(str_store_party_name, s4, ":venue"),
]],
[anyone,"member_direct_campaign_call_to_arms_verify", [],
"You wish to summon all lords for a new campaign?", "member_give_order_call_to_arms_verify_2",[]],
[anyone|plyr,"member_give_order_call_to_arms_verify_2", [], "Yes. We must gather all our forces before we march on the enemy.", "member_give_order_call_to_arms",[]],
[anyone|plyr,"member_give_order_call_to_arms_verify_2", [], "On second thought, it won't be necessary to summon everyone.", "member_pretalk",[]],
[anyone,"member_give_order_call_to_arms",
[],
"All right then. I will send messengers and tell everyone to come here.", "member_pretalk",
[
(assign, "$player_marshal_ai_state", sfai_gathering_army),
(assign, "$player_marshal_ai_object", "p_main_party"),
(call_script, "script_decide_faction_ai", "$players_kingdom"),
(assign, "$g_recalculate_ais", 1),
]],
[anyone,"member_give_order_disband_army_verify", [],
"You want to end the current campaign and release all lords from duty?", "member_give_order_disband_army_2",[]],
[anyone|plyr,"member_give_order_disband_army_2", [], "Yes. We no longer need all our forces here.", "member_give_order_disband_army",[]],
[anyone|plyr,"member_give_order_disband_army_2", [], "On second thought, it will be better to stay together for now.", "member_pretalk",[]],
[anyone,"member_give_order_disband_army",
[],
"All right. I will let everyone know that they are released from duty.", "member_pretalk",
[
(assign, "$player_marshal_ai_state", sfai_default),
(assign, "$player_marshal_ai_object", -1),
(call_script, "script_decide_faction_ai", "$players_kingdom"),
(assign, "$g_recalculate_ais", 1),
]],
[anyone,"mayor_wealth_comparison_1",[
(assign, ":wealthiest_center", "$g_encountered_party"),
(assign, ":poorer_centers", 0),
(assign, ":richer_centers", 0),
(party_get_slot, ":wealthiest_center_wealth", "$g_encountered_party", slot_town_prosperity),
(party_get_slot, ":mayor_center_wealth", "$g_encountered_party", slot_town_prosperity),
(try_for_range, ":other_center", towns_begin, towns_end),
(neq, ":other_center", "$g_encountered_party"),
(party_get_slot, ":other_center_wealth", ":other_center", slot_town_prosperity),
(try_begin),
(gt, ":other_center_wealth", ":wealthiest_center_wealth"),
(val_add, ":richer_centers", 1),
(assign, ":wealthiest_center", ":other_center"),
(assign, ":wealthiest_center_wealth", ":other_center_wealth"),
(else_try),
(gt, ":other_center_wealth", ":mayor_center_wealth"),
(val_add, ":richer_centers", 1),
(else_try),
(val_add, ":poorer_centers", 1),
(try_end),
(try_end),
(assign, reg4, ":richer_centers"),
(assign, reg5, ":poorer_centers"),
(str_store_party_name, s5, "$g_encountered_party"),
(str_store_party_name, s4, ":wealthiest_center"),
], "Overall, the wealthiest town in Calradia is known to be {s4}. Here in {s5}, we are poorer than {reg4} towns, and richer than {reg5}.", "mayor_wealth_comparison_2",[
]],
#Production of this town
#Production of the hinterland
#Volume of trade
[anyone,"mayor_wealth_comparison_2",[
(assign, ":wealthiest_center", "$g_encountered_party"),
(assign, ":poorer_centers", 0),
(assign, ":richer_centers", 0),
(assign, ":mayor_town_production", 0),
(try_for_range, ":item_kind_id", trade_goods_begin, trade_goods_end),
(call_script, "script_center_get_production", "$g_encountered_party", ":item_kind_id"),
(val_add, ":mayor_town_production", reg0),
(try_end),
(assign, ":wealthiest_town_production", ":mayor_town_production"),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":mayor_town_production"),
(str_store_party_name, s4, "$g_encountered_party"),
(display_message, "@{!}DEBUG -- Total production for {s4}: {reg4}"),
(try_end),
(try_for_range, ":other_center", towns_begin, towns_end),
(neq, ":other_center", "$g_encountered_party"),
(assign, ":other_town_production", 0),
(try_for_range, ":item_kind_id", trade_goods_begin, trade_goods_end),
(call_script, "script_center_get_production", ":other_center", ":item_kind_id"),
(val_add, ":other_town_production", reg0),
(try_end),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":other_town_production"),
(str_store_party_name, s4, ":other_center"),
(display_message, "@{!}DEBUG -- Total production for {s4}: {reg4}"),
(try_end),
(try_begin),
(gt, ":other_town_production", ":wealthiest_town_production"),
(val_add, ":richer_centers", 1),
(assign, ":wealthiest_center", ":other_center"),
(assign, ":wealthiest_town_production", ":other_town_production"),
(else_try),
(gt, ":other_town_production", ":mayor_town_production"),
(val_add, ":richer_centers", 1),
(else_try),
(val_add, ":poorer_centers", 1),
(try_end),
(try_end),
(assign, reg4, ":richer_centers"),
(assign, reg5, ":poorer_centers"),
(str_store_party_name, s5, "$g_encountered_party"),
(str_store_party_name, s4, ":wealthiest_center"),
], "In terms of local industry, the most productive town in Calradia is known to be {s4}. Here in {s5}, we produce less than {reg4} towns, and produce more than {reg5}. Production is of course affected by the supply of raw materials, as well as by the overall prosperity of the town.", "mayor_wealth_comparison_3",[
]],
[anyone,"mayor_wealth_comparison_3",[
(assign, ":wealthiest_center", "$g_encountered_party"),
(assign, ":poorer_centers", 0),
(assign, ":richer_centers", 0),
(try_for_range, ":town", towns_begin, towns_end),
(party_set_slot, ":town", slot_party_temp_slot_1, 0),
(try_end),
(try_for_range, ":village", villages_begin, villages_end),
(assign, ":village_good_production", 0),
(try_for_range, ":item_kind_id", trade_goods_begin, trade_goods_end),
(call_script, "script_center_get_production", ":village", ":item_kind_id"),
(val_add, ":village_good_production", reg0),
(try_end),
(party_get_slot, ":market_town", ":village", slot_village_market_town),
(party_get_slot, ":market_center_production", ":market_town", slot_party_temp_slot_1),
(val_add, ":market_center_production", ":village_good_production"),
(party_set_slot, ":market_town", slot_party_temp_slot_1, ":market_center_production"),
(try_end),
(party_get_slot, ":mayor_town_production", "$g_encountered_party", slot_party_temp_slot_1),
(assign, ":wealthiest_town_production", ":mayor_town_production"),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":mayor_town_production"),
(str_store_party_name, s4, "$g_encountered_party"),
(display_message, "@{!}DEBUG -- Total rural production for {s4} region: {reg4}"),
(try_end),
(try_for_range, ":other_center", towns_begin, towns_end),
(neq, ":other_center", "$g_encountered_party"),
(party_get_slot, ":other_town_production", ":other_center", slot_party_temp_slot_1),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":other_town_production"),
(str_store_party_name, s4, ":other_center"),
(display_message, "@{!}DEBUG -- Total rural production for {s4} region: {reg4}"),
(try_end),
(try_begin),
(gt, ":other_town_production", ":wealthiest_town_production"),
(val_add, ":richer_centers", 1),
(assign, ":wealthiest_center", ":other_center"),
(assign, ":wealthiest_town_production", ":other_town_production"),
(else_try),
(gt, ":other_town_production", ":mayor_town_production"),
(val_add, ":richer_centers", 1),
(else_try),
(val_add, ":poorer_centers", 1),
(try_end),
(try_end),
(assign, reg4, ":richer_centers"),
(assign, reg5, ":poorer_centers"),
(str_store_party_name, s5, "$g_encountered_party"),
(str_store_party_name, s4, ":wealthiest_center"),
], "In terms of the output of the surrounding villages, the town of {s4} is the richest in Calradia. Here in {s5}, the villages produce less than the hinterland around {reg4} towns, and produce more than {reg5}. The wealth of a town's hinterland, of course, is heavily dependent on the tides of war. Looting and pillage, and shifts in territory, can make a major impact.", "mayor_wealth_comparison_4",[
]],
[anyone,"mayor_wealth_comparison_4",[
(assign, ":wealthiest_center", "$g_encountered_party"),
(assign, ":poorer_centers", 0),
(assign, ":richer_centers", 0),
(try_for_range, ":town", towns_begin, towns_end),
(party_set_slot, ":town", slot_party_temp_slot_1, 0),
(try_end),
(try_for_range, ":log_entry_iterator", 0, "$num_log_entries"),
(store_sub, ":log_entry_no", "$num_log_entries", ":log_entry_iterator"),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_party_traded),
(troop_get_slot, ":event_time", "trp_log_array_entry_time", ":log_entry_no"),
(store_current_hours, ":cur_hour"),
(store_sub, ":hours_ago", ":cur_hour", ":event_time"),
(lt, ":hours_ago", 1344),
(troop_get_slot, ":origin", "trp_log_array_center_object", ":log_entry_no"),
(is_between, ":origin", towns_begin, towns_end), #exclude village trading here
(troop_get_slot, ":destination", "trp_log_array_troop_object", ":log_entry_no"),
(party_get_slot, ":num_visits", ":destination", slot_party_temp_slot_1),
(val_add, ":num_visits", 1),
(party_set_slot, ":destination", slot_party_temp_slot_1, ":num_visits"),
(try_end),
(party_get_slot, ":mayor_town_production", "$g_encountered_party", slot_party_temp_slot_1),
(assign, ":wealthiest_town_production", ":mayor_town_production"),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":mayor_town_production"),
(str_store_party_name, s4, "$g_encountered_party"),
(display_message, "@{!}DEBUG -- Total trade for {s4}: {reg4}"),
(try_end),
(try_for_range, ":other_center", towns_begin, towns_end),
(neq, ":other_center", "$g_encountered_party"),
(party_get_slot, ":other_town_production", ":other_center", slot_party_temp_slot_1),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":other_town_production"),
(str_store_party_name, s4, ":other_center"),
(display_message, "@{!}DEBUG -- Total trade for {s4}: {reg4}"),
(try_end),
(try_begin),
(gt, ":other_town_production", ":wealthiest_town_production"),
(val_add, ":richer_centers", 1),
(assign, ":wealthiest_center", ":other_center"),
(assign, ":wealthiest_town_production", ":other_town_production"),
(else_try),
(gt, ":other_town_production", ":mayor_town_production"),
(val_add, ":richer_centers", 1),
(else_try),
(val_add, ":poorer_centers", 1),
(try_end),
(try_end),
(assign, reg4, ":richer_centers"),
(assign, reg5, ":poorer_centers"),
(str_store_party_name, s5, "$g_encountered_party"),
(str_store_party_name, s4, ":wealthiest_center"),
], "In terms of trade, the town of {s4} is believed to have received the most visits from caravans over the past few months. Here in {s5}, we are less visited than {reg4} towns, and more visited than {reg5}. ", "mayor_wealth_comparison_5",[
]],
[anyone,"mayor_wealth_comparison_5",[
(assign, ":wealthiest_center", "$g_encountered_party"),
(assign, ":poorer_centers", 0),
(assign, ":richer_centers", 0),
(try_for_range, ":town", towns_begin, towns_end),
(party_set_slot, ":town", slot_party_temp_slot_1, 0),
(try_end),
(try_for_range, ":log_entry_iterator", 0, "$num_log_entries"),
(store_sub, ":log_entry_no", "$num_log_entries", ":log_entry_iterator"),
(troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_traveller_attacked),
(troop_get_slot, ":event_time", "trp_log_array_entry_time", ":log_entry_no"),
(store_current_hours, ":cur_hour"),
(store_sub, ":hours_ago", ":cur_hour", ":event_time"),
(lt, ":hours_ago", 1344),
(troop_get_slot, ":origin", "trp_log_array_center_object", ":log_entry_no"),
(troop_get_slot, ":destination", "trp_log_array_troop_object", ":log_entry_no"),
(try_begin),
(is_between, ":destination", towns_begin, towns_end),
(party_get_slot, ":num_attacks", ":destination", slot_party_temp_slot_1),
(val_add, ":num_attacks", 1),
(party_set_slot, ":destination", slot_party_temp_slot_1, ":num_attacks"),
(try_end),
(try_begin),
(is_between, ":origin", towns_begin, towns_end),
(party_get_slot, ":num_attacks", ":origin", slot_party_temp_slot_1),
(val_add, ":num_attacks", 1),
(party_set_slot, ":origin", slot_party_temp_slot_1, ":num_attacks"),
(try_end),
(try_end),
(party_get_slot, ":mayor_town_production", "$g_encountered_party", slot_party_temp_slot_1),
(assign, ":wealthiest_town_production", ":mayor_town_production"),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":mayor_town_production"),
(str_store_party_name, s4, "$g_encountered_party"),
(display_message, "@{!}DEBUG -- Total attacks for {s4}: {reg4}"),
(try_end),
(try_for_range, ":other_center", towns_begin, towns_end),
(neq, ":other_center", "$g_encountered_party"),
(party_get_slot, ":other_town_production", ":other_center", slot_party_temp_slot_1),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":other_town_production"),
(str_store_party_name, s4, ":other_center"),
(display_message, "@{!}DEBUG -- Total attacks for {s4}: {reg4}"),
(try_end),
(try_begin),
(gt, ":other_town_production", ":wealthiest_town_production"),
(val_add, ":richer_centers", 1),
(assign, ":wealthiest_center", ":other_center"),
(assign, ":wealthiest_town_production", ":other_town_production"),
(else_try),
(gt, ":other_town_production", ":mayor_town_production"),
(val_add, ":richer_centers", 1),
(else_try),
(val_add, ":poorer_centers", 1),
(try_end),
(try_end),
(assign, reg4, ":richer_centers"),
(assign, reg5, ":poorer_centers"),
(str_store_party_name, s5, "$g_encountered_party"),
(str_store_party_name, s4, ":wealthiest_center"),
], "In terms of attacks on travellers, the town of {s4} is believed to be the most dangerous. Here in {s5}, we are less afflicted by bandits and raiders than {reg4} towns, and more afflicted than {reg5}. ", "mayor_pretalk",[
]],
[anyone|plyr,"free", [[in_meta_mission]], " Good-bye.", "close_window",[]],
[anyone|plyr,"free", [[neg|in_meta_mission]], " [Leave]", "close_window",[]],
# [anyone,"free", [], "NO MATCHING SENTENCE!", "close_window",[]],
]
| Python |
from header_postfx import *
####################################################################################################################
# Each postfx_param contains the following fields:
# 1) id (string):
# 2) flags (int).
# 3) tonemap operator type (0,1,2,3)
# 4) shader parameters1 [ HDRRange, HDRExposureScaler, LuminanceAverageScaler, LuminanceMaxScaler ]
# 5) shader parameters2 [ BrightpassTreshold, BrightpassPostPower, BlurStrenght, BlurAmount ]
# 6) shader parameters3 [ AmbientColorCoef, SunColorCoef, SpecularCoef, -reserved ]
#
#define postfxParams1 (PFX1) float4(postfx_editor_vector[1].x, postfx_editor_vector[1].y, postfx_editor_vector[1].z, postfx_editor_vector[1].w)
#define postfxParams2 (PFX2) float4(postfx_editor_vector[2].x, postfx_editor_vector[2].y, postfx_editor_vector[2].z, postfx_editor_vector[2].w)
#define postfxParams3 (PFX3) float4(postfx_editor_vector[3].x, postfx_editor_vector[3].y, postfx_editor_vector[3].z, postfx_editor_vector[3].w)
####################################################################################################################
postfx_params = [
("default", 0, 0, [125.9922, 1.0588, 1.4510, 9.1765], [0.9608, 1.1373, 1.1373, 0.1961], [1.0, 1.0, 1.0, 1.0000]),
("map_params", 0, 3, [128.0000, 1.04, 1.2941, 10.0000], [2.3725, 2.1569, 1.8431, 0.4863], [1.0, 1.0, 1.05, 1.0]),
("indoors", 0, 0, [128.0000, 1.0, 1.2549, 10.0000], [0.6471, 4.7843, 4.1616, 0.00155], [0.9804, 0.9804, 1.5294, 1.0000]),
("sunset", 0, 0, [128.0000, 0.5882, 0.9804, 0.9804], [0.0784, 2.1176, 1.3725, 0.1255], [0.9804, 0.9804, 1.7647, 1.0000]),
("night", 0, 0, [128.0000, 1.0, 1.2549, 10.0000], [0.6471, 4.7843, 1.2157, 0.0000], [0.9804, 0.9804, 1.5294, 1.0000]),
#("sunny", 0, 0, [128.0000, 0.6667, 0.9804, 0.9804], [0.4510, 2.4314, 1.2941, 0.1412], [0.9804, 0.9804, 1.4118, 1.0000]),
# ("sunny", 0, 1, [128.0000, 1.0, 0.9804, 0.9804], [1.2157, 2.4314, 1.3333, 0.1412], [1.0196, 1.0804, 1.4314, 1.0000]) ,
("sunny", 0, 0, [128.0000, 0.5882, 0.9804, 0.9804], [0.0784, 2.1176, 1.3725, 0.1255], [0.9804, 0.9804, 1.7647, 1.0000]),
("cloudy", 0, 0, [128.0000, 1.0, 0.9804, 0.0000], [0.3137, 2.6667, 2.0000, 0.4314], [0.9804, 0.9804, 1.4314, 1.0000]) ,
("overcast", 0, 0, [128.0000, 1.0, 0.9804, 0.0000], [0.3137, 2.6667, 2.0000, 0.0], [0.9804, 0.9804, 1.0314, 1.0000]) ,
("high_contrast", 0, 3, [128.0000, 1.0000, 1.2941, 10.0000], [0.4314, 2.0000, 1.0588, 0.0549], [2.0000, 0.7059, 1.4902, 1.0000]),
]
| Python |
import string
from header_common import *
from module_info import *
from module_animations import *
from process_common import *
def compile_action_sets(actions):
action_codes = []
for action in actions:
index = -1
for i_action_code in xrange(len(action_codes)):
if action_codes[i_action_code] == action[0]:
index = i_action_code
break
if index == -1:
pos = len(action_codes)
action_codes.append(action[0])
action[0] = pos
else:
action[0] = index
return action_codes
def write_actions(action_set,num_action_codes,action_codes,file_name):
file = open(export_dir + file_name,"w")
file.write("%d\n"%num_action_codes)
for i_action_code in xrange(num_action_codes):
action_found = 0
for action in action_set:
if action[0] == i_action_code:
file.write(" %s %d %d "%(action_codes[i_action_code],action[1], action[2])) #print flags
file.write(" %d\n"%(len(action)-3))
for elem in action[3:]:
file.write(" %f %s %d %d %d "%(elem[0],elem[1],elem[2],elem[3],elem[4]))
if (len(elem) > 5):
file.write("%d "%elem[5])
else:
file.write("0 ")
if (len(elem) > 6):
file.write("%f %f %f "%elem[6])
else:
file.write("0.0 0.0 0.0 ")
if (len(elem) > 7):
file.write("%f \n"%(elem[7]))
else:
file.write("0.0 \n")
action_found = 1
break
if not action_found:
file.write(" none 0 0\n") #oops
def save_python_header(action_codes):
ofile = open("./ID_animations.py","w")
for i_anim in xrange(len(action_codes)):
ofile.write("anim_%s = %d\n"%(action_codes[i_anim],i_anim))
ofile.write("\n\n")
ofile.close()
print "Exporting animations..."
action_codes = compile_action_sets(animations)
save_python_header(action_codes)
write_actions(animations,len(action_codes),action_codes,"actions.txt")
| Python |
from header_game_menus import *
from header_parties import *
from header_items import *
from header_mission_templates import *
from header_music import *
from header_terrain_types import *
from module_constants import *
####################################################################################################################
# (menu-id, menu-flags, menu_text, mesh-name, [<operations>], [<options>]),
#
# Each game menu is a tuple that contains the following fields:
#
# 1) Game-menu id (string): used for referencing game-menus in other files.
# The prefix menu_ is automatically added before each game-menu-id
#
# 2) Game-menu flags (int). See header_game_menus.py for a list of available flags.
# You can also specify menu text color here, with the menu_text_color macro
# 3) Game-menu text (string).
# 4) mesh-name (string). Not currently used. Must be the string "none"
# 5) Operations block (list). A list of operations. See header_operations.py for reference.
# The operations block is executed when the game menu is activated.
# 6) List of Menu options (List).
# Each menu-option record is a tuple containing the following fields:
# 6.1) Menu-option-id (string) used for referencing game-menus in other files.
# The prefix mno_ is automatically added before each menu-option.
# 6.2) Conditions block (list). This must be a valid operation block. See header_operations.py for reference.
# The conditions are executed for each menu option to decide whether the option will be shown to the player or not.
# 6.3) Menu-option text (string).
# 6.4) Consequences block (list). This must be a valid operation block. See header_operations.py for reference.
# The consequences are executed for the menu option that has been selected by the player.
#
#
# Note: The first Menu is the initial character creation menu.
####################################################################################################################
game_menus = [
("start_game_0",menu_text_color(0xFF000000)|mnf_disable_all_keys,
"Welcome, adventurer, to Mount and Blade: Warband. Before beginning the game you must create your character. Remember that in the traditional medieval society depicted in the game, war and politics are usually dominated by male members of the nobility. That does not however mean that you should not choose to play a female character, or one who is not of noble birth. Male nobles may have a somewhat easier start, but women and commoners can attain all of the same goals -- and in fact may have a much more interesting if more challenging early game.",
"none",
[],
[
("continue",[],"Continue...",
[(jump_to_menu, "mnu_start_game_1"),
]
),
("go_back",[],"Go back",
[
(change_screen_quit),
]),
]
),
("start_phase_2",mnf_disable_all_keys,
"You hear about Calradia, a land torn between rival kingdoms battling each other for supremacy,\
a haven for knights and mercenaries, cutthroats and adventurers, all willing to risk their lives in pursuit of fortune, power, or glory...\
In this land which holds great dangers and even greater opportunities, you believe you may leave your past behind and start a new life.\
You feel that finally, you hold the key of your destiny in your hands, free to choose as you will,\
and that whatever course you take, great adventures will await you. Drawn by the stories you hear about Calradia and its kingdoms, you...",
"none",
[],
[
("town_1",[(eq, "$current_startup_quest_phase", 0),],"join a caravan to Praven, in the Kingdom of Swadia.",
[
(assign, "$current_town", "p_town_6"),
(assign, "$g_starting_town", "$current_town"),
(assign, "$g_journey_string", "str_journey_to_praven"),
(jump_to_menu, "mnu_start_phase_2_5"),
# (party_relocate_near_party, "p_main_party", "$g_starting_town", 2),
# (change_screen_return),
]),
("town_2",[(eq, "$current_startup_quest_phase", 0),],"join a caravan to Reyvadin, in the Kingdom of the Vaegirs.",
[
(assign, "$current_town", "p_town_8"),
(assign, "$g_starting_town", "$current_town"),
(assign, "$g_journey_string", "str_journey_to_reyvadin"),
(jump_to_menu, "mnu_start_phase_2_5"),
# (party_relocate_near_party, "p_main_party", "$g_starting_town", 2),
# (change_screen_return),
]),
("town_3",[(eq, "$current_startup_quest_phase", 0),],"join a caravan to Tulga, in the Khergit Khanate.",
[
(assign, "$current_town", "p_town_10"),
(assign, "$g_starting_town", "$current_town"),
(assign, "$g_journey_string", "str_journey_to_tulga"),
(jump_to_menu, "mnu_start_phase_2_5"),
# (party_relocate_near_party, "p_main_party", "$g_starting_town", 2),
# (change_screen_return),
]),
("town_4",[(eq, "$current_startup_quest_phase", 0),],"take a ship to Sargoth, in the Kingdom of the Nords.",
[
(assign, "$current_town", "p_town_1"),
(assign, "$g_starting_town", "$current_town"),
(assign, "$g_journey_string", "str_journey_to_sargoth"),
(jump_to_menu, "mnu_start_phase_2_5"),
# (party_relocate_near_party, "p_main_party", "$g_starting_town", 2),
# (change_screen_return),
]),
("town_5",[(eq, "$current_startup_quest_phase", 0),],"take a ship to Jelkala, in the Kingdom of the Rhodoks.",
[
(assign, "$current_town", "p_town_5"),
(assign, "$g_starting_town", "$current_town"),
(assign, "$g_journey_string", "str_journey_to_jelkala"),
(jump_to_menu, "mnu_start_phase_2_5"),
# (party_relocate_near_party, "p_main_party", "$g_starting_town", 2),
# (change_screen_return),
]),
("town_6",[(eq, "$current_startup_quest_phase", 0),],"join a caravan to Shariz, in the Sarranid Sultanate.",
[
(assign, "$current_town", "p_town_19"),
(assign, "$g_starting_town", "$current_town"),
(assign, "$g_journey_string", "str_journey_to_shariz"),
(jump_to_menu, "mnu_start_phase_2_5"),
# (party_relocate_near_party, "p_main_party", "$g_starting_town", 2),
# (change_screen_return),
]),
("tutorial_cheat",[(eq,1,0)],"{!}CHEAT!",
[
(change_screen_return),
(assign, "$cheat_mode", 1),
(set_show_messages, 0),
(add_xp_to_troop, 15000, "trp_player"),
(troop_raise_skill, "trp_player", skl_leadership, 7),
(troop_raise_skill, "trp_player", skl_prisoner_management, 5),
(troop_raise_skill, "trp_player", skl_inventory_management, 10),
(party_add_members, "p_main_party", "trp_swadian_knight", 10),
(party_add_members, "p_main_party", "trp_vaegir_knight", 10),
(party_add_members, "p_main_party", "trp_vaegir_archer", 10),
(party_add_members, "p_main_party", "trp_swadian_sharpshooter", 10),
(troop_add_item, "trp_player","itm_scale_armor",0),
(troop_add_item, "trp_player","itm_full_helm",0),
(troop_add_item, "trp_player","itm_hafted_blade_b",0),
(troop_add_item, "trp_player","itm_hafted_blade_a",0),
(troop_add_item, "trp_player","itm_morningstar",0),
(troop_add_item, "trp_player","itm_tutorial_spear",0),
(troop_add_item, "trp_player","itm_tutorial_staff",0),
(troop_add_item, "trp_player","itm_tutorial_staff_no_attack",0),
(troop_add_item, "trp_player","itm_arena_lance",0),
(troop_add_item, "trp_player","itm_practice_staff",0),
(troop_add_item, "trp_player","itm_practice_lance",0),
(troop_add_item, "trp_player","itm_practice_javelin",0),
(troop_add_item, "trp_player","itm_scythe",0),
(troop_add_item, "trp_player","itm_pitch_fork",0),
(troop_add_item, "trp_player","itm_military_fork",0),
(troop_add_item, "trp_player","itm_battle_fork",0),
(troop_add_item, "trp_player","itm_boar_spear",0),
(troop_add_item, "trp_player","itm_jousting_lance",0),
(troop_add_item, "trp_player","itm_double_sided_lance",0),
(troop_add_item, "trp_player","itm_glaive",0),
(troop_add_item, "trp_player","itm_poleaxe",0),
(troop_add_item, "trp_player","itm_polehammer",0),
(troop_add_item, "trp_player","itm_staff",0),
(troop_add_item, "trp_player","itm_quarter_staff",0),
(troop_add_item, "trp_player","itm_iron_staff",0),
(troop_add_item, "trp_player","itm_shortened_spear",0),
(troop_add_item, "trp_player","itm_spear",0),
(troop_add_item, "trp_player","itm_war_spear",0),
(troop_add_item, "trp_player","itm_military_scythe",0),
(troop_add_item, "trp_player","itm_light_lance",0),
(troop_add_item, "trp_player","itm_lance",0),
(troop_add_item, "trp_player","itm_heavy_lance",0),
(troop_add_item, "trp_player","itm_great_lance",0),
(troop_add_item, "trp_player","itm_pike",0),
(troop_add_item, "trp_player","itm_ashwood_pike",0),
(troop_add_item, "trp_player","itm_awlpike",0),
(troop_add_item, "trp_player","itm_throwing_spears",0),
(troop_add_item, "trp_player","itm_javelin",0),
(troop_add_item, "trp_player","itm_jarid",0),
(troop_add_item, "trp_player","itm_long_axe_b",0),
(set_show_messages, 1),
(try_for_range, ":cur_place", scenes_begin, scenes_end),
(scene_set_slot, ":cur_place", slot_scene_visited, 1),
(try_end),
(call_script, "script_get_player_party_morale_values"),
(party_set_morale, "p_main_party", reg0),
]
),
]
),
(
"start_game_3",mnf_disable_all_keys,
"Choose your scenario:",
"none",
[
(assign, "$g_custom_battle_scenario", 0),
(assign, "$g_custom_battle_scenario", "$g_custom_battle_scenario"),
## #Default banners
## (troop_set_slot, "trp_banner_background_color_array", 126, 0xFF212221),
## (troop_set_slot, "trp_banner_background_color_array", 127, 0xFF212221),
## (troop_set_slot, "trp_banner_background_color_array", 128, 0xFF2E3B10),
## (troop_set_slot, "trp_banner_background_color_array", 129, 0xFF425D7B),
## (troop_set_slot, "trp_banner_background_color_array", 130, 0xFF394608),
],
[
## ("custom_battle_scenario_1",[], "Skirmish 1",
## [
## (assign, "$g_custom_battle_scenario", 0),
## (jump_to_menu, "mnu_custom_battle_2"),
##
## ]
## ),
#### ("custom_battle_scenario_2",[],"Siege Attack 1",
#### [
#### (assign, "$g_custom_battle_scenario", 1),
#### (jump_to_menu, "mnu_custom_battle_2"),
####
#### ]
#### ),
## ("custom_battle_scenario_3",[],"Skirmish 2",
## [
## (assign, "$g_custom_battle_scenario", 1),
## (jump_to_menu, "mnu_custom_battle_2"),
##
## ]
## ),
## ("custom_battle_scenario_4",[],"Siege Defense",
## [
## (assign, "$g_custom_battle_scenario", 2),
## (jump_to_menu, "mnu_custom_battle_2"),
## ]
## ),
## ("custom_battle_scenario_5",[],"Skirmish 3",
## [
## (assign, "$g_custom_battle_scenario", 3),
## (jump_to_menu, "mnu_custom_battle_2"),
## ]
## ),
## ("custom_battle_scenario_6",[],"Siege Attack",
## [
## (assign, "$g_custom_battle_scenario", 4),
## (jump_to_menu, "mnu_custom_battle_2"),
##
## ]
## ),
("go_back",[],"Go back",
[(change_screen_quit),
]
),
]
),
## ("start_game_3",mnf_disable_all_keys,
## "Choose your scenario:",
## "none",
## [
## (assign, "$g_custom_battle_scenario", 0),
## (assign, "$g_custom_battle_scenario", "$g_custom_battle_scenario"),
#### #Default banners
#### (troop_set_slot, "trp_banner_background_color_array", 126, 0xFF212221),
#### (troop_set_slot, "trp_banner_background_color_array", 127, 0xFF212221),
#### (troop_set_slot, "trp_banner_background_color_array", 128, 0xFF2E3B10),
#### (troop_set_slot, "trp_banner_background_color_array", 129, 0xFF425D7B),
#### (troop_set_slot, "trp_banner_background_color_array", 130, 0xFF394608),
## ],
## [
#### ("custom_battle_scenario_1",[], "Skirmish 1",
#### [
#### (assign, "$g_custom_battle_scenario", 0),
#### (jump_to_menu, "mnu_custom_battle_2"),
####
#### ]
#### ),
###### ("custom_battle_scenario_2",[],"Siege Attack 1",
###### [
###### (assign, "$g_custom_battle_scenario", 1),
###### (jump_to_menu, "mnu_custom_battle_2"),
######
###### ]
###### ),
#### ("custom_battle_scenario_3",[],"Skirmish 2",
#### [
#### (assign, "$g_custom_battle_scenario", 1),
#### (jump_to_menu, "mnu_custom_battle_2"),
####
#### ]
#### ),
#### ("custom_battle_scenario_4",[],"Siege Defense",
#### [
#### (assign, "$g_custom_battle_scenario", 2),
#### (jump_to_menu, "mnu_custom_battle_2"),
#### ]
#### ),
#### ("custom_battle_scenario_5",[],"Skirmish 3",
#### [
#### (assign, "$g_custom_battle_scenario", 3),
#### (jump_to_menu, "mnu_custom_battle_2"),
#### ]
#### ),
#### ("custom_battle_scenario_6",[],"Siege Attack",
#### [
#### (assign, "$g_custom_battle_scenario", 4),
#### (jump_to_menu, "mnu_custom_battle_2"),
####
#### ]
#### ),
## ("go_back",[],"Go back",
## [(change_screen_quit),
## ]
## ),
## ]
## ),
(
"tutorial",mnf_disable_all_keys,
"You approach a field where the locals are training with weapons. You can practice here to improve your combat skills.",
"none",
[
(try_begin),
(eq, "$g_tutorial_entered", 1),
(change_screen_quit),
(else_try),
(set_passage_menu, "mnu_tutorial"),
## (try_begin),
## (eq, "$tutorial_1_finished", 1),
## (str_store_string, s1, "str_finished"),
## (else_try),
## (str_store_string, s1, "str_empty_string"),
## (try_end),
## (try_begin),
## (eq, "$tutorial_2_finished", 1),
## (str_store_string, s2, "str_finished"),
## (else_try),
## (str_store_string, s2, "str_empty_string"),
## (try_end),
## (try_begin),
## (eq, "$tutorial_3_finished", 1),
## (str_store_string, s3, "str_finished"),
## (else_try),
## (str_store_string, s3, "str_empty_string"),
## (try_end),
## (try_begin),
## (eq, "$tutorial_4_finished", 1),
## (str_store_string, s4, "str_finished"),
## (else_try),
## (str_store_string, s4, "str_empty_string"),
## (try_end),
## (try_begin),
## (eq, "$tutorial_5_finished", 1),
## (str_store_string, s5, "str_finished"),
## (else_try),
## (str_store_string, s5, "str_empty_string"),
## (try_end),
(assign, "$g_tutorial_entered", 1),
(try_end),
],
[
## ("tutorial_1",
## [(eq,1,0),],
## "Tutorial #1: Basic movement and weapon selection. {s1}",
## [
## #(modify_visitors_at_site,"scn_tutorial_1"),(reset_visitors,0),
#### (set_jump_mission,"mt_tutorial_1"),
#### (jump_to_scene,"scn_tutorial_1"),(change_screen_mission)]),
## ]),
##
## ("tutorial_2",[(eq,1,0),],"Tutorial #2: Fighting with a shield. {s2}",[
#### (modify_visitors_at_site,"scn_tutorial_2"),(reset_visitors,0),
#### (set_visitor,1,"trp_tutorial_maceman"),
#### (set_visitor,2,"trp_tutorial_archer"),
#### (set_jump_mission,"mt_tutorial_2"),
#### (jump_to_scene,"scn_tutorial_2"),(change_screen_mission)]),
## (modify_visitors_at_site,"scn_tutorial_training_ground"),
## (reset_visitors, 0),
## (set_player_troop, "trp_player"),
## (set_visitor,0,"trp_player"),
## (set_jump_mission,"mt_ai_training"),
## (jump_to_scene,"scn_tutorial_training_ground"),
## (change_screen_mission)]),
##
## ("tutorial_3",[(eq,1,0),],"Tutorial #3: Fighting without a shield. {s3}",[
## (modify_visitors_at_site,"scn_tutorial_3"),(reset_visitors,0),
## (set_visitor,1,"trp_tutorial_maceman"),
## (set_visitor,2,"trp_tutorial_swordsman"),
## (set_jump_mission,"mt_tutorial_3"),
## (jump_to_scene,"scn_tutorial_3"),(change_screen_mission)]),
## ("tutorial_3b",[(eq,0,1)],"Tutorial 3 b",[(try_begin),
## (ge, "$tutorial_3_state", 12),
## (modify_visitors_at_site,"scn_tutorial_3"),(reset_visitors,0),
## (set_visitor,1,"trp_tutorial_maceman"),
## (set_visitor,2,"trp_tutorial_swordsman"),
## (set_jump_mission,"mt_tutorial_3_2"),
## (jump_to_scene,"scn_tutorial_3"),
## (change_screen_mission),
## (else_try),
## (display_message,"str_door_locked",0xFFFFAAAA),
## (try_end)], "Next level"),
## ("tutorial_4",[(eq,1,0),],"Tutorial #4: Riding a horse. {s4}",[
## (modify_visitors_at_site,"scn_tutorial_training_ground"),
## (reset_visitors, 0),
## (set_player_troop, "trp_player"),
## (assign, "$g_player_troop", "trp_player"),
## (troop_raise_attribute, "$g_player_troop", ca_strength, 12),
## (troop_raise_attribute, "$g_player_troop", ca_agility, 9),
## (troop_raise_attribute, "$g_player_troop", ca_charisma, 5),
## (troop_raise_skill, "$g_player_troop", skl_shield, 3),
## (troop_raise_skill, "$g_player_troop", skl_athletics, 2),
## (troop_raise_skill, "$g_player_troop", skl_riding, 3),
## (troop_raise_skill, "$g_player_troop", skl_power_strike, 1),
## (troop_raise_skill, "$g_player_troop", skl_power_draw, 5),
## (troop_raise_skill, "$g_player_troop", skl_weapon_master, 4),
## (troop_raise_skill, "$g_player_troop", skl_ironflesh, 1),
## (troop_raise_skill, "$g_player_troop", skl_horse_archery, 6),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_one_handed_weapon, 70),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_two_handed_weapon, 70),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_polearm, 70),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_crossbow, 70),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_throwing, 70),
##
## (troop_clear_inventory, "$g_player_troop"),
## (troop_add_item, "$g_player_troop","itm_leather_jerkin",0),
## (troop_add_item, "$g_player_troop","itm_leather_boots",0),
## (troop_add_item, "$g_player_troop","itm_practice_sword",0),
## (troop_add_item, "$g_player_troop","itm_quarter_staff",0),
## (troop_equip_items, "$g_player_troop"),
## (set_visitor,0,"trp_player"),
## (set_visitor,32,"trp_tutorial_fighter_1"),
## (set_visitor,33,"trp_tutorial_fighter_2"),
## (set_visitor,34,"trp_tutorial_fighter_3"),
## (set_visitor,35,"trp_tutorial_fighter_4"),
## (set_visitor,40,"trp_tutorial_master_archer"),
## (set_visitor,41,"trp_tutorial_archer_1"),
## (set_visitor,42,"trp_tutorial_archer_1"),
## (set_visitor,60,"trp_tutorial_master_horseman"),
## (set_visitor,61,"trp_tutorial_rider_1"),
## (set_visitor,62,"trp_tutorial_rider_1"),
## (set_visitor,63,"trp_tutorial_rider_2"),
## (set_visitor,64,"trp_tutorial_rider_2"),
## (set_jump_mission,"mt_tutorial_training_ground"),
## (jump_to_scene,"scn_tutorial_training_ground"),
## (change_screen_mission),
## ]),
##
## ("tutorial_5",
## [
## (eq,1,0),
## ],
## "Tutorial #5: Commanding a band of soldiers. {s5}",
## [
## (modify_visitors_at_site,"scn_tutorial_5"),(reset_visitors,0),
## (set_visitor,0,"trp_player"),
## (set_visitor,1,"trp_vaegir_infantry"),
## (set_visitor,2,"trp_vaegir_infantry"),
## (set_visitor,3,"trp_vaegir_infantry"),
## (set_visitor,4,"trp_vaegir_infantry"),
## (set_jump_mission,"mt_tutorial_5"),
## (jump_to_scene,"scn_tutorial_5"),
## (change_screen_mission),
## ]),
##
## ("tutorial_edit_custom_battle_scenes",
## [(eq,1,0),],
## "(NO TRANSLATE) tutorial_edit_custom_battle_scenes",
## [
## (jump_to_menu,"mnu_custom_battle_scene"),
## ]),
("continue",[],"Continue...",
[
(modify_visitors_at_site,"scn_tutorial_training_ground"),
(reset_visitors, 0),
(set_player_troop, "trp_player"),
(assign, "$g_player_troop", "trp_player"),
(troop_raise_attribute, "$g_player_troop", ca_strength, 12),
(troop_raise_attribute, "$g_player_troop", ca_agility, 9),
(troop_raise_attribute, "$g_player_troop", ca_charisma, 5),
(troop_raise_skill, "$g_player_troop", skl_shield, 3),
(troop_raise_skill, "$g_player_troop", skl_athletics, 2),
(troop_raise_skill, "$g_player_troop", skl_riding, 3),
(troop_raise_skill, "$g_player_troop", skl_power_strike, 1),
(troop_raise_skill, "$g_player_troop", skl_power_draw, 5),
(troop_raise_skill, "$g_player_troop", skl_weapon_master, 4),
(troop_raise_skill, "$g_player_troop", skl_ironflesh, 1),
(troop_raise_skill, "$g_player_troop", skl_horse_archery, 6),
(troop_raise_proficiency_linear, "$g_player_troop", wpt_one_handed_weapon, 70),
(troop_raise_proficiency_linear, "$g_player_troop", wpt_two_handed_weapon, 70),
(troop_raise_proficiency_linear, "$g_player_troop", wpt_polearm, 70),
(troop_raise_proficiency_linear, "$g_player_troop", wpt_crossbow, 70),
(troop_raise_proficiency_linear, "$g_player_troop", wpt_throwing, 70),
(troop_clear_inventory, "$g_player_troop"),
(troop_add_item, "$g_player_troop","itm_leather_jerkin",0),
(troop_add_item, "$g_player_troop","itm_leather_boots",0),
(troop_add_item, "$g_player_troop","itm_practice_sword",0),
(troop_add_item, "$g_player_troop","itm_quarter_staff",0),
(troop_equip_items, "$g_player_troop"),
(set_visitor,0,"trp_player"),
(set_visitor,32,"trp_tutorial_fighter_1"),
(set_visitor,33,"trp_tutorial_fighter_2"),
(set_visitor,34,"trp_tutorial_fighter_3"),
(set_visitor,35,"trp_tutorial_fighter_4"),
(set_visitor,40,"trp_tutorial_master_archer"),
(set_visitor,41,"trp_tutorial_archer_1"),
(set_visitor,42,"trp_tutorial_archer_1"),
(set_visitor,60,"trp_tutorial_master_horseman"),
(set_visitor,61,"trp_tutorial_rider_1"),
(set_visitor,62,"trp_tutorial_rider_1"),
(set_visitor,63,"trp_tutorial_rider_2"),
(set_visitor,64,"trp_tutorial_rider_2"),
(set_jump_mission,"mt_tutorial_training_ground"),
(jump_to_scene,"scn_tutorial_training_ground"),
(change_screen_mission),
]),
("go_back_dot",
[],
"Go back.",
[
(change_screen_quit),
]),
]
),
("reports",0,
"Character Renown: {reg5}^Honor Rating: {reg6}^Party Morale: {reg8}^Party Size Limit: {reg7}^",
"none",
[(call_script, "script_game_get_party_companion_limit"),
(assign, ":party_size_limit", reg0),
(troop_get_slot, ":renown", "trp_player", slot_troop_renown),
(assign, reg5, ":renown"),
(assign, reg6, "$player_honor"),
(assign, reg7, ":party_size_limit"),
#(call_script, "script_get_player_party_morale_values"),
#(party_set_morale, "p_main_party", reg0),
(party_get_morale, reg8, "p_main_party"),
],
[
("cheat_faction_orders",[(ge,"$cheat_mode",1)],"{!}Cheat: Faction orders.",
[(jump_to_menu, "mnu_faction_orders"),
]
),
("view_character_report",[],"View character report.",
[(jump_to_menu, "mnu_character_report"),
]
),
("view_party_size_report",[],"View party size report.",
[(jump_to_menu, "mnu_party_size_report"),
]
),
("view_npc_mission_report",[],"View companion mission report.",
[(jump_to_menu, "mnu_companion_report"),
]
),
("view_weekly_budget_report",[],"View weekly budget report.",
[
(assign, "$g_apply_budget_report_to_gold", 0),
(start_presentation, "prsnt_budget_report"),
]
),
("view_morale_report",[],"View party morale report.",
[(jump_to_menu, "mnu_morale_report"),
]
),
#NPC companion changes begin
("lord_relations",[],"View list of known lords by relation.",
[
(jump_to_menu, "mnu_lord_relations"),
]
),
("courtship_relations",[],"View courtship relations.",
[
(jump_to_menu, "mnu_courtship_relations"),
]
),
("status_check",[(eq,"$cheat_mode",1)],"{!}NPC status check.",
[
(try_for_range, ":npc", companions_begin, companions_end),
(main_party_has_troop, ":npc"),
(str_store_troop_name, 4, ":npc"),
(troop_get_slot, reg3, ":npc", slot_troop_morality_state),
(troop_get_slot, reg4, ":npc", slot_troop_2ary_morality_state),
(troop_get_slot, reg5, ":npc", slot_troop_personalityclash_state),
(troop_get_slot, reg6, ":npc", slot_troop_personalityclash2_state),
(troop_get_slot, reg7, ":npc", slot_troop_personalitymatch_state),
(display_message, "@{!}{s4}: M{reg3}, 2M{reg4}, PC{reg5}, 2PC{reg6}, PM{reg7}"),
(try_end),
]
),
#NPC companion changes end
("view_faction_relations_report",[],"View faction relations report.",
[(jump_to_menu, "mnu_faction_relations_report"),
]
),
("resume_travelling",[],"Resume travelling.",
[(change_screen_return),
]
),
]
),
(
"custom_battle_scene",menu_text_color(0xFF000000)|mnf_disable_all_keys,
"(NO_TRANS)",
"none",
[],
[
("quick_battle_scene_1",[],"{!}quick_battle_scene_1",
[
(set_jump_mission,"mt_ai_training"),
(jump_to_scene,"scn_quick_battle_scene_1"),(change_screen_mission)
]
),
("quick_battle_scene_2",[],"{!}quick_battle_scene_2",
[
(set_jump_mission,"mt_ai_training"),
(jump_to_scene,"scn_quick_battle_scene_2"),(change_screen_mission)
]
),
("quick_battle_scene_3",[],"{!}quick_battle_scene_3",
[
(set_jump_mission,"mt_ai_training"),
(jump_to_scene,"scn_quick_battle_scene_3"),(change_screen_mission)
]
),
("quick_battle_scene_4",[],"{!}quick_battle_scene_4",
[
(set_jump_mission,"mt_ai_training"),
(jump_to_scene,"scn_quick_battle_scene_4"),(change_screen_mission)
]
),
("quick_battle_scene_5",[],"{!}quick_battle_scene_5",
[
(set_jump_mission,"mt_ai_training"),
(jump_to_scene,"scn_quick_battle_scene_5"),(change_screen_mission)
]
),
("go_back",[],"{!}Go back",
[(change_screen_quit),
]
),
]
),
#depreciated
## (
## "custom_battle_2",mnf_disable_all_keys,
## "{s16}",
## "none",
## [
## (assign, "$g_battle_result", 0),
## (set_show_messages, 0),
##
## (troop_clear_inventory, "trp_player"),
## (troop_raise_attribute, "trp_player", ca_strength, -1000),
## (troop_raise_attribute, "trp_player", ca_agility, -1000),
## (troop_raise_attribute, "trp_player", ca_charisma, -1000),
## (troop_raise_attribute, "trp_player", ca_intelligence, -1000),
## (troop_raise_skill, "trp_player", skl_shield, -1000),
## (troop_raise_skill, "trp_player", skl_athletics, -1000),
## (troop_raise_skill, "trp_player", skl_riding, -1000),
## (troop_raise_skill, "trp_player", skl_power_strike, -1000),
## (troop_raise_skill, "trp_player", skl_power_throw, -1000),
## (troop_raise_skill, "trp_player", skl_weapon_master, -1000),
## (troop_raise_skill, "trp_player", skl_horse_archery, -1000),
## (troop_raise_skill, "trp_player", skl_ironflesh, -1000),
## (troop_raise_proficiency_linear, "trp_player", wpt_one_handed_weapon, -10000),
## (troop_raise_proficiency_linear, "trp_player", wpt_two_handed_weapon, -10000),
## (troop_raise_proficiency_linear, "trp_player", wpt_polearm, -10000),
## (troop_raise_proficiency_linear, "trp_player", wpt_archery, -10000),
## (troop_raise_proficiency_linear, "trp_player", wpt_crossbow, -10000),
## (troop_raise_proficiency_linear, "trp_player", wpt_throwing, -10000),
##
## (reset_visitors),
#### Scene 1 Start "Shalow Lake War"
## (try_begin),
## (eq, "$g_custom_battle_scenario", 0),
## (assign, "$g_player_troop", "trp_knight_1_15"),
## (set_player_troop, "$g_player_troop"),
##
## (assign, "$g_custom_battle_scene", "scn_quick_battle_1"),
## (modify_visitors_at_site, "$g_custom_battle_scene"),
## (set_visitor, 0, "$g_player_troop"),
##
### (troop_add_item, "trp_player","itm_bascinet",0),
### (troop_add_item, "trp_player","itm_mail_with_surcoat",0),
### (troop_add_item, "trp_player","itm_bastard_sword_a",0),
### (troop_add_item, "trp_player","itm_war_bow",0),
### (troop_add_item, "trp_player","itm_khergit_arrows",0),
### (troop_add_item, "trp_player","itm_kite_shield",0),
### (troop_add_item, "trp_player","itm_hunter",0),
### (troop_add_item, "trp_player","itm_mail_chausses",0),
### (troop_equip_items, "trp_player"),
##
## (set_visitors, 1, "trp_farmer", 13),
## (set_visitors, 2, "trp_swadian_sergeant", 5),
## (set_visitors, 3, "trp_swadian_sharpshooter", 4),
## (set_visitors, 4, "trp_swadian_man_at_arms", 8),
## (set_visitors, 5, "trp_swadian_knight", 3),
## (set_visitors, 6, "trp_peasant_woman", 7),
##
#### Enemy
## (set_visitors, 16, "trp_vaegir_infantry", 6),
## (set_visitors, 17, "trp_vaegir_archer", 6),
## (set_visitors, 18, "trp_vaegir_horseman", 4),
## (set_visitors, 19, "trp_vaegir_knight", 10),
## (set_visitors, 20, "trp_vaegir_guard", 6),
## (str_store_string, s16, "str_custom_battle_1"),
##
#### SCENE 3 Start "Mountain Bandit Hunt"
## (else_try),
## (eq, "$g_custom_battle_scenario", 1),
## (assign, "$g_player_troop", "trp_knight_2_5"),
## (set_player_troop, "$g_player_troop"),
##
## (assign, "$g_custom_battle_scene", "scn_quick_battle_3"),
## (modify_visitors_at_site, "$g_custom_battle_scene"),
## (set_visitor, 0, "$g_player_troop"),
##
## (set_visitors, 1, "trp_vaegir_archer", 4),
## (set_visitors, 2, "trp_vaegir_archer", 5),
## (set_visitors, 3, "trp_vaegir_veteran", 4),
## (set_visitors, 4, "trp_vaegir_horseman", 4),
## (set_visitors, 5, "trp_vaegir_footman", 2),
## (set_visitors, 6, "trp_vaegir_knight", 4),
#### ENEMY
##
## (set_visitors, 16, "trp_mountain_bandit", 4),
## (set_visitors, 17, "trp_bandit", 8),
## (set_visitors, 18, "trp_mountain_bandit", 8),
## (set_visitors, 19, "trp_mountain_bandit", 6),
## (set_visitors, 20, "trp_sea_raider", 5),
## (set_visitors, 21, "trp_mountain_bandit", 4),
## (set_visitors, 22, "trp_brigand", 6),
## (set_visitors, 23, "trp_sea_raider", 8),
## (set_visitors, 25, "trp_brigand", 10),
## (str_store_string, s16, "str_custom_battle_2"),
##
#### SCENE 4 Start "Grand Stand"
## (else_try),
## (eq, "$g_custom_battle_scenario", 2),
## (assign, "$g_player_troop", "trp_kingdom_5_lady_1"),
## (set_player_troop, "$g_player_troop"),
##
## (troop_raise_attribute, "$g_player_troop", ca_strength, 12),
## (troop_raise_attribute, "$g_player_troop", ca_agility, 9),
## (troop_raise_attribute, "$g_player_troop", ca_charisma, 5),
## (troop_raise_attribute, "$g_player_troop", ca_intelligence, 5),
## (troop_raise_skill, "$g_player_troop", skl_shield, 3),
## (troop_raise_skill, "$g_player_troop", skl_athletics, 2),
## (troop_raise_skill, "$g_player_troop", skl_riding, 3),
## (troop_raise_skill, "$g_player_troop", skl_power_strike, 4),
## (troop_raise_skill, "$g_player_troop", skl_power_draw, 5),
## (troop_raise_skill, "$g_player_troop", skl_weapon_master, 4),
## (troop_raise_skill, "$g_player_troop", skl_ironflesh, 6),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_one_handed_weapon, 100),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_two_handed_weapon, 30),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_polearm, 20),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_crossbow, 110),
## (troop_raise_proficiency_linear, "$g_player_troop", wpt_throwing, 10),
##
## (assign, "$g_custom_battle_scene", "scn_quick_battle_4"),
## (modify_visitors_at_site, "$g_custom_battle_scene"),
## (set_visitor, 0, "$g_player_troop"),
##
## (troop_clear_inventory, "$g_player_troop"),
## (troop_add_item, "$g_player_troop","itm_helmet_with_neckguard",0),
## (troop_add_item, "$g_player_troop","itm_plate_armor",0),
## (troop_add_item, "$g_player_troop","itm_iron_greaves",0),
## (troop_add_item, "$g_player_troop","itm_mail_chausses",0),
## (troop_add_item, "$g_player_troop","itm_tab_shield_small_round_c",0),
## (troop_add_item, "$g_player_troop","itm_heavy_crossbow",0),
## (troop_add_item, "$g_player_troop","itm_bolts",0),
## (troop_add_item, "$g_player_troop","itm_sword_medieval_b_small",0),
## (troop_equip_items, "$g_player_troop"),
#### US
## (set_visitors, 1, "trp_vaegir_infantry", 4),
## (set_visitors, 2, "trp_vaegir_archer", 3),
## (set_visitors, 3, "trp_vaegir_infantry", 4),
## (set_visitors, 4, "trp_vaegir_archer", 3),
## (set_visitors, 5, "trp_vaegir_infantry", 3),
## (set_visitors, 6, "trp_vaegir_footman", 5),
## (set_visitors, 7, "trp_vaegir_footman", 4),
## (set_visitors, 8, "trp_vaegir_archer", 3),
##
#### ENEMY
## (set_visitors, 16, "trp_swadian_footman", 8),
## (set_visitors, 17, "trp_swadian_crossbowman", 9),
## (set_visitors, 18, "trp_swadian_sergeant", 7),
## (set_visitors, 19, "trp_swadian_sharpshooter", 8),
## (set_visitors, 20, "trp_swadian_militia", 13),
## (str_store_string, s16, "str_custom_battle_3"),
##
#### Scene 5 START
## (else_try),
## (eq, "$g_custom_battle_scenario", 3),
## (assign, "$g_player_troop", "trp_knight_1_10"),
## (set_player_troop, "$g_player_troop"),
##
## (assign, "$g_custom_battle_scene", "scn_quick_battle_5"),
## (modify_visitors_at_site, "$g_custom_battle_scene"),
## (set_visitor, 0, "$g_player_troop"),
##
#### US
## (set_visitors, 1, "trp_swadian_knight", 3),
## (set_visitors, 2, "trp_swadian_sergeant", 4),
## (set_visitors, 3, "trp_swadian_sharpshooter", 8),
## (set_visitors, 4, "trp_swadian_man_at_arms", 8),
## (set_visitors, 5, "trp_swadian_knight", 2),
##
#### enemy
## (set_visitors, 16, "trp_vaegir_infantry", 8),
## (set_visitors, 17, "trp_vaegir_archer", 10),
## (set_visitors, 18, "trp_vaegir_horseman", 4),
## (set_visitors, 19, "trp_vaegir_knight", 10),
## (set_visitors, 20, "trp_vaegir_guard", 7),
## (str_store_string, s16, "str_custom_battle_4"),
##
## (else_try),
## (eq, "$g_custom_battle_scenario", 4),
##
#### (assign, "$g_custom_battle_scene", "scn_quick_battle_6"),
## (assign, "$g_custom_battle_scene", "scn_quick_battle_7"),
##
### Player Wear
## (assign, "$g_player_troop", "trp_knight_4_9"),
## (set_player_troop, "$g_player_troop"),
##
## (modify_visitors_at_site, "$g_custom_battle_scene"),
## (set_visitor, 0, "$g_player_troop"),
##
## (set_visitors, 1, "trp_nord_archer", 4),
## (set_visitors, 2, "trp_nord_archer", 4),
## (set_visitors, 3, "trp_nord_champion", 4),
## (set_visitors, 4, "trp_nord_veteran", 5),
## (set_visitors, 5, "trp_nord_warrior", 5),
## (set_visitors, 6, "trp_nord_trained_footman", 8),
##
#### ENEMY
## (set_visitors, 11, "trp_vaegir_knight", 2),
## (set_visitors, 12, "trp_vaegir_guard", 6),
## (set_visitors, 13, "trp_vaegir_infantry", 8),
## (set_visitors, 14, "trp_vaegir_veteran", 10),
## (set_visitors, 16, "trp_vaegir_skirmisher", 5),
## (set_visitors, 17, "trp_vaegir_archer", 4),
## (set_visitors, 18, "trp_vaegir_marksman", 2),
## (set_visitors, 19, "trp_vaegir_skirmisher", 4),
## (set_visitors, 20, "trp_vaegir_skirmisher", 3),
## (set_visitors, 21, "trp_vaegir_skirmisher", 3),
## (set_visitors, 22, "trp_vaegir_skirmisher", 3),
## (set_visitors, 23, "trp_vaegir_archer", 2),
## (str_store_string, s16, "str_custom_battle_5"),
## (try_end),
## (set_show_messages, 1),
## ],
##
## [
## ("custom_battle_go",[],"Start.",
## [(try_begin),
## (eq, "$g_custom_battle_scenario", 2),
#### (set_jump_mission,"mt_custom_battle_siege"),
## (else_try),
## (eq, "$g_custom_battle_scenario", 4),
#### (set_jump_mission,"mt_custom_battle_5"),
## (else_try),
#### (set_jump_mission,"mt_custom_battle"),
## (try_end),
## (jump_to_menu, "mnu_custom_battle_end"),
## (jump_to_scene,"$g_custom_battle_scene"),
## (change_screen_mission),
## ]
## ),
## ("leave_custom_battle_2",[],"Cancel.",
## [(jump_to_menu, "mnu_start_game_3"),
## ]
## ),
## ]
## ),
(
"custom_battle_end",mnf_disable_all_keys,
"The battle is over. {s1} Your side killed {reg5} enemies and lost {reg6} troops over the battle. You personally slew {reg7} men in the fighting.",
"none",
[(music_set_situation, 0),
(assign, reg5, "$g_custom_battle_team2_death_count"),
(assign, reg6, "$g_custom_battle_team1_death_count"),
(get_player_agent_kill_count, ":kill_count"),
(get_player_agent_kill_count, ":wound_count", 1),
(store_add, reg7, ":kill_count", ":wound_count"),
(try_begin),
(eq, "$g_battle_result", 1),
(str_store_string, s1, "str_battle_won"),
(else_try),
(str_store_string, s1, "str_battle_lost"),
(try_end),
(try_begin),
(ge, "$g_custom_battle_team2_death_count", 100),
(unlock_achievement, ACHIEVEMENT_LOOK_AT_THE_BONES),
(try_end),
],
[
("continue",[],"Continue.",
[(change_screen_quit),
]
),
]
),
("start_game_1",menu_text_color(0xFF000000)|mnf_disable_all_keys,
"Select your character's gender.",
"none",
[],
[
("start_male",[],"Male",
[
(troop_set_type,"trp_player", 0),
(assign,"$character_gender",tf_male),
(jump_to_menu,"mnu_start_character_1"),
]
),
("start_female",[],"Female",
[
(troop_set_type, "trp_player", 1),
(assign, "$character_gender", tf_female),
(jump_to_menu, "mnu_start_character_1"),
]
),
("go_back",[],"Go back",
[
(jump_to_menu,"mnu_start_game_0"),
]),
]
),
(
"start_character_1",mnf_disable_all_keys,
"You were born years ago, in a land far away. Your father was...",
"none",
[
(str_clear,s10),
(str_clear,s11),
(str_clear,s12),
(str_clear,s13),
(str_clear,s14),
(str_clear,s15),
],
[
("start_noble",[],"An impoverished noble.",[
(assign,"$background_type",cb_noble),
(assign, reg3, "$character_gender"),
(str_store_string,s10,"@You came into the world a {reg3?daughter:son} of declining nobility,\
owning only the house in which they lived. However, despite your family's hardships,\
they afforded you a good education and trained you from childhood for the rigors of aristocracy and life at court."),
(jump_to_menu,"mnu_start_character_2"),
]),
("start_merchant",[],"A travelling merchant.",[
(assign,"$background_type",cb_merchant),
(assign, reg3, "$character_gender"),
(str_store_string,s10,"@You were born the {reg3?daughter:son} of travelling merchants,\
always moving from place to place in search of a profit. Although your parents were wealthier than most\
and educated you as well as they could, you found little opportunity to make friends on the road,\
living mostly for the moments when you could sell something to somebody."),
(jump_to_menu,"mnu_start_character_2"),
]),
("start_guard",[],"A veteran warrior.",[
(assign,"$background_type",cb_guard),
(assign, reg3, "$character_gender"),
(str_store_string,s10,"@As a child, your family scrabbled out a meagre living from your father's wages\
as a guardsman to the local lord. It was not an easy existence, and you were too poor to get much of an\
education. You learned mainly how to defend yourself on the streets, with or without a weapon in hand."),
(jump_to_menu,"mnu_start_character_2"),
]),
("start_forester",[],"A hunter.",[
(assign,"$background_type",cb_forester),
(assign, reg3, "$character_gender"),
(str_store_string,s11,"@{reg3?daughter:son}"),
(str_store_string,s10,"@You were the {reg3?daughter:son} of a family who lived off the woods,\
doing whatever they needed to make ends meet. Hunting, woodcutting, making arrows,\
even a spot of poaching whenever things got tight. Winter was never a good time for your family\
as the cold took animals and people alike, but you always lived to see another dawn,\
though your brothers and sisters might not be so fortunate."),
(jump_to_menu,"mnu_start_character_2"),
]),
("start_nomad",[],"A steppe nomad.",[
(assign,"$background_type",cb_nomad),
(assign, reg3, "$character_gender"),
(str_store_string,s11,"@{reg3?daughter:son}"),
(str_store_string,s10,"@You were a child of the steppe, born to a tribe of wandering nomads who lived\
in great camps throughout the arid grasslands.\
Like the other tribesmen, your family revered horses above almost everything else, and they taught you\
how to ride almost before you learned how to walk. "),
(jump_to_menu,"mnu_start_character_2"),
]),
("start_thief",[],"A thief.",[
(assign,"$background_type",cb_thief),
(assign, reg3, "$character_gender"),
(str_store_string,s10,"@As the {reg3?daughter:son} of a thief, you had very little 'formal' education.\
Instead you were out on the street, begging until you learned how to cut purses, cutting purses\
until you learned how to pick locks, all the way through your childhood.\
Still, these long years made you streetwise and sharp to the secrets of cities and shadowy backways."),
(jump_to_menu,"mnu_start_character_2"),
]),
## ("start_priest",[],"Priests.",[
## (assign,"$background_type",cb_priest),
## (assign, reg3, "$character_gender"),
## (str_store_string,s10,"@A {reg3?daughter:son} that nobody wanted, you were left to the church as a baby,\
## a foundling raised by the priests and nuns to their own traditions.\
## You were only one of many other foundlings and orphans, but you nonetheless received a lot of attention\
## as well as many years of study in the church library and before the altar. They taught you many things.\
## Gradually, faith became such a part of your life that it was no different from the blood coursing through your veins."),
## (jump_to_menu,"mnu_start_character_2"),
## ]),
("go_back",[],"Go back",
[(jump_to_menu,"mnu_start_game_1"),
]),
]
),
(
"start_character_2",0,
"{s10}^^ You started to learn about the world almost as soon as you could walk and talk. You spent your early life as...",
"none",
[],
[
("page",[
],"A page at a nobleman's court.",[
(assign,"$background_answer_2", cb2_page),
(assign, reg3, "$character_gender"),
(str_store_string,s11,"@As a {reg3?girl:boy} growing out of childhood,\
you were sent to live in the court of one of the nobles of the land.\
There, your first lessons were in humility, as you waited upon the lords and ladies of the household.\
But from their chess games, their gossip, even the poetry of great deeds and courtly love, you quickly began to learn about the adult world of conflict\
and competition. You also learned from the rough games of the other children, who battered at each other with sticks in imitation of their elders' swords."),
(jump_to_menu,"mnu_start_character_3"),
]),
("apprentice",[
],"A craftsman's apprentice.",[
(assign,"$background_answer_2", cb2_apprentice),
(assign, reg3, "$character_gender"),
(str_store_string,s11,"@As a {reg3?girl:boy} growing out of childhood,\
you apprenticed with a local craftsman to learn a trade. After years of hard work and study under your\
new master, he promoted you to journeyman and employed you as a fully paid craftsman for as long as\
you wished to stay."),
(jump_to_menu,"mnu_start_character_3"),
]),
("stockboy",[
],"A shop assistant.",[
(assign,"$background_answer_2",cb2_merchants_helper),
(assign, reg3, "$character_gender"),
(str_store_string,s11,"@As a {reg3?girl:boy} growing out of childhood,\
you apprenticed to a wealthy merchant, picking up the trade over years of working shops and driving caravans.\
You soon became adept at the art of buying low, selling high, and leaving the customer thinking they'd\
got the better deal."),
(jump_to_menu,"mnu_start_character_3"),
]),
("urchin",[
],"A street urchin.",[
(assign,"$background_answer_2",cb2_urchin),
(assign, reg3, "$character_gender"),
(str_store_string,s11,"@As a {reg3?girl:boy} growing out of childhood,\
you took to the streets, doing whatever you must to survive.\
Begging, thieving and working for gangs to earn your bread, you lived from day to day in this violent world,\
always one step ahead of the law and those who wished you ill."),
(jump_to_menu,"mnu_start_character_3"),
]),
("nomad",[
],"A steppe child.",[
(assign,"$background_answer_2",cb2_steppe_child),
(assign, reg3, "$character_gender"),
(str_store_string,s11,"@As a {reg3?girl:boy} growing out of childhood,\
you rode the great steppes on a horse of your own, learning the ways of the grass and the desert.\
Although you sometimes went hungry, you became a skillful hunter and pathfinder in this trackless country.\
Your body too started to harden with muscle as you grew into the life of a nomad {reg3?woman:man}."),
(jump_to_menu,"mnu_start_character_3"),
]),
## ("mummer",[],"Mummer.",[
## (assign,"$background_answer_2",5),
## (assign, reg3, "$character_gender"),
## (str_store_string,s13,"@{reg3?woman:man}"),
## (str_store_string,s12,"@{reg3?girl:boy}"),
## (str_store_string,s11,"@As a {s12} growing out of childhood,\
## you attached yourself to a troupe of wandering entertainers, going from town to town setting up mummer's\
## shows. It was a life of hard work, selling, begging and stealing your living from the punters who flocked\
## to watch your antics. Over time you became a performer well capable of attracting a crowd."),
## (jump_to_menu,"mnu_start_character_3"),
## ]),
## ("courtier",[],"Courtier.",[
## (assign,"$background_answer_2",6),
## (assign, reg3, "$character_gender"),
## (str_store_string,s13,"@{reg3?woman:man}"),
## (str_store_string,s12,"@{reg3?girl:boy}"),
## (str_store_string,s11,"@As a {s12} growing out of childhood,\
## you spent much of your life at court, inserting yourself into the tightly-knit circles of nobility.\
## With the years you became more and more involved with the politics and intrigue demanded of a high-born {s13}.\
## You could not afford to remain a stranger to backstabbing and political violence, even if you wanted to."),
## (jump_to_menu,"mnu_start_character_3"),
## ]),
## ("noble",[],"Noble in training.",[
## (assign,"$background_answer_2",7),
## (assign, reg3, "$character_gender"),
## (str_store_string,s13,"@{reg3?woman:man}"),
## (str_store_string,s12,"@{reg3?girl:boy}"),
## (try_begin),
## (eq,"$character_gender",tf_male),
## (str_store_string,s11,"@As a {s12} growing out of childhood,\
## you were trained and educated to perform the duties and wield the rights of a noble landowner.\
## The managing of taxes and rents were equally important in your education as diplomacy and even\
## personal defence. You learned everything you needed to become a lord of your own hall."),
## (else_try),
## (str_store_string,s11,"@As a {s12} growing out of childhood,\
## you were trained and educated to the duties of a noble {s13}. You learned much about the household arts,\
## but even more about diplomacy and decorum, and all the things that a future husband might choose to speak of.\
## Truly, you became every inch as shrewd as any lord, though it would be rude to admit it aloud."),
## (try_end),
## (jump_to_menu,"mnu_start_character_3"),
## ]),
## ("acolyte",[],"Cleric acolyte.",[
## (assign,"$background_answer_2",8),
## (assign, reg3, "$character_gender"),
## (str_store_string,s13,"@{reg3?woman:man}"),
## (str_store_string,s12,"@{reg3?girl:boy}"),
## (str_store_string,s11,"@As a {s12} growing out of childhood,\
## you became an acolyte in the church, the lowest rank on the way to priesthood.\
## Years of rigorous learning and hard work followed. You were one of several acolytes,\
## performing most of the menial labour in the church in addition to being trained for more holy tasks.\
## On the night of your adulthood you were allowed to conduct your first service.\
## After that you were no longer an acolyte {s12}, but a {s13} waiting to take your vows into the service of God."),
## (jump_to_menu,"mnu_start_character_3"),
## ]),
("go_back",[],"Go back.",
[(jump_to_menu,"mnu_start_character_1"),
]),
]
),
(
"start_character_3",mnf_disable_all_keys,
"{s11}^^ Then, as a young adult, life changed as it always does. You became...",
"none",
[(assign, reg3, "$character_gender"),],
[
## ("bravo",[],"A travelling bravo.",[
## (assign,"$background_answer_3",1),
## (str_store_string,s14,"@{reg3?daughter:man}"),
## (str_store_string,s13,"@{reg3?woman:man}"),
## (str_store_string,s12,"@Though the distinction felt sudden to you,\
## somewhere along the way you had become a {s13}, and the whole world seemed to change around you.\
## You left your old life behind to travel the roads as a mercenary, a bravo, guarding caravans for coppers\
## or bashing in heads for silvers. You became a {s14} of the open road, working with bandits as often as against.\
## Going from fight to fight, you grew experienced at battle, and you learned what it was to kill."),
## (jump_to_menu,"mnu_start_character_4"),
## ]),
## ("merc",[],"A sellsword in foreign lands.",[
## (assign,"$background_answer_3",2),
## (str_store_string,s14,"@{reg3?daughter:man}"),
## (str_store_string,s13,"@{reg3?woman:man}"),
## (str_store_string,s12,"@Though the distinction felt sudden to you,\
## somewhere along the way you had become a {s13}, and the whole world seemed to change around you.\
## You signed on with a mercenary company and travelled far from your home. The life you found was rough and\
## ready, marching to the beat of strange drums and learning unusual ways of fighting.\
## There were men who taught you how to wield any weapon you desired, and plenty of battles to hone your skills.\
## You were one of the charmed few who survived through every campaign in which you marched."),
## (jump_to_menu,"mnu_start_character_4"),
## ]),
("squire",[(eq,"$character_gender",tf_male)],"A squire.",[
(assign,"$background_answer_3",cb3_squire),
(str_store_string,s14,"@{reg3?daughter:man}"),
(str_store_string,s12,"@Though the distinction felt sudden to you,\
somewhere along the way you had become a {reg3?woman:man}, and the whole world seemed to change around you.\
When you were named squire to a noble at court, you practiced long hours with weapons,\
learning how to deal out hard knocks and how to take them, too.\
You were instructed in your obligations to your lord, and of your duties to those who might one day be your vassals.\
But in addition to learning the chivalric ideal, you also learned about the less uplifting side\
-- old warriors' stories of ruthless power politics, of betrayals and usurpations,\
of men who used guile as well as valor to achieve their aims."),
(jump_to_menu,"mnu_start_character_4"),
]),
("lady",[(eq,"$character_gender",tf_female)],"A lady-in-waiting.",[
(assign,"$background_answer_3",cb3_lady_in_waiting),
(str_store_string,s14,"@{reg3?daughter:man}"),
(str_store_string,s13,"@{reg3?woman:man}"),
(str_store_string,s12,"@Though the distinction felt sudden to you,\
somewhere along the way you had become a {s13}, and the whole world seemed to change around you.\
You joined the tightly-knit circle of women at court, ladies who all did proper ladylike things,\
the wives and mistresses of noble men as well as maidens who had yet to find a husband.\
However, even here you found politics at work as the ladies schemed for prominence and fought each other\
bitterly to catch the eye of whatever unmarried man was in fashion at court.\
You soon learned ways of turning these situations and goings-on to your advantage. With it came the\
realisation that you yourself could wield great influence in the world, if only you applied yourself\
with a little bit of subtlety."),
(jump_to_menu,"mnu_start_character_4"),
]),
("troubadour",[],"A troubadour.",[
(assign,"$background_answer_3",cb3_troubadour),
(str_store_string,s14,"@{reg3?daughter:man}"),
(str_store_string,s13,"@{reg3?woman:man}"),
(str_store_string,s12,"@Though the distinction felt sudden to you,\
somewhere along the way you had become a {s13}, and the whole world seemed to change around you.\
You set out on your own with nothing except the instrument slung over your back and your own voice.\
It was a poor existence, with many a hungry night when people failed to appreciate your play,\
but you managed to survive on your music alone. As the years went by you became adept at playing the\
drunken crowds in your taverns, and even better at talking anyone out of anything you wanted."),
(jump_to_menu,"mnu_start_character_4"),
]),
("student",[],"A university student.",[
(assign,"$background_answer_3",cb3_student),
(str_store_string,s12,"@Though the distinction felt sudden to you,\
somewhere along the way you had become a {reg3?woman:man}, and the whole world seemed to change around you.\
You found yourself as a student in the university of one of the great cities,\
where you studied theology, philosophy, and medicine.\
But not all your lessons were learned in the lecture halls.\
You may or may not have joined in with your fellows as they roamed the alleys in search of wine, women, and a good fight.\
However, you certainly were able to observe how a broken jaw is set,\
or how an angry townsman can be persuaded to set down his club and accept cash compensation for the destruction of his shop."),
(jump_to_menu,"mnu_start_character_4"),
]),
("peddler",[],"A goods peddler.",[
(assign,"$background_answer_3",cb3_peddler),
(str_store_string,s14,"@{reg3?daughter:man}"),
(str_store_string,s13,"@{reg3?woman:man}"),
(str_store_string,s12,"@Though the distinction felt sudden to you,\
somewhere along the way you had become a {s13}, and the whole world seemed to change around you.\
Heeding the call of the open road, you travelled from village to village buying and selling what you could.\
It was not a rich existence, but you became a master at haggling even the most miserly elders into\
giving you a good price. Soon, you knew, you would be well-placed to start your own trading empire..."),
(jump_to_menu,"mnu_start_character_4"),
]),
("craftsman",[],"A smith.",[
(assign,"$background_answer_3", cb3_craftsman),
(str_store_string,s14,"@{reg3?daughter:man}"),
(str_store_string,s13,"@{reg3?woman:man}"),
(str_store_string,s12,"@Though the distinction felt sudden to you,\
somewhere along the way you had become a {s13}, and the whole world seemed to change around you.\
You pursued a career as a smith, crafting items of function and beauty out of simple metal.\
As time wore on you became a master of your trade, and fine work started to fetch fine prices.\
With food in your belly and logs on your fire, you could take pride in your work and your growing reputation."),
(jump_to_menu,"mnu_start_character_4"),
]),
("poacher",[],"A game poacher.",[
(assign,"$background_answer_3", cb3_poacher),
(str_store_string,s14,"@{reg3?daughter:man}"),
(str_store_string,s13,"@{reg3?woman:man}"),
(str_store_string,s12,"@Though the distinction felt sudden to you,\
somewhere along the way you had become a {s13}, and the whole world seemed to change around you.\
Dissatisfied with common men's desperate scrabble for coin, you took to your local lord's own forests\
and decided to help yourself to its bounty, laws be damned. You hunted stags, boars and geese and sold\
the precious meat under the table. You cut down trees right under the watchmen's noses and turned them into\
firewood that warmed many freezing homes during winter. All for a few silvers, of course."),
(jump_to_menu,"mnu_start_character_4"),
]),
## ("preacher",[],"Itinerant preacher.",[
## (assign,"$background_answer_3",6),
## (str_store_string,s14,"@{reg3?daughter:man}"),
## (str_store_string,s13,"@{reg3?woman:man}"),
## (str_store_string,s12,"@Though the distinction felt sudden to you,\
## somewhere along the way you had become a {s13}, and the whole world seemed to change around you.\
## You packed your few belongings and went out into the world to spread the word of God. You preached to\
## anyone who would listen, and impressed many with the passion of your sermons. Though you had taken a vow\
## to remain in poverty through your itinerant years, you never lacked for food, drink or shelter; the\
## hospitality of the peasantry was always generous to a rising {s13} of God."),
## (jump_to_menu,"mnu_start_character_4"),
## ]),
("go_back",[],"Go back.",
[(jump_to_menu,"mnu_start_character_2"),
]
),
]
),
(
"start_character_4",mnf_disable_all_keys,
"{s12}^^But soon everything changed and you decided to strike out on your own as an adventurer. What made you take this decision was...",
#Finally, what made you decide to strike out on your own as an adventurer?",
"none",
[],
[
("revenge",[],"Personal revenge.",[
(assign,"$background_answer_4", cb4_revenge),
(str_store_string,s13,"@Only you know exactly what caused you to give up your old life and become an adventurer.\
Still, it was not a difficult choice to leave, with the rage burning brightly in your heart.\
You want vengeance. You want justice. What was done to you cannot be undone,\
and these debts can only be paid in blood..."),
(jump_to_menu,"mnu_choose_skill"),
]),
("death",[],"The loss of a loved one.",[
(assign,"$background_answer_4",cb4_loss),
(str_store_string,s13,"@Only you know exactly what caused you to give up your old life and become an adventurer.\
All you can say is that you couldn't bear to stay, not with the memories of those you loved so close and so\
painful. Perhaps your new life will let you forget,\
or honour the name that you can no longer bear to speak..."),
(jump_to_menu,"mnu_choose_skill"),
]),
("wanderlust",[],"Wanderlust.",[
(assign,"$background_answer_4",cb4_wanderlust),
(str_store_string,s13,"@Only you know exactly what caused you to give up your old life and become an adventurer.\
You're not even sure when your home became a prison, when the familiar became mundane, but your dreams of\
wandering have taken over your life. Whether you yearn for some faraway place or merely for the open road and the\
freedom to travel, you could no longer bear to stay in the same place. You simply went and never looked back..."),
(jump_to_menu,"mnu_choose_skill"),
]),
## ("fervor",[],"Religious fervor.",[
## (assign,"$background_answer_4",4),
## (str_store_string,s13,"@Only you know exactly what caused you to give up your old life and become an adventurer.\
## Regardless, the intense faith burning in your soul would not let you find peace in any single place.\
## There were others in the world, souls to be washed in the light of God. Now you preach wherever you go,\
## seeking to bring salvation and revelation to the masses, be they faithful or pagan. They will all know the\
## glory of God by the time you're done..."),
## (jump_to_menu,"mnu_choose_skill"),
## ]),
("disown",[],"Being forced out of your home.",[
(assign,"$background_answer_4",cb4_disown),
(str_store_string,s13,"@Only you know exactly what caused you to give up your old life and become an adventurer.\
However, you know you cannot go back. There's nothing to go back to. Whatever home you may have had is gone\
now, and you must face the fact that you're out in the wide wide world. Alone to sink or swim..."),
(jump_to_menu,"mnu_choose_skill"),
]),
("greed",[],"Lust for money and power.",[
(assign,"$background_answer_4",cb4_greed),
(str_store_string,s13,"@Only you know exactly what caused you to give up your old life and become an adventurer.\
To everyone else, it's clear that you're now motivated solely by personal gain.\
You want to be rich, powerful, respected, feared.\
You want to be the one whom others hurry to obey.\
You want people to know your name, and tremble whenever it is spoken.\
You want everything, and you won't let anyone stop you from having it..."),
(jump_to_menu,"mnu_choose_skill"),
]),
("go_back",[],"Go back.",
[(jump_to_menu,"mnu_start_character_3"),
]
),
]
),
(
"choose_skill",mnf_disable_all_keys,
"{s13}",
"none",
[(assign,"$current_string_reg",10),
(assign, ":difficulty", 0),
(try_begin),
(eq, "$character_gender", tf_female),
(str_store_string, s14, "str_woman"),
(val_add, ":difficulty", 1),
(else_try),
(str_store_string, s14, "str_man"),
(try_end),
(try_begin),
(eq,"$background_type",cb_noble),
(str_store_string, s15, "str_noble"),
(val_sub, ":difficulty", 1),
(else_try),
(str_store_string, s15, "str_common"),
(try_end),
(try_begin),
(eq, ":difficulty", -1),
(str_store_string, s16, "str_may_find_that_you_are_able_to_take_your_place_among_calradias_great_lords_relatively_quickly"),
(else_try),
(eq, ":difficulty", 0),
(str_store_string, s16, "str_may_face_some_difficulties_establishing_yourself_as_an_equal_among_calradias_great_lords"),
(else_try),
(eq, ":difficulty", 1),
(str_store_string, s16, "str_may_face_great_difficulties_establishing_yourself_as_an_equal_among_calradias_great_lords"),
(try_end),
],
[
## ("start_swordsman",[],"Swordsmanship.",[
## (assign, "$starting_skill", 1),
## (str_store_string, s14, "@You are particularly talented at swordsmanship."),
## (jump_to_menu,"mnu_past_life_explanation"),
## ]),
## ("start_archer",[],"Archery.",[
## (assign, "$starting_skill", 2),
## (str_store_string, s14, "@You are particularly talented at archery."),
## (jump_to_menu,"mnu_past_life_explanation"),
## ]),
## ("start_medicine",[],"Medicine.",[
## (assign, "$starting_skill", 3),
## (str_store_string, s14, "@You are particularly talented at medicine."),
## (jump_to_menu,"mnu_past_life_explanation"),
## ]),
("begin_adventuring",[],"Become an adventurer and ride to your destiny.",[
(set_show_messages, 0),
(try_begin),
(eq,"$character_gender",0),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_charisma,1),
(else_try),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(try_end),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_attribute, "trp_player",ca_charisma,1),
(troop_raise_skill, "trp_player","skl_leadership",1),
(troop_raise_skill, "trp_player","skl_riding",1),
## (try_begin),
## (eq, "$starting_skill", 1),
## (troop_raise_attribute, "trp_player",ca_agility,1),
## (troop_raise_attribute, "trp_player",ca_strength,1),
## (troop_raise_skill, "trp_player",skl_power_strike,2),
## (troop_raise_proficiency, "trp_player",0,30),
## (troop_raise_proficiency, "trp_player",1,20),
## (else_try),
## (eq, "$starting_skill", 2),
## (troop_raise_attribute, "trp_player",ca_strength,2),
## (troop_raise_skill, "trp_player",skl_power_draw,2),
## (troop_raise_proficiency, "trp_player",3,50),
## (else_try),
## (troop_raise_attribute, "trp_player",ca_intelligence,1),
## (troop_raise_attribute, "trp_player",ca_charisma,1),
## (troop_raise_skill, "trp_player",skl_first_aid,1),
## (troop_raise_skill, "trp_player",skl_wound_treatment,1),
## (troop_add_item, "trp_player","itm_winged_mace",0),
## (troop_raise_proficiency, "trp_player",0,15),
## (troop_raise_proficiency, "trp_player",1,15),
## (troop_raise_proficiency, "trp_player",2,15),
## (try_end),
(try_begin),
(eq,"$background_type",cb_noble),
(eq,"$character_gender",tf_male),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_attribute, "trp_player",ca_charisma,2),
(troop_raise_skill, "trp_player",skl_weapon_master,1),
(troop_raise_skill, "trp_player",skl_power_strike,1),
(troop_raise_skill, "trp_player",skl_riding,1),
(troop_raise_skill, "trp_player",skl_tactics,1),
(troop_raise_skill, "trp_player",skl_leadership,1),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,10),
(troop_raise_proficiency, "trp_player",wpt_two_handed_weapon,10),
(troop_raise_proficiency, "trp_player",wpt_polearm,10),
(troop_add_item, "trp_player","itm_tab_shield_round_a",imod_battered),
(troop_set_slot, "trp_player", slot_troop_renown, 100),
(call_script, "script_change_player_honor", 3),
## (troop_add_item, "trp_player","itm_red_gambeson",imod_plain),
## (troop_add_item, "trp_player","itm_sword",imod_plain),
## (troop_add_item, "trp_player","itm_dagger",imod_balanced),
## (troop_add_item, "trp_player","itm_woolen_hose",0),
## (troop_add_item, "trp_player","itm_dried_meat",0),
## (troop_add_item, "trp_player","itm_saddle_horse",imod_plain),
(troop_add_gold, "trp_player", 100),
(else_try),
(eq,"$background_type",cb_noble),
(eq,"$character_gender",tf_female),
(troop_raise_attribute, "trp_player",ca_intelligence,2),
(troop_raise_attribute, "trp_player",ca_charisma,1),
(troop_raise_skill, "trp_player",skl_wound_treatment,1),
(troop_raise_skill, "trp_player",skl_riding,2),
(troop_raise_skill, "trp_player",skl_first_aid,1),
(troop_raise_skill, "trp_player",skl_leadership,1),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,20),
(troop_set_slot, "trp_player", slot_troop_renown, 50),
(troop_add_item, "trp_player","itm_tab_shield_round_a",imod_battered),
## (troop_add_item, "trp_player","itm_dress",imod_sturdy),
## (troop_add_item, "trp_player","itm_dagger",imod_watered_steel),
## (troop_add_item, "trp_player","itm_woolen_hose",0),
## (troop_add_item, "trp_player","itm_hunting_crossbow",0),
## (troop_add_item, "trp_player","itm_bolts",0),
## (troop_add_item, "trp_player","itm_smoked_fish",0),
## (troop_add_item, "trp_player","itm_courser",imod_spirited),
(troop_add_gold, "trp_player", 100),
(else_try),
(eq,"$background_type",cb_merchant),
(troop_raise_attribute, "trp_player",ca_intelligence,2),
(troop_raise_attribute, "trp_player",ca_charisma,1),
(troop_raise_skill, "trp_player",skl_riding,1),
(troop_raise_skill, "trp_player",skl_leadership,1),
(troop_raise_skill, "trp_player",skl_trade,2),
(troop_raise_skill, "trp_player",skl_inventory_management,1),
(troop_raise_proficiency, "trp_player",wpt_two_handed_weapon,10),
## (troop_add_item, "trp_player","itm_leather_jacket",0),
## (troop_add_item, "trp_player","itm_leather_boots",0),
## (troop_add_item, "trp_player","itm_fur_hat",0),
## (troop_add_item, "trp_player","itm_dagger",0),
## (troop_add_item, "trp_player","itm_hunting_crossbow",0),
## (troop_add_item, "trp_player","itm_bolts",0),
## (troop_add_item, "trp_player","itm_smoked_fish",0),
## (troop_add_item, "trp_player","itm_saddle_horse",0),
## (troop_add_item, "trp_player","itm_sumpter_horse",0),
## (troop_add_item, "trp_player","itm_salt",0),
## (troop_add_item, "trp_player","itm_salt",0),
## (troop_add_item, "trp_player","itm_salt",0),
## (troop_add_item, "trp_player","itm_pottery",0),
## (troop_add_item, "trp_player","itm_pottery",0),
(troop_add_gold, "trp_player", 250),
(troop_set_slot, "trp_player", slot_troop_renown, 20),
(else_try),
(eq,"$background_type",cb_guard),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_attribute, "trp_player",ca_charisma,1),
(troop_raise_skill, "trp_player","skl_ironflesh",1),
(troop_raise_skill, "trp_player","skl_power_strike",1),
(troop_raise_skill, "trp_player","skl_weapon_master",1),
(troop_raise_skill, "trp_player","skl_leadership",1),
(troop_raise_skill, "trp_player","skl_trainer",1),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,10),
(troop_raise_proficiency, "trp_player",wpt_two_handed_weapon,15),
(troop_raise_proficiency, "trp_player",wpt_polearm,20),
(troop_raise_proficiency, "trp_player",wpt_throwing,10),
(troop_add_item, "trp_player","itm_tab_shield_kite_b",imod_battered),
## (troop_add_item, "trp_player","itm_leather_jerkin",imod_ragged),
## (troop_add_item, "trp_player","itm_skullcap",imod_rusty),
## (troop_add_item, "trp_player","itm_spear",0),
## (troop_add_item, "trp_player","itm_arming_sword",imod_chipped),
## (troop_add_item, "trp_player","itm_hunting_crossbow",0),
## (troop_add_item, "trp_player","itm_hunter_boots",0),
## (troop_add_item, "trp_player","itm_leather_gloves",imod_ragged),
## (troop_add_item, "trp_player","itm_bolts",0),
## (troop_add_item, "trp_player","itm_smoked_fish",0),
## (troop_add_item, "trp_player","itm_saddle_horse",imod_swaybacked),
(troop_add_gold, "trp_player", 50),
(troop_set_slot, "trp_player", slot_troop_renown, 10),
(else_try),
(eq,"$background_type",cb_forester),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_agility,2),
(troop_raise_skill, "trp_player","skl_power_draw",1),
(troop_raise_skill, "trp_player","skl_tracking",1),
(troop_raise_skill, "trp_player","skl_pathfinding",1),
(troop_raise_skill, "trp_player","skl_spotting",1),
(troop_raise_skill, "trp_player","skl_athletics",1),
(troop_raise_proficiency, "trp_player",wpt_two_handed_weapon,10),
(troop_raise_proficiency, "trp_player",wpt_archery,30),
## (troop_add_item, "trp_player","itm_short_bow",imod_bent),
## (troop_add_item, "trp_player","itm_arrows",0),
## (troop_add_item, "trp_player","itm_axe",imod_chipped),
## (troop_add_item, "trp_player","itm_rawhide_coat",0),
## (troop_add_item, "trp_player","itm_hide_boots",0),
## (troop_add_item, "trp_player","itm_dried_meat",0),
## (troop_add_item, "trp_player","itm_sumpter_horse",imod_heavy),
## (troop_add_item, "trp_player","itm_furs",0),
(troop_add_gold, "trp_player", 30),
(else_try),
(eq,"$background_type",cb_nomad),
(eq,"$character_gender",tf_male),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_skill, "trp_player","skl_power_draw",1),
(troop_raise_skill, "trp_player","skl_horse_archery",1),
(troop_raise_skill, "trp_player","skl_pathfinding",1),
(troop_raise_skill, "trp_player","skl_riding",2),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,10),
(troop_raise_proficiency, "trp_player",wpt_archery,30),
(troop_raise_proficiency, "trp_player",wpt_throwing,10),
(troop_add_item, "trp_player","itm_tab_shield_small_round_a",imod_battered),
## (troop_add_item, "trp_player","itm_javelin",imod_bent),
## (troop_add_item, "trp_player","itm_sword_khergit_1",imod_rusty),
## (troop_add_item, "trp_player","itm_nomad_armor",0),
## (troop_add_item, "trp_player","itm_hide_boots",0),
## (troop_add_item, "trp_player","itm_horse_meat",0),
## (troop_add_item, "trp_player","itm_steppe_horse",0),
(troop_add_gold, "trp_player", 15),
(troop_set_slot, "trp_player", slot_troop_renown, 10),
(else_try),
(eq,"$background_type",cb_nomad),
(eq,"$character_gender",tf_female),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_skill, "trp_player","skl_wound_treatment",1),
(troop_raise_skill, "trp_player","skl_first_aid",1),
(troop_raise_skill, "trp_player","skl_pathfinding",1),
(troop_raise_skill, "trp_player","skl_riding",2),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,5),
(troop_raise_proficiency, "trp_player",wpt_archery,20),
(troop_raise_proficiency, "trp_player",wpt_throwing,5),
(troop_add_item, "trp_player","itm_tab_shield_small_round_a",imod_battered),
## (troop_add_item, "trp_player","itm_javelin",imod_bent),
## (troop_add_item, "trp_player","itm_sickle",imod_plain),
## (troop_add_item, "trp_player","itm_nomad_armor",0),
## (troop_add_item, "trp_player","itm_hide_boots",0),
## (troop_add_item, "trp_player","itm_steppe_horse",0),
## (troop_add_item, "trp_player","itm_grain",0),
(troop_add_gold, "trp_player", 20),
(else_try),
(eq,"$background_type",cb_thief),
(troop_raise_attribute, "trp_player",ca_agility,3),
(troop_raise_skill, "trp_player","skl_athletics",2),
(troop_raise_skill, "trp_player","skl_power_throw",1),
(troop_raise_skill, "trp_player","skl_inventory_management",1),
(troop_raise_skill, "trp_player","skl_looting",1),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,20),
(troop_raise_proficiency, "trp_player",wpt_throwing,20),
(troop_add_item, "trp_player","itm_throwing_knives",0),
## (troop_add_item, "trp_player","itm_stones",0),
## (troop_add_item, "trp_player","itm_cudgel",imod_plain),
## (troop_add_item, "trp_player","itm_dagger",imod_rusty),
## (troop_add_item, "trp_player","itm_shirt",imod_tattered),
## (troop_add_item, "trp_player","itm_black_hood",imod_tattered),
## (troop_add_item, "trp_player","itm_wrapping_boots",imod_ragged),
(troop_add_gold, "trp_player", 25),
## (else_try),
## (eq,"$background_type",cb_priest),
## (troop_raise_attribute, "trp_player",ca_strength,1),
## (troop_raise_attribute, "trp_player",ca_intelligence,2),
## (troop_raise_attribute, "trp_player",ca_charisma,1),
## (troop_raise_skill, "trp_player",skl_wound_treatment,1),
## (troop_raise_skill, "trp_player",skl_leadership,1),
## (troop_raise_skill, "trp_player",skl_prisoner_management,1),
## (troop_raise_proficiency, "trp_player",0,10),
## (troop_add_item, "trp_player","itm_robe",0),
## (troop_add_item, "trp_player","itm_wrapping_boots",0),
## (troop_add_item, "trp_player","itm_club",0),
## (troop_add_item, "trp_player","itm_smoked_fish",0),
## (troop_add_item, "trp_player","itm_sumpter_horse",0),
## (troop_add_gold, "trp_player", 10),
## (troop_set_slot, "trp_player", slot_troop_renown, 10),
(try_end),
(try_begin),
(eq,"$background_answer_2",cb2_page),
(troop_raise_attribute, "trp_player",ca_charisma,1),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_skill, "trp_player","skl_power_strike",1),
(troop_raise_skill, "trp_player","skl_persuasion",1),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,15),
(troop_raise_proficiency, "trp_player",wpt_polearm,5),
(else_try),
(eq,"$background_answer_2",cb2_apprentice),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_skill, "trp_player","skl_engineer",1),
(troop_raise_skill, "trp_player","skl_trade",1),
(else_try),
(eq,"$background_answer_2",cb2_urchin),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_skill, "trp_player","skl_spotting",1),
(troop_raise_skill, "trp_player","skl_looting",1),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,15),
(troop_raise_proficiency, "trp_player",wpt_throwing,5),
(else_try),
(eq,"$background_answer_2",cb2_steppe_child),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_skill, "trp_player","skl_horse_archery",1),
(troop_raise_skill, "trp_player","skl_power_throw",1),
(troop_raise_proficiency, "trp_player",wpt_archery,15),
(call_script,"script_change_troop_renown", "trp_player", 5),
(else_try),
(eq,"$background_answer_2",cb2_merchants_helper),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_attribute, "trp_player",ca_charisma,1),
(troop_raise_skill, "trp_player","skl_inventory_management",1),
(troop_raise_skill, "trp_player","skl_trade",1),
## (else_try),
## (eq,"$background_answer_2",5),
## (troop_raise_attribute, "trp_player",ca_intelligence,1),
## (troop_raise_attribute, "trp_player",ca_charisma,1),
## (troop_raise_skill, "trp_player",skl_leadership,1),
## (troop_raise_skill, "trp_player",skl_athletics,1),
## (troop_raise_skill, "trp_player",skl_riding,1),
## (troop_raise_proficiency, "trp_player",1,5),
## (troop_raise_proficiency, "trp_player",2,5),
## (call_script,"script_change_troop_renown", "trp_player", 15),
## (else_try),
## (eq,"$background_answer_2",6),
## (troop_raise_attribute, "trp_player",ca_charisma,3),
## (troop_raise_attribute, "trp_player",ca_agility,1),
## (troop_raise_skill, "trp_player",skl_weapon_master,1),
## (troop_raise_proficiency, "trp_player",0,15),
## (troop_raise_proficiency, "trp_player",2,10),
## (troop_raise_proficiency, "trp_player",4,10),
## (call_script,"script_change_troop_renown", "trp_player", 20),
## (else_try),
## (eq,"$background_answer_2",7),
## (troop_raise_attribute, "trp_player",ca_intelligence,1),
## (troop_raise_attribute, "trp_player",ca_charisma,2),
## (troop_raise_skill, "trp_player",skl_leadership,1),
## (troop_raise_skill, "trp_player",skl_tactics,1),
## (troop_raise_proficiency, "trp_player",0,10),
## (troop_raise_proficiency, "trp_player",1,10),
## (call_script,"script_change_troop_renown", "trp_player", 15),
## (else_try),
## (eq,"$background_answer_2",8),
## (troop_raise_attribute, "trp_player",ca_agility,1),
## (troop_raise_attribute, "trp_player",ca_intelligence,1),
## (troop_raise_attribute, "trp_player",ca_charisma,1),
## (troop_raise_skill, "trp_player",skl_leadership,1),
## (troop_raise_skill, "trp_player",skl_surgery,1),
## (troop_raise_skill, "trp_player",skl_first_aid,1),
## (troop_raise_proficiency, "trp_player",2,10),
## (call_script,"script_change_troop_renown", "trp_player", 5),
(try_end),
(try_begin),
## (eq,"$background_answer_3",1),
## (troop_raise_attribute, "trp_player",ca_strength,1),
## (troop_raise_skill, "trp_player",skl_power_strike,1),
## (troop_raise_skill, "trp_player",skl_shield,1),
## (troop_add_gold, "trp_player", 10),
## (try_begin),
## (this_or_next|player_has_item,"itm_sword"),
## (troop_has_item_equipped,"trp_player","itm_sword"),
## (troop_remove_item, "trp_player","itm_sword"),
## (try_end),
## (try_begin),
## (this_or_next|player_has_item,"itm_arming_sword"),
## (troop_has_item_equipped,"trp_player","itm_arming_sword"),
## (troop_remove_item, "trp_player","itm_arming_sword"),
## (try_end),
## (troop_add_item, "trp_player","itm_short_sword",0),
## (troop_add_item, "trp_player","itm_wooden_shield",imod_battered),
## (troop_raise_proficiency, "trp_player",0,10),
## (troop_raise_proficiency, "trp_player",4,10),
## (else_try),
## (eq,"$background_answer_3",2),
## (troop_raise_attribute, "trp_player",ca_agility,1),
## (troop_raise_skill, "trp_player",skl_weapon_master,1),
## (troop_raise_skill, "trp_player",skl_shield,1),
## (try_begin),
## (this_or_next|player_has_item,"itm_hide_boots"),
## (troop_has_item_equipped,"trp_player","itm_hide_boots"),
## (troop_remove_item, "trp_player","itm_hide_boots"),
## (try_end),
## (troop_add_item, "trp_player","itm_khergit_guard_helmet",imod_crude),
## (troop_add_item, "trp_player","itm_mail_chausses",imod_crude),
## (troop_add_item, "trp_player","itm_sword_khergit_1",imod_plain),
## (troop_add_gold, "trp_player", 20),
## (troop_raise_proficiency, "trp_player",2,20),
## (else_try),
(eq,"$background_answer_3",cb3_poacher),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_skill, "trp_player","skl_power_draw",1),
(troop_raise_skill, "trp_player","skl_tracking",1),
(troop_raise_skill, "trp_player","skl_spotting",1),
(troop_raise_skill, "trp_player","skl_athletics",1),
(troop_add_gold, "trp_player", 10),
(troop_raise_proficiency, "trp_player",wpt_polearm,10),
(troop_raise_proficiency, "trp_player",wpt_archery,35),
(troop_add_item, "trp_player","itm_axe",imod_chipped),
(troop_add_item, "trp_player","itm_rawhide_coat",0),
(troop_add_item, "trp_player","itm_hide_boots",0),
(troop_add_item, "trp_player","itm_hunting_bow",0),
(troop_add_item, "trp_player","itm_barbed_arrows",0),
(troop_add_item, "trp_player","itm_sumpter_horse",imod_heavy),
(troop_add_item, "trp_player","itm_dried_meat",0),
(troop_add_item, "trp_player","itm_dried_meat",0),
(troop_add_item, "trp_player","itm_furs",0),
(troop_add_item, "trp_player","itm_furs",0),
(else_try),
(eq,"$background_answer_3",cb3_craftsman),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_skill, "trp_player","skl_weapon_master",1),
(troop_raise_skill, "trp_player","skl_engineer",1),
(troop_raise_skill, "trp_player","skl_tactics",1),
(troop_raise_skill, "trp_player","skl_trade",1),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,15),
(troop_add_gold, "trp_player", 100),
(troop_add_item, "trp_player","itm_leather_boots",imod_ragged),
(troop_add_item, "trp_player","itm_coarse_tunic",0),
(troop_add_item, "trp_player","itm_sword_medieval_b", imod_balanced),
(troop_add_item, "trp_player","itm_hunting_crossbow",0),
(troop_add_item, "trp_player","itm_bolts",0),
(troop_add_item, "trp_player","itm_tools",0),
(troop_add_item, "trp_player","itm_saddle_horse",0),
(troop_add_item, "trp_player","itm_smoked_fish",0),
(else_try),
(eq,"$background_answer_3",cb3_peddler),
(troop_raise_attribute, "trp_player",ca_charisma,1),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_skill, "trp_player","skl_riding",1),
(troop_raise_skill, "trp_player","skl_trade",1),
(troop_raise_skill, "trp_player","skl_pathfinding",1),
(troop_raise_skill, "trp_player","skl_inventory_management",1),
(troop_add_item, "trp_player","itm_leather_gloves",imod_plain),
(troop_add_gold, "trp_player", 90),
(troop_raise_proficiency, "trp_player",wpt_polearm,15),
(troop_add_item, "trp_player","itm_leather_jacket",0),
(troop_add_item, "trp_player","itm_leather_boots",imod_ragged),
(troop_add_item, "trp_player","itm_fur_hat",0),
(troop_add_item, "trp_player","itm_staff",0),
(troop_add_item, "trp_player","itm_hunting_crossbow",0),
(troop_add_item, "trp_player","itm_bolts",0),
(troop_add_item, "trp_player","itm_saddle_horse",0),
(troop_add_item, "trp_player","itm_sumpter_horse",0),
(troop_add_item, "trp_player","itm_linen",0),
(troop_add_item, "trp_player","itm_pottery",0),
(troop_add_item, "trp_player","itm_wool",0),
(troop_add_item, "trp_player","itm_wool",0),
(troop_add_item, "trp_player","itm_smoked_fish",0),
## (else_try),
## (eq,"$background_answer_3",6),
## (troop_raise_attribute, "trp_player",ca_strength,1),
## (troop_raise_attribute, "trp_player",ca_charisma,1),
## (troop_raise_skill, "trp_player",skl_shield,1),
## (troop_raise_skill, "trp_player",skl_wound_treatment,1),
## (troop_raise_skill, "trp_player",skl_first_aid,1),
## (troop_raise_skill, "trp_player",skl_surgery,1),
## (troop_add_item, "trp_player","itm_leather_gloves",imod_ragged),
## (troop_add_item, "trp_player","itm_quarter_staff",imod_heavy),
## (troop_add_item, "trp_player","itm_black_hood",0),
## (troop_add_gold, "trp_player", 10),
## (troop_raise_proficiency, "trp_player",2,20),
(else_try),
(eq,"$background_answer_3",cb3_troubadour),
(troop_raise_attribute, "trp_player",ca_charisma,2),
(troop_raise_skill, "trp_player","skl_weapon_master",1),
(troop_raise_skill, "trp_player","skl_persuasion",1),
(troop_raise_skill, "trp_player","skl_leadership",1),
(troop_raise_skill, "trp_player","skl_pathfinding",1),
(troop_add_gold, "trp_player", 80),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,25),
(troop_raise_proficiency, "trp_player",wpt_crossbow,10),
(troop_add_item, "trp_player","itm_tabard",imod_sturdy),
(troop_add_item, "trp_player","itm_leather_boots",imod_ragged),
(troop_add_item, "trp_player","itm_sword_medieval_a", imod_rusty),
(troop_add_item, "trp_player","itm_hunting_crossbow", 0),
(troop_add_item, "trp_player","itm_bolts", 0),
(troop_add_item, "trp_player","itm_saddle_horse",imod_swaybacked),
(troop_add_item, "trp_player","itm_smoked_fish",0),
(else_try),
(eq,"$background_answer_3",cb3_squire),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_skill, "trp_player","skl_riding",1),
(troop_raise_skill, "trp_player","skl_weapon_master",1),
(troop_raise_skill, "trp_player","skl_power_strike",1),
(troop_raise_skill, "trp_player","skl_leadership",1),
(troop_add_gold, "trp_player", 20),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,30),
(troop_raise_proficiency, "trp_player",wpt_two_handed_weapon,30),
(troop_raise_proficiency, "trp_player",wpt_polearm,30),
(troop_raise_proficiency, "trp_player",wpt_archery,10),
(troop_raise_proficiency, "trp_player",wpt_crossbow,10),
(troop_raise_proficiency, "trp_player",wpt_throwing,10),
(troop_add_item, "trp_player","itm_leather_jerkin",imod_ragged),
(troop_add_item, "trp_player","itm_leather_boots",imod_tattered),
(troop_add_item, "trp_player","itm_sword_medieval_a", imod_rusty),
(troop_add_item, "trp_player","itm_hunting_crossbow",0),
(troop_add_item, "trp_player","itm_bolts",0),
(troop_add_item, "trp_player","itm_saddle_horse",imod_swaybacked),
(troop_add_item, "trp_player","itm_smoked_fish",0),
(else_try),
(eq,"$background_answer_3",cb3_lady_in_waiting),
(eq,"$character_gender",tf_female),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_attribute, "trp_player",ca_charisma,1),
(troop_raise_skill, "trp_player","skl_persuasion",2),
(troop_raise_skill, "trp_player","skl_riding",1),
(troop_raise_skill, "trp_player","skl_wound_treatment",1),
(troop_add_item, "trp_player","itm_dagger", 0),
(troop_add_item, "trp_player","itm_hunting_crossbow",0),
(troop_add_item, "trp_player","itm_bolts",0),
(troop_add_item, "trp_player","itm_courser", imod_spirited),
(troop_add_item, "trp_player","itm_woolen_hood",imod_sturdy),
(troop_add_item, "trp_player","itm_woolen_dress",imod_sturdy),
(troop_add_gold, "trp_player", 100),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,10),
(troop_raise_proficiency, "trp_player",wpt_crossbow,15),
(troop_add_item, "trp_player","itm_smoked_fish",0),
(else_try),
(eq,"$background_answer_3",cb3_student),
(troop_raise_attribute, "trp_player",ca_intelligence,2),
(troop_raise_skill, "trp_player","skl_weapon_master",1),
(troop_raise_skill, "trp_player","skl_surgery",1),
(troop_raise_skill, "trp_player","skl_wound_treatment",1),
(troop_raise_skill, "trp_player","skl_persuasion",1),
(troop_add_gold, "trp_player", 80),
(troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,20),
(troop_raise_proficiency, "trp_player",wpt_crossbow,20),
(troop_add_item, "trp_player","itm_linen_tunic",imod_sturdy),
(troop_add_item, "trp_player","itm_woolen_hose",0),
(troop_add_item, "trp_player","itm_sword_medieval_a", imod_rusty),
(troop_add_item, "trp_player","itm_hunting_crossbow", 0),
(troop_add_item, "trp_player","itm_bolts", 0),
(troop_add_item, "trp_player","itm_saddle_horse",imod_swaybacked),
(troop_add_item, "trp_player","itm_smoked_fish",0),
(store_random_in_range, ":book_no", books_begin, books_end),
(troop_add_item, "trp_player",":book_no",0),
(try_end),
(try_begin),
(eq,"$background_answer_4",cb4_revenge),
(troop_raise_attribute, "trp_player",ca_strength,2),
(troop_raise_skill, "trp_player","skl_power_strike",1),
(else_try),
(eq,"$background_answer_4",cb4_loss),
(troop_raise_attribute, "trp_player",ca_charisma,2),
(troop_raise_skill, "trp_player","skl_ironflesh",1),
(else_try),
(eq,"$background_answer_4",cb4_wanderlust),
(troop_raise_attribute, "trp_player",ca_agility,2),
(troop_raise_skill, "trp_player","skl_pathfinding",1),
## (else_try),
## (eq,"$background_answer_4",4),
## (troop_raise_attribute, "trp_player",ca_charisma,1),
## (troop_raise_skill, "trp_player",skl_wound_treatment,1),
## (troop_raise_proficiency, "trp_player",5,10),
(else_try),
(eq,"$background_answer_4",cb4_disown),
(troop_raise_attribute, "trp_player",ca_strength,1),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_skill, "trp_player","skl_weapon_master",1),
(else_try),
(eq,"$background_answer_4",cb4_greed),
(troop_raise_attribute, "trp_player",ca_agility,1),
(troop_raise_attribute, "trp_player",ca_intelligence,1),
(troop_raise_skill, "trp_player","skl_looting",1),
(try_end),
(try_begin),
(eq, "$background_type", cb_noble),
(jump_to_menu, "mnu_auto_return"),
#normal_banner_begin
(start_presentation, "prsnt_banner_selection"),
#custom_banner_begin
# (start_presentation, "prsnt_custom_banner"),
(else_try),
(change_screen_return, 0),
(try_end),
(set_show_messages, 1),
]),
("go_back_dot",[],"Go back.",[
(jump_to_menu,"mnu_start_character_4"),
]),
]
),
(
"past_life_explanation",mnf_disable_all_keys,
"{s3}",
"none",
[
(try_begin),
(gt,"$current_string_reg",14),
(assign,"$current_string_reg",10),
(try_end),
(str_store_string_reg,s3,"$current_string_reg"),
(try_begin),
(ge,"$current_string_reg",14),
(str_store_string,s5,"@Back to the beginning..."),
(else_try),
(str_store_string,s5,"@View next segment..."),
(try_end),
],
[
("view_next",[],"{s5}",[
(val_add,"$current_string_reg",1),
(jump_to_menu, "mnu_past_life_explanation"),
]),
("continue",[],"Continue...",
[
]),
("go_back_dot",[],"Go back.",[
(jump_to_menu, "mnu_choose_skill"),
]),
]
),
(
"auto_return",0,
"{!}This menu automatically returns to caller.",
"none",
[(change_screen_return, 0)],
[
]
),
("morale_report",0,
"{s1}",
"none",
[
(call_script, "script_get_player_party_morale_values"),
#(party_set_morale, "p_main_party", reg0),
(assign, ":target_morale", reg0),
(assign, reg1, "$g_player_party_morale_modifier_party_size"),
(try_begin),
(gt, reg1, 0),
(str_store_string, s2, "@{!} -"),
(else_try),
(str_store_string, s2, "str_space"),
(try_end),
(assign, reg2, "$g_player_party_morale_modifier_leadership"),
(try_begin),
(gt, reg2, 0),
(str_store_string, s3, "@{!} +"),
(else_try),
(str_store_string, s3, "str_space"),
(try_end),
(try_begin),
(gt, "$g_player_party_morale_modifier_no_food", 0),
(assign, reg7, "$g_player_party_morale_modifier_no_food"),
(str_store_string, s5, "@^No food: -{reg7}"),
(else_try),
(str_store_string, s5, "str_space"),
(try_end),
(assign, reg3, "$g_player_party_morale_modifier_food"),
(try_begin),
(gt, reg3, 0),
(str_store_string, s4, "@{!} +"),
(else_try),
(str_store_string, s4, "str_space"),
(try_end),
(try_begin),
(gt, "$g_player_party_morale_modifier_debt", 0),
(assign, reg6, "$g_player_party_morale_modifier_debt"),
(str_store_string, s6, "@^Wage debt: -{reg6}"),
(else_try),
(str_store_string, s6, "str_space"),
(try_end),
(party_get_morale, reg5, "p_main_party"),
(store_sub, reg4, reg5, ":target_morale"),
(try_begin),
(gt, reg4, 0),
(str_store_string, s7, "@{!} +"),
(else_try),
(str_store_string, s7, "str_space"),
(try_end),
(assign, reg6, 50),
(str_store_string, s1, "str_current_party_morale_is_reg5_current_party_morale_modifiers_are__base_morale__50_party_size_s2reg1_leadership_s3reg2_food_variety_s4reg3s5s6_recent_events_s7reg4_total__reg5___"),
(try_for_range, ":kingdom_no", npc_kingdoms_begin, npc_kingdoms_end),
(faction_get_slot, ":faction_morale", ":kingdom_no", slot_faction_morale_of_player_troops),
(val_div, ":faction_morale", 100),
(neq, ":faction_morale", 0),
(assign, reg6, ":faction_morale"),
(str_store_faction_name, s9, ":kingdom_no"),
(str_store_string, s1, "str_s1extra_morale_for_s9_troops__reg6_"),
(try_end),
],
[
("continue",[],"Continue...",
[
(jump_to_menu, "mnu_reports"),
]),
]
),
("courtship_relations",0,
"{s1}",
"none",
[(str_store_string, s1, "str_courtships_in_progress_"),
(try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
(troop_slot_eq, ":lady", slot_troop_met, 2),
(call_script, "script_troop_get_relation_with_troop", "trp_player", ":lady"),
(gt, reg0, 0),
(assign, reg3, reg0),
(str_store_troop_name, s2, ":lady"),
(store_current_hours, ":hours_since_last_visit"),
(troop_get_slot, ":last_visit_hour", ":lady", slot_troop_last_talk_time),
(val_sub, ":hours_since_last_visit", ":last_visit_hour"),
(store_div, ":days_since_last_visit", ":hours_since_last_visit", 24),
(assign, reg4, ":days_since_last_visit"),
(str_store_string, s1, "str_s1_s2_relation_reg3_last_visit_reg4_days_ago"),
(try_end),
(str_store_string, s1, "str_s1__poems_known"),
(try_begin),
(gt, "$allegoric_poem_recitations", 0),
(str_store_string, s1, "str_s1_storming_the_castle_of_love_allegoric"),
(try_end),
(try_begin),
(gt, "$tragic_poem_recitations", 0),
(str_store_string, s1, "str_s1_kais_and_layali_tragic"),
(try_end),
(try_begin),
(gt, "$comic_poem_recitations", 0),
(str_store_string, s1, "str_s1_a_conversation_in_the_garden_comic"),
(try_end),
(try_begin),
(gt, "$heroic_poem_recitations", 0),
(str_store_string, s1, "str_s1_helgered_and_kara_epic"),
(try_end),
(try_begin),
(gt, "$mystic_poem_recitations", 0),
(str_store_string, s1, "str_s1_a_hearts_desire_mystic"),
(try_end),
],
[
("continue",[],"Continue...",
[(jump_to_menu, "mnu_reports"),
]
),
]
),
("lord_relations",0,
"{s1}",
"none",
[
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(troop_set_slot, ":active_npc", slot_troop_temp_slot, 0),
(try_end),
(str_clear, s1),
(try_for_range, ":unused", active_npcs_begin, active_npcs_end),
(assign, ":score_to_beat", -100),
(assign, ":best_relation_remaining_npc", -1),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":active_npc", slot_troop_temp_slot, 0),
(troop_slot_eq, ":active_npc", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_ge, ":active_npc", slot_troop_met, 1),
(call_script, "script_troop_get_player_relation", ":active_npc"),
(assign, ":relation_with_player", reg0),
(ge, ":relation_with_player", ":score_to_beat"),
(assign, ":score_to_beat", ":relation_with_player"),
(assign, ":best_relation_remaining_npc", ":active_npc"),
(try_end),
(gt, ":best_relation_remaining_npc", -1),
(str_store_troop_name_link, s4, ":best_relation_remaining_npc"),
(assign, reg4, ":score_to_beat"),
(str_store_string, s1, "@{!}{s1}^{s4}: {reg4}"),
(troop_set_slot, ":best_relation_remaining_npc", slot_troop_temp_slot, 1),
(try_end),
],
[
("continue",[],"Continue...",
[(jump_to_menu, "mnu_reports"),
]
),
]
),
("companion_report",0,
"{s7}{s1}",
"none",
[
(str_clear, s1),
(str_store_string, s7, "str_no_companions_in_service"),
(try_begin),
(troop_get_slot, ":spouse_or_betrothed", "trp_player", slot_troop_spouse),
(try_begin),
(troop_get_type, ":is_female", "trp_player"),
(eq, ":is_female", 1),
(str_store_string, s8, "str_husband"),
(else_try),
(str_store_string, s8, "str_wife"),
(try_end),
(try_begin),
(le, ":spouse_or_betrothed", 0),
(troop_get_slot, ":spouse_or_betrothed", "trp_player", slot_troop_betrothed),
(str_store_string, s8, "str_betrothed"),
(try_end),
(gt, ":spouse_or_betrothed", 0),
(str_store_troop_name, s4, ":spouse_or_betrothed"),
(troop_get_slot, ":cur_center", ":spouse_or_betrothed", slot_troop_cur_center),
(try_begin),
(is_between, ":cur_center", centers_begin, centers_end),
(str_store_party_name, s5, ":cur_center"),
(else_try),
(troop_slot_eq, ":spouse_or_betrothed", slot_troop_occupation, slto_kingdom_hero),
(str_store_string, s5, "str_leading_party"),
(else_try),
(str_store_string, s5, "str_whereabouts_unknown"),
(try_end),
(str_store_string, s3, "str_s4_s8_s5"),
(str_store_string, s2, s1),
(str_store_string, s1, "str_s2_s3"),
(try_end),
(try_begin),
(ge, "$cheat_mode", 1),
(ge, "$npc_to_rejoin_party", 0),
(str_store_troop_name, s5, "$npc_to_rejoin_party"),
(str_store_string, s1, "@{!}DEBUG -- {s1}^NPC in rejoin queue: {s5}^"),
(try_end),
(try_for_range, ":companion", companions_begin, companions_end),
(str_clear, s2),
(str_clear, s3),
(try_begin),
(troop_get_slot, ":days_left", ":companion", slot_troop_days_on_mission),
(troop_slot_eq, ":companion", slot_troop_occupation, slto_player_companion),
(str_store_troop_name, s4, ":companion"),
(try_begin),
(troop_slot_eq, ":companion", slot_troop_current_mission, npc_mission_kingsupport),
(str_store_string, s8, "str_gathering_support"),
(try_begin),
(eq, ":days_left", 1),
(str_store_string, s5, "str_expected_back_imminently"),
(else_try),
(assign, reg3, ":days_left"),
(str_store_string, s5, "str_expected_back_in_approximately_reg3_days"),
(try_end),
(else_try),
(troop_slot_eq, ":companion", slot_troop_current_mission, npc_mission_gather_intel),
(troop_get_slot, ":town_with_contacts", ":companion", slot_troop_town_with_contacts),
(str_store_party_name, s11, ":town_with_contacts"),
(str_store_string, s8, "str_gathering_intelligence"),
(try_begin),
(eq, ":days_left", 1),
(str_store_string, s5, "str_expected_back_imminently"),
(else_try),
(assign, reg3, ":days_left"),
(str_store_string, s5, "str_expected_back_in_approximately_reg3_days"),
(try_end),
(else_try), #This covers most diplomatic missions
(troop_slot_ge, ":companion", slot_troop_current_mission, npc_mission_peace_request),
(neg|troop_slot_ge, ":companion", slot_troop_current_mission, 8),
(troop_get_slot, ":faction", ":companion", slot_troop_mission_object),
(str_store_faction_name, s9, ":faction"),
(str_store_string, s8, "str_diplomatic_embassy_to_s9"),
(try_begin),
(eq, ":days_left", 1),
(str_store_string, s5, "str_expected_back_imminently"),
(else_try),
(assign, reg3, ":days_left"),
(str_store_string, s5, "str_expected_back_in_approximately_reg3_days"),
(try_end),
(else_try),
(eq, ":companion", "$g_player_minister"),
(str_store_string, s8, "str_serving_as_minister"),
(try_begin),
(is_between, "$g_player_court", centers_begin, centers_end),
(str_store_party_name, s9, "$g_player_court"),
(str_store_string, s5, "str_in_your_court_at_s9"),
(else_try),
(str_store_string, s5, "str_whereabouts_unknown"),
(try_end),
(else_try),
(main_party_has_troop, ":companion"),
(str_store_string, s8, "str_under_arms"),
(str_store_string, s5, "str_in_your_party"),
(else_try),
(troop_slot_eq, ":companion", slot_troop_current_mission, npc_mission_rejoin_when_possible),
(str_store_string, s8, "str_attempting_to_rejoin_party"),
(str_store_string, s5, "str_whereabouts_unknown"),
(else_try), #Companions who are in a center
(troop_slot_ge, ":companion", slot_troop_cur_center, 1),
(str_store_string, s8, "str_separated_from_party"),
(str_store_string, s5, "str_whereabouts_unknown"),
(else_try), #Excludes companions who have occupation = retirement
(troop_set_slot, ":companion", slot_troop_current_mission, npc_mission_rejoin_when_possible),
(str_store_string, s8, "str_attempting_to_rejoin_party"),
(str_store_string, s5, "str_whereabouts_unknown"),
(try_begin),
(ge, "$cheat_mode", 1),
(troop_get_slot, reg2, ":companion", slot_troop_current_mission),
(troop_get_slot, reg3, ":companion", slot_troop_days_on_mission),
(troop_get_slot, reg4, ":companion", slot_troop_prisoner_of_party),
(troop_get_slot, reg4, ":companion", slot_troop_playerparty_history),
(display_message, "@{!}DEBUG: {s4} current mission: {reg2}, days on mission: {reg3}, prisoner: {reg4}, pphistory: {reg5}"),
(try_end),
(try_end),
(str_store_string, s3, "str_s4_s8_s5"),
(str_store_string, s2, s1),
(str_store_string, s1, "str_s2_s3"),
(str_clear, s7), #"no companions in service"
(else_try),
(neg|troop_slot_eq, ":companion", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_ge, ":companion", slot_troop_prisoner_of_party, centers_begin),
(str_store_troop_name, s4, ":companion"),
(str_store_string, s8, "str_missing_after_battle"),
(str_store_string, s5, "str_whereabouts_unknown"),
(str_store_string, s3, "str_s4_s8_s5"),
(str_store_string, s2, s1),
(str_store_string, s1, "str_s2_s3"),
(str_clear, s7), #"no companions in service"
(try_end),
(try_end),
],
[
("continue",[],"Continue...",
[(jump_to_menu, "mnu_reports"),
]
),
]
),
("faction_orders",0,
"{!}{s9}",
"none",
[
(str_clear, s9),
(store_current_hours, ":cur_hours"),
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
(neq, ":faction_no", "fac_player_supporters_faction"),
(faction_get_slot, ":old_faction_ai_state", ":faction_no", slot_faction_ai_state),
(try_begin),
(faction_get_slot, ":faction_marshal", ":faction_no", slot_faction_marshall),
(gt, ":faction_marshal", -1),
(assign, ":faction_ai_decider", ":faction_marshal"),
(else_try),
(faction_get_slot, ":faction_ai_decider", ":faction_no", slot_faction_leader),
(try_end),
#(*1) these two lines moved to here from (*2)
(call_script, "script_npc_decision_checklist_faction_ai_alt", ":faction_ai_decider"),
(assign, ":new_strategy", reg0),
(str_store_string, s26, s14),
#(3*) these three lines moved to here from (*4)
(faction_get_slot, ":faction_ai_state", ":faction_no", slot_faction_ai_state),
(faction_get_slot, ":faction_ai_object", ":faction_no", slot_faction_ai_object),
(faction_get_slot, ":faction_marshall", ":faction_no", slot_faction_marshall),
(faction_get_slot, ":faction_ai_offensive_max_followers", ":faction_no", slot_faction_ai_offensive_max_followers),
(str_store_faction_name, s10, ":faction_no"),
(try_begin),
(faction_get_slot, ":faction_issue", ":faction_no", slot_faction_political_issue),
(try_begin),
(eq, ":faction_issue", 1),
(str_store_string, s11, "@Appoint next marshal"),
(else_try),
(is_between, ":faction_issue", centers_begin, centers_end),
(str_store_party_name, s12, ":faction_issue"),
(str_store_string, s11, "@Award {s12} as fief"),
(else_try),
(eq, ":faction_issue", 0),
(str_store_string, s11, "@None"),
(else_try),
(assign, reg3, ":faction_issue"),
(str_store_string, s11, "@{!}Error ({reg3})"),
(try_end),
(store_current_hours, reg4),
(faction_get_slot, ":faction_issue_put_on_agenda", ":faction_no", slot_faction_political_issue_time),
(val_sub, reg4, ":faction_issue_put_on_agenda"),
(str_store_string, s10, "@{!}{s10}^Faction political issue: {s11}"),
(try_begin),
(faction_slot_ge, ":faction_no", slot_faction_political_issue, 1),
(str_store_string, s10, "@{!}{s10} (on agenda {reg4} hours)"),
(try_end),
(try_end),
(assign, reg2, ":faction_ai_offensive_max_followers"),
(try_begin),
(eq, ":faction_ai_state", sfai_default),
(str_store_string, s11, "@{!}Defending"),
(else_try),
(eq, ":faction_ai_state", sfai_gathering_army),
(str_store_string, s11, "@{!}Gathering army"),
(else_try),
(eq, ":faction_ai_state", sfai_attacking_center),
(str_store_party_name, s11, ":faction_ai_object"),
(str_store_string, s11, "@{!}Besieging {s11}"),
(else_try),
(eq, ":faction_ai_state", sfai_raiding_village),
(str_store_party_name, s11, ":faction_ai_object"),
(str_store_string, s11, "@{!}Raiding {s11}"),
(else_try),
(eq, ":faction_ai_state", sfai_attacking_enemy_army),
(str_store_party_name, s11, ":faction_ai_object"),
(str_store_string, s11, "str_attacking_enemy_army_near_s11"),
(else_try),
(eq, ":faction_ai_state", sfai_feast),
(str_store_party_name, s11, ":faction_ai_object"),
(str_store_string, s11, "str_holding_feast_at_s11"),
(else_try),
(eq, ":faction_ai_state", sfai_attacking_enemies_around_center),
(str_store_party_name, s11, ":faction_ai_object"),
(str_store_string, s11, "@{!}Attacking enemies around {s11}"),
(else_try),
(assign, reg4, ":faction_ai_state"),
(str_store_string, s11, "str_sfai_reg4"),
(try_end),
(try_begin),
(lt, ":faction_marshall", 0),
(str_store_string, s12, "@No one"),
(else_try),
(str_store_troop_name, s12, ":faction_marshall"),
(troop_get_slot, reg21, ":faction_marshall", slot_troop_controversy),
(str_store_string, s12, "@{!}{s12} (controversy: {reg21})"),
(try_end),
(try_for_parties, ":screen_party"),
(party_slot_eq, ":screen_party", slot_party_ai_state, spai_screening_army),
(store_faction_of_party, ":screen_party_faction", ":screen_party"),
(eq, ":screen_party_faction", ":faction_no"),
(str_store_party_name, s38, ":screen_party"),
(str_store_string, s12, "@{!}{s12}^Screening party: {s38}"),
(try_end),
#(*2) these two lines moved to up (look *1)
#(call_script, "script_npc_decision_checklist_faction_ai", ":faction_no"),
#(assign, ":new_strategy", reg0),
#(try_begin),
# (this_or_next|eq, ":new_strategy", sfai_default),
# (eq, ":new_strategy", sfai_feast),
#
# (store_current_hours, ":hours"),
# (faction_set_slot, ":faction_no", slot_faction_ai_last_rest_time, ":hours"),
#(try_end),
(try_begin),
#new condition to rest, (a faction's new strategy should be feast or default) and (":hours_at_current_state" > 20)
(this_or_next|eq, ":new_strategy", sfai_default),
(eq, ":new_strategy", sfai_feast),
(store_current_hours, ":hours_at_current_state"),
(faction_get_slot, ":current_state_started", ":faction_no", slot_faction_ai_current_state_started),
(val_sub, ":hours_at_current_state", ":current_state_started"),
(ge, ":hours_at_current_state", 18),
(store_current_hours, ":hours"),
(faction_set_slot, ":faction_no", slot_faction_ai_last_rest_time, ":hours"),
(try_end),
#Change of strategy
(try_begin),
(neq, ":new_strategy", ":old_faction_ai_state"),
(store_current_hours, ":hours"),
(faction_set_slot, ":faction_no", slot_faction_ai_current_state_started, ":hours"),
(try_end),
(call_script, "script_evaluate_realm_stability", ":faction_no"),
(assign, ":disgruntled_lords", reg0),
(assign, ":restless_lords", reg1),
(faction_get_slot, ":last_feast_ended", ":faction_no", slot_faction_last_feast_start_time),
(store_sub, ":hours_since_last_feast", ":cur_hours", ":last_feast_ended"),
(val_sub, ":hours_since_last_feast", 72),
(faction_get_slot, ":current_state_started", ":faction_no", slot_faction_ai_current_state_started),
(store_sub, ":hours_at_current_state", ":cur_hours", ":current_state_started"),
(faction_get_slot, ":faction_ai_last_offensive_time", ":faction_no", slot_faction_last_offensive_concluded),
(store_sub, ":hours_since_last_offensive", ":cur_hours", ":faction_ai_last_offensive_time"),
(faction_get_slot, ":faction_ai_last_rest", ":faction_no", slot_faction_ai_last_rest_time),
(store_sub, ":hours_since_last_rest", ":cur_hours", ":faction_ai_last_rest"),
(faction_get_slot, ":faction_ai_last_decisive_event", ":faction_no", slot_faction_ai_last_decisive_event),
(store_sub, ":hours_since_last_decisive_event", ":cur_hours", ":faction_ai_last_decisive_event"),
(assign, reg3, ":hours_at_current_state"),
(assign, reg4, ":hours_since_last_offensive"),
(assign, reg5, ":hours_since_last_feast"),
(assign, reg7, ":disgruntled_lords"),
(assign, reg8, ":restless_lords"),
(assign, reg9, ":hours_since_last_rest"),
(assign, reg10, ":hours_since_last_decisive_event"),
(str_store_string, s14, s26),
(str_store_string, s9, "str_s9s10_current_state_s11_hours_at_current_state_reg3_current_strategic_thinking_s14_marshall_s12_since_the_last_offensive_ended_reg4_hours_since_the_decisive_event_reg10_hours_since_the_last_rest_reg9_hours_since_the_last_feast_ended_reg5_hours_percent_disgruntled_lords_reg7_percent_restless_lords_reg8__"),
(try_end),
(try_begin),
(neg|is_between, "$g_cheat_selected_faction", kingdoms_begin, kingdoms_end),
(call_script, "script_get_next_active_kingdom", kingdoms_end),
(assign, "$g_cheat_selected_faction", reg0),
(try_end),
(str_store_faction_name, s10, "$g_cheat_selected_faction"),
(str_store_string, s9, "@Selected faction is: {s10}^^{s9}"),
],
[
("faction_orders_next_faction", [],"{!}Select next faction.",
[
(call_script, "script_get_next_active_kingdom", "$g_cheat_selected_faction"),
(assign, "$g_cheat_selected_faction", reg0),
(jump_to_menu, "mnu_faction_orders"),
]
),
("faction_orders_political_collapse", [],"{!}CHEAT - Cause all lords in faction to fall out with their liege.",
[
(try_for_range, ":lord", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":lord", slot_troop_occupation, slto_kingdom_hero),
(store_faction_of_troop, ":troop_faction", ":lord"),
(eq, ":troop_faction", "$g_cheat_selected_faction"),
(faction_get_slot, ":faction_liege", ":troop_faction", slot_faction_leader),
(call_script, "script_troop_change_relation_with_troop", ":lord", ":faction_liege", -200),
(try_end),
]
),
("faction_orders_defend", [],"{!}Force defend.",
[
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_ai_state, sfai_default),
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_ai_object, -1),
(jump_to_menu, "mnu_faction_orders"),
]
),
("faction_orders_feast", [],"{!}Force feast.",
[
(assign, ":location_high_score", 0),
(try_for_range, ":location", walled_centers_begin, walled_centers_end),
(neg|party_slot_ge, ":location", slot_center_is_besieged_by, 1),
(store_faction_of_party, ":location_faction", ":location"),
(eq, ":location_faction", "$g_cheat_selected_faction"),
(party_get_slot, ":location_lord", ":location", slot_town_lord),
(troop_get_slot, ":location_score", ":location_lord", slot_troop_renown),
(store_random_in_range, ":random", 0, 1000), #will probably be king or senior lord
(val_add, ":location_score", ":random"),
(gt, ":location_score", ":location_high_score"),
(assign, ":location_high_score", ":location_score"),
(assign, ":location_feast", ":location"),
(try_end),
(try_begin),
(gt, ":location_feast", centers_begin),
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_ai_state, sfai_feast),
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_ai_object, ":location_feast"),
(try_begin),
(eq, "$g_player_eligible_feast_center_no", ":location_feast"),
(assign, "$g_player_eligible_feast_center_no", -1),
(try_end),
(store_current_hours, ":hours"),
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_last_feast_start_time, ":hours"),
(try_end),
(jump_to_menu, "mnu_faction_orders"),
]
),
("faction_orders_gather", [],"{!}Force gather army.",
[
(store_current_hours, ":cur_hours"),
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_ai_state, sfai_gathering_army),
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_last_offensive_concluded, ":cur_hours"),
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_ai_offensive_max_followers, 1),
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_ai_object, -1),
(jump_to_menu, "mnu_faction_orders"),
]
),
("faction_orders_increase_time", [],"{!}Increase last offensive time by 24 hours.",
[
(faction_get_slot, ":faction_ai_last_offensive_time", "$g_cheat_selected_faction", slot_faction_last_offensive_concluded),
(val_sub, ":faction_ai_last_offensive_time", 24),
(faction_set_slot, "$g_cheat_selected_faction", slot_faction_last_offensive_concluded, ":faction_ai_last_offensive_time"),
(jump_to_menu, "mnu_faction_orders"),
]
),
("faction_orders_rethink", [],"{!}Force rethink.",
[
(call_script, "script_init_ai_calculation"),
(call_script, "script_decide_faction_ai", "$g_cheat_selected_faction"),
(jump_to_menu, "mnu_faction_orders"),
]
),
("faction_orders_rethink_all", [],"{!}Force rethink for all factions.",
[
(call_script, "script_recalculate_ais"),
(jump_to_menu, "mnu_faction_orders"),
]
),
("enable_alt_ai",[(eq, "$g_use_alternative_ai", 2),],"{!}CHEAT! - enable alternative ai",
[
(assign, "$g_use_alternative_ai", 1),
(jump_to_menu, "mnu_faction_orders"),
]
),
("disable_alt_ai",[(eq, "$g_use_alternative_ai", 2)],"{!}CHEAT! - disable alternative ai",
[
(assign, "$g_use_alternative_ai", 0),
(jump_to_menu, "mnu_faction_orders"),
]
),
("faction_orders_init_econ", [],"{!}Initialize economic stats.",
[
(call_script, "script_initialize_economic_information"),
(jump_to_menu, "mnu_faction_orders"),
]
),
("go_back_dot",[],"{!}Go back.",
[(jump_to_menu, "mnu_reports"),
]
),
]
),
("character_report",0,
"{s9}",
"none",
[(try_begin),
(gt, "$g_player_reading_book", 0),
(player_has_item, "$g_player_reading_book"),
(str_store_item_name, s8, "$g_player_reading_book"),
(str_store_string, s9, "@You are currently reading {s8}."),
(else_try),
(assign, "$g_player_reading_book", 0),
(str_store_string, s9, "@You are not reading any books."),
(try_end),
(assign, ":num_friends", 0),
(assign, ":num_enemies", 0),
(str_store_string, s6, "@none"),
(str_store_string, s8, "@none"),
(try_for_range, ":troop_no", active_npcs_begin, active_npcs_end),
(this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_inactive_pretender),
(call_script, "script_troop_get_player_relation", ":troop_no"),
(assign, ":player_relation", reg0),
#(troop_get_slot, ":player_relation", ":troop_no", slot_troop_player_relation),
(try_begin),
(gt, ":player_relation", 20),
(try_begin),
(eq, ":num_friends", 0),
(str_store_troop_name, s8, ":troop_no"),
(else_try),
(eq, ":num_friends", 1),
(str_store_troop_name, s7, ":troop_no"),
(str_store_string, s8, "@{s7} and {s8}"),
(else_try),
(str_store_troop_name, s7, ":troop_no"),
(str_store_string, s8, "@{!}{s7}, {s8}"),
(try_end),
(val_add, ":num_friends", 1),
(else_try),
(lt, ":player_relation", -20),
(try_begin),
(eq, ":num_enemies", 0),
(str_store_troop_name, s6, ":troop_no"),
(else_try),
(eq, ":num_enemies", 1),
(str_store_troop_name, s5, ":troop_no"),
(str_store_string, s6, "@{s5} and {s6}"),
(else_try),
(str_store_troop_name, s5, ":troop_no"),
(str_store_string, s6, "@{!}{s5}, {s6}"),
(try_end),
(val_add, ":num_enemies", 1),
(try_end),
(try_end),
#lord recruitment changes begin
(str_clear, s12),
(try_begin),
(gt, "$player_right_to_rule", 0),
(assign, reg12, "$player_right_to_rule"),
(str_store_string, s12, "str__right_to_rule_reg12"),
(try_end),
(str_clear, s15),
(try_begin),
(this_or_next|gt, "$claim_arguments_made", 0),
(this_or_next|gt, "$ruler_arguments_made", 0),
(this_or_next|gt, "$victory_arguments_made", 0),
(this_or_next|gt, "$lords_arguments_made", 0),
(eq, 1, 0),
(assign, reg3, "$claim_arguments_made"),
(assign, reg4, "$ruler_arguments_made"),
(assign, reg5, "$victory_arguments_made"),
(assign, reg6, "$lords_arguments_made"),
(assign, reg7, "$benefit_arguments_made"),
(str_store_string, s15, "str_political_arguments_made_legality_reg3_rights_of_lords_reg4_unificationpeace_reg5_rights_of_commons_reg6_fief_pledges_reg7"),
(try_end),
#lord recruitment changes begin
(assign, reg3, "$player_honor"),
(troop_get_slot, reg2, "trp_player", slot_troop_renown),
(str_store_string, s9, "str_renown_reg2_honour_rating_reg3s12_friends_s8_enemies_s6_s9"),
(call_script, "script_get_number_of_hero_centers", "trp_player"),
(assign, ":no_centers", reg0),
(try_begin),
(gt, ":no_centers", 0),
(try_for_range, ":i_center", 0, ":no_centers"),
(call_script, "script_troop_get_leaded_center_with_index", "trp_player", ":i_center"),
(assign, ":cur_center", reg0),
(try_begin),
(eq, ":i_center", 0),
(str_store_party_name, s8, ":cur_center"),
(else_try),
(eq, ":i_center", 1),
(str_store_party_name, s7, ":cur_center"),
(str_store_string, s8, "@{s7} and {s8}"),
(else_try),
(str_store_party_name, s7, ":cur_center"),
(str_store_string, s8, "@{!}{s7}, {s8}"),
(try_end),
(try_end),
(str_store_string, s9, "@Your estates are: {s8}.^{s9}"),
(try_end),
(try_begin),
(gt, "$players_kingdom", 0),
(str_store_faction_name, s8, "$players_kingdom"),
(try_begin),
(this_or_next|is_between, "$players_kingdom", npc_kingdoms_begin, npc_kingdoms_end),
(neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
#(str_store_string, s9, "@You are a lord of {s8}.^{s9}"),
(str_store_string, s9, "str_you_are_a_lord_lady_of_s8_s9"),
(else_try),
(str_store_string, s9, "str_you_are_king_queen_of_s8_s9"),
(try_end),
(try_end),
],
[
#lord recruitment changes begin
("continue",[(eq,"$cheat_mode",1)],"{!}CHEAT! - increase Right to Rule",
[
(val_add, "$player_right_to_rule", 10),
(jump_to_menu, "mnu_character_report"),
]
),
("continue",[(eq,"$cheat_mode",1),
(str_store_troop_name, s14, "$g_talk_troop"),
],"{!}CHEAT! - increase your relation with {s14}",
[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
(jump_to_menu, "mnu_character_report"),
]
),
("continue",[(eq,"$cheat_mode",1)],"{!}CHEAT! - increase honor",
[
(val_add, "$player_honor", 10),
(jump_to_menu, "mnu_character_report"),
]
),
("continue",[(eq,"$cheat_mode",1)],"{!}CHEAT! - increase renown",
[
(troop_get_slot, ":renown", "trp_player", slot_troop_renown),
(val_add, ":renown", 50),
(troop_set_slot, "trp_player", slot_troop_renown, ":renown"),
(jump_to_menu, "mnu_character_report"),
]
),
("continue",[(eq,"$cheat_mode",1)],"{!}CHEAT! - increase persuasion",
[
(troop_raise_skill, "trp_player", "skl_persuasion", 1),
(jump_to_menu, "mnu_character_report"),
]
),
("continue",[],"Continue...",
[(jump_to_menu, "mnu_reports"),
]
),
#lord recruitment changes end
]
),
("party_size_report",0,
"{s1}",
"none",
[(call_script, "script_game_get_party_companion_limit"),
(assign, ":party_size_limit", reg0),
(store_skill_level, ":leadership", "skl_leadership", "trp_player"),
(val_mul, ":leadership", 5),
(store_attribute_level, ":charisma", "trp_player", ca_charisma),
(troop_get_slot, ":renown", "trp_player", slot_troop_renown),
(val_div, ":renown", 25),
(try_begin),
(gt, ":leadership", 0),
(str_store_string, s2, "@{!} +"),
(else_try),
(str_store_string, s2, "str_space"),
(try_end),
(try_begin),
(gt, ":charisma", 0),
(str_store_string, s3, "@{!} +"),
(else_try),
(str_store_string, s3, "str_space"),
(try_end),
(try_begin),
(gt, ":renown", 0),
(str_store_string, s4, "@{!} +"),
(else_try),
(str_store_string, s4, "str_space"),
(try_end),
(assign, reg5, ":party_size_limit"),
(assign, reg1, ":leadership"),
(assign, reg2, ":charisma"),
(assign, reg3, ":renown"),
(str_store_string, s1, "@Current party size limit is {reg5}.^Current party size modifiers are:^^Base size: +30^Leadership: {s2}{reg1}^Charisma: {s3}{reg2}^Renown: {s4}{reg3}^TOTAL: {reg5}"),
],
[
("continue",[],"Continue...",
[(jump_to_menu, "mnu_reports"),
]
),
]
),
("faction_relations_report",0,
"{s1}",
"none",
[(str_clear, s2),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(neq, ":cur_kingdom", "fac_player_supporters_faction"),
(store_relation, ":cur_relation", "fac_player_supporters_faction", ":cur_kingdom"),
(try_begin),
(ge, ":cur_relation", 90),
(str_store_string, s3, "@Loyal"),
(else_try),
(ge, ":cur_relation", 80),
(str_store_string, s3, "@Devoted"),
(else_try),
(ge, ":cur_relation", 70),
(str_store_string, s3, "@Fond"),
(else_try),
(ge, ":cur_relation", 60),
(str_store_string, s3, "@Gracious"),
(else_try),
(ge, ":cur_relation", 50),
(str_store_string, s3, "@Friendly"),
(else_try),
(ge, ":cur_relation", 40),
(str_store_string, s3, "@Supportive"),
(else_try),
(ge, ":cur_relation", 30),
(str_store_string, s3, "@Favorable"),
(else_try),
(ge, ":cur_relation", 20),
(str_store_string, s3, "@Cooperative"),
(else_try),
(ge, ":cur_relation", 10),
(str_store_string, s3, "@Accepting"),
(else_try),
(ge, ":cur_relation", 0),
(str_store_string, s3, "@Indifferent"),
(else_try),
(ge, ":cur_relation", -10),
(str_store_string, s3, "@Suspicious"),
(else_try),
(ge, ":cur_relation", -20),
(str_store_string, s3, "@Grumbling"),
(else_try),
(ge, ":cur_relation", -30),
(str_store_string, s3, "@Hostile"),
(else_try),
(ge, ":cur_relation", -40),
(str_store_string, s3, "@Resentful"),
(else_try),
(ge, ":cur_relation", -50),
(str_store_string, s3, "@Angry"),
(else_try),
(ge, ":cur_relation", -60),
(str_store_string, s3, "@Hateful"),
(else_try),
(ge, ":cur_relation", -70),
(str_store_string, s3, "@Revengeful"),
(else_try),
(str_store_string, s3, "@Vengeful"),
(try_end),
(str_store_faction_name, s4, ":cur_kingdom"),
(assign, reg1, ":cur_relation"),
(str_store_string, s2, "@{!}{s2}^{s4}: {reg1} ({s3})"),
(try_end),
(str_store_string, s1, "@Your relation with the factions are:^{s2}"),
],
[
("continue",[],"Continue...",
[(jump_to_menu, "mnu_reports"),
]
),
]
),
("camp",mnf_scale_picture,
"You set up camp. What do you want to do?",
"none",
[
(assign, "$g_player_icon_state", pis_normal),
(set_background_mesh, "mesh_pic_camp"),
],
[
("camp_action_1",[(eq,"$cheat_mode",1)],"{!}Cheat: Walk around.",
[(set_jump_mission,"mt_ai_training"),
(call_script, "script_setup_random_scene"),
(change_screen_mission),
]
),
("camp_action",[],"Take an action.",
[(jump_to_menu, "mnu_camp_action"),
]
),
("camp_wait_here",[],"Wait here for some time.",
[
(assign,"$g_camp_mode", 1),
(assign, "$g_infinite_camping", 0),
(assign, "$g_player_icon_state", pis_camping),
(try_begin),
(party_is_active, "p_main_party"),
(party_get_current_terrain, ":cur_terrain", "p_main_party"),
(try_begin),
(eq, ":cur_terrain", rt_desert),
(unlock_achievement, ACHIEVEMENT_SARRANIDIAN_NIGHTS),
(try_end),
(try_end),
(rest_for_hours_interactive, 24 * 365, 5, 1), #rest while attackable
(change_screen_return),
]
),
("camp_cheat",
[(ge, "$cheat_mode", 1)
], "CHEAT MENU!",
[(jump_to_menu, "mnu_camp_cheat"),
],
),
("resume_travelling",[],"Resume travelling.",
[
(change_screen_return),
]
),
]
),
("camp_cheat",0,
"Select a cheat:",
"none",
[
],
[
("camp_cheat_find_item",[], "Find an item...",
[
(jump_to_menu, "mnu_cheat_find_item"),
]
),
("camp_cheat_find_item",[], "Change weather..",
[
(jump_to_menu, "mnu_cheat_change_weather"),
]
),
("camp_cheat_1",[],"{!}Increase player renown.",
[
(str_store_string, s1, "@Player renown is increased by 100. "),
(call_script, "script_change_troop_renown", "trp_player", 100),
(jump_to_menu, "mnu_camp_cheat"),
]
),
("camp_cheat_2",[],"{!}Increase player honor.",
[
(assign, reg7, "$player_honor"),
(val_add, reg7, 1),
(display_message, "@Player honor is increased by 1 and it is now {reg7}."),
(val_add, "$player_honor", 1),
(jump_to_menu, "mnu_camp_cheat"),
]
),
("camp_cheat_3",[],"{!}Update political notes.",
[
(try_for_range, ":hero", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":hero", slot_troop_occupation, slto_kingdom_hero),
(call_script, "script_update_troop_political_notes", ":hero"),
(try_end),
(try_for_range, ":kingdom", kingdoms_begin, kingdoms_end),
(call_script, "script_update_faction_political_notes", ":kingdom"),
(try_end),
]
),
("camp_cheat_4",[],"{!}Update troop notes.",
[
(try_for_range, ":hero", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":hero", slot_troop_occupation, slto_kingdom_hero),
(call_script, "script_update_troop_notes", ":hero"),
(try_end),
(try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
(call_script, "script_update_troop_notes", ":lady"),
(call_script, "script_update_troop_political_notes", ":lady"),
(call_script, "script_update_troop_location_notes", ":lady", 0),
(try_end),
]
),
("camp_cheat_5",[],"{!}Scramble minstrels.",
[
(call_script, "script_update_tavern_minstrels"),
]
),
("camp_cheat_6",[],"{!}Infinite camp",
[
(assign,"$g_camp_mode", 1),
(assign, "$g_infinite_camping", 1),
(assign, "$g_player_icon_state", pis_camping),
(rest_for_hours_interactive, 10 * 24 * 365, 20), #10 year rest while not attackable with 20x speed
(change_screen_return),
]
),
("cheat_faction_orders",[(ge,"$cheat_mode",1)],
"{!}Cheat: Set Debug messages to All.",
[(assign,"$cheat_mode",1),
(jump_to_menu, "mnu_camp_cheat"),
]
),
("cheat_faction_orders",[
(ge, "$cheat_mode", 1),
(neq,"$cheat_mode",3)],"{!}Cheat: Set Debug messages to Econ Only.",
[(assign,"$cheat_mode",3),
(jump_to_menu, "mnu_camp_cheat"),
]
),
("cheat_faction_orders",[
(ge, "$cheat_mode", 1),
(neq,"$cheat_mode",4)],"{!}Cheat: Set Debug messages to Political Only.",
[(assign,"$cheat_mode",4),
(jump_to_menu, "mnu_camp_cheat"),
]
),
("back_to_camp_menu",[],"{!}Back to camp menu.",
[
(jump_to_menu, "mnu_camp"),
]
),
]
),
("cheat_find_item",0,
"{!}Current item range: {reg5} to {reg6}",
"none",
[
(assign, reg5, "$cheat_find_item_range_begin"),
(store_add, reg6, "$cheat_find_item_range_begin", max_inventory_items),
(val_min, reg6, "itm_items_end"),
(val_sub, reg6, 1),
],
[
("cheat_find_item_next_range",[], "{!}Move to next item range.",
[
(val_add, "$cheat_find_item_range_begin", max_inventory_items),
(try_begin),
(ge, "$cheat_find_item_range_begin", "itm_items_end"),
(assign, "$cheat_find_item_range_begin", 0),
(try_end),
(jump_to_menu, "mnu_cheat_find_item"),
]
),
("cheat_find_item_choose_this",[], "{!}Choose from this range.",
[
(troop_clear_inventory, "trp_find_item_cheat"),
(store_add, ":max_item", "$cheat_find_item_range_begin", max_inventory_items),
(val_min, ":max_item", "itm_items_end"),
(store_sub, ":num_items_to_add", ":max_item", "$cheat_find_item_range_begin"),
(try_for_range, ":i_slot", 0, ":num_items_to_add"),
(store_add, ":item_id", "$cheat_find_item_range_begin", ":i_slot"),
(troop_add_items, "trp_find_item_cheat", ":item_id", 1),
(try_end),
(change_screen_trade, "trp_find_item_cheat"),
]
),
("camp_action_4",[],"{!}Back to camp menu.",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
("cheat_change_weather",0,
"{!}Current cloud amount: {reg5}^Current Fog Strength: {reg6}",
"none",
[
(get_global_cloud_amount, reg5),
(get_global_haze_amount, reg6),
],
[
("cheat_increase_cloud",[], "{!}Increase Cloud Amount.",
[
(get_global_cloud_amount, ":cur_cloud_amount"),
(val_add, ":cur_cloud_amount", 5),
(val_min, ":cur_cloud_amount", 100),
(set_global_cloud_amount, ":cur_cloud_amount"),
]
),
("cheat_decrease_cloud",[], "{!}Decrease Cloud Amount.",
[
(get_global_cloud_amount, ":cur_cloud_amount"),
(val_sub, ":cur_cloud_amount", 5),
(val_max, ":cur_cloud_amount", 0),
(set_global_cloud_amount, ":cur_cloud_amount"),
]
),
("cheat_increase_fog",[], "{!}Increase Fog Amount.",
[
(get_global_haze_amount, ":cur_fog_amount"),
(val_add, ":cur_fog_amount", 5),
(val_min, ":cur_fog_amount", 100),
(set_global_haze_amount, ":cur_fog_amount"),
]
),
("cheat_decrease_fog",[], "{!}Decrease Fog Amount.",
[
(get_global_haze_amount, ":cur_fog_amount"),
(val_sub, ":cur_fog_amount", 5),
(val_max, ":cur_fog_amount", 0),
(set_global_haze_amount, ":cur_fog_amount"),
]
),
("camp_action_4",[],"{!}Back to camp menu.",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
("camp_action",0,
"Choose an action:",
"none",
[
],
[
("camp_recruit_prisoners",
[(troops_can_join, 1),
(store_current_hours, ":cur_time"),
(val_sub, ":cur_time", 24),
(gt, ":cur_time", "$g_prisoner_recruit_last_time"),
(try_begin),
(gt, "$g_prisoner_recruit_last_time", 0),
(assign, "$g_prisoner_recruit_troop_id", 0),
(assign, "$g_prisoner_recruit_size", 0),
(assign, "$g_prisoner_recruit_last_time", 0),
(try_end),
], "Recruit some of your prisoners to your party.",
[(jump_to_menu, "mnu_camp_recruit_prisoners"),
],
),
("action_read_book",[],"Select a book to read.",
[(jump_to_menu, "mnu_camp_action_read_book"),
]
),
("action_rename_kingdom",
[
(eq, "$players_kingdom_name_set", 1),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
],"Rename your kingdom.",
[(start_presentation, "prsnt_name_kingdom"),
]
),
("action_modify_banner",[(eq, "$cheat_mode", 1)],"{!}Cheat: Modify your banner.",
[
(start_presentation, "prsnt_banner_selection"),
#(start_presentation, "prsnt_custom_banner"),
]
),
("action_retire",[],"Retire from adventuring.",
[(jump_to_menu, "mnu_retirement_verify"),
]
),
("camp_action_4",[],"Back to camp menu.",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
("camp_recruit_prisoners",0,
"You offer your prisoners freedom if they agree to join you as soldiers. {s18}",
"none",
[(assign, ":num_regular_prisoner_slots", 0),
(party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":cur_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
(neg|troop_is_hero, ":cur_troop_id"),
(val_add, ":num_regular_prisoner_slots", 1),
(try_end),
(try_begin),
(eq, ":num_regular_prisoner_slots", 0),
(jump_to_menu, "mnu_camp_no_prisoners"),
(else_try),
(eq, "$g_prisoner_recruit_troop_id", 0),
(store_current_hours, "$g_prisoner_recruit_last_time"),
(store_random_in_range, ":rand", 0, 100),
(store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
(store_sub, ":reject_chance", 15, ":persuasion_level"),
(val_mul, ":reject_chance", 4),
(try_begin),
(lt, ":rand", ":reject_chance"),
(assign, "$g_prisoner_recruit_troop_id", -7),
(else_try),
(assign, ":num_regular_prisoner_slots", 0),
(party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":cur_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
(neg|troop_is_hero, ":cur_troop_id"),
(val_add, ":num_regular_prisoner_slots", 1),
(try_end),
(store_random_in_range, ":random_prisoner_slot", 0, ":num_regular_prisoner_slots"),
(try_for_range, ":cur_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
(neg|troop_is_hero, ":cur_troop_id"),
(val_sub, ":random_prisoner_slot", 1),
(lt, ":random_prisoner_slot", 0),
(assign, ":num_stacks", 0),
(assign, "$g_prisoner_recruit_troop_id", ":cur_troop_id"),
(party_prisoner_stack_get_size, "$g_prisoner_recruit_size", "p_main_party", ":cur_stack"),
(try_end),
(try_end),
(try_begin),
(gt, "$g_prisoner_recruit_troop_id", 0),
(party_get_free_companions_capacity, ":capacity", "p_main_party"),
(val_min, "$g_prisoner_recruit_size", ":capacity"),
(assign, reg1, "$g_prisoner_recruit_size"),
(gt, "$g_prisoner_recruit_size", 0),
(try_begin),
(gt, "$g_prisoner_recruit_size", 1),
(assign, reg2, 1),
(else_try),
(assign, reg2, 0),
(try_end),
(str_store_troop_name_by_count, s1, "$g_prisoner_recruit_troop_id", "$g_prisoner_recruit_size"),
(str_store_string, s18, "@{reg1} {s1} {reg2?accept:accepts} the offer."),
(else_try),
(str_store_string, s18, "@No one accepts the offer."),
(try_end),
(try_end),
],
[
("camp_recruit_prisoners_accept",[(gt, "$g_prisoner_recruit_troop_id", 0)],"Take them.",
[(remove_troops_from_prisoners, "$g_prisoner_recruit_troop_id", "$g_prisoner_recruit_size"),
(party_add_members, "p_main_party", "$g_prisoner_recruit_troop_id", "$g_prisoner_recruit_size"),
(store_mul, ":morale_change", -3, "$g_prisoner_recruit_size"),
(call_script, "script_change_player_party_morale", ":morale_change"),
(jump_to_menu, "mnu_camp"),
]
),
("camp_recruit_prisoners_reject",[(gt, "$g_prisoner_recruit_troop_id", 0)],"Reject them.",
[(jump_to_menu, "mnu_camp"),
(assign, "$g_prisoner_recruit_troop_id", 0),
(assign, "$g_prisoner_recruit_size", 0),
]
),
("continue",[(le, "$g_prisoner_recruit_troop_id", 0)],"Go back.",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
("camp_no_prisoners",0,
"You have no prisoners to recruit from.",
"none",
[],
[
("continue",[],"Continue...",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
("camp_action_read_book",0,
"Choose a book to read:",
"none",
[],
[
("action_read_book_1",[(player_has_item, "itm_book_tactics"),
(item_slot_eq, "itm_book_tactics", slot_item_book_read, 0),
(str_store_item_name, s1, "itm_book_tactics"),
],"{s1}.",
[(assign, "$temp", "itm_book_tactics"),
(jump_to_menu, "mnu_camp_action_read_book_start"),
]
),
("action_read_book_2",[(player_has_item, "itm_book_persuasion"),
(item_slot_eq, "itm_book_persuasion", slot_item_book_read, 0),
(str_store_item_name, s1, "itm_book_persuasion"),
],"{s1}.",
[(assign, "$temp", "itm_book_persuasion"),
(jump_to_menu, "mnu_camp_action_read_book_start"),
]
),
("action_read_book_3",[(player_has_item, "itm_book_leadership"),
(item_slot_eq, "itm_book_leadership", slot_item_book_read, 0),
(str_store_item_name, s1, "itm_book_leadership"),
],"{s1}.",
[(assign, "$temp", "itm_book_leadership"),
(jump_to_menu, "mnu_camp_action_read_book_start"),
]
),
("action_read_book_4",[(player_has_item, "itm_book_intelligence"),
(item_slot_eq, "itm_book_intelligence", slot_item_book_read, 0),
(str_store_item_name, s1, "itm_book_intelligence"),
],"{s1}.",
[(assign, "$temp", "itm_book_intelligence"),
(jump_to_menu, "mnu_camp_action_read_book_start"),
]
),
("action_read_book_5",[(player_has_item, "itm_book_trade"),
(item_slot_eq, "itm_book_trade", slot_item_book_read, 0),
(str_store_item_name, s1, "itm_book_trade"),
],"{s1}.",
[(assign, "$temp", "itm_book_trade"),
(jump_to_menu, "mnu_camp_action_read_book_start"),
]
),
("action_read_book_6",[(player_has_item, "itm_book_weapon_mastery"),
(item_slot_eq, "itm_book_weapon_mastery", slot_item_book_read, 0),
(str_store_item_name, s1, "itm_book_weapon_mastery"),
],"{s1}.",
[(assign, "$temp", "itm_book_weapon_mastery"),
(jump_to_menu, "mnu_camp_action_read_book_start"),
]
),
("action_read_book_7",[(player_has_item, "itm_book_engineering"),
(item_slot_eq, "itm_book_engineering", slot_item_book_read, 0),
(str_store_item_name, s1, "itm_book_engineering"),
],"{s1}.",
[(assign, "$temp", "itm_book_engineering"),
(jump_to_menu, "mnu_camp_action_read_book_start"),
]
),
("camp_action_4",[],"Back to camp menu.",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
("camp_action_read_book_start",0,
"{s1}",
"none",
[(assign, ":new_book", "$temp"),
(str_store_item_name, s2, ":new_book"),
(try_begin),
(store_attribute_level, ":int", "trp_player", ca_intelligence),
(item_get_slot, ":int_req", ":new_book", slot_item_intelligence_requirement),
(le, ":int_req", ":int"),
(str_store_string, s1, "@You start reading {s2}. After a few pages,\
you feel you could learn a lot from this book. You decide to keep it close by and read whenever you have the time."),
(assign, "$g_player_reading_book", ":new_book"),
(else_try),
(str_store_string, s1, "@You flip through the pages of {s2}, but you find the text confusing and difficult to follow.\
Try as you might, it soon gives you a headache, and you're forced to give up the attempt."),
(try_end),],
[
("continue",[],"Continue...",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
("retirement_verify",0,
"You are at day {reg0}. Your current luck is {reg1}. Are you sure you want to retire?",
"none",
[
(store_current_day, reg0),
(assign, reg1, "$g_player_luck"),
],
[
("retire_yes",[],"Yes.",
[
(start_presentation, "prsnt_retirement"),
]
),
("retire_no",[],"No.",
[
(jump_to_menu, "mnu_camp"),
]
),
]
),
("end_game",0,
"The decision is made, and you resolve to give up your adventurer's\
life and settle down. You sell off your weapons and armour, gather up\
all your money, and ride off into the sunset....",
"none",
[],
[
("end_game_bye",[],"Farewell.",
[
(change_screen_quit),
]
),
]
),
("cattle_herd",mnf_scale_picture,
"You encounter a herd of cattle.",
"none",
[(play_sound, "snd_cow_moo"),
(set_background_mesh, "mesh_pic_cattle"),
],
[
("cattle_drive_away",[],"Drive the cattle onward.",
[
(party_set_slot, "$g_encountered_party", slot_cattle_driven_by_player, 1),
(party_set_ai_behavior, "$g_encountered_party", ai_bhvr_driven_by_party),
(party_set_ai_object,"$g_encountered_party", "p_main_party"),
(change_screen_return),
]
),
("cattle_stop",[],"Bring the herd to a stop.",
[
(party_set_slot, "$g_encountered_party", slot_cattle_driven_by_player, 0),
(party_set_ai_behavior, "$g_encountered_party", ai_bhvr_hold),
(change_screen_return),
]
),
("cattle_kill",[(assign, ":continue", 1),
(try_begin),
(check_quest_active, "qst_move_cattle_herd"),
(quest_slot_eq, "qst_move_cattle_herd", slot_quest_target_party, "$g_encountered_party"),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1)],"Slaughter some of the animals.",
[(jump_to_menu, "mnu_cattle_herd_kill"),
]
),
("leave",[],"Leave.",
[(change_screen_return),
]
),
]
),
("cattle_herd_kill",0,
"How many animals do you want to slaughter?",
"none",
[(party_get_num_companions, reg5, "$g_encountered_party")],
[
("cattle_kill_1",[(ge, reg5, 1),],"One.",
[(call_script, "script_kill_cattle_from_herd", "$g_encountered_party", 1),
(jump_to_menu, "mnu_cattle_herd_kill_end"),
(change_screen_loot, "trp_temp_troop"),
(play_sound, "snd_cow_slaughter"),
]
),
("cattle_kill_2",[(ge, reg5, 2),],"Two.",
[(call_script, "script_kill_cattle_from_herd", "$g_encountered_party", 2),
(jump_to_menu, "mnu_cattle_herd_kill_end"),
(change_screen_loot, "trp_temp_troop"),
(play_sound, "snd_cow_slaughter"),
]
),
("cattle_kill_3",[(ge, reg5, 3),],"Three.",
[(call_script, "script_kill_cattle_from_herd", "$g_encountered_party", 3),
(jump_to_menu, "mnu_cattle_herd_kill_end"),
(change_screen_loot, "trp_temp_troop"),
(play_sound, "snd_cow_slaughter"),
]
),
("cattle_kill_4",[(ge, reg5, 4),],"Four.",
[(call_script, "script_kill_cattle_from_herd", "$g_encountered_party", 4),
(jump_to_menu, "mnu_cattle_herd_kill_end"),
(change_screen_loot, "trp_temp_troop"),
(play_sound, "snd_cow_slaughter"),
]
),
("cattle_kill_5",[(ge, reg5, 5),],"Five.",
[(call_script, "script_kill_cattle_from_herd", "$g_encountered_party", 5),
(jump_to_menu, "mnu_cattle_herd_kill_end"),
(change_screen_loot, "trp_temp_troop"),
(play_sound, "snd_cow_slaughter"),
]
),
("go_back_dot",[],"Go back.",
[(jump_to_menu, "mnu_cattle_herd"),
]
),
]
),
("cattle_herd_kill_end",0,
"{!}You shouldn't be reading this.",
"none",
[(change_screen_return)],
[
]
),
("arena_duel_fight",0,
"You and your opponent prepare to duel.",
"none",
[],
[
("continue",[],"Continue...",
[
(assign, "$g_leave_encounter", 0),
(try_begin),
(is_between, "$g_encountered_party", towns_begin, towns_end),
(party_get_slot, ":duel_scene", "$g_encountered_party", slot_town_arena),
(else_try),
(eq, "$g_start_arena_fight_at_nearest_town", 1),
(assign, ":closest_town", -1),
(assign, ":minimum_dist", 10000),
(try_for_range, ":cur_town", towns_begin, towns_end),
(store_distance_to_party_from_party, ":dist", ":cur_town", "$g_encountered_party"),
(lt, ":dist", ":minimum_dist"),
(assign, ":minimum_dist", ":dist"),
(assign, ":closest_town", ":cur_town"),
(try_end),
(try_begin),
(ge, ":closest_town", 0),
(party_get_slot, ":duel_scene", ":closest_town", slot_town_arena),
(try_end),
(assign, "$g_start_arena_fight_at_nearest_town", 0),
(else_try),
(party_get_current_terrain, ":terrain", "p_main_party"),
(eq, ":terrain", 4),
(assign, ":duel_scene", "scn_training_ground_ranged_melee_3"),
(else_try),
(eq, ":terrain", 5),
(assign, ":duel_scene", "scn_training_ground_ranged_melee_4"),
(else_try),
(assign, ":duel_scene", "scn_training_ground_ranged_melee_1"),
(try_end),
(modify_visitors_at_site, ":duel_scene"),
(reset_visitors),
(set_visitor, 0, "trp_player"),
(set_visitor, 1, "$g_duel_troop"),
(set_jump_mission, "mt_duel_with_lord"),
(jump_to_scene, ":duel_scene"),
(jump_to_menu, "mnu_arena_duel_conclusion"),
(change_screen_mission),
]),
]
),
("arena_duel_conclusion",0,
"{!}{s11}",
"none",
[
(try_begin),
(eq, "$g_leave_encounter", 1),
(change_screen_return),
(try_end),
(str_store_troop_name, s10, "$g_duel_troop"),
(try_begin),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_duel_troop"),
(check_quest_failed, "qst_duel_for_lady"),
(str_store_string, s11, "str_you_lie_stunned_for_several_minutes_then_stagger_to_your_feet_to_find_your_s10_standing_over_you_you_have_lost_the_duel"),
(else_try),
(quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_duel_troop"),
(check_quest_succeeded, "qst_duel_for_lady"),
(str_store_string, s11, "str_s10_lies_in_the_arenas_dust_for_several_minutes_then_staggers_to_his_feet_you_have_won_the_duel"),
(else_try),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_duel_troop"),
(check_quest_failed, "qst_duel_courtship_rival"),
(str_store_string, s11, "str_you_lie_stunned_for_several_minutes_then_stagger_to_your_feet_to_find_your_s10_standing_over_you_you_have_lost_the_duel"),
(else_try),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_duel_troop"),
(check_quest_succeeded, "qst_duel_courtship_rival"),
(str_store_string, s11, "str_s10_lies_in_the_arenas_dust_for_several_minutes_then_staggers_to_his_feet_you_have_won_the_duel"),
(else_try),
(quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_duel_troop"),
(check_quest_succeeded, "qst_duel_avenge_insult"),
(str_store_string, s11, "str_s10_lies_in_the_arenas_dust_for_several_minutes_then_staggers_to_his_feet_you_have_won_the_duel"),
(else_try),
(quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_duel_troop"),
(check_quest_failed, "qst_duel_avenge_insult"),
(str_store_string, s11, "str_you_lie_stunned_for_several_minutes_then_stagger_to_your_feet_to_find_your_s10_standing_over_you_you_have_lost_the_duel"),
(else_try),
(quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_duel_troop"),
(check_quest_succeeded, "qst_denounce_lord"),
(str_store_string, s11, "str_s10_lies_in_the_arenas_dust_for_several_minutes_then_staggers_to_his_feet_you_have_won_the_duel"),
(else_try),
(quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_duel_troop"),
(check_quest_failed, "qst_denounce_lord"),
(str_store_string, s11, "str_you_lie_stunned_for_several_minutes_then_stagger_to_your_feet_to_find_your_s10_standing_over_you_you_have_lost_the_duel"),
(else_try),
(str_store_troop_name, s10, "$g_duel_troop"),
(try_end),
],
[
("continue",[],"Continue...",
[
(call_script, "script_get_meeting_scene"), (assign, ":meeting_scene", reg0),
(modify_visitors_at_site,":meeting_scene"),
(reset_visitors),
(set_visitor,0,"trp_player"),
(set_visitor,17,"$g_duel_troop"),
(set_jump_mission,"mt_conversation_encounter"),
(jump_to_scene,":meeting_scene"),
(assign, "$talk_context", tc_after_duel),
(change_screen_map_conversation, "$g_duel_troop"),
]),
]
),
(
"simple_encounter",mnf_enable_hot_keys|mnf_scale_picture,
"{s2} You have {reg10} troops fit for battle against their {reg11}.",
"none",
[
(assign, "$g_enemy_party", "$g_encountered_party"),
(assign, "$g_ally_party", -1),
(call_script, "script_encounter_calculate_fit"),
(try_begin),
(eq, "$new_encounter", 1),
(assign, "$new_encounter", 0),
(assign, "$g_encounter_is_in_village", 0),
(assign, "$g_encounter_type", 0),
(try_begin),
(party_slot_eq, "$g_enemy_party", slot_party_ai_state, spai_raiding_around_center),
(party_get_slot, ":village_no", "$g_enemy_party", slot_party_ai_object),
(store_distance_to_party_from_party, ":dist", ":village_no", "$g_enemy_party"),
(try_begin),
(lt, ":dist", raid_distance),
(assign, "$g_encounter_is_in_village", ":village_no"),
(assign, "$g_encounter_type", enctype_fighting_against_village_raid),
(try_end),
(try_end),
(try_begin),
(gt, "$g_player_raiding_village", 0),
(assign, "$g_encounter_is_in_village", "$g_player_raiding_village"),
(assign, "$g_encounter_type", enctype_catched_during_village_raid),
(party_quick_attach_to_current_battle, "$g_encounter_is_in_village", 1), #attach as enemy
(str_store_string, s1, "@Villagers"),
(display_message, "str_s1_joined_battle_enemy"),
(else_try),
(eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(party_quick_attach_to_current_battle, "$g_encounter_is_in_village", 0), #attach as friend
(str_store_string, s1, "@Villagers"),
(display_message, "str_s1_joined_battle_friend"),
# Let village party join battle at your side
(try_end),
(call_script, "script_let_nearby_parties_join_current_battle", 0, 0),
(call_script, "script_encounter_init_variables"),
(assign, "$encountered_party_hostile", 0),
(assign, "$encountered_party_friendly", 0),
(try_begin),
(gt, "$g_encountered_party_relation", 0),
(assign, "$encountered_party_friendly", 1),
(try_end),
(try_begin),
(lt, "$g_encountered_party_relation", 0),
(assign, "$encountered_party_hostile", 1),
(try_begin),
(encountered_party_is_attacker),
(assign, "$cant_leave_encounter", 1),
(try_end),
(try_end),
(assign, "$talk_context", tc_party_encounter),
(call_script, "script_setup_party_meeting", "$g_encountered_party"),
(else_try), #second or more turn
# (try_begin),
# (call_script, "script_encounter_calculate_morale_change"),
# (try_end),
(try_begin),
# We can leave battle only after some troops have been killed.
(eq, "$cant_leave_encounter", 1),
(call_script, "script_party_count_members_with_full_health", "p_main_party_backup"),
(assign, ":org_total_party_counts", reg0),
(call_script, "script_party_count_members_with_full_health", "p_encountered_party_backup"),
(val_add, ":org_total_party_counts", reg0),
(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(assign, ":cur_total_party_counts", reg0),
(call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
(val_add, ":cur_total_party_counts", reg0),
(store_sub, ":leave_encounter_limit", ":org_total_party_counts", 10),
(lt, ":cur_total_party_counts", ":leave_encounter_limit"),
(assign, "$cant_leave_encounter", 0),
(try_end),
(eq, "$g_leave_encounter",1),
(change_screen_return),
(try_end),
#setup s2
(try_begin),
(party_is_active, "$g_encountered_party"),
(str_store_party_name, s1,"$g_encountered_party"),
(try_begin),
(eq, "$g_encounter_type", 0),
(str_store_string, s2,"@You have encountered {s1}."),
(else_try),
(eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(str_store_party_name, s3, "$g_encounter_is_in_village"),
(str_store_string, s2,"@You have engaged {s1} while they were raiding {s3}."),
(else_try),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(str_store_party_name, s3, "$g_encounter_is_in_village"),
(str_store_string, s2,"@You were caught by {s1} while your forces were raiding {s3}."),
(try_end),
(try_end),
(try_begin),
(call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
(assign, ":num_enemy_regulars_remaining", reg0),
(assign, ":enemy_finished", 0),
(try_begin),
(eq, "$g_battle_result", 1), #battle won
(this_or_next|le, ":num_enemy_regulars_remaining", 0), #battle won
(le, ":num_enemy_regulars_remaining", "$num_routed_enemies"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
(assign, ":enemy_finished",1),
(else_try),
(eq, "$g_engaged_enemy", 1),
(this_or_next|le, ":num_enemy_regulars_remaining", 0),
(le, "$g_enemy_fit_for_battle", "$num_routed_enemies"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
(ge, "$g_friend_fit_for_battle",1),
(assign, ":enemy_finished",1),
(try_end),
(this_or_next|eq, ":enemy_finished",1),
(eq,"$g_enemy_surrenders",1),
(assign, "$g_next_menu", -1),
(jump_to_menu, "mnu_total_victory"),
(else_try),
(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(assign, ":num_our_regulars_remaining", reg0),
(assign, ":friends_finished",0),
(try_begin),
(eq, "$g_battle_result", -1),
#(eq, ":num_our_regulars_remaining", 0), #battle lost
(le, ":num_our_regulars_remaining", "$num_routed_us"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
(assign, ":friends_finished", 1),
(else_try),
(eq, "$g_engaged_enemy", 1),
(ge, "$g_enemy_fit_for_battle",1),
(le, "$g_friend_fit_for_battle",0),
(assign, ":friends_finished",1),
(try_end),
(this_or_next|eq, ":friends_finished",1),
(eq,"$g_player_surrenders",1),
(assign, "$g_next_menu", "mnu_captivity_start_wilderness"),
(jump_to_menu, "mnu_total_defeat"),
(try_end),
(try_begin),
(eq, "$g_encountered_party_template", "pt_looters"),
(set_background_mesh, "mesh_pic_bandits"),
(else_try),
(eq, "$g_encountered_party_template", "pt_mountain_bandits"),
(set_background_mesh, "mesh_pic_mountain_bandits"),
(else_try),
(eq, "$g_encountered_party_template", "pt_steppe_bandits"),
(set_background_mesh, "mesh_pic_steppe_bandits"),
(else_try),
(eq, "$g_encountered_party_template", "pt_taiga_bandits"),
(set_background_mesh, "mesh_pic_steppe_bandits"),
(else_try),
(eq, "$g_encountered_party_template", "pt_sea_raiders"),
(set_background_mesh, "mesh_pic_sea_raiders"),
(else_try),
(eq, "$g_encountered_party_template", "pt_forest_bandits"),
(set_background_mesh, "mesh_pic_forest_bandits"),
(else_try),
(eq, "$g_encountered_party_template", "pt_deserters"),
(set_background_mesh, "mesh_pic_deserters"),
(else_try),
(eq, "$g_encountered_party_template", "pt_kingdom_hero_party"),
(party_stack_get_troop_id, ":leader_troop", "$g_encountered_party", 0),
(ge, ":leader_troop", 1),
(troop_get_slot, ":leader_troop_faction", ":leader_troop", slot_troop_original_faction),
(try_begin),
(eq, ":leader_troop_faction", fac_kingdom_1),
(set_background_mesh, "mesh_pic_swad"),
(else_try),
(eq, ":leader_troop_faction", fac_kingdom_2),
(set_background_mesh, "mesh_pic_vaegir"),
(else_try),
(eq, ":leader_troop_faction", fac_kingdom_3),
(set_background_mesh, "mesh_pic_khergit"),
(else_try),
(eq, ":leader_troop_faction", fac_kingdom_4),
(set_background_mesh, "mesh_pic_nord"),
(else_try),
(eq, ":leader_troop_faction", fac_kingdom_5),
(set_background_mesh, "mesh_pic_rhodock"),
(else_try),
(eq, ":leader_troop_faction", fac_kingdom_6),
(set_background_mesh, "mesh_pic_sarranid_encounter"),
(try_end),
(try_end),
],
[
("encounter_attack",
[
(eq, "$encountered_party_friendly", 0),
(neg|troop_is_wounded, "trp_player"),
],
"Charge the enemy.",
[
(assign, "$g_battle_result", 0),
(assign, "$g_engaged_enemy", 1),
(party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
(try_begin),
(eq, ":encountered_party_template", "pt_village_farmers"),
(unlock_achievement, ACHIEVEMENT_HELP_HELP_IM_BEING_REPRESSED),
(try_end),
(call_script, "script_calculate_renown_value"),
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(assign, "$g_village_raid_evil", 0),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(assign, "$g_village_raid_evil", 0),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(set_jump_mission,"mt_lead_charge"),
(call_script, "script_setup_random_scene"),
(try_end),
(assign, "$g_next_menu", "mnu_simple_encounter"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
("encounter_order_attack",
[
(eq, "$encountered_party_friendly", 0),
(call_script, "script_party_count_members_with_full_health", "p_main_party"),(ge, reg0, 4),
],
"Order your troops to attack without you.",
[
(jump_to_menu, "mnu_order_attack_begin"),
#(simulate_battle,3),
]),
("encounter_leave",[
(eq,"$cant_leave_encounter", 0),
],"Leave.",[
###NPC companion changes begin
(try_begin),
(eq, "$encountered_party_friendly", 0),
(encountered_party_is_attacker),
(call_script, "script_objectionable_action", tmt_aristocratic, "str_flee_battle"),
(try_end),
###NPC companion changes end
#Troop commentary changes begin
(try_begin),
(eq, "$encountered_party_friendly", 0),
# (encountered_party_is_attacker),
(party_get_num_companion_stacks, ":num_stacks", "p_encountered_party_backup"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_encountered_party_backup",":stack_no"),
(is_between, ":stack_troop", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":victorious_faction", ":stack_troop"),
# (store_relation, ":relation_with_stack_troop", ":victorious_faction", "fac_player_faction"),
# (lt, ":relation_with_stack_troop", 0),
(call_script, "script_add_log_entry", logent_player_retreated_from_lord, "trp_player", -1, ":stack_troop", ":victorious_faction"),
(try_end),
(try_end),
#Troop commentary changes end
(leave_encounter),(change_screen_return)]),
("encounter_retreat",[
(eq,"$cant_leave_encounter", 1),
(call_script, "script_get_max_skill_of_player_party", "skl_tactics"),
(assign, ":max_skill", reg0),
(val_add, ":max_skill", 4),
(call_script, "script_party_count_members_with_full_health", "p_collective_enemy", 0),
(assign, ":enemy_party_strength", reg0),
(val_div, ":enemy_party_strength", 2),
(val_div, ":enemy_party_strength", ":max_skill"),
(val_max, ":enemy_party_strength", 1),
(call_script, "script_party_count_fit_regulars", "p_main_party"),
(assign, ":player_count", reg0),
(ge, ":player_count", ":enemy_party_strength"),
],"Pull back, leaving some soldiers behind to cover your retreat.",[(jump_to_menu, "mnu_encounter_retreat_confirm"),]),
("encounter_surrender",[
(eq,"$cant_leave_encounter", 1),
],"Surrender.",[(assign,"$g_player_surrenders",1)]),
]
),
(
"encounter_retreat_confirm",0,
"As the party member with the highest tactics skill,\
({reg2}), {reg3?you devise:{s3} devises} a plan that will allow you and your men to escape with your lives,\
but you'll have to leave {reg4} soldiers behind to stop the enemy from giving chase.",
"none",
[(call_script, "script_get_max_skill_of_player_party", "skl_tactics"),
(assign, ":max_skill", reg0),
(assign, ":max_skill_owner", reg1),
(assign, reg2, ":max_skill"),
(val_add, ":max_skill", 4),
(call_script, "script_party_count_members_with_full_health", "p_collective_enemy", 0),
(assign, ":enemy_party_strength", reg0),
(val_div, ":enemy_party_strength", 2),
(store_div, reg4, ":enemy_party_strength", ":max_skill"),
(val_max, reg4, 1),
(try_begin),
(eq, ":max_skill_owner", "trp_player"),
(assign, reg3, 1),
(else_try),
(assign, reg3, 0),
(str_store_troop_name, s3, ":max_skill_owner"),
(try_end),
],
[
("leave_behind",[],"Go on. The sacrifice of these men will save the rest.",[
(assign, ":num_casualties", reg4),
(try_for_range, ":unused", 0, ":num_casualties"),
(call_script, "script_cf_party_remove_random_regular_troop", "p_main_party"),
(assign, ":lost_troop", reg0),
(store_random_in_range, ":random_no", 0, 100),
(ge, ":random_no", 30),
(party_add_prisoners, "$g_encountered_party", ":lost_troop", 1),
(try_end),
(call_script, "script_change_player_party_morale", -20),
(jump_to_menu, "mnu_encounter_retreat"),
]),
("dont_leave_behind",[],"No. We leave no one behind.",[(jump_to_menu, "mnu_simple_encounter"),]),
]
),
(
"encounter_retreat",0,
"You tell {reg4} of your troops to hold the enemy while you retreat with the rest of your party.",
"none",
[
],
[
("continue",[],"Continue...",[
###Troop commentary changes begin
(call_script, "script_objectionable_action", tmt_aristocratic, "str_flee_battle"),
(party_get_num_companion_stacks, ":num_stacks", "p_encountered_party_backup"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_encountered_party_backup",":stack_no"),
(is_between, ":stack_troop", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":victorious_faction", ":stack_troop"),
(call_script, "script_add_log_entry", logent_player_retreated_from_lord_cowardly, "trp_player", -1, ":stack_troop", ":victorious_faction"),
(try_end),
###Troop commentary changes end
(party_ignore_player, "$g_encountered_party", 1),
(leave_encounter),(change_screen_return)]),
]
),
(
"order_attack_begin",0,
"Your troops prepare to attack the enemy.",
"none",
[],
[
("order_attack_begin",[],"Order the attack to begin.",
[
(party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
(try_begin),
(eq, ":encountered_party_template", "pt_village_farmers"),
(unlock_achievement, ACHIEVEMENT_HELP_HELP_IM_BEING_REPRESSED),
(try_end),
(assign, "$g_engaged_enemy", 1),
(jump_to_menu,"mnu_order_attack_2"),
]),
("call_back",[],"Call them back.",[(jump_to_menu,"mnu_simple_encounter")]),
]
),
(
"order_attack_2",mnf_disable_all_keys,
"{s4}^^Your casualties: {s8}^^Enemy casualties: {s9}",
"none",
[
(set_background_mesh, "mesh_pic_charge"),
(call_script, "script_party_calculate_strength", "p_main_party", 1), #exclude player
(assign, ":player_party_strength", reg0),
(call_script, "script_party_calculate_strength", "p_collective_enemy", 0),
(assign, ":enemy_party_strength", reg0),
(party_collect_attachments_to_party, "p_main_party", "p_collective_ally"),
(call_script, "script_party_calculate_strength", "p_collective_ally", 1), #exclude player
(assign, ":total_player_and_followers_strength", reg0),
(try_begin),
(le, ":total_player_and_followers_strength", ":enemy_party_strength"),
(assign, ":minimum_power", ":total_player_and_followers_strength"),
(else_try),
(assign, ":minimum_power", ":enemy_party_strength"),
(try_end),
(try_begin),
(le, ":minimum_power", 5),
(assign, ":division_constant", 1),
(else_try),
(le, ":minimum_power", 10),
(assign, ":division_constant", 2),
(else_try),
(le, ":minimum_power", 25),
(assign, ":division_constant", 3),
(else_try),
(le, ":minimum_power", 50),
(assign, ":division_constant", 4),
(else_try),
(le, ":minimum_power", 100),
(assign, ":division_constant", 5),
(else_try),
(le, ":minimum_power", 200),
(assign, ":division_constant", 6),
(else_try),
(le, ":minimum_power", 400),
(assign, ":division_constant", 7),
(else_try),
(le, ":minimum_power", 800),
(assign, ":division_constant", 8),
(else_try),
(le, ":minimum_power", 1600),
(assign, ":division_constant", 9),
(else_try),
(le, ":minimum_power", 3200),
(assign, ":division_constant", 10),
(else_try),
(le, ":minimum_power", 6400),
(assign, ":division_constant", 11),
(else_try),
(le, ":minimum_power", 12800),
(assign, ":division_constant", 12),
(else_try),
(le, ":minimum_power", 25600),
(assign, ":division_constant", 13),
(else_try),
(le, ":minimum_power", 51200),
(assign, ":division_constant", 14),
(else_try),
(le, ":minimum_power", 102400),
(assign, ":division_constant", 15),
(else_try),
(assign, ":division_constant", 16),
(try_end),
(val_div, ":player_party_strength", ":division_constant"), #1.126, ":division_constant" was 5 before
(val_max, ":player_party_strength", 1), #1.126
(val_div, ":enemy_party_strength", ":division_constant"), #1.126, ":division_constant" was 5 before
(val_max, ":enemy_party_strength", 1), #1.126
(val_div, ":total_player_and_followers_strength", ":division_constant"), #1.126, ":division_constant" was 5 before
(val_max, ":total_player_and_followers_strength", 1), #1.126
(store_mul, "$g_strength_contribution_of_player", ":player_party_strength", 100),
(val_div, "$g_strength_contribution_of_player", ":total_player_and_followers_strength"),
(inflict_casualties_to_party_group, "p_main_party", ":enemy_party_strength", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s8, s0),
(try_begin),
(ge, "$g_ally_party", 0),
(inflict_casualties_to_party_group, "$g_ally_party", ":enemy_party_strength", "p_temp_casualties"),
(str_store_string_reg, s8, s0),
(try_end),
(inflict_casualties_to_party_group, "$g_encountered_party", ":total_player_and_followers_strength", "p_temp_casualties"),
#ozan begin
(party_get_num_companion_stacks, ":num_stacks", "p_temp_casualties"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "p_temp_casualties", ":stack_no"),
(try_begin),
(party_stack_get_size, ":stack_size", "p_temp_casualties", ":stack_no"),
(gt, ":stack_size", 0),
(party_add_members, "p_total_enemy_casualties", ":stack_troop", ":stack_size"), #addition_to_p_total_enemy_casualties
(party_stack_get_num_wounded, ":stack_wounded_size", "p_temp_casualties", ":stack_no"),
(gt, ":stack_wounded_size", 0),
(party_wound_members, "p_total_enemy_casualties", ":stack_troop", ":stack_wounded_size"),
(try_end),
(try_end),
#ozan end
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s9, s0),
(party_collect_attachments_to_party, "$g_encountered_party", "p_collective_enemy"),
(assign, "$no_soldiers_left", 0),
(try_begin),
(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(assign, ":num_our_regulars_remaining", reg0),
(store_add, ":num_routed_us_plus_one", "$num_routed_us", 1),
(le, ":num_our_regulars_remaining", ":num_routed_us_plus_one"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
(assign, "$no_soldiers_left", 1),
(str_store_string, s4, "str_order_attack_failure"),
(else_try),
(call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
(assign, ":num_enemy_regulars_remaining", reg0),
(this_or_next|le, ":num_enemy_regulars_remaining", 0),
(le, ":num_enemy_regulars_remaining", "$num_routed_enemies"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
(assign, ":continue", 0),
(party_get_num_companion_stacks, ":party_num_stacks", "p_collective_enemy"),
(try_begin),
(eq, ":party_num_stacks", 0),
(assign, ":continue", 1),
(else_try),
(party_stack_get_troop_id, ":party_leader", "p_collective_enemy", 0),
(try_begin),
(neg|troop_is_hero, ":party_leader"),
(assign, ":continue", 1),
(else_try),
(troop_is_wounded, ":party_leader"),
(assign, ":continue", 1),
(try_end),
(try_end),
(eq, ":continue", 1),
(assign, "$g_battle_result", 1),
(assign, "$no_soldiers_left", 1),
(str_store_string, s4, "str_order_attack_success"),
(else_try),
(str_store_string, s4, "str_order_attack_continue"),
(try_end),
],
[
("order_attack_continue",[(eq, "$no_soldiers_left", 0)],"Order your soldiers to continue the attack.",[
(jump_to_menu,"mnu_order_attack_2"),
]),
("order_retreat",[(eq, "$no_soldiers_left", 0)],"Call your soldiers back.",[
(jump_to_menu,"mnu_simple_encounter"),
]),
("continue",[(eq, "$no_soldiers_left", 1)],"Continue...",[
(jump_to_menu,"mnu_simple_encounter"),
]),
]
),
(
"battle_debrief",mnf_scale_picture|mnf_disable_all_keys,
"{s11}^^Your Casualties:{s8}{s10}^^Enemy Casualties:{s9}",
"none",
[
(try_begin),
(eq, "$g_battle_result", 1),
(call_script, "script_change_troop_renown", "trp_player", "$battle_renown_value"),
(try_begin),
(ge, "$g_encountered_party", 0),
(party_is_active, "$g_encountered_party"),
(party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
(eq, ":encountered_party_template", "pt_kingdom_caravan_party"),
(get_achievement_stat, ":number_of_village_raids", ACHIEVEMENT_THE_BANDIT, 0),
(get_achievement_stat, ":number_of_caravan_raids", ACHIEVEMENT_THE_BANDIT, 1),
(val_add, ":number_of_caravan_raids", 1),
(set_achievement_stat, ACHIEVEMENT_THE_BANDIT, 1, ":number_of_caravan_raids"),
(try_begin),
(ge, ":number_of_village_raids", 3),
(ge, ":number_of_caravan_raids", 3),
(unlock_achievement, ACHIEVEMENT_THE_BANDIT),
(try_end),
(try_end),
(try_begin),
(party_get_current_terrain, ":cur_terrain", "p_main_party"),
(eq, ":cur_terrain", rt_snow),
(get_achievement_stat, ":number_of_victories_at_snowy_lands", ACHIEVEMENT_BEST_SERVED_COLD, 0),
(val_add, ":number_of_victories_at_snowy_lands", 1),
(set_achievement_stat, ACHIEVEMENT_BEST_SERVED_COLD, 0, ":number_of_victories_at_snowy_lands"),
(try_begin),
(eq, ":number_of_victories_at_snowy_lands", 10),
(unlock_achievement, ACHIEVEMENT_BEST_SERVED_COLD),
(try_end),
(try_end),
(try_begin),
(ge, "$g_enemy_party", 0),
(party_is_active, "$g_enemy_party"),
(party_stack_get_troop_id, ":stack_troop", "$g_enemy_party", 0),
(eq, ":stack_troop", "trp_mountain_bandit"),
(get_achievement_stat, ":number_of_victories_aganist_mountain_bandits", ACHIEVEMENT_MOUNTAIN_BLADE, 0),
(val_add, ":number_of_victories_aganist_mountain_bandits", 1),
(set_achievement_stat, ACHIEVEMENT_MOUNTAIN_BLADE, 0, ":number_of_victories_aganist_mountain_bandits"),
(try_begin),
(eq, ":number_of_victories_aganist_mountain_bandits", 10),
(unlock_achievement, ACHIEVEMENT_MOUNTAIN_BLADE),
(try_end),
(try_end),
(try_begin),
(is_between, "$g_ally_party", walled_centers_begin, walled_centers_end),
(unlock_achievement, ACHIEVEMENT_NONE_SHALL_PASS),
(try_end),
(try_begin),
(eq, "$g_joined_battle_to_help", 1),
(unlock_achievement, ACHIEVEMENT_GOOD_SAMARITAN),
(try_end),
(try_end),
(assign, "$g_joined_battle_to_help", 0),
(call_script, "script_count_casualties_and_adjust_morale"),#new
(call_script, "script_encounter_calculate_fit"),
(call_script, "script_party_count_fit_regulars", "p_main_party"),
(assign, "$playerparty_postbattle_regulars", reg0),
(try_begin),
(eq, "$g_battle_result", 1),
(eq, "$g_enemy_fit_for_battle", 0),
(str_store_string, s11, "@You were victorious!"),
# (play_track, "track_bogus"), #clear current track.
# (call_script, "script_music_set_situation_with_culture", mtf_sit_victorious),
(try_begin),
(gt, "$g_friend_fit_for_battle", 1),
(set_background_mesh, "mesh_pic_victory"),
(try_end),
(else_try),
(eq, "$g_battle_result", -1),
(ge, "$g_enemy_fit_for_battle",1),
(this_or_next|le, "$g_friend_fit_for_battle",0),
(le, "$playerparty_postbattle_regulars", 0),
(str_store_string, s11, "@Battle was lost. Your forces were utterly crushed."),
(set_background_mesh, "mesh_pic_defeat"),
(else_try),
(eq, "$g_battle_result", -1),
(str_store_string, s11, "@Your companions carry you away from the fighting."),
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 1),
(set_background_mesh, "mesh_pic_wounded_fem"),
(else_try),
(set_background_mesh, "mesh_pic_wounded"),
(try_end),
(else_try),
(eq, "$g_battle_result", 1),
(str_store_string, s11, "@You have defeated the enemy."),
(try_begin),
(gt, "$g_friend_fit_for_battle", 1),
(set_background_mesh, "mesh_pic_victory"),
(try_end),
(else_try),
(eq, "$g_battle_result", 0),
(str_store_string, s11, "@You have retreated from the fight."),
(try_end),
#NPC companion changes begin
##check for excessive casualties, more forgiving if battle result is good
(try_begin),
(gt, "$playerparty_prebattle_regulars", 9),
(store_add, ":divisor", 3, "$g_battle_result"),
(store_div, ":half_of_prebattle_regulars", "$playerparty_prebattle_regulars", ":divisor"),
(lt, "$playerparty_postbattle_regulars", ":half_of_prebattle_regulars"),
(call_script, "script_objectionable_action", tmt_egalitarian, "str_excessive_casualties"),
(try_end),
#NPC companion changes end
(call_script, "script_print_casualties_to_s0", "p_player_casualties", 0),
(str_store_string_reg, s8, s0),
(call_script, "script_print_casualties_to_s0", "p_enemy_casualties", 0),
(str_store_string_reg, s9, s0),
(str_clear, s10),
(try_begin),
(eq, "$any_allies_at_the_last_battle", 1),
(call_script, "script_print_casualties_to_s0", "p_ally_casualties", 0),
(str_store_string, s10, "@^^Ally Casualties:{s0}"),
(try_end),
],
[
("continue",[],"Continue...",[(jump_to_menu, "$g_next_menu"),]),
]
),
(
"total_victory", 0,
"You shouldn't be reading this... {s9}",
"none",
[
# We exploit the menu condition system below.
# The conditions should make sure that always another screen or menu is called.
(assign, ":break", 0),
(try_begin),
(eq, "$routed_party_added", 0), #new
(assign, "$routed_party_added", 1),
#add new party to map (routed_warriors)
(call_script, "script_add_routed_party"),
(end_try),
(try_begin),
(check_quest_active, "qst_track_down_bandits"),
(neg|check_quest_succeeded, "qst_track_down_bandits"),
(neg|check_quest_failed, "qst_track_down_bandits"),
(quest_get_slot, ":quest_party", "qst_track_down_bandits", slot_quest_target_party),
(party_is_active, ":quest_party"),
(party_get_attached_to, ":quest_party_attached"),
(this_or_next|eq, ":quest_party", "$g_enemy_party"),
(eq, ":quest_party_attached", "$g_enemy_party"),
(call_script, "script_succeed_quest", "qst_track_down_bandits"),
(try_end),
(try_begin),
(gt, "$g_private_battle_with_troop", 0),
(troop_slot_eq, "$g_private_battle_with_troop", slot_troop_leaded_party, "$g_encountered_party"),
(assign, "$g_private_battle_with_troop", 0),
(assign, "$g_disable_condescending_comments", 1),
(try_end),
#new - begin
(party_get_num_companion_stacks, ":num_stacks", "p_collective_enemy"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "p_collective_enemy", ":i_stack"),
(is_between, ":stack_troop", lords_begin, lords_end),
(troop_is_wounded, ":stack_troop"),
(party_add_members, "p_total_enemy_casualties", ":stack_troop", 1),
(try_end),
#new - end
(try_begin),
# Talk to ally leader
(eq, "$thanked_by_ally_leader", 0),
(assign, "$thanked_by_ally_leader", 1),
(gt, "$g_ally_party", 0),
#(store_add, ":total_str_without_player", "$g_starting_strength_ally_party", "$g_starting_strength_enemy_party"),
(store_add, ":total_str_without_player", "$g_starting_strength_friends", "$g_starting_strength_enemy_party"),
(val_sub, ":total_str_without_player", "$g_starting_strength_main_party"),
(store_sub, ":ally_strength_without_player", "$g_starting_strength_friends", "$g_starting_strength_main_party"),
(store_mul, ":ally_advantage", ":ally_strength_without_player", 100),
(val_add, ":total_str_without_player", 1),
(val_div, ":ally_advantage", ":total_str_without_player"),
#Ally advantage=50 means battle was evenly matched
(store_sub, ":enemy_advantage", 100, ":ally_advantage"),
(store_mul, ":faction_reln_boost", ":enemy_advantage", "$g_starting_strength_enemy_party"),
(val_div, ":faction_reln_boost", 3000),
(val_min, ":faction_reln_boost", 4),
(store_mul, "$g_relation_boost", ":enemy_advantage", ":enemy_advantage"),
(val_div, "$g_relation_boost", 700),
(val_clamp, "$g_relation_boost", 0, 20),
(party_get_num_companion_stacks, ":num_ally_stacks", "$g_ally_party"),
(gt, ":num_ally_stacks", 0),
(store_faction_of_party, ":ally_faction","$g_ally_party"),
(call_script, "script_change_player_relation_with_faction", ":ally_faction", ":faction_reln_boost"),
(party_stack_get_troop_id, ":ally_leader", "$g_ally_party"),
(party_stack_get_troop_dna, ":ally_leader_dna", "$g_ally_party", 0),
(try_begin),
(troop_is_hero, ":ally_leader"),
(troop_get_slot, ":hero_relation", ":ally_leader", slot_troop_player_relation),
(assign, ":rel_boost", "$g_relation_boost"),
(try_begin),
(lt, ":hero_relation", -5),
(val_div, ":rel_boost", 3),
(try_end),
(call_script,"script_change_player_relation_with_troop", ":ally_leader", ":rel_boost"),
(try_end),
(assign, "$talk_context", tc_ally_thanks),
(call_script, "script_setup_troop_meeting", ":ally_leader", ":ally_leader_dna"),
(else_try),
# Talk to enemy leaders
(assign, ":break", 0),
(party_get_num_companion_stacks, ":num_stacks", "p_total_enemy_casualties"), #p_encountered changed to total_enemy_casualties
(try_for_range, ":stack_no", "$last_defeated_hero", ":num_stacks"), #May 31 bug note -- this now returns some heroes in victorious party as well as in the other party
(eq, ":break", 0),
(party_stack_get_troop_id, ":stack_troop", "p_total_enemy_casualties", ":stack_no"),
(party_stack_get_troop_dna, ":stack_troop_dna", "p_total_enemy_casualties", ":stack_no"),
(troop_is_hero, ":stack_troop"),
(store_troop_faction, ":defeated_faction", ":stack_troop"),
#steve post 0912 changes begin - removed, this is duplicated elsewhere in game menus
#(call_script, "script_add_log_entry", logent_lord_defeated_by_player, "trp_player", -1, ":stack_troop", ":defeated_faction"),
(try_begin),
(store_relation, ":relation", ":defeated_faction", "fac_player_faction"),
(ge, ":relation", 0),
(str_store_troop_name, s4, ":stack_troop"),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "@{!}{s4} skipped in p_total_enemy_casualties capture queue because is friendly"),
(try_end),
(else_try),
(try_begin),
(party_stack_get_troop_id, ":party_leader", "$g_encountered_party", 0),
(is_between, ":party_leader", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":party_leader", slot_troop_occupation, slto_kingdom_hero),
(store_sub, ":kingdom_hero_id", ":party_leader", active_npcs_begin),
(get_achievement_stat, ":was_he_defeated_player_before", ACHIEVEMENT_BARON_GOT_BACK, ":kingdom_hero_id"),
(eq, ":was_he_defeated_player_before", 1),
(unlock_achievement, ACHIEVEMENT_BARON_GOT_BACK),
(try_end),
(store_add, "$last_defeated_hero", ":stack_no", 1),
(call_script, "script_remove_troop_from_prison", ":stack_troop"),
(troop_set_slot, ":stack_troop", slot_troop_leaded_party, -1),
(call_script, "script_cf_check_hero_can_escape_from_player", ":stack_troop"),
(str_store_troop_name, s1, ":stack_troop"),
(str_store_faction_name, s3, ":defeated_faction"),
(str_store_string, s17, "@{s1} of {s3} managed to escape."),
(display_log_message, "@{!}{s17}"),
(jump_to_menu, "mnu_enemy_slipped_away"),
(assign, ":break", 1),
(else_try),
(store_add, "$last_defeated_hero", ":stack_no", 1),
(call_script, "script_remove_troop_from_prison", ":stack_troop"),
(troop_set_slot, ":stack_troop", slot_troop_leaded_party, -1),
(assign, "$talk_context", tc_hero_defeated),
(call_script, "script_setup_troop_meeting", ":stack_troop", ":stack_troop_dna"),
(assign, ":break", 1),
(try_end),
(try_end),
(eq, ":break", 1),
(else_try),
# Talk to freed heroes
(assign, ":break", 0),
(party_get_num_prisoner_stacks, ":num_prisoner_stacks", "p_collective_enemy"),
(try_for_range, ":stack_no", "$last_freed_hero", ":num_prisoner_stacks"),
(eq, ":break", 0),
(party_prisoner_stack_get_troop_id, ":stack_troop", "p_collective_enemy", ":stack_no"),
(troop_is_hero, ":stack_troop"),
(party_prisoner_stack_get_troop_dna, ":stack_troop_dna", "p_collective_enemy", ":stack_no"),
(store_add, "$last_freed_hero", ":stack_no", 1),
(assign, "$talk_context", tc_hero_freed),
(call_script, "script_setup_troop_meeting", ":stack_troop", ":stack_troop_dna"),
(assign, ":break", 1),
(try_end),
(eq, ":break", 1),
(else_try),
(eq, "$capture_screen_shown", 0),
(assign, "$capture_screen_shown", 1),
(party_clear, "p_temp_party"),
(assign, "$g_move_heroes", 0),
#(call_script, "script_party_prisoners_add_party_companions", "p_temp_party", "p_collective_enemy"),
#p_total_enemy_casualties deki yarali askerler p_temp_party'e prisoner olarak eklenecek.
(call_script, "script_party_add_wounded_members_as_prisoners", "p_temp_party", "p_total_enemy_casualties"),
(call_script, "script_party_add_party_prisoners", "p_temp_party", "p_collective_enemy"),
(try_begin),
(call_script, "script_party_calculate_strength", "p_collective_friends_backup",0),
(assign,":total_initial_strength", reg(0)),
(gt, ":total_initial_strength", 0),
#(gt, "$g_ally_party", 0),
(call_script, "script_party_calculate_strength", "p_main_party_backup",0),
(assign,":player_party_initial_strength", reg(0)),
# move ally_party_initial_strength/(player_party_initial_strength + ally_party_initial_strength) prisoners to ally party.
# First we collect the share of prisoners of the ally party and distribute those among the allies.
(store_sub, ":ally_party_initial_strength", ":total_initial_strength", ":player_party_initial_strength"),
#(call_script, "script_party_calculate_strength", "p_ally_party_backup"),
#(assign,":ally_party_initial_strength", reg(0)),
#(store_add, ":total_initial_strength", ":player_party_initial_strength", ":ally_party_initial_strength"),
(store_mul, ":ally_share", ":ally_party_initial_strength", 1000),
(val_div, ":ally_share", ":total_initial_strength"),
(assign, "$pin_number", ":ally_share"), #we send this as a parameter to the script.
(party_clear, "p_temp_party_2"),
(call_script, "script_move_members_with_ratio", "p_temp_party", "p_temp_party_2"),
#TODO: This doesn't handle prisoners if our allies joined battle after us.
(try_begin),
(gt, "$g_ally_party", 0),
(distribute_party_among_party_group, "p_temp_party_2", "$g_ally_party"),
(try_end),
#next if there's anything left, we'll open up the party exchange screen and offer them to the player.
(try_end),
(party_get_num_companions, ":num_rescued_prisoners", "p_temp_party"),
(party_get_num_prisoners, ":num_captured_enemies", "p_temp_party"),
(store_add, ":total_capture_size", ":num_rescued_prisoners", ":num_captured_enemies"),
(gt, ":total_capture_size", 0),
(change_screen_exchange_with_party, "p_temp_party"),
(else_try),
(eq, "$loot_screen_shown", 0),
(assign, "$loot_screen_shown", 1),
(try_begin),
(gt, "$g_ally_party", 0),
(call_script, "script_party_add_party", "$g_ally_party", "p_temp_party"), #Add remaining prisoners to ally TODO: FIX it.
(else_try),
(party_get_num_attached_parties, ":num_quick_attachments", "p_main_party"),
(gt, ":num_quick_attachments", 0),
(party_get_attached_party_with_rank, ":helper_party", "p_main_party", 0),
(call_script, "script_party_add_party", ":helper_party", "p_temp_party"), #Add remaining prisoners to our reinforcements
(try_end),
(troop_clear_inventory, "trp_temp_troop"),
(call_script, "script_party_calculate_loot", "p_total_enemy_casualties"), #p_encountered_party_backup changed to total_enemy_casualties
(gt, reg0, 0),
(troop_sort_inventory, "trp_temp_troop"),
(change_screen_loot, "trp_temp_troop"),
(else_try),
#finished all
(try_begin),
(le, "$g_ally_party", 0),
(end_current_battle),
(try_end),
(call_script, "script_party_give_xp_and_gold", "p_total_enemy_casualties"), #p_encountered_party_backup changed to total_enemy_casualties
(try_begin),
(eq, "$g_enemy_party", 0),
(display_message,"str_error_string"),
(try_end),
(try_begin),
(party_is_active, "$g_ally_party"),
(call_script, "script_battle_political_consequences", "$g_enemy_party", "$g_ally_party"),
(else_try),
(call_script, "script_battle_political_consequences", "$g_enemy_party", "p_main_party"),
(try_end),
(call_script, "script_event_player_defeated_enemy_party", "$g_enemy_party"),
(call_script, "script_clear_party_group", "$g_enemy_party"),
(try_begin),
(eq, "$g_next_menu", -1),
#NPC companion changes begin
(call_script, "script_post_battle_personality_clash_check"),
#NPC companion changes end
#Post 0907 changes begin
(party_stack_get_troop_id, ":enemy_leader", "p_encountered_party_backup",0),
(try_begin),
(is_between, ":enemy_leader", active_npcs_begin, active_npcs_end),
(neg|is_between, "$g_encountered_party", centers_begin, centers_end),
(store_troop_faction, ":enemy_leader_faction", ":enemy_leader"),
(try_begin),
(eq, "$g_ally_party", 0),
(call_script, "script_add_log_entry", logent_lord_defeated_by_player, "trp_player", -1, ":enemy_leader", ":enemy_leader_faction"),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "@{!}Victory comment. Player was alone"),
(try_end),
(else_try),
(ge, "$g_strength_contribution_of_player", 40),
(call_script, "script_add_log_entry", logent_lord_defeated_by_player, "trp_player", -1, ":enemy_leader", ":enemy_leader_faction"),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "@{!}Ordinary victory comment. The player provided at least 40 percent forces."),
(try_end),
(else_try),
(gt, "$g_starting_strength_enemy_party", 1000),
(call_script, "script_get_closest_center", "p_main_party"),
(assign, ":battle_of_where", reg0),
(call_script, "script_add_log_entry", logent_player_participated_in_major_battle, "trp_player", ":battle_of_where", -1, ":enemy_leader_faction"),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "@{!}Player participation comment. The enemy had at least 1k starting strength."),
(try_end),
(else_try),
(eq, "$cheat_mode", 1),
(display_message, "@{!}No victory comment. The battle was small, and the player provided less than 40 percent of allied strength"),
(try_end),
(try_end),
#Post 0907 changes end
(val_add, "$g_total_victories", 1),
(leave_encounter),
(change_screen_return),
(else_try),
(try_begin), #my kingdom
#(change_screen_return),
(eq, "$g_next_menu", "mnu_castle_taken"),
(call_script, "script_add_log_entry", logent_castle_captured_by_player, "trp_player", "$g_encountered_party", -1, "$g_encountered_party_faction"),
(store_current_hours, ":hours"),
(faction_set_slot, "$players_kingdom", slot_faction_ai_last_decisive_event, ":hours"),
(try_begin), #player took a walled center while he is a vassal of npc kingdom.
(is_between, "$players_kingdom", npc_kingdoms_begin, npc_kingdoms_end),
(jump_to_menu, "$g_next_menu"),
(else_try), #player took a walled center while he is a vassal of rebels.
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(assign, "$g_center_taken_by_player_faction", "$g_encountered_party"),
(neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(faction_get_slot, ":faction_leader", "fac_player_supporters_faction", slot_faction_leader),
(change_screen_return),
(start_map_conversation, ":faction_leader", -1),
(else_try), #player took a walled center for player's kingdom
(neg|is_between, "$players_kingdom", npc_kingdoms_begin, npc_kingdoms_end),
(assign, "$g_center_taken_by_player_faction", "$g_encountered_party"),
(assign, "$talk_context", tc_give_center_to_fief),
(change_screen_return),
(assign, ":best_troop", "trp_swadian_sharpshooter"),
(assign, ":maximum_troop_score", 0),
(party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "p_main_party", ":stack_no"),
(neq, ":stack_troop", "trp_player"),
(party_stack_get_size, ":stack_size", "p_main_party", ":stack_no"),
(party_stack_get_num_wounded, ":num_wounded", "p_main_party", ":stack_no"),
(troop_get_slot, ":num_routed", "p_main_party", slot_troop_player_routed_agents),
(assign, ":continue", 0),
(try_begin),
(neg|troop_is_hero, ":stack_troop"),
(store_add, ":agents_which_cannot_speak", ":num_wounded", ":num_routed"),
(gt, ":stack_size", ":agents_which_cannot_speak"),
(assign, ":continue", 1),
(else_try),
(troop_is_hero, ":stack_troop"),
(neg|troop_is_wounded, ":stack_troop"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(try_begin),
(troop_is_hero, ":stack_troop"),
(troop_get_slot, ":troop_renown", ":stack_troop", slot_troop_renown),
(store_mul, ":troop_score", ":troop_renown", 100),
(val_add, ":troop_score", 1000),
(else_try),
(store_character_level, ":troop_level", ":stack_troop"),
(assign, ":troop_score", ":troop_level"),
(try_end),
(try_begin),
(gt, ":troop_score", ":maximum_troop_score"),
(assign, ":maximum_troop_score", ":troop_score"),
(assign, ":best_troop", ":stack_troop"),
(party_stack_get_troop_dna, ":best_troop_dna", "p_main_party", ":stack_no"),
(try_end),
(try_end),
(start_map_conversation, ":best_troop", ":best_troop_dna"),
(try_end),
(try_end),
(try_end),
(try_end),
],
[
("continue",[],"Continue...",[]),
]
),
(
"enemy_slipped_away",0,
"{s17}",
"none",
[],
[
("continue",[],"Continue...",[(jump_to_menu,"mnu_total_victory")]),
]
),
(
"total_defeat",0,
"{!}You shouldn't be reading this...",
"none",
[
(play_track, "track_captured", 1),
# Free prisoners
(party_get_num_prisoner_stacks, ":num_prisoner_stacks","p_main_party"),
(try_for_range, ":stack_no", 0, ":num_prisoner_stacks"),
(party_prisoner_stack_get_troop_id, ":stack_troop","p_main_party",":stack_no"),
(troop_is_hero, ":stack_troop"),
(call_script, "script_remove_troop_from_prison", ":stack_troop"),
(try_end),
(try_begin),
(party_is_active, "$g_ally_party"),
(call_script, "script_battle_political_consequences", "$g_ally_party", "$g_enemy_party"),
(else_try),
(call_script, "script_battle_political_consequences", "p_main_party", "$g_enemy_party"),
(try_end),
(call_script, "script_loot_player_items", "$g_enemy_party"),
(assign, "$g_move_heroes", 0),
(party_clear, "p_temp_party"),
(call_script, "script_party_add_party_prisoners", "p_temp_party", "p_main_party"),
(call_script, "script_party_prisoners_add_party_companions", "p_temp_party", "p_main_party"),
(distribute_party_among_party_group, "p_temp_party", "$g_enemy_party"),
(assign, "$g_prison_heroes", 1),
(call_script, "script_party_remove_all_companions", "p_main_party"),
(assign, "$g_prison_heroes", 0),
(assign, "$g_move_heroes", 1),
(call_script, "script_party_remove_all_prisoners", "p_main_party"),
(val_add, "$g_total_defeats", 1),
(try_begin),
(neq, "$g_player_surrenders", 1),
(store_random_in_range, ":random_no", 0, 100),
(ge, ":random_no", "$g_player_luck"),
(jump_to_menu, "mnu_permanent_damage"),
(else_try),
(try_begin),
(eq, "$g_next_menu", -1),
(leave_encounter),
(change_screen_return),
(else_try),
(jump_to_menu, "$g_next_menu"),
(try_end),
(try_end),
(try_begin),
(gt, "$g_ally_party", 0),
(call_script, "script_party_wound_all_members", "$g_ally_party"),
(try_end),
#Troop commentary changes begin
(party_get_num_companion_stacks, ":num_stacks", "p_encountered_party_backup"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_encountered_party_backup",":stack_no"),
(is_between, ":stack_troop", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":victorious_faction", ":stack_troop"),
(call_script, "script_add_log_entry", logent_player_defeated_by_lord, "trp_player", -1, ":stack_troop", ":victorious_faction"),
(try_end),
#Troop commentary changes end
],
[]
),
(
"permanent_damage",mnf_disable_all_keys,
"{s0}",
"none",
[
(assign, ":end_cond", 1),
(try_for_range, ":unused", 0, ":end_cond"),
(store_random_in_range, ":random_attribute", 0, 4),
(store_attribute_level, ":attr_level", "trp_player", ":random_attribute"),
(try_begin),
(gt, ":attr_level", 3),
(neq, ":random_attribute", ca_charisma),
(try_begin),
(eq, ":random_attribute", ca_strength),
(str_store_string, s0, "@Some of your tendons have been damaged in the battle. You lose 1 strength."),
(else_try),
(eq, ":random_attribute", ca_agility),
(str_store_string, s0, "@You took a nasty wound which will cause you to limp slightly even after it heals. You lose 1 agility."),
## (else_try),
## (eq, ":random_attribute", ca_charisma),
## (str_store_string, s0, "@After the battle you are aghast to find that one of the terrible blows you suffered has left a deep, disfiguring scar on your face, horrifying those around you. Your charisma is reduced by 1."),
(else_try),
## (eq, ":random_attribute", ca_intelligence),
(str_store_string, s0, "@You have trouble thinking straight after the battle, perhaps from a particularly hard hit to your head, and frequent headaches now plague your existence. Your intelligence is reduced by 1."),
(try_end),
(else_try),
(lt, ":end_cond", 200),
(val_add, ":end_cond", 1),
(try_end),
(try_end),
(try_begin),
(eq, ":end_cond", 200),
(try_begin),
(eq, "$g_next_menu", -1),
(leave_encounter),
(change_screen_return),
(else_try),
(jump_to_menu, "$g_next_menu"),
(try_end),
(else_try),
(troop_raise_attribute, "trp_player", ":random_attribute", -1),
(try_end),
],
[
("s0",
[
(store_random_in_range, ":random_no", 0, 4),
(try_begin),
(eq, ":random_no", 0),
(str_store_string, s0, "@Perhaps I'm getting unlucky..."),
(else_try),
(eq, ":random_no", 1),
(str_store_string, s0, "@Retirement is starting to sound better and better."),
(else_try),
(eq, ":random_no", 2),
(str_store_string, s0, "@No matter! I will persevere!"),
(else_try),
(eq, ":random_no", 3),
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 1),
(str_store_string, s0, "@What did I do to deserve this?"),
(else_try),
(str_store_string, s0, "@I suppose it'll make for a good story, at least..."),
(try_end),
(try_end),
],
"{s0}",
[
(try_begin),
(eq, "$g_next_menu", -1),
(leave_encounter),
(change_screen_return),
(else_try),
(jump_to_menu, "$g_next_menu"),
(try_end),
]),
]
),
(
"pre_join",0,
"You come across a battle between {s2} and {s1}. You decide to...",
"none",
[
(str_store_party_name, 1,"$g_encountered_party"),
(str_store_party_name, 2,"$g_encountered_party_2"),
],
[
("pre_join_help_attackers",[
(store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
(store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
(store_faction_of_party, ":defender_faction", "$g_encountered_party"),
(store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),
(ge, ":attacker_relation", 0),
(lt, ":defender_relation", 0),
],
"Move in to help the {s2}.",[
(select_enemy,0),
(assign,"$g_enemy_party","$g_encountered_party"),
(assign,"$g_ally_party","$g_encountered_party_2"),
(jump_to_menu,"mnu_join_battle")]),
("pre_join_help_defenders",[
(store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
(store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
(store_faction_of_party, ":defender_faction", "$g_encountered_party"),
(store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),
(ge, ":defender_relation", 0),
(lt, ":attacker_relation", 0),
],
"Rush to the aid of the {s1}.",[
(select_enemy,1),
(assign,"$g_enemy_party","$g_encountered_party_2"),
(assign,"$g_ally_party","$g_encountered_party"),
(jump_to_menu,"mnu_join_battle")]),
("pre_join_leave",[],"Don't get involved.",[(leave_encounter),(change_screen_return)]),
]
),
(
"join_battle",0,
"You are helping the {s2} against the {s1}. You have {reg10} troops fit for battle against the enemy's {reg11}.",
"none",
[
(str_store_party_name, 1,"$g_enemy_party"),
(str_store_party_name, 2,"$g_ally_party"),
(call_script, "script_encounter_calculate_fit"),
(try_begin),
(eq, "$new_encounter", 1),
(assign, "$new_encounter", 0),
(call_script, "script_encounter_init_variables"),
(else_try), #second or more turn
(eq, "$g_leave_encounter",1),
(change_screen_return),
(try_end),
(try_begin),
(call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
(assign, ":num_enemy_regulars_remaining", reg0),
(assign, ":enemy_finished",0),
(try_begin),
(eq, "$g_battle_result", 1),
(this_or_next|le, ":num_enemy_regulars_remaining", 0), #battle won
(le, ":num_enemy_regulars_remaining", "$num_routed_enemies"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
(assign, ":enemy_finished",1),
(else_try),
(eq, "$g_engaged_enemy", 1),
(le, "$g_enemy_fit_for_battle",0),
(ge, "$g_friend_fit_for_battle",1),
(assign, ":enemy_finished",1),
(try_end),
(this_or_next|eq, ":enemy_finished",1),
(eq,"$g_enemy_surrenders",1),
(assign, "$g_next_menu", -1),
(jump_to_menu, "mnu_total_victory"),
(else_try),
(call_script, "script_party_count_members_with_full_health", "p_collective_friends"),
(assign, ":num_ally_regulars_remaining", reg0),
(assign, ":battle_lost", 0),
(try_begin),
(eq, "$g_battle_result", -1),
#(eq, ":num_ally_regulars_remaining", 0), #battle lost
(le, ":num_ally_regulars_remaining", "$num_routed_allies"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
(assign, ":battle_lost",1),
(try_end),
(this_or_next|eq, ":battle_lost",1),
(eq,"$g_player_surrenders",1),
(leave_encounter),
(change_screen_return),
(try_end),
],
[
("join_attack",
[
(neg|troop_is_wounded, "trp_player"),
],
"Charge the enemy.",
[
(assign, "$g_joined_battle_to_help", 1),
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(assign, "$g_battle_result", 0),
(call_script, "script_calculate_renown_value"),
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(set_jump_mission,"mt_lead_charge"),
(call_script, "script_setup_random_scene"),
(assign, "$g_next_menu", "mnu_join_battle"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
("join_order_attack",
[
(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(ge, reg0, 3),
],
"Order your troops to attack with your allies while you stay back.",
[
(assign, "$g_joined_battle_to_help", 1),
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(jump_to_menu,"mnu_join_order_attack"),
]),
("join_leave",[],"Leave.",
[
(try_begin),
(neg|troop_is_wounded, "trp_player"),
(call_script, "script_objectionable_action", tmt_aristocratic, "str_flee_battle"),
(party_stack_get_troop_id, ":enemy_leader","$g_enemy_party",0),
(is_between, ":enemy_leader", active_npcs_begin, active_npcs_end),
(call_script, "script_add_log_entry", logent_player_retreated_from_lord, "trp_player", -1, ":enemy_leader", -1),
(try_end),
(leave_encounter),(change_screen_return)]),
]),
(
"join_order_attack",mnf_disable_all_keys,
"{s4}^^Your casualties: {s8}^^Allies' casualties: {s9}^^Enemy casualties: {s10}",
"none",
[
(call_script, "script_party_calculate_strength", "p_main_party", 1), #skip player
(assign, ":player_party_strength", reg0),
(val_div, ":player_party_strength", 5),
(call_script, "script_party_calculate_strength", "p_collective_friends", 0),
(assign, ":friend_party_strength", reg0),
(val_div, ":friend_party_strength", 5),
(call_script, "script_party_calculate_strength", "p_collective_enemy", 0),
(assign, ":enemy_party_strength", reg0),
(val_div, ":enemy_party_strength", 5),
(try_begin),
(eq, ":friend_party_strength", 0),
(store_div, ":enemy_party_strength_for_p", ":enemy_party_strength", 2),
(else_try),
(assign, ":enemy_party_strength_for_p", ":enemy_party_strength"),
(val_mul, ":enemy_party_strength_for_p", ":player_party_strength"),
(val_div, ":enemy_party_strength_for_p", ":friend_party_strength"),
(try_end),
(val_sub, ":enemy_party_strength", ":enemy_party_strength_for_p"),
(inflict_casualties_to_party_group, "p_main_party", ":enemy_party_strength_for_p", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s8, s0),
(inflict_casualties_to_party_group, "$g_enemy_party", ":friend_party_strength", "p_temp_casualties"),
#ozan begin
(party_get_num_companion_stacks, ":num_stacks", "p_temp_casualties"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "p_temp_casualties", ":stack_no"),
(try_begin),
(party_stack_get_size, ":stack_size", "p_temp_casualties", ":stack_no"),
(gt, ":stack_size", 0),
(party_add_members, "p_total_enemy_casualties", ":stack_troop", ":stack_size"), #addition_to_p_total_enemy_casualties
(party_stack_get_num_wounded, ":stack_wounded_size", "p_temp_casualties", ":stack_no"),
(gt, ":stack_wounded_size", 0),
(party_wound_members, "p_total_enemy_casualties", ":stack_troop", ":stack_wounded_size"),
(try_end),
(try_end),
#ozan end
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s10, s0),
(call_script, "script_collect_friendly_parties"),
#(party_collect_attachments_to_party, "$g_ally_party", "p_collective_ally"),
(inflict_casualties_to_party_group, "$g_ally_party", ":enemy_party_strength", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s9, s0),
(party_collect_attachments_to_party, "$g_enemy_party", "p_collective_enemy"),
#(assign, "$cant_leave_encounter", 0),
(assign, "$no_soldiers_left", 0),
(try_begin),
(call_script, "script_party_count_members_with_full_health","p_main_party"),
(assign, ":num_our_regulars_remaining", reg0),
#(le, ":num_our_regulars_remaining", 0),
(le, ":num_our_regulars_remaining", "$num_routed_us"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
(assign, "$no_soldiers_left", 1),
(str_store_string, s4, "str_join_order_attack_failure"),
(else_try),
(call_script, "script_party_count_members_with_full_health","p_collective_enemy"),
(assign, ":num_enemy_regulars_remaining", reg0),
(this_or_next|le, ":num_enemy_regulars_remaining", 0),
(le, ":num_enemy_regulars_remaining", "$num_routed_enemies"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
(assign, "$g_battle_result", 1),
(assign, "$no_soldiers_left", 1),
(str_store_string, s4, "str_join_order_attack_success"),
(else_try),
(str_store_string, s4, "str_join_order_attack_continue"),
(try_end),
],
[
("continue",[],"Continue...",
[
(jump_to_menu,"mnu_join_battle"),
]),
]
),
# Towns
(
"zendar",mnf_auto_enter,
"You enter the town of Zendar.",
"none",
[(reset_price_rates,0),(set_price_rate_for_item,"itm_tools",70),(set_price_rate_for_item,"itm_salt",140)],
[
("zendar_enter",[],"_",[(set_jump_mission,"mt_town_default"),(jump_to_scene,"scn_zendar_center"),(change_screen_mission)],"Door to the town center."),
("zendar_tavern",[],"_",[(set_jump_mission,"mt_town_default"),
(jump_to_scene,"scn_the_happy_boar"),
(change_screen_mission)],"Door to the tavern."),
("zendar_merchant",[],"_",[(set_jump_mission,"mt_town_default"),
(jump_to_scene,"scn_zendar_merchant"),
(change_screen_mission)],"Door to the merchant."),
("zendar_arena",[],"_",[(set_jump_mission,"mt_town_default"),
(jump_to_scene,"scn_zendar_arena"),
(change_screen_mission)],"Door to the arena."),
# ("zendar_leave",[],"Leave town.",[[leave_encounter],[change_screen_return]]),
("town_1_leave",[],"_",[(leave_encounter),(change_screen_return)]),
]
),
(
"salt_mine",mnf_auto_enter,
"You enter the salt mine.",
"none",
[(reset_price_rates,0),(set_price_rate_for_item,"itm_salt",55)],
[
("enter",[],"Enter.",[(set_jump_mission,"mt_town_center"),(jump_to_scene,"scn_salt_mine"),(change_screen_mission)]),
("leave",[],"Leave.",[(leave_encounter),(change_screen_return)]),
]
),
(
"four_ways_inn",mnf_auto_enter,
"You arrive at the Four Ways Inn.",
"none",
[],
[
# ("enter",[],"Enter.",[[set_jump_mission,"mt_town_default"],[jump_to_scene,"scn_conversation_scene"],[change_screen_mission]]),
("enter",[],"Enter.",[(set_jump_mission,"mt_ai_training"),(jump_to_scene,"scn_four_ways_inn"),(change_screen_mission)]),
("leave",[],"Leave.",[(leave_encounter),(change_screen_return)]),
]
),
(
"test_scene",0,
"You enter the test scene.",
"none",
[],
[
("enter",[],"Enter 1.",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_multi_scene_1"],[change_screen_mission]]),
("enter",[],"Enter 2.",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_multi_scene_2"],[change_screen_mission]]),
("enter",[],"Enter 3.",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_multi_scene_3"],[change_screen_mission]]),
("enter",[],"Enter 4.",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_multi_scene_4"],[change_screen_mission]]),
("enter",[],"Enter 5.",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_multi_scene_5"],[change_screen_mission]]),
("enter",[],"Enter 6.",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_multi_scene_6"],[change_screen_mission]]),
("enter",[],"Enter 7.",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_test2"],[change_screen_mission]]),
("enter",[],"Enter 8.",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_test3"],[change_screen_mission]]),
("enter",[],"Enter 9.",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_multi_scene_13"],[change_screen_mission]]),
("leave",[],"Leave.",[(leave_encounter),(change_screen_return)]),
]
),
(
"battlefields",0,
"{!}Select a field...",
"none",
[],
[
("enter_f1",[],"{!}Field 1",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_field_1"],[change_screen_mission]]),
("enter_f2",[],"{!}Field 2",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_field_2"],[change_screen_mission]]),
("enter_f3",[],"{!}Field 3",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_field_3"],[change_screen_mission]]),
("enter_f4",[],"{!}Field 4",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_field_4"],[change_screen_mission]]),
("enter_f5",[],"{!}Field 5",[[set_jump_mission,"mt_ai_training"],[jump_to_scene,"scn_field_5"],[change_screen_mission]]),
("leave",[],"Leave.",[(leave_encounter),(change_screen_return)]),
]
),
(
"dhorak_keep",0,
# "Dhorak Keep, the stronghold of the bandits stands overlooking the barren wilderness.",
"You enter the Dhorak Keep",
"none",
[],
[
("enter",[],"Enter.",[(set_jump_mission,"mt_town_center"),(jump_to_scene,"scn_dhorak_keep"),(change_screen_mission)]),
("leave",[],"Leave.",[(leave_encounter),(change_screen_return)]),
]
),
## (
## "center_under_attack_while_resting",0,
## "{s1} has been besieged by {s2}, and the enemy seems to be preparing for an assault!\
## What will you do?",
## "none",
## [
## (party_get_battle_opponent, ":besieger_party", "$auto_enter_town"),
## (str_store_party_name, s1, "$auto_enter_town"),
## (str_store_party_name, s2, ":besieger_party"),
## ],
## [
## ("defend_against_siege", [],"Help the defenders of {s1}!",
## [
## (assign, "$g_last_player_do_nothing_against_siege_next_check", 0),
## (rest_for_hours, 0, 0, 0),
## (change_screen_return),
## (start_encounter, "$auto_enter_town"),
## ]),
## ("do_not_defend_against_siege",[],"Find a secure place and wait there.",
## [
## (change_screen_return),
## ]),
## ]
## ),
(
"join_siege_outside",mnf_scale_picture,
"{s1} has come under siege by {s2}.",
"none",
[
(str_store_party_name, s1, "$g_encountered_party"),
(str_store_party_name, s2, "$g_encountered_party_2"),
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 1),
(set_background_mesh, "mesh_pic_siege_sighted_fem"),
(else_try),
(set_background_mesh, "mesh_pic_siege_sighted"),
(try_end),
],
[
("approach_besiegers",[(store_faction_of_party, ":faction_no", "$g_encountered_party_2"),
(store_relation, ":relation", ":faction_no", "fac_player_supporters_faction"),
(ge, ":relation", 0),
(store_faction_of_party, ":faction_no", "$g_encountered_party"),
(store_relation, ":relation", ":faction_no", "fac_player_supporters_faction"),
(lt, ":relation", 0),
],"Approach the siege camp.",[
(jump_to_menu, "mnu_besiegers_camp_with_allies"),
]),
("pass_through_siege",[(store_faction_of_party, ":faction_no", "$g_encountered_party"),
(store_relation, ":relation", ":faction_no", "fac_player_supporters_faction"),
(ge, ":relation", 0),
],"Pass through the siege lines and enter {s1}.",
[
(jump_to_menu,"mnu_cut_siege_without_fight"),
]),
("leave",[],"Leave.",[(leave_encounter),
(change_screen_return)]),
]
),
(
"cut_siege_without_fight",0,
"The besiegers let you approach the gates without challenge.",
"none",
[],
[
("continue",[],"Continue...",[(try_begin),
(this_or_next|eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
(eq, "$g_encountered_party_faction", "$players_kingdom"),
(jump_to_menu, "mnu_town"),
(else_try),
(jump_to_menu, "mnu_castle_outside"),
(try_end)]),
]
),
(
"besiegers_camp_with_allies",0,
"{s1} remains under siege. The banners of {s2} fly above the camp of the besiegers,\
where you and your men are welcomed.",
"none",
[
(str_store_party_name, s1, "$g_encountered_party"),
(str_store_party_name, s2, "$g_encountered_party_2"),
(assign, "$g_enemy_party", "$g_encountered_party"),
(assign, "$g_ally_party", "$g_encountered_party_2"),
(select_enemy, 0),
(call_script, "script_encounter_calculate_fit"),
(try_begin),
(eq, "$new_encounter", 1),
(assign, "$new_encounter", 0),
(call_script, "script_encounter_init_variables"),
(try_end),
(try_begin),
(eq, "$g_leave_encounter",1),
(change_screen_return),
(else_try),
(assign, ":enemy_finished", 0),
(try_begin),
(eq, "$g_battle_result", 1),
(assign, ":enemy_finished", 1),
(else_try),
(le, "$g_enemy_fit_for_battle", 0),
(ge, "$g_friend_fit_for_battle", 1),
(assign, ":enemy_finished", 1),
(try_end),
(this_or_next|eq, ":enemy_finished", 1),
(eq, "$g_enemy_surrenders", 1),
## (assign, "$g_next_menu", -1),#"mnu_castle_taken_by_friends"),
## (jump_to_menu, "mnu_total_victory"),
(call_script, "script_party_wound_all_members", "$g_enemy_party"),
(leave_encounter),
(change_screen_return),
(else_try),
(call_script, "script_party_count_members_with_full_health", "p_collective_friends"),
(assign, ":ally_num_soldiers", reg0),
(eq, "$g_battle_result", -1),
(eq, ":ally_num_soldiers", 0), #battle lost (sdsd = TODO : also compare this with routed allies too like in other parts)
(leave_encounter),
(change_screen_return),
(try_end),
],
[
("talk_to_siege_commander",[]," Request a meeting with the commander.",[
(call_script, "script_get_meeting_scene"), (assign, ":meeting_scene", reg0),
(modify_visitors_at_site,":meeting_scene"),(reset_visitors),
(set_visitor,0,"trp_player"),
(party_stack_get_troop_id, ":siege_leader_id","$g_encountered_party_2",0),
(party_stack_get_troop_dna,":siege_leader_dna","$g_encountered_party_2",0),
(set_visitor,17,":siege_leader_id",":siege_leader_dna"),
(set_jump_mission,"mt_conversation_encounter"),
(jump_to_scene,":meeting_scene"),
(assign, "$talk_context", tc_siege_commander),
(change_screen_map_conversation, ":siege_leader_id")]),
("join_siege_with_allies",[(neg|troop_is_wounded, "trp_player")], "Join the next assault.",
[
(assign, "$g_joined_battle_to_help", 1),
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(try_begin),
(check_quest_active, "qst_join_siege_with_army"),
(quest_slot_eq, "qst_join_siege_with_army", slot_quest_target_center, "$g_encountered_party"),
(add_xp_as_reward, 250),
(call_script, "script_end_quest", "qst_join_siege_with_army"),
#Reactivating follow army quest
(faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall),
(str_store_troop_name_link, s9, ":faction_marshall"),
(setup_quest_text, "qst_follow_army"),
(str_store_string, s2, "@{s9} wants you to follow his army until further notice."),
(call_script, "script_start_quest", "qst_follow_army", ":faction_marshall"),
(assign, "$g_player_follow_army_warnings", 0),
(try_end),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_town_walls),
(else_try),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_castle_exterior),
(try_end),
(call_script, "script_calculate_battle_advantage"),
(val_mul, reg0, 2),
(val_div, reg0, 3), #scale down the advantage a bit in sieges.
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_center_siege_with_belfry, 1),
(set_jump_mission,"mt_castle_attack_walls_belfry"),
(else_try),
(set_jump_mission,"mt_castle_attack_walls_ladder"),
(try_end),
(jump_to_scene,":battle_scene"),
(assign, "$g_siege_final_menu", "mnu_besiegers_camp_with_allies"),
(assign, "$g_siege_battle_state", 1),
(assign, "$g_next_menu", "mnu_castle_besiege_inner_battle"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
("join_siege_stay_back", [(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(ge, reg0, 3),
],
"Order your soldiers to join the next assault without you.",
[
(assign, "$g_joined_battle_to_help", 1),
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(try_begin),
(check_quest_active, "qst_join_siege_with_army"),
(quest_slot_eq, "qst_join_siege_with_army", slot_quest_target_center, "$g_encountered_party"),
(add_xp_as_reward, 100),
(call_script, "script_end_quest", "qst_join_siege_with_army"),
#Reactivating follow army quest
(faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall),
(str_store_troop_name_link, s9, ":faction_marshall"),
(setup_quest_text, "qst_follow_army"),
(str_store_string, s2, "@{s9} wants you to follow his army until further notice."),
(call_script, "script_start_quest", "qst_follow_army", ":faction_marshall"),
(assign, "$g_player_follow_army_warnings", 0),
(try_end),
(jump_to_menu,"mnu_castle_attack_walls_with_allies_simulate")]),
("leave",[],"Leave.",[(leave_encounter),(change_screen_return)]),
]
),
(
"castle_outside",mnf_scale_picture,
"You are outside {s2}.{s11} {s3} {s4}",
"none",
[
(assign, "$g_enemy_party", "$g_encountered_party"),
(assign, "$g_ally_party", -1),
(str_store_party_name, s2,"$g_encountered_party"),
(call_script, "script_encounter_calculate_fit"),
(assign,"$all_doors_locked",1),
(assign, "$current_town","$g_encountered_party"),
(try_begin),
(eq, "$new_encounter", 1),
(assign, "$new_encounter", 0),
(call_script, "script_let_nearby_parties_join_current_battle", 1, 0),
(call_script, "script_encounter_init_variables"),
(assign, "$entry_to_town_forbidden",0),
(assign, "$sneaked_into_town",0),
(assign, "$town_entered", 0),
# (assign, "$waiting_for_arena_fight_result", 0),
(assign, "$encountered_party_hostile", 0),
(assign, "$encountered_party_friendly", 0),
(try_begin),
(gt, "$g_player_besiege_town", 0),
(neq,"$g_player_besiege_town","$g_encountered_party"),
(party_slot_eq, "$g_player_besiege_town", slot_center_is_besieged_by, "p_main_party"),
(call_script, "script_lift_siege", "$g_player_besiege_town", 0),
(assign,"$g_player_besiege_town",-1),
(try_end),
(try_begin),
(lt, "$g_encountered_party_relation", 0),
(assign, "$encountered_party_hostile", 1),
(assign,"$entry_to_town_forbidden",1),
(try_end),
(assign,"$cant_sneak_into_town",0),
(try_begin),
(eq,"$current_town","$last_sneak_attempt_town"),
(store_current_hours,reg(2)),
(val_sub,reg(2),"$last_sneak_attempt_time"),
(lt,reg(2),12),
(assign,"$cant_sneak_into_town",1),
(try_end),
(else_try), #second or more turn
(eq, "$g_leave_encounter",1),
(change_screen_return),
(try_end),
(str_clear,s4),
(try_begin),
(eq,"$entry_to_town_forbidden",1),
(try_begin),
(eq,"$cant_sneak_into_town",1),
(str_store_string,s4,"str_sneaking_to_town_impossible"),
(else_try),
(str_store_string,s4,"str_entrance_to_town_forbidden"),
(try_end),
(try_end),
(party_get_slot, ":center_lord", "$current_town", slot_town_lord),
(store_faction_of_party, ":center_faction", "$current_town"),
(str_store_faction_name,s9,":center_faction"),
(try_begin),
(ge, ":center_lord", 0),
(str_store_troop_name,s8,":center_lord"),
(str_store_string,s7,"@{s8} of {s9}"),
(try_end),
(try_begin), # same mnu_town
(party_slot_eq,"$current_town",slot_party_type, spt_castle),
(try_begin),
(eq, ":center_lord", "trp_player"),
(str_store_string,s11,"@ Your own banner flies over the castle gate."),
(else_try),
(ge, ":center_lord", 0),
(str_store_string,s11,"@ You see the banner of {s7} over the castle gate."),
(else_try),
(is_between, ":center_faction", kingdoms_begin, kingdoms_end),
(str_store_string,s11,"str__this_castle_is_temporarily_under_royal_control"),
(else_try),
(str_store_string,s11,"str__this_castle_does_not_seem_to_be_under_anyones_control"),
(try_end),
(else_try),
(try_begin),
(eq, ":center_lord", "trp_player"),
(str_store_string,s11,"@ Your own banner flies over the town gates."),
(else_try),
(ge, ":center_lord", 0),
(str_store_string,s11,"@ You see the banner of {s7} over the town gates."),
(else_try),
(is_between, ":center_faction", kingdoms_begin, kingdoms_end),
(str_store_string,s11,"str__this_town_is_temporarily_under_royal_control"),
(else_try),
(str_store_string,s11,"str__the_townspeople_seem_to_have_declared_their_independence"),
(try_end),
(try_end),
(party_get_num_companions, reg(7),"p_collective_enemy"),
(assign,"$castle_undefended",0),
(str_clear, s3),
(try_begin),
(eq,reg(7),0),
(assign,"$castle_undefended",1),
# (party_set_faction,"$g_encountered_party","fac_neutral"),
# (party_set_slot, "$g_encountered_party", slot_town_lord, stl_unassigned),
(str_store_string, s3, "str_castle_is_abondened"),
(else_try),
(eq,"$g_encountered_party_faction","fac_player_supporters_faction"),
(str_store_string, s3, "str_place_is_occupied_by_player"),
(else_try),
(lt, "$g_encountered_party_relation", 0),
(str_store_string, s3, "str_place_is_occupied_by_enemy"),
(else_try),
# (str_store_string, s3, "str_place_is_occupied_by_friendly"),
(try_end),
(try_begin),
(eq, "$g_leave_town_outside",1),
(assign, "$g_leave_town_outside",0),
(assign, "$g_permitted_to_center", 0),
(change_screen_return),
(else_try),
(check_quest_active, "qst_escort_lady"),
(quest_slot_eq, "qst_escort_lady", slot_quest_target_center, "$g_encountered_party"),
(quest_get_slot, ":quest_object_troop", "qst_escort_lady", slot_quest_object_troop),
(call_script, "script_get_meeting_scene"), (assign, ":meeting_scene", reg0),
(modify_visitors_at_site,":meeting_scene"),
(reset_visitors),
(set_visitor,0, "trp_player"),
(set_visitor,17, ":quest_object_troop"),
(set_jump_mission, "mt_conversation_encounter"),
(jump_to_scene, ":meeting_scene"),
(assign, "$talk_context", tc_entering_center_quest_talk),
(change_screen_map_conversation, ":quest_object_troop"),
(else_try),
(check_quest_active, "qst_kidnapped_girl"),
(quest_slot_eq, "qst_kidnapped_girl", slot_quest_giver_center, "$g_encountered_party"),
(quest_slot_eq, "qst_kidnapped_girl", slot_quest_current_state, 3),
(call_script, "script_get_meeting_scene"), (assign, ":meeting_scene", reg0),
(modify_visitors_at_site,":meeting_scene"),
(reset_visitors),
(set_visitor,0, "trp_player"),
(set_visitor,17, "trp_kidnapped_girl"),
(set_jump_mission, "mt_conversation_encounter"),
(jump_to_scene, ":meeting_scene"),
(assign, "$talk_context", tc_entering_center_quest_talk),
(change_screen_map_conversation, "trp_kidnapped_girl"),
## (else_try),
## (gt, "$lord_requested_to_talk_to", 0),
## (store_current_hours, ":cur_hours"),
## (neq, ":cur_hours", "$quest_given_time"),
## (modify_visitors_at_site,"scn_conversation_scene"),
## (reset_visitors),
## (assign, ":cur_lord", "$lord_requested_to_talk_to"),
## (assign, "$lord_requested_to_talk_to", 0),
## (set_visitor,0,"trp_player"),
## (set_visitor,17,":cur_lord"),
## (set_jump_mission,"mt_conversation_encounter"),
## (jump_to_scene,"scn_conversation_scene"),
## (assign, "$talk_context", tc_castle_gate_lord),
## (change_screen_map_conversation, ":cur_lord"),
(else_try),
(eq, "$g_town_visit_after_rest", 1),
(assign, "$g_town_visit_after_rest", 0),
(jump_to_menu,"mnu_town"),
(else_try),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle),
(this_or_next|party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_leader, "trp_player"),
(jump_to_menu, "mnu_enter_your_own_castle"),
(else_try),
(party_slot_eq,"$g_encountered_party", slot_party_type,spt_castle),
(ge, "$g_encountered_party_relation", 0),
(this_or_next|eq,"$castle_undefended", 1),
(this_or_next|eq, "$g_permitted_to_center", 1),
(eq, "$g_encountered_party_faction", "$players_kingdom"),
(jump_to_menu, "mnu_town"),
(else_try),
(party_slot_eq,"$g_encountered_party", slot_party_type,spt_town),
(ge, "$g_encountered_party_relation", 0),
(jump_to_menu, "mnu_town"),
(else_try),
(eq, "$g_player_besiege_town", "$g_encountered_party"),
(jump_to_menu, "mnu_castle_besiege"),
(try_end),
(call_script, "script_set_town_picture"),
],
[
# ("talk_to_castle_commander",[
# (party_get_num_companions, ":no_companions", "$g_encountered_party"),
# (ge, ":no_companions", 1),
# (eq,"$ruler_meeting_denied",0), #this variable is removed
# ],
# "Request a meeting with the lord of the castle.",[
# (modify_visitors_at_site,"scn_conversation_scene"),(reset_visitors),
# (set_visitor,0,"trp_player"),
# (party_stack_get_troop_id, reg(6),"$g_encountered_party",0),
# (party_stack_get_troop_dna,reg(7),"$g_encountered_party",0),
# (set_visitor,17,reg(6),reg(7)),
# (set_jump_mission,"mt_conversation_encounter"),
# (jump_to_scene,"scn_conversation_scene"),
# (assign, "$talk_context", tc_castle_commander),
# (change_screen_map_conversation, reg(6))
# ]),
("approach_gates",[(this_or_next|eq,"$entry_to_town_forbidden",1),
(party_slot_eq,"$g_encountered_party", slot_party_type,spt_castle)],
"Approach the gates and hail the guard.",[
(jump_to_menu, "mnu_castle_guard"),
## (modify_visitors_at_site,"scn_conversation_scene"),(reset_visitors),
## (set_visitor,0,"trp_player"),
## (store_faction_of_party, ":cur_faction", "$g_encountered_party"),
## (faction_get_slot, ":cur_guard", ":cur_faction", slot_faction_guard_troop),
## (set_visitor,17,":cur_guard"),
## (set_jump_mission,"mt_conversation_encounter"),
## (jump_to_scene,"scn_conversation_scene"),
## (assign, "$talk_context", tc_castle_gate),
## (change_screen_map_conversation, ":cur_guard")
]),
("town_sneak",
[
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type,spt_town),
(str_store_string, s7, "str_town"),
(else_try),
(str_store_string, s7, "str_castle"),
(try_end),
(eq, "$entry_to_town_forbidden", 1),
(eq, "$cant_sneak_into_town", 0)
],
"Disguise yourself and try to sneak into the {s7}",
[
(faction_get_slot, ":player_alarm", "$g_encountered_party_faction", slot_faction_player_alarm),
(party_get_num_companions, ":num_men", "p_main_party"),
(party_get_num_prisoners, ":num_prisoners", "p_main_party"),
(val_add, ":num_men", ":num_prisoners"),
(val_mul, ":num_men", 2),
(val_div, ":num_men", 3),
(store_add, ":get_caught_chance", ":player_alarm", ":num_men"),
(store_random_in_range, ":random_chance", 0, 100),
(try_begin),
(this_or_next|ge, ":random_chance", ":get_caught_chance"),
(eq, "$g_last_defeated_bandits_town", "$g_encountered_party"),
(assign, "$g_last_defeated_bandits_town", 0),
(assign, "$sneaked_into_town",1),
(assign, "$town_entered", 1),
(jump_to_menu,"mnu_sneak_into_town_suceeded"),
(assign, "$g_mt_mode", tcm_disguised),
(else_try),
(jump_to_menu,"mnu_sneak_into_town_caught"),
(try_end)
]),
("castle_start_siege",
[
(this_or_next|party_slot_eq, "$g_encountered_party", slot_center_is_besieged_by, -1),
( party_slot_eq, "$g_encountered_party", slot_center_is_besieged_by, "p_main_party"),
(store_relation, ":reln", "$g_encountered_party_faction", "fac_player_supporters_faction"),
(lt, ":reln", 0),
(lt, "$g_encountered_party_2", 1),
(call_script, "script_party_count_fit_for_battle","p_main_party"),
(gt, reg(0), 5),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(assign, reg6, 1),
(else_try),
(assign, reg6, 0),
(try_end),
],
"Besiege the {reg6?town:castle}.",
[
(assign,"$g_player_besiege_town","$g_encountered_party"),
(store_relation, ":relation", "fac_player_supporters_faction", "$g_encountered_party_faction"),
(val_min, ":relation", -40),
(call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", ":relation"),
(call_script, "script_update_all_notes"),
(jump_to_menu, "mnu_castle_besiege"),
]),
("cheat_castle_start_siege",
[
(eq, "$cheat_mode", 1),
(this_or_next|party_slot_eq, "$g_encountered_party", slot_center_is_besieged_by, -1),
( party_slot_eq, "$g_encountered_party", slot_center_is_besieged_by, "p_main_party"),
(store_relation, ":reln", "$g_encountered_party_faction", "fac_player_supporters_faction"),
(ge, ":reln", 0),
(lt, "$g_encountered_party_2", 1),
(call_script, "script_party_count_fit_for_battle","p_main_party"),
(gt, reg(0), 1),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(assign, reg6, 1),
(else_try),
(assign, reg6, 0),
(try_end),
],
"{!}CHEAT: Besiege the {reg6?town:castle}...",
[
(assign,"$g_player_besiege_town","$g_encountered_party"),
(jump_to_menu, "mnu_castle_besiege"),
]),
("castle_leave",[],"Leave.",[(change_screen_return,0)]),
("castle_cheat_interior",[(eq, "$cheat_mode", 1)], "{!}CHEAT! Interior.",[(set_jump_mission,"mt_ai_training"),
(party_get_slot, ":castle_scene", "$current_town", slot_town_castle),
(jump_to_scene,":castle_scene"),
(change_screen_mission)]),
("castle_cheat_exterior",[(eq, "$cheat_mode", 1)], "{!}CHEAT! Exterior.",[
# (set_jump_mission,"mt_town_default"),
(set_jump_mission,"mt_ai_training"),
(party_get_slot, ":castle_scene", "$current_town", slot_castle_exterior),
(jump_to_scene,":castle_scene"),
(change_screen_mission)]),
("castle_cheat_town_walls",[(eq, "$cheat_mode", 1),(party_slot_eq,"$current_town",slot_party_type, spt_town),], "{!}CHEAT! Town Walls.",
[
(party_get_slot, ":scene", "$current_town", slot_town_walls),
(set_jump_mission,"mt_ai_training"),
(jump_to_scene,":scene"),
(change_screen_mission)]),
]
),
(
"castle_guard",mnf_scale_picture,
"You approach the gate. The men on the walls watch you closely.",
"none",
[
(call_script, "script_set_town_picture"),
],
[
("request_shelter",[(party_slot_eq, "$g_encountered_party",slot_party_type, spt_castle),
(ge, "$g_encountered_party_relation", 0)],
"Request entry to the castle.",
[(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
(try_begin),
(lt, ":castle_lord", 0),
(jump_to_menu, "mnu_castle_entry_granted"),
(else_try),
(call_script, "script_troop_get_player_relation", ":castle_lord"),
(assign, ":castle_lord_relation", reg0),
#(troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
(try_begin),
(gt, ":castle_lord_relation", -15),
(jump_to_menu, "mnu_castle_entry_granted"),
(else_try),
(jump_to_menu, "mnu_castle_entry_denied"),
(try_end),
(try_end),
]),
("request_meeting_commander",[],
"Request a meeting with someone.",
[
(jump_to_menu, "mnu_castle_meeting"),
]),
("guard_leave",[],
"Leave.",
[(change_screen_return,0)]),
]
),
(
"castle_entry_granted",mnf_scale_picture,
"After a brief wait, the guards open the gates for you and allow your party inside.",
"none",
[
(call_script, "script_set_town_picture"),
],
[
("continue",[],
"Continue...",
[(jump_to_menu,"mnu_town")]),
]
),
(
"castle_entry_denied",mnf_scale_picture,
"The lord of this castle has forbidden you from coming inside these walls,\
and the guard sergeant informs you that his men will fire if you attempt to come any closer.",
"none",
[
(call_script, "script_set_town_picture"),
],
[
("continue",[],
"Continue...",
[(jump_to_menu,"mnu_castle_guard")]),
]
),
(
"castle_meeting",mnf_scale_picture,
"With whom do you want to meet?",
"none",
[
(assign, "$num_castle_meeting_troops", 0),
(try_for_range, ":troop_no", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(call_script, "script_get_troop_attached_party", ":troop_no"),
(eq, "$g_encountered_party", reg0),
(troop_set_slot, "trp_temp_array_a", "$num_castle_meeting_troops", ":troop_no"),
(val_add, "$num_castle_meeting_troops", 1),
(try_end),
(call_script, "script_set_town_picture"),
],
[
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 0),(troop_get_slot, ":troop_no", "trp_temp_array_a", 0),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 0),(jump_to_menu,"mnu_castle_meeting_selected")]),
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 1),(troop_get_slot, ":troop_no", "trp_temp_array_a", 1),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 1),(jump_to_menu,"mnu_castle_meeting_selected")]),
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 2),(troop_get_slot, ":troop_no", "trp_temp_array_a", 2),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 2),(jump_to_menu,"mnu_castle_meeting_selected")]),
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 3),(troop_get_slot, ":troop_no", "trp_temp_array_a", 3),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 3),(jump_to_menu,"mnu_castle_meeting_selected")]),
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 4),(troop_get_slot, ":troop_no", "trp_temp_array_a", 4),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 4),(jump_to_menu,"mnu_castle_meeting_selected")]),
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 5),(troop_get_slot, ":troop_no", "trp_temp_array_a", 5),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 5),(jump_to_menu,"mnu_castle_meeting_selected")]),
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 6),(troop_get_slot, ":troop_no", "trp_temp_array_a", 6),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 6),(jump_to_menu,"mnu_castle_meeting_selected")]),
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 7),(troop_get_slot, ":troop_no", "trp_temp_array_a", 7),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 7),(jump_to_menu,"mnu_castle_meeting_selected")]),
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 8),(troop_get_slot, ":troop_no", "trp_temp_array_a", 8),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 8),(jump_to_menu,"mnu_castle_meeting_selected")]),
("guard_meet_s5",[(gt, "$num_castle_meeting_troops", 9),(troop_get_slot, ":troop_no", "trp_temp_array_a", 9),(str_store_troop_name, s5, ":troop_no")],
"{s5}.",[(troop_get_slot, "$castle_meeting_selected_troop", "trp_temp_array_a", 9),(jump_to_menu,"mnu_castle_meeting_selected")]),
("forget_it",[],
"Forget it.",
[(jump_to_menu,"mnu_castle_guard")]),
]
),
(
"castle_meeting_selected",0,
"Your request for a meeting is relayed inside, and finally {s6} appears in the courtyard to speak with you.",
"none",
[(str_store_troop_name, s6, "$castle_meeting_selected_troop")],
[
("continue",[],
"Continue...",
[(jump_to_menu, "mnu_castle_outside"),
(modify_visitors_at_site,"scn_conversation_scene"),(reset_visitors),
(set_visitor,0,"trp_player"),
(set_visitor,17,"$castle_meeting_selected_troop"),
(set_jump_mission,"mt_conversation_encounter"),
(jump_to_scene,"scn_conversation_scene"),
(assign, "$talk_context", tc_castle_gate),
(change_screen_map_conversation, "$castle_meeting_selected_troop"),
]),
]
),
(
"castle_besiege",mnf_scale_picture,
"You are laying siege to {s1}. {s2} {s3}",
"none",
[
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 1),
(set_background_mesh, "mesh_pic_siege_sighted_fem"),
(else_try),
(set_background_mesh, "mesh_pic_siege_sighted"),
(try_end),
(assign, "$g_siege_force_wait", 0),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_center_is_besieged_by, -1),
(party_set_slot, "$g_encountered_party", slot_center_is_besieged_by, "p_main_party"),
(store_current_hours, ":cur_hours"),
(party_set_slot, "$g_encountered_party", slot_center_siege_begin_hours, ":cur_hours"),
(assign, "$g_siege_method", 0),
(assign, "$g_siege_sallied_out_once", 0),
(try_end),
(party_get_slot, ":town_food_store", "$g_encountered_party", slot_party_food_store),
(call_script, "script_center_get_food_consumption", "$g_encountered_party"),
(assign, ":food_consumption", reg0),
(assign, reg7, ":food_consumption"),
(assign, reg8, ":town_food_store"),
(store_div, reg3, ":town_food_store", ":food_consumption"),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(assign, reg6, 1),
(else_try),
(assign, reg6, 0),
(try_end),
(try_begin),
(gt, reg3, 0),
(str_store_string, s2, "@The {reg6?town's:castle's} food stores should last for {reg3} more days."),
(else_try),
(str_store_string, s2, "@The {reg6?town's:castle's} food stores have run out and the defenders are starving."),
(try_end),
(str_store_string, s3, "str_empty_string"),
(try_begin),
(ge, "$g_siege_method", 1),
(store_current_hours, ":cur_hours"),
(try_begin),
(lt, ":cur_hours", "$g_siege_method_finish_hours"),
(store_sub, reg9, "$g_siege_method_finish_hours", ":cur_hours"),
(try_begin),
(eq, "$g_siege_method", 1),
(str_store_string, s3, "@You're preparing to attack the walls, the work should finish in {reg9} hours."),
(else_try),
(eq, "$g_siege_method", 2),
(str_store_string, s3, "@Your forces are building a siege tower. They estimate another {reg9} hours to complete the build."),
(try_end),
(else_try),
(try_begin),
(eq, "$g_siege_method", 1),
(str_store_string, s3, "@You are ready to attack the walls at any time."),
(else_try),
(eq, "$g_siege_method", 2),
(str_store_string, s3, "@The siege tower is built and ready to make an assault."),
(try_end),
(try_end),
(try_end),
#Check if enemy leaves the castle to us...
(try_begin),
(eq, "$g_castle_left_to_player",1), #we come here after dialog. Empty the castle and send parties away.
(assign, "$g_castle_left_to_player",0),
(store_faction_of_party, ":castle_faction", "$g_encountered_party"),
(party_set_faction,"$g_encountered_party","fac_neutral"), #temporarily erase faction so that it is not the closest town
(party_get_num_attached_parties, ":num_attached_parties_to_castle","$g_encountered_party"),
(try_for_range_backwards, ":iap", 0, ":num_attached_parties_to_castle"),
(party_get_attached_party_with_rank, ":attached_party", "$g_encountered_party", ":iap"),
(party_detach, ":attached_party"),
(party_get_slot, ":attached_party_type", ":attached_party", slot_party_type),
(eq, ":attached_party_type", spt_kingdom_hero_party),
(store_faction_of_party, ":attached_party_faction", ":attached_party"),
(call_script, "script_get_closest_walled_center_of_faction", ":attached_party", ":attached_party_faction"),
(try_begin),
(gt, reg0, 0),
(call_script, "script_party_set_ai_state", ":attached_party", spai_holding_center, reg0),
(else_try),
(call_script, "script_party_set_ai_state", ":attached_party", spai_patrolling_around_center, "$g_encountered_party"),
(try_end),
(try_end),
(call_script, "script_party_remove_all_companions", "$g_encountered_party"),
(change_screen_return),
(party_collect_attachments_to_party, "$g_encountered_party", "p_collective_enemy"), #recalculate so that
(call_script, "script_party_copy", "p_encountered_party_backup", "p_collective_enemy"), #leaving troops will not be considered as captured
(party_set_faction,"$g_encountered_party",":castle_faction"),
(try_end),
#Check for victory or defeat....
(assign, "$g_enemy_party", "$g_encountered_party"),
(assign, "$g_ally_party", -1),
(str_store_party_name, 1,"$g_encountered_party"),
(call_script, "script_encounter_calculate_fit"),
(assign, reg11, "$g_enemy_fit_for_battle"),
(assign, reg10, "$g_friend_fit_for_battle"),
(try_begin),
(eq, "$g_leave_encounter",1),
(change_screen_return),
(else_try),
(call_script, "script_party_count_fit_regulars","p_collective_enemy"),
(assign, ":enemy_finished", 0),
(try_begin),
(eq, "$g_battle_result", 1),
(assign, ":enemy_finished", 1),
(else_try),
(le, "$g_enemy_fit_for_battle", 0),
(ge, "$g_friend_fit_for_battle", 1),
(assign, ":enemy_finished", 1),
(try_end),
(this_or_next|eq, ":enemy_finished", 1),
(eq, "$g_enemy_surrenders", 1),
(assign, "$g_next_menu", "mnu_castle_taken"),
(jump_to_menu, "mnu_total_victory"),
(else_try),
(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(assign, ":main_party_fit_regulars", reg0),
(eq, "$g_battle_result", -1),
(eq, ":main_party_fit_regulars", 0), #all lost (sdsd = TODO : )
(assign, "$g_next_menu", "mnu_captivity_start_castle_defeat"),
(jump_to_menu, "mnu_total_defeat"),
(try_end),
],
[
("siege_request_meeting",[(eq, "$cant_talk_to_enemy", 0)],"Call for a meeting with the castle commander.", [
(assign, "$cant_talk_to_enemy", 1),
(assign, "$g_enemy_surrenders",0),
(assign, "$g_castle_left_to_player",0),
(assign, "$talk_context", tc_castle_commander),
(party_get_num_attached_parties, ":num_attached_parties_to_castle","$g_encountered_party"),
(try_begin),
(gt, ":num_attached_parties_to_castle", 0),
(party_get_attached_party_with_rank, ":leader_attached_party", "$g_encountered_party", 0),
(call_script, "script_setup_party_meeting", ":leader_attached_party"),
(else_try),
(call_script, "script_setup_party_meeting", "$g_encountered_party"),
(try_end),
]),
("wait_24_hours",[],"Wait until tomorrow.", [
(assign,"$auto_besiege_town","$g_encountered_party"),
(assign, "$g_siege_force_wait", 1),
(store_time_of_day,":cur_time_of_day"),
(val_add, ":cur_time_of_day", 1),
(assign, ":time_to_wait", 31),
(val_sub,":time_to_wait",":cur_time_of_day"),
(val_mod,":time_to_wait",24),
(val_add, ":time_to_wait", 1),
(rest_for_hours_interactive, ":time_to_wait", 5, 1), #rest while attackable
(assign, "$cant_talk_to_enemy", 0),
(change_screen_return),
]),
("castle_lead_attack",
[
(neg|troop_is_wounded, "trp_player"),
(ge, "$g_siege_method", 1),
(gt, "$g_friend_fit_for_battle", 3),
(store_current_hours, ":cur_hours"),
(ge, ":cur_hours", "$g_siege_method_finish_hours"),
],
"Lead your soldiers in an assault.",
[
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_town_walls),
(else_try),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_castle_exterior),
(try_end),
(call_script, "script_calculate_renown_value"),
(call_script, "script_calculate_battle_advantage"),
(assign, ":battle_advantage", reg0),
(val_mul, ":battle_advantage", 2),
(val_div, ":battle_advantage", 3), #scale down the advantage a bit in sieges.
(set_battle_advantage, ":battle_advantage"),
(set_party_battle_mode),
(assign, "$g_siege_battle_state", 1),
(assign, ":siege_sally", 0),
(try_begin),
(le, ":battle_advantage", -4), #we are outnumbered, defenders sally out
(eq, "$g_siege_sallied_out_once", 0),
(set_jump_mission,"mt_castle_attack_walls_defenders_sally"),
(assign, "$g_siege_battle_state", 0),
(assign, ":siege_sally", 1),
(else_try),
(party_slot_eq, "$current_town", slot_center_siege_with_belfry, 1),
(set_jump_mission,"mt_castle_attack_walls_belfry"),
(else_try),
(set_jump_mission,"mt_castle_attack_walls_ladder"),
(try_end),
(assign, "$cant_talk_to_enemy", 0),
(assign, "$g_siege_final_menu", "mnu_castle_besiege"),
(assign, "$g_next_menu", "mnu_castle_besiege_inner_battle"),
(assign, "$g_siege_method", 0), #reset siege timer
(jump_to_scene,":battle_scene"),
(try_begin),
(eq, ":siege_sally", 1),
(jump_to_menu, "mnu_siege_attack_meets_sally"),
(else_try),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
(try_end),
]),
("attack_stay_back",
[
(ge, "$g_siege_method", 1),
(gt, "$g_friend_fit_for_battle", 3),
(store_current_hours, ":cur_hours"),
(ge, ":cur_hours", "$g_siege_method_finish_hours"),
],
"Order your soldiers to attack while you stay back...", [(assign, "$cant_talk_to_enemy", 0),(jump_to_menu,"mnu_castle_attack_walls_simulate")]),
("build_ladders",[(party_slot_eq, "$current_town", slot_center_siege_with_belfry, 0),(eq, "$g_siege_method", 0)],
"Prepare ladders to attack the walls.", [(jump_to_menu,"mnu_construct_ladders")]),
("build_siege_tower",[(party_slot_eq, "$current_town", slot_center_siege_with_belfry, 1),(eq, "$g_siege_method", 0)],
"Build a siege tower.", [(jump_to_menu,"mnu_construct_siege_tower")]),
("cheat_castle_lead_attack",[(eq, "$cheat_mode", 1),
(eq, "$g_siege_method", 0)],
"{!}CHEAT: Instant build equipments.",
[
(assign, "$g_siege_method", 1),
(assign, "$g_siege_method_finish_hours", 0),
(jump_to_menu, "mnu_castle_besiege"),
]),
("cheat_conquer_castle",[(eq, "$cheat_mode", 1),
],
"{!}CHEAT: Instant conquer castle.",
[
(assign, "$g_next_menu", "mnu_castle_taken"),
(jump_to_menu, "mnu_total_victory"),
]),
("lift_siege",[],"Abandon the siege.",
[
(call_script, "script_lift_siege", "$g_player_besiege_town", 0),
(assign,"$g_player_besiege_town", -1),
(change_screen_return)]),
]
),
(
"siege_attack_meets_sally",mnf_scale_picture,
"The defenders sally out to meet your assault.",
"none",
[
(set_background_mesh, "mesh_pic_sally_out"),
],
[
("continue",[],
"Continue...",
[
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
]
),
(
"castle_besiege_inner_battle",mnf_scale_picture,
"{s1}",
"none",
[
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 1),
(set_background_mesh, "mesh_pic_siege_sighted_fem"),
(else_try),
(set_background_mesh, "mesh_pic_siege_sighted"),
(try_end),
(assign, ":result", "$g_battle_result"),#will be reset at script_encounter_calculate_fit
(call_script, "script_encounter_calculate_fit"),
# TODO: To use for the future:
(str_store_string, s1, "@As a last defensive effort, you retreat to the main hall of the keep.\
You and your remaining soldiers will put up a desperate fight here. If you are defeated, there's no other place to fall back to."),
(str_store_string, s1, "@You've been driven away from the walls.\
Now the attackers are pouring into the streets. IF you can defeat them, you can perhaps turn the tide and save the day."),
(try_begin),
(this_or_next|neq, ":result", 1),
(this_or_next|le, "$g_friend_fit_for_battle", 0),
(le, "$g_enemy_fit_for_battle", 0),
(jump_to_menu, "$g_siege_final_menu"),
(else_try),
(call_script, "script_encounter_calculate_fit"),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(try_begin),
(eq, "$g_siege_battle_state", 0),
(eq, ":result", 1),
(assign, "$g_battle_result", 0),
(jump_to_menu, "$g_siege_final_menu"),
(else_try),
(eq, "$g_siege_battle_state", 1),
(eq, ":result", 1),
(str_store_string, s1, "@You've breached the town walls,\
but the stubborn defenders continue to resist you in the streets!\
You'll have to deal with them before you can attack the keep at the heart of the town."),
(else_try),
(eq, "$g_siege_battle_state", 2),
(eq, ":result", 1),
(str_store_string, s1, "@The town centre is yours,\
but the remaining defenders have retreated to the castle.\
It must fall before you can complete your victory."),
(else_try),
(jump_to_menu, "$g_siege_final_menu"),
(try_end),
(else_try),
(try_begin),
(eq, "$g_siege_battle_state", 0),
(eq, ":result", 1),
(assign, "$g_battle_result", 0),
(jump_to_menu, "$g_siege_final_menu"),
(else_try),
(eq, "$g_siege_battle_state", 1),
(eq, ":result", 1),
(str_store_string, s1, "@The remaining defenders have retreated to the castle as a last defense. You must go in and crush any remaining resistance."),
(else_try),
(jump_to_menu, "$g_siege_final_menu"),
(try_end),
(try_end),
],
[
("continue",[],
"Continue...",
[
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(try_begin),
(eq, "$g_siege_battle_state", 1),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_town_center),
(set_jump_mission, "mt_besiege_inner_battle_town_center"),
(else_try),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_town_castle),
(set_jump_mission, "mt_besiege_inner_battle_castle"),
(try_end),
(else_try),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_town_castle),
(set_jump_mission, "mt_besiege_inner_battle_castle"),
(try_end),
## (call_script, "script_calculate_battle_advantage"),
## (set_battle_advantage, reg0),
(set_party_battle_mode),
(jump_to_scene, ":battle_scene"),
(val_add, "$g_siege_battle_state", 1),
(assign, "$g_next_menu", "mnu_castle_besiege_inner_battle"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
]
),
(
"construct_ladders",0,
"As the party member with the highest Engineer skill ({reg2}), {reg3?you estimate:{s3} estimates} that it will take\
{reg4} hours to build enough scaling ladders for the assault.",
"none",
[(call_script, "script_get_max_skill_of_player_party", "skl_engineer"),
(assign, ":max_skill", reg0),
(assign, ":max_skill_owner", reg1),
(assign, reg2, ":max_skill"),
(store_sub, reg4, 14, ":max_skill"),
(val_mul, reg4, 2),
(val_div, reg4, 3),
(try_begin),
(eq, ":max_skill_owner", "trp_player"),
(assign, reg3, 1),
(else_try),
(assign, reg3, 0),
(str_store_troop_name, s3, ":max_skill_owner"),
(try_end),
],
[
("build_ladders_cont",[],
"Do it.", [
(assign, "$g_siege_method", 1),
(store_current_hours, ":cur_hours"),
(call_script, "script_get_max_skill_of_player_party", "skl_engineer"),
(store_sub, ":hours_takes", 14, reg0),
(val_mul, ":hours_takes", 2),
(val_div, ":hours_takes", 3),
(store_add, "$g_siege_method_finish_hours",":cur_hours", ":hours_takes"),
(assign,"$auto_besiege_town","$current_town"),
(rest_for_hours_interactive, 96, 5, 1), #rest while attackable. A trigger will divert control when attack is ready.
(change_screen_return),
]),
("go_back",[],
"Go back.", [(jump_to_menu,"mnu_castle_besiege")]),
],
),
(
"construct_siege_tower",0,
"As the party member with the highest Engineer skill ({reg2}), {reg3?you estimate:{s3} estimates} that building a siege tower will take\
{reg4} hours.",
"none",
[(call_script, "script_get_max_skill_of_player_party", "skl_engineer"),
(assign, ":max_skill", reg0),
(assign, ":max_skill_owner", reg1),
(assign, reg2, ":max_skill"),
(store_sub, reg4, 15, ":max_skill"),
(val_mul, reg4, 6),
(try_begin),
(eq, ":max_skill_owner", "trp_player"),
(assign, reg3, 1),
(else_try),
(assign, reg3, 0),
(str_store_troop_name, s3, ":max_skill_owner"),
(try_end),
],
[
("build_siege_tower_cont",[],
"Start building.", [
(assign, "$g_siege_method", 2),
(store_current_hours, ":cur_hours"),
(call_script, "script_get_max_skill_of_player_party", "skl_engineer"),
(store_sub, ":hours_takes", 15, reg0),
(val_mul, ":hours_takes", 6),
(store_add, "$g_siege_method_finish_hours",":cur_hours", ":hours_takes"),
(assign,"$auto_besiege_town","$current_town"),
(rest_for_hours_interactive, 240, 5, 1), #rest while attackable. A trigger will divert control when attack is ready.
(change_screen_return),
]),
("go_back",[],
"Go back.", [(jump_to_menu,"mnu_castle_besiege")]),
],
),
(
"castle_attack_walls_simulate",mnf_scale_picture|mnf_disable_all_keys,
"{s4}^^Your casualties:{s8}^^Enemy casualties were: {s9}",
"none",
[
(try_begin),
(set_background_mesh, "mesh_pic_siege_attack"),
(try_end),
(call_script, "script_party_calculate_strength", "p_main_party", 1), #skip player
(assign, ":player_party_strength", reg0),
(val_div, ":player_party_strength", 10),
(call_script, "script_party_calculate_strength", "$g_encountered_party", 0),
(assign, ":enemy_party_strength", reg0),
(val_div, ":enemy_party_strength", 4),
(inflict_casualties_to_party_group, "p_main_party", ":enemy_party_strength", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s8, s0),
(inflict_casualties_to_party_group, "$g_encountered_party", ":player_party_strength", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s9, s0),
(assign, "$no_soldiers_left", 0),
(try_begin),
(call_script, "script_party_count_members_with_full_health","p_main_party"),
(le, reg0, 0), #(sdsd = TODO : compare with num_routed_us)
(assign, "$no_soldiers_left", 1),
(str_store_string, s4, "str_attack_walls_failure"),
(else_try),
(call_script, "script_party_count_members_with_full_health","$g_encountered_party"),
(le, reg0, 0), #(sdsd = TODO : compare with num_routed_enemies)
(assign, "$no_soldiers_left", 1),
(assign, "$g_battle_result", 1),
(str_store_string, s4, "str_attack_walls_success"),
(else_try),
(str_store_string, s4, "str_attack_walls_continue"),
(try_end),
],
[
## ("lead_next_wave",[(eq, "$no_soldiers_left", 0)],"Lead the next wave of attack personally.", [
## (party_get_slot, ":battle_scene", "$g_encountered_party", slot_castle_exterior),
## (set_party_battle_mode),
## (set_jump_mission,"mt_castle_attack_walls"),
## (jump_to_scene,":battle_scene"),
## (jump_to_menu,"mnu_castle_outside"),
## (change_screen_mission),
## ]),
## ("continue_attacking",[(eq, "$no_soldiers_left", 0)],"Order your soldiers to keep attacking...", [
## (jump_to_menu,"mnu_castle_attack_walls_3"),
## ]),
## ("call_soldiers_back",[(eq, "$no_soldiers_left", 0)],"Call your soldiers back.",[(jump_to_menu,"mnu_castle_outside")]),
("continue",[],"Continue...",[(jump_to_menu,"mnu_castle_besiege")]),
]
),
(
"castle_attack_walls_with_allies_simulate",mnf_scale_picture|mnf_disable_all_keys,
"{s4}^^Your casualties: {s8}^^Allies' casualties: {s9}^^Enemy casualties: {s10}",
"none",
[
(try_begin),
(set_background_mesh, "mesh_pic_siege_attack"),
(try_end),
(call_script, "script_party_calculate_strength", "p_main_party", 1), #skip player
(assign, ":player_party_strength", reg0),
(val_div, ":player_party_strength", 10),
(call_script, "script_party_calculate_strength", "p_collective_friends", 0),
(assign, ":friend_party_strength", reg0),
(val_div, ":friend_party_strength", 10),
(val_max, ":friend_party_strength", 1),
(call_script, "script_party_calculate_strength", "p_collective_enemy", 0),
(assign, ":enemy_party_strength", reg0),
(val_div, ":enemy_party_strength", 4),
## (assign, reg0, ":player_party_strength"),
## (assign, reg1, ":friend_party_strength"),
## (assign, reg2, ":enemy_party_strength"),
## (assign, reg3, "$g_enemy_party"),
## (assign, reg4, "$g_ally_party"),
## (display_message, "@{!}player_str={reg0} friend_str={reg1} enemy_str={reg2}"),
## (display_message, "@{!}enemy_party={reg3} ally_party={reg4}"),
(try_begin),
(eq, ":friend_party_strength", 0),
(store_div, ":enemy_party_strength_for_p", ":enemy_party_strength", 2),
(else_try),
(assign, ":enemy_party_strength_for_p", ":enemy_party_strength"),
(val_mul, ":enemy_party_strength_for_p", ":player_party_strength"),
(val_div, ":enemy_party_strength_for_p", ":friend_party_strength"),
(try_end),
(val_sub, ":enemy_party_strength", ":enemy_party_strength_for_p"),
(inflict_casualties_to_party_group, "p_main_party", ":enemy_party_strength_for_p", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s8, s0),
(inflict_casualties_to_party_group, "$g_enemy_party", ":friend_party_strength", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s10, s0),
(call_script, "script_collect_friendly_parties"),
(inflict_casualties_to_party_group, "$g_ally_party", ":enemy_party_strength", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s9, s0),
(party_collect_attachments_to_party, "$g_enemy_party", "p_collective_enemy"),
(assign, "$no_soldiers_left", 0),
(try_begin),
(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(le, reg0, 0), #(sdsd = TODO : compare with num_routed_us)
(assign, "$no_soldiers_left", 1),
(str_store_string, s4, "str_attack_walls_failure"),
(else_try),
(call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
(le, reg0, 0), #(sdsd = TODO : compare with num_routed_enemies)
(assign, "$no_soldiers_left", 1),
(assign, "$g_battle_result", 1),
(str_store_string, s4, "str_attack_walls_success"),
(else_try),
(str_store_string, s4, "str_attack_walls_continue"),
(try_end),
],
[
("continue",[],"Continue...",[(jump_to_menu,"mnu_besiegers_camp_with_allies")]),
]
),
(
"castle_taken_by_friends",0,
"Nothing to see here.",
"none",
[
(party_clear, "$g_encountered_party"),
(party_stack_get_troop_id, ":leader", "$g_encountered_party_2", 0),
(party_set_slot, "$g_encountered_party", slot_center_last_taken_by_troop, ":leader"),
(store_troop_faction, ":faction_no", ":leader"),
#Reduce prosperity of the center by 5
(call_script, "script_change_center_prosperity", "$g_encountered_party", -5),
(try_begin),
(assign, ":damage", 20),
(is_between, "$g_encountered_party", towns_begin, towns_end),
(assign, ":damage", 40),
(try_end),
(try_begin),
(neq, ":faction_no", "$g_encountered_party_faction"),
(call_script, "script_faction_inflict_war_damage_on_faction", ":faction_no", "$g_encountered_party_faction", ":damage"),
(try_end),
(call_script, "script_give_center_to_faction", "$g_encountered_party", ":faction_no"),
(call_script, "script_add_log_entry", logent_player_participated_in_siege, "trp_player", "$g_encountered_party", 0, "$g_encountered_party_faction"),
## (call_script, "script_change_troop_renown", "trp_player", 1),
(change_screen_return),
],
[
],
),
(
"castle_taken",mnf_disable_all_keys,
"{s3} has fallen to your troops, and you now have full control of the {reg2?town:castle}.\
{reg1? You may station troops here to defend it against enemies who may try to recapture it. Also, you should select now whether you will hold the {reg2?town:castle} yourself or give it to a faithful vassal...:}",# Only visible when castle is taken without being a vassal of a kingdom.
"none",
[
(party_clear, "$g_encountered_party"),
(try_begin),
(eq, "$players_kingdom", "fac_player_supporters_faction"),
(party_get_slot, ":new_owner", "$g_encountered_party", slot_town_lord),
(neq, ":new_owner", "trp_player"),
(try_for_range, ":unused", 0, 4),
(call_script, "script_cf_reinforce_party", "$g_encountered_party"),
(try_end),
(try_end),
(call_script, "script_lift_siege", "$g_encountered_party", 0),
(assign, "$g_player_besiege_town", -1),
(party_set_slot, "$g_encountered_party", slot_center_last_taken_by_troop, "trp_player"),
#Reduce prosperity of the center by 5
(call_script, "script_change_center_prosperity", "$g_encountered_party", -5),
(call_script, "script_change_troop_renown", "trp_player", 5),
(assign, ":damage", 20),
(try_begin),
(is_between, "$g_encountered_party", towns_begin, towns_end),
(assign, ":damage", 40),
(try_end),
(call_script, "script_faction_inflict_war_damage_on_faction", "$players_kingdom", "$g_encountered_party_faction", ":damage"),
#removed, is it duplicate (useless)? See 20 lines above.
#(call_script, "script_add_log_entry", logent_castle_captured_by_player, "trp_player", "$g_encountered_party", -1, "$g_encountered_party_faction"),
(try_begin),
(is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
(neq, "$players_kingdom", "fac_player_supporters_faction"),
(call_script, "script_give_center_to_faction", "$g_encountered_party", "$players_kingdom"),
(call_script, "script_order_best_besieger_party_to_guard_center", "$g_encountered_party", "$players_kingdom"),
(jump_to_menu, "mnu_castle_taken_2"),
(else_try),
(call_script, "script_give_center_to_faction", "$g_encountered_party", "fac_player_supporters_faction"),
(call_script, "script_order_best_besieger_party_to_guard_center", "$g_encountered_party", "fac_player_supporters_faction"),
(str_store_party_name, s3, "$g_encountered_party"),
(assign, reg1, 0),
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(assign, reg1, 1),
(try_end),
#(party_set_slot, "$g_encountered_party", slot_town_lord, stl_unassigned),
(try_end),
(assign, reg2, 0),
(try_begin),
(is_between, "$g_encountered_party", towns_begin, towns_end),
(assign, reg2, 1),
(try_end),
],
[
("continue",[],"Continue...",
[
(assign, "$auto_enter_town", "$g_encountered_party"),
(change_screen_return),
]),
],
),
(
"castle_taken_2",mnf_disable_all_keys,
"{s3} has fallen to your troops, and you now have full control of the castle.\
It is time to send word to {s9} about your victory. {s5}",
"none",
[
(str_store_party_name, s3, "$g_encountered_party"),
(str_clear, s5),
(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s9, ":faction_leader"),
(try_begin),
(eq, "$player_has_homage", 0),
(assign, reg8, 0),
(try_begin),
(party_slot_eq, "$g_encountered_party", spt_town),
(assign, reg8, 1),
(try_end),
(str_store_string, s5, "@However, since you are not a sworn {man/follower} of {s9}, there is no chance he would recognize you as the {lord/lady} of this {reg8?town:castle}."),
(try_end),
],
[
("castle_taken_claim",[(eq, "$player_has_homage", 1)],
"Request that {s3} be awarded to you.",
[
(party_set_slot, "$g_encountered_party", slot_center_last_taken_by_troop, "trp_player"),
(assign, "$g_castle_requested_by_player", "$current_town"),
(assign, "$g_castle_requested_for_troop", "trp_player"),
(assign, "$auto_enter_town", "$g_encountered_party"),
(change_screen_return),
]),
("castle_taken_claim_2",[
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(is_between, ":spouse", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":spouse", slot_troop_occupation, slto_kingdom_hero),
(store_faction_of_troop, ":spouse_faction", ":spouse"),
(eq, ":spouse_faction", "$players_kingdom"),
],
"Request that {s3} be awarded to your {wife/husband}.",
[
(party_set_slot, "$g_encountered_party", slot_center_last_taken_by_troop, "trp_player"),
(assign, "$g_castle_requested_by_player", "$current_town"),
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(assign, "$g_castle_requested_for_troop", ":spouse"),
(assign, "$auto_enter_town", "$g_encountered_party"),
(change_screen_return),
]),
("castle_taken_no_claim",[],"Ask no rewards.",
[
(party_set_slot, "$g_encountered_party", slot_center_last_taken_by_troop, -1),
(assign, "$auto_enter_town", "$g_encountered_party"),
(change_screen_return),
# (jump_to_menu, "mnu_town"),
]),
],
),
(
"requested_castle_granted_to_player",mnf_scale_picture,
"You receive a message from your liege, {s3}.^^\
{reg4?She:He} has decided to grant {s2}{reg3? and the nearby village of {s4}:} to you, with all due incomes and titles, to hold in {reg4?her:his} name for as long as you maintain your oath of homage..",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s3, ":faction_leader"),
(str_store_party_name, s2, "$g_center_to_give_to_player"),
(try_begin),
(party_slot_eq, "$g_center_to_give_to_player", slot_party_type, spt_castle),
(assign, reg3, 1),
(try_for_range, ":cur_village", villages_begin, villages_end),
(party_slot_eq, ":cur_village", slot_village_bound_center, "$g_center_to_give_to_player"),
(str_store_party_name, s4, ":cur_village"),
(try_end),
(else_try),
(assign, reg3, 0),
(try_end),
(troop_get_type, reg4, ":faction_leader"),
],
[
("continue",[],"Continue.",
[
(call_script, "script_give_center_to_lord", "$g_center_to_give_to_player", "trp_player", 0),
(jump_to_menu, "mnu_give_center_to_player_2"),
],
),
]
),
(
"requested_castle_granted_to_player_husband", mnf_scale_picture,
"You receive a message from your liege, {s3}.^^\
{reg4?She:He} has decided to grant {s2}{reg3? and the nearby village of {s4}:} to your husband, {s7}.",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s3, ":faction_leader"),
(str_store_party_name, s2, "$g_center_to_give_to_player"),
(try_begin),
(party_slot_eq, "$g_center_to_give_to_player", slot_party_type, spt_castle),
(assign, reg3, 1),
(try_for_range, ":cur_village", villages_begin, villages_end),
(party_slot_eq, ":cur_village", slot_village_bound_center, "$g_center_to_give_to_player"),
(str_store_party_name, s4, ":cur_village"),
(try_end),
(else_try),
(assign, reg3, 0),
(try_end),
(troop_get_type, reg4, ":faction_leader"),
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(str_store_troop_name, s11, ":spouse"),
(str_store_string, s7, "str_to_your_husband_s11"),
],
[
("continue",[],"Continue.",
[
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(call_script, "script_give_center_to_lord", "$g_center_to_give_to_player", ":spouse", 0),
],
),
]
),
(
"requested_castle_granted_to_another",mnf_scale_picture,
"You receive a message from your monarch, {s3}.^^\
'I was most pleased to hear of your valiant efforts in the capture of {s2}. Your victory has gladdened all our hearts.\
You also requested me to give you ownership of the castle, but that is a favour which I fear I cannot grant,\
as you already hold significant estates in my realm.\
Instead I have sent you {reg6} denars to cover the expenses of your campaign, but {s2} I give to {s5}.'\
",
"none",
[(set_background_mesh, "mesh_pic_messenger"),
(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s3, ":faction_leader"),
(str_store_party_name, s2, "$g_center_to_give_to_player"),
(party_get_slot, ":new_owner", "$g_center_to_give_to_player", slot_town_lord),
(str_store_troop_name, s5, ":new_owner"),
(assign, reg6, 900),
(assign, "$g_castle_requested_by_player", -1),
(assign, "$g_castle_requested_for_troop", -1),
],
[
("accept_decision",[],"Accept the decision.",
[
(call_script, "script_troop_add_gold", "trp_player", reg6),
(change_screen_return),
]),
("leave_faction",[],"You have been wronged! Renounce your oath to your liege! ",
[
(jump_to_menu, "mnu_leave_faction"),
(call_script, "script_troop_add_gold", "trp_player", reg6),
]),
],
),
(
"requested_castle_granted_to_another_female",mnf_scale_picture,
"You receive a message from your monarch, {s3}.^^\
'I was most pleased to hear of your valiant efforts in the capture of {s2}. Your victory has gladdened all our hearts.\
You also requested me to give ownership of the castle to your husband, but that is a favour which I fear I cannot grant,\
as he already holds significant estates in my realm.\
Instead I have sent you {reg6} denars to cover the expenses of your campaign, but {s2} I give to {s5}.'\
",
"none",
[(set_background_mesh, "mesh_pic_messenger"),
(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s3, ":faction_leader"),
(str_store_party_name, s2, "$g_center_to_give_to_player"),
(party_get_slot, ":new_owner", "$g_center_to_give_to_player", slot_town_lord),
(str_store_troop_name, s5, ":new_owner"),
(assign, reg6, 900),
(assign, "$g_castle_requested_by_player", -1),
(assign, "$g_castle_requested_for_troop", -1),
],
[
("accept_decision",[],"Accept the decision.",
[
(call_script, "script_troop_add_gold", "trp_player", reg6),
(change_screen_return),
]),
],
),
(
"leave_faction",0,
"Renouncing your oath is a grave act. Your lord may condemn you and confiscate your lands and holdings.\
However, if you return them of your own free will, he may let the betrayal go without a fight.",
"none",
[
],
[
("leave_faction_give_back", [], "Renounce your oath and give up your holdings.",
[
#Troop commentary changes begin
# (call_script, "script_add_log_entry", logent_renounced_allegiance, "trp_player", -1, "$g_talk_troop", "$g_talk_troop_faction"),
#Troop commentary changes end
(call_script, "script_player_leave_faction", 1), #1 means give back fiefs
(change_screen_return),
]),
("leave_faction_hold", [
(str_store_party_name, s2, "$g_center_to_give_to_player"),
], "Renounce your oath and rule your lands, including {s2}, in your own name.",
[
(call_script, "script_give_center_to_lord", "$g_center_to_give_to_player", "trp_player", 0), #this should activate the player faction (it does not)
(call_script, "script_player_leave_faction", 0), #"1" would mean give back fiefs
(call_script, "script_activate_player_faction", "trp_player"), #Activating player faction should now work
(change_screen_return),
]),
("leave_faction_cancel", [], "Remain loyal and accept the decision.",
[
(change_screen_return),
]),
],
),
(
"give_center_to_player",mnf_scale_picture,
"Your lord offers to extend your fiefs!\
{s1} sends word that he is willing to grant {s2} to you in payment for your loyal service,\
adding it to your holdings. What is your answer?",
"none",
[(set_background_mesh, "mesh_pic_messenger"),
(store_faction_of_party, ":center_faction", "$g_center_to_give_to_player"),
(faction_get_slot, ":faction_leader", ":center_faction", slot_faction_leader),
(str_store_troop_name, s1, ":faction_leader"),
(str_store_party_name, s2, "$g_center_to_give_to_player"),
],
[
("give_center_to_player_accept",[],"Accept the offer.",
[(call_script, "script_give_center_to_lord", "$g_center_to_give_to_player", "trp_player", 0),
(jump_to_menu, "mnu_give_center_to_player_2"),
]),
("give_center_to_player_reject",[],"Reject. You have no interest in holding {s2}.",
[(party_set_slot, "$g_center_to_give_to_player", slot_town_lord, stl_rejected_by_player),
(change_screen_return),
]),
],
),
(
"give_center_to_player_2",0,
"With a brief ceremony, you are officially confirmed as the new lord of {s2}{reg3? and its bound village {s4}:}.\
{reg3?They:It} will make a fine part of your fiefdom.\
You can now claim the rents and revenues from your personal estates there, draft soldiers from the populace,\
and manage the lands as you see fit.\
However, you are also expected to defend your fief and your people from harm,\
as well as maintaining the rule of law and order.",
"none",
[
(str_store_party_name, s2, "$g_center_to_give_to_player"),
(assign, reg3, 0),
(try_begin),
(party_slot_eq, "$g_center_to_give_to_player", slot_party_type, spt_castle),
(try_for_range, ":cur_village", villages_begin, villages_end),
(party_slot_eq, ":cur_village", slot_village_bound_center, "$g_center_to_give_to_player"),
(str_store_party_name, s4, ":cur_village"),
(assign, reg3, 1),
(try_end),
(try_end),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
],
),
(
"oath_fulfilled",0,
"You had a contract with {s1} to serve him for a certain duration.\
Your contract has now expired. What will you do?",
"none",
[
(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s1, ":faction_leader"),
],
[
("renew_oath",[(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s1, ":faction_leader")], "Renew your contract with {s1} for another month.",
[
(store_current_day, ":cur_day"),
(store_add, "$mercenary_service_next_renew_day", ":cur_day", 30),
(change_screen_return),
]),
("dont_renew_oath",[],"Become free of your bond.",
[
(call_script, "script_player_leave_faction", 1), #1 means give back fiefs
(change_screen_return),
]),
]
),
## (
## "castle_garrison_stationed",0,
### "The rest of the castle garrison recognizes that their situation is hopeless and surrenders. {s1} is at your mercy now. What do you want to do with this castle?",
## "_",
## "none",
## [
## (jump_to_menu, "mnu_town"),
## ],
## [],
## ),
## (
## "castle_choose_captain",0,
## "You will need to assign one of your companions as the castellan. Who will it be?",
## "none",
## [
## (try_for_range, ":slot_no", 0, 20),
## (troop_set_slot, "trp_temp_troop", ":slot_no", 0),
## (try_end),
## (assign, ":num_captains", 0),
## (party_clear, "p_temp_party"),
## (party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
## (try_for_range, ":i_s", 1,":num_stacks"),
## (party_stack_get_troop_id, ":companion","p_main_party", ":i_s"),
## (troop_slot_eq, ":companion", slot_troop_occupation, slto_player_companion),
## (troop_set_slot, "trp_temp_troop", ":num_captains", ":companion"),
## (try_end),
## ],
## [
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 0),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 0),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 1),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 1),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 2),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 2),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 3),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 3),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 4),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 4),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 5),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 5),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 6),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 6),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 7),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 7),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 8),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 8),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 9),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 9),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 10),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 10),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 11),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 11),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 12),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 12),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 13),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 13),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 14),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 14),(jump_to_menu,"mnu_castle_captain_chosen")]),
## ("castellan_candidate", [(troop_get_slot, ":captain", "trp_temp_troop", 15),(gt,":captain",0),(str_store_troop_name, s5,":captain")],
## "{s5}", [(troop_get_slot, "$selected_castellan", "trp_temp_troop", 15),(jump_to_menu,"mnu_castle_captain_chosen")]),
##
## ("cancel",[],
## "Cancel...",
## [(jump_to_menu, "mnu_town")]),
## ],
## ),
## (
## "castle_captain_chosen",0,
## "h this castle?",
## "none",
## [
## (party_add_leader, "$g_encountered_party", "$selected_castellan"),
## (party_remove_members, "p_main_party", "$selected_castellan",1),
## (party_set_slot, "$g_encountered_party", slot_town_lord, "trp_player"),
## (party_set_faction, "$g_encountered_party", "fac_player_supporters_faction"),
## (try_for_range, ":slot_no", 0, 20), #clear temp troop slots just in case
## (troop_set_slot, "trp_temp_troop", ":slot_no", 0),
## (try_end),
## (jump_to_menu, "mnu_town"),
## (change_screen_exchange_members,0),
## ],
## [],
## ),
## (
## "under_siege_attacked_continue",0,
## "Nothing to see here.",
## "none",
## [
## (assign, "$g_enemy_party", "$g_encountered_party_2"),
## (assign, "$g_ally_party", "$g_encountered_party"),
## (party_set_next_battle_simulation_time, "$g_encountered_party", 0),
## (call_script, "script_encounter_calculate_fit"),
## (try_begin),
## (call_script, "script_party_count_fit_regulars", "p_collective_enemy"),
## (assign, ":num_enemy_regulars_remaining", reg(0)),
## (assign, ":enemy_finished",0),
## (try_begin),
## (eq, "$g_battle_result", 1),
## (eq, ":num_enemy_regulars_remaining", 0), #battle won
## (assign, ":enemy_finished",1),
## (else_try),
## (eq, "$g_engaged_enemy", 1),
## (le, "$g_enemy_fit_for_battle",0),
## (ge, "$g_friend_fit_for_battle",1),
## (assign, ":enemy_finished",1),
## (try_end),
## (this_or_next|eq, ":enemy_finished",1),
## (eq,"$g_enemy_surrenders",1),
#### (assign, "$g_center_under_siege_battle", 0),
## (assign, "$g_next_menu", -1),
## (jump_to_menu, "mnu_total_victory"),
## (else_try),
## (assign, ":battle_lost", 0),
## (try_begin),
## (eq, "$g_battle_result", -1),
## (assign, ":battle_lost",1),
## (try_end),
## (this_or_next|eq, ":battle_lost",1),
## (eq,"$g_player_surrenders",1),
#### (assign, "$g_center_under_siege_battle", 0),
## (assign, "$g_next_menu", "mnu_captivity_start_under_siege_defeat"),
## (jump_to_menu, "mnu_total_defeat"),
## (else_try),
## # Ordinary victory.
## (try_begin),
## #check whether enemy retreats
## (eq, "$g_battle_result", 1),
## (store_mul, ":min_enemy_str", "$g_enemy_fit_for_battle", 2),
## (lt, ":min_enemy_str", "$g_friend_fit_for_battle"),
## (party_set_slot, "$g_enemy_party", slot_party_retreat_flag, 1),
##
## (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
## (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
## (troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
## (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
## (gt, ":party_no", 0),
## (party_slot_eq, ":party_no", slot_party_ai_state, spai_besieging_center),
## (party_slot_eq, ":party_no", slot_party_ai_object, "$g_encountered_party"),
## (party_slot_eq, ":party_no", slot_party_ai_substate, 1),
## (call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
## (call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, ":center_no"),
## (try_end),
## (display_message, "@{!}TODO: Enemy retreated. The assault has ended, siege continues."),
## (change_screen_return),
## (try_end),
#### (assign, "$g_center_under_siege_battle", 0),
## (try_end),
## ],
## [
## ]
## ),
(
"siege_started_defender",0,
"{s1} is launching an assault against the walls of {s2}. You have {reg10} troops fit for battle against the enemy's {reg11}. You decide to...",
"none",
[
(select_enemy,1),
(assign, "$g_enemy_party", "$g_encountered_party_2"),
(assign, "$g_ally_party", "$g_encountered_party"),
(str_store_party_name, 1,"$g_enemy_party"),
(str_store_party_name, 2,"$g_ally_party"),
(call_script, "script_encounter_calculate_fit"),
(try_begin),
(eq, "$g_siege_first_encounter", 1),
(call_script, "script_let_nearby_parties_join_current_battle", 0, 1),
(call_script, "script_encounter_init_variables"),
(try_end),
(try_begin),
(eq, "$g_siege_first_encounter", 0),
(try_begin),
(call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
(assign, ":num_enemy_regulars_remaining", reg0),
(call_script, "script_party_count_members_with_full_health", "p_collective_friends"),
(assign, ":num_ally_regulars_remaining", reg0),
(assign, ":enemy_finished", 0),
(try_begin),
(eq, "$g_battle_result", 1),
(eq, ":num_enemy_regulars_remaining", 0), #battle won (sdsd = TODO : compare with num_routed_us)
(assign, ":enemy_finished",1),
(else_try),
(eq, "$g_engaged_enemy", 1),
(le, "$g_enemy_fit_for_battle",0),
(ge, "$g_friend_fit_for_battle",1),
(assign, ":enemy_finished",1),
(try_end),
(this_or_next|eq, ":enemy_finished",1),
(eq,"$g_enemy_surrenders",1),
(assign, "$g_next_menu", -1),
(jump_to_menu, "mnu_total_victory"),
(else_try),
(assign, ":battle_lost", 0),
(try_begin),
(this_or_next|eq, "$g_battle_result", -1),
(troop_is_wounded, "trp_player"),
(eq, ":num_ally_regulars_remaining", 0), #(sdsd = TODO : compare with num_routed_allies)
(assign, ":battle_lost",1),
(try_end),
(this_or_next|eq, ":battle_lost",1),
(eq,"$g_player_surrenders",1),
(assign, "$g_next_menu", "mnu_captivity_start_under_siege_defeat"),
(jump_to_menu, "mnu_total_defeat"),
(else_try),
# Ordinary victory/defeat.
(assign, ":attackers_retreat", 0),
(try_begin),
#check whether enemy retreats
(eq, "$g_battle_result", 1),
## (store_mul, ":min_enemy_str", "$g_enemy_fit_for_battle", 2),
## (lt, ":min_enemy_str", "$g_friend_fit_for_battle"),
(assign, ":attackers_retreat", 1),
(else_try),
(eq, "$g_battle_result", 0),
(store_div, ":min_enemy_str", "$g_enemy_fit_for_battle", 3),
(lt, ":min_enemy_str", "$g_friend_fit_for_battle"),
(assign, ":attackers_retreat", 1),
(else_try),
(store_random_in_range, ":random_no", 0, 100),
(store_mul, ":num_ally_regulars_remaining_multiplied", ":num_ally_regulars_remaining", 13),
(val_div, ":num_ally_regulars_remaining_multiplied", 10),
(ge, ":num_ally_regulars_remaining_multiplied", ":num_enemy_regulars_remaining"),
(lt, ":random_no", 10),
(neq, "$new_encounter", 1),
(assign, ":attackers_retreat", 1),
(try_end),
(try_begin),
(eq, ":attackers_retreat", 1),
(party_get_slot, ":siege_hardness", "$g_encountered_party", slot_center_siege_hardness),
(val_add, ":siege_hardness", 100),
(party_set_slot, "$g_encountered_party", slot_center_siege_hardness, ":siege_hardness"),
(party_set_slot, "$g_enemy_party", slot_party_retreat_flag, 1),
(try_for_range, ":troop_no", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
(gt, ":party_no", 0),
(party_slot_eq, ":party_no", slot_party_ai_state, spai_besieging_center),
(party_slot_eq, ":party_no", slot_party_ai_object, "$g_encountered_party"),
(party_slot_eq, ":party_no", slot_party_ai_substate, 1),
(call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
(call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, "$g_encountered_party"),
(try_end),
(display_message, "@The enemy has been forced to retreat. The assault is over, but the siege continues."),
(assign, "$g_battle_simulation_cancel_for_party", "$g_encountered_party"),
(leave_encounter),
(change_screen_return),
(assign, "$g_battle_simulation_auto_enter_town_after_battle", "$g_encountered_party"),
(try_end),
(try_end),
(try_end),
(assign, "$g_siege_first_encounter", 0),
(assign, "$new_encounter", 0),
],
[
("siege_defender_join_battle",
[
(neg|troop_is_wounded, "trp_player"),
],
"Join the battle.",[
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(assign, "$g_battle_result", 0),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_town_walls),
(else_try),
(party_get_slot, ":battle_scene", "$g_encountered_party", slot_castle_exterior),
(try_end),
(call_script, "script_calculate_battle_advantage"),
(val_mul, reg0, 2),
(val_div, reg0, 3), #scale down the advantage a bit.
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(party_slot_eq, "$current_town", slot_center_siege_with_belfry, 1),
(set_jump_mission,"mt_castle_attack_walls_belfry"),
(else_try),
(set_jump_mission,"mt_castle_attack_walls_ladder"),
(try_end),
(jump_to_scene,":battle_scene"),
(assign, "$g_next_menu", "mnu_siege_started_defender"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission)]),
("siege_defender_troops_join_battle",[(call_script, "script_party_count_members_with_full_health", "p_main_party"),
(this_or_next|troop_is_wounded, "trp_player"),
(ge, reg0, 3)],
"Order your men to join the battle without you.",[
(party_set_next_battle_simulation_time, "$g_encountered_party", -1),
(select_enemy,1),
(assign,"$g_enemy_party","$g_encountered_party_2"),
(assign,"$g_ally_party","$g_encountered_party"),
(assign,"$g_siege_join", 1),
(jump_to_menu,"mnu_siege_join_defense")]),
]
),
(
"siege_join_defense",mnf_disable_all_keys,
"{s4}^^Your casualties: {s8}^^Allies' casualties: {s9}^^Enemy casualties: {s10}",
"none",
[
(try_begin),
(eq, "$g_siege_join", 1),
(call_script, "script_party_calculate_strength", "p_main_party", 1), #skip player
(assign, ":player_party_strength", reg0),
(val_div, ":player_party_strength", 5),
(else_try),
(assign, ":player_party_strength", 0),
(try_end),
(call_script, "script_party_calculate_strength", "p_collective_ally", 0),
(assign, ":ally_party_strength", reg0),
(val_div, ":ally_party_strength", 5),
(call_script, "script_party_calculate_strength", "p_collective_enemy", 0),
(assign, ":enemy_party_strength", reg0),
(val_div, ":enemy_party_strength", 10),
(store_add, ":friend_party_strength", ":player_party_strength", ":ally_party_strength"),
(try_begin),
(eq, ":friend_party_strength", 0),
(store_div, ":enemy_party_strength_for_p", ":enemy_party_strength", 2),
(else_try),
(assign, ":enemy_party_strength_for_p", ":enemy_party_strength"),
(val_mul, ":enemy_party_strength_for_p", ":player_party_strength"),
(val_div, ":enemy_party_strength_for_p", ":friend_party_strength"),
(try_end),
(val_sub, ":enemy_party_strength", ":enemy_party_strength_for_p"),
(inflict_casualties_to_party_group, "p_main_party", ":enemy_party_strength_for_p", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s8, s0),
(inflict_casualties_to_party_group, "$g_ally_party", ":enemy_party_strength", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s9, s0),
(party_collect_attachments_to_party, "$g_ally_party", "p_collective_ally"),
(inflict_casualties_to_party_group, "$g_enemy_party", ":friend_party_strength", "p_temp_casualties"),
(call_script, "script_print_casualties_to_s0", "p_temp_casualties", 0),
(str_store_string_reg, s10, s0),
(party_collect_attachments_to_party, "$g_enemy_party", "p_collective_enemy"),
(try_begin),
(call_script, "script_party_count_members_with_full_health","p_main_party"),
(le, reg0, 0),
(str_store_string, s4, "str_siege_defender_order_attack_failure"),
(else_try),
(call_script, "script_party_count_members_with_full_health","p_collective_enemy"),
(le, reg0, 0),
(assign, "$g_battle_result", 1),
(str_store_string, s4, "str_siege_defender_order_attack_success"),
(else_try),
(str_store_string, s4, "str_siege_defender_order_attack_continue"),
(try_end),
],
[
("continue",[],"Continue...",[
(jump_to_menu,"mnu_siege_started_defender"),
]),
]
),
(
"enter_your_own_castle",0,
"{s10}",
"none",
[
(try_begin),
(neg|is_between, "$players_kingdom", npc_kingdoms_begin, npc_kingdoms_end),
(faction_get_slot, ":faction_leader", "fac_player_supporters_faction", slot_faction_leader),
(eq, ":faction_leader", "trp_player"),
(str_store_string, s10, "@As you approach, you are spotted by the castle guards, who welcome you and open the gates for their {king/queen}."),
(else_try),
(str_store_string, s10, "@As you approach, you are spotted by the castle guards, who welcome you and open the gates for their {lord/lady}."),
(try_end),
(str_store_party_name, s2, "$current_town"),
],
[
("continue",[],"Continue...",
[ (jump_to_menu,"mnu_town"),
]),
],
),
(
"village",mnf_enable_hot_keys,
"{s10} {s12}^{s11}^{s6}{s7}",
"none",
[
(assign, "$current_town", "$g_encountered_party"),
(call_script, "script_update_center_recon_notes", "$current_town"),
(assign, "$g_defending_against_siege", 0), #required for bandit check
(assign, "$g_battle_result", 0),
(assign, "$qst_collect_taxes_currently_collecting", 0),
(assign, "$qst_train_peasants_against_bandits_currently_training", 0),
(try_begin),
(gt, "$auto_enter_menu_in_center", 0),
(jump_to_menu, "$auto_enter_menu_in_center"),
(assign, "$auto_enter_menu_in_center", 0),
(try_end),
(try_begin),
(neq, "$g_player_raiding_village", "$current_town"),
(assign, "$g_player_raiding_village", 0),
(else_try),
(jump_to_menu, "mnu_village_loot_continue"),
(try_end),
(try_begin),#Fix for collecting taxes
(eq, "$g_town_visit_after_rest", 1),
(assign, "$g_town_visit_after_rest", 0),
(try_end),
(str_store_party_name,s2, "$current_town"),
(party_get_slot, ":center_lord", "$current_town", slot_town_lord),
(store_faction_of_party, ":center_faction", "$current_town"),
(str_store_faction_name,s9,":center_faction"),
(try_begin),
(ge, ":center_lord", 0),
(str_store_troop_name,s8,":center_lord"),
(str_store_string,s7,"@{s8} of {s9}"),
(try_end),
(str_clear, s10),
(str_clear, s12),
(try_begin),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
(str_store_string, s60, s2),
(party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
(try_begin),
(eq, "$cheat_mode", 1),
(assign, reg4, ":prosperity",),
(display_message, "@{!}Prosperity: {reg4}"),
(try_end),
#(val_add, ":prosperity", 5),
(store_div, ":str_id", ":prosperity", 10),
(val_min, ":str_id", 9),
(val_add, ":str_id", "str_village_prosperity_0"),
(str_store_string, s10, ":str_id"),
(store_div, ":str_id", ":prosperity", 20),
(val_min, ":str_id", 4),
(try_begin),
(is_between, "$current_town", "p_village_91", villages_end),
(val_add, ":str_id", "str_oasis_village_alt_prosperity_0"),
(else_try),
(val_add, ":str_id", "str_village_alt_prosperity_0"),
(try_end),
(str_store_string, s12, ":str_id"),
(try_end),
(str_clear, s11),
(try_begin),
(party_slot_eq, "$current_town", slot_village_state, svs_looted),
(else_try),
(eq, ":center_lord", "trp_player"),
(str_store_string,s11,"@ This village and the surrounding lands belong to you."),
(else_try),
(ge, ":center_lord", 0),
(str_store_string,s11,"@ You remember that this village and the surrounding lands belong to {s7}."),
(else_try),
(str_store_string,s11,"@ These lands belong to no one."),
(try_end),
(str_clear, s7),
(try_begin),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(call_script, "script_describe_center_relation_to_s3", ":center_relation"),
(assign, reg9, ":center_relation"),
(str_store_string, s7, "@{!} {s3} ({reg9})."),
(try_end),
(str_clear, s6),
(try_begin),
(party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(party_get_slot, ":bandit_troop", "$current_town", slot_village_infested_by_bandits),
(store_character_level, ":player_level", "trp_player"),
(store_add, "$qst_eliminate_bandits_infesting_village_num_bandits", ":player_level", 10),
(val_mul, "$qst_eliminate_bandits_infesting_village_num_bandits", 12),
(val_div, "$qst_eliminate_bandits_infesting_village_num_bandits", 10),
(store_random_in_range, "$qst_eliminate_bandits_infesting_village_num_villagers", 25, 30),
(assign, reg8, "$qst_eliminate_bandits_infesting_village_num_bandits"),
(str_store_troop_name_by_count, s35, ":bandit_troop", "$qst_eliminate_bandits_infesting_village_num_bandits"),
(str_store_string, s6, "@ The village is infested by {reg8} {s35}."),
(assign, "$g_enemy_party", -1), #new, no known enemy party while saving village from bandits dfdf
(assign, "$g_ally_party", -1), #new, no known enemy party while saving village from bandits dfdf
(try_begin),
(eq, ":bandit_troop", "trp_forest_bandit"),
(set_background_mesh, "mesh_pic_forest_bandits"),
(else_try),
(eq, ":bandit_troop", "trp_steppe_bandit"),
(set_background_mesh, "mesh_pic_steppe_bandits"),
(else_try),
(eq, ":bandit_troop", "trp_taiga_bandit"),
(set_background_mesh, "mesh_pic_steppe_bandits"),
(else_try),
(eq, ":bandit_troop", "trp_mountain_bandit"),
(set_background_mesh, "mesh_pic_mountain_bandits"),
(else_try),
(eq, ":bandit_troop", "trp_sea_raider"),
(set_background_mesh, "mesh_pic_sea_raiders"),
(else_try),
(set_background_mesh, "mesh_pic_bandits"),
(try_end),
(else_try),
(party_slot_eq, "$current_town", slot_village_state, svs_looted),
(str_store_string, s6, "@ The village has been looted. A handful of souls scatter as you pass through the burnt out houses."),
(try_begin),
(neq, "$g_player_raid_complete", 1),
(play_track, "track_empty_village", 1),
(try_end),
(set_background_mesh, "mesh_pic_looted_village"),
(else_try),
(party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
(str_store_string, s6, "@ The village is being raided."),
(else_try),
(party_get_current_terrain, ":cur_terrain", "$current_town"),
(try_begin),
(this_or_next|eq, ":cur_terrain", rt_steppe),
(this_or_next|eq, ":cur_terrain", rt_steppe_forest),
(this_or_next|eq, ":cur_terrain", rt_desert),
( eq, ":cur_terrain", rt_desert_forest),
(set_background_mesh, "mesh_pic_village_s"),
(else_try),
(this_or_next|eq, ":cur_terrain", rt_snow),
( eq, ":cur_terrain", rt_snow_forest),
(set_background_mesh, "mesh_pic_village_w"),
(else_try),
(set_background_mesh, "mesh_pic_village_p"),
(try_end),
(try_end),
(try_begin),
(eq, "$g_player_raid_complete", 1),
(assign, "$g_player_raid_complete", 0),
(jump_to_menu, "mnu_village_loot_complete"),
(else_try),
(party_get_slot, ":raider_party", "$current_town", slot_village_raided_by),
(gt, ":raider_party", 0),
# Process here...
(try_end),
(try_begin),
(eq,"$g_leave_town",1),
(assign,"$g_leave_town",0),
(change_screen_return),
(try_end),
(try_begin),
(store_time_of_day, ":cur_hour"),
(ge, ":cur_hour", 5),
(lt, ":cur_hour", 21),
(assign, "$town_nighttime", 0),
(else_try),
(assign, "$town_nighttime", 1),
(try_end),
],
[
("village_manage",
[
(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player")
]
,"Manage this village.",
[
(assign, "$g_next_menu", "mnu_village"),
(jump_to_menu, "mnu_center_manage"),
]),
("recruit_volunteers",
[
(call_script, "script_cf_village_recruit_volunteers_cond"),
]
,"Recruit Volunteers.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_volunteers"),
(try_end),
]),
("village_center",[(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),]
,"Go to the village center.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(party_get_slot, ":village_scene", "$current_town", slot_castle_exterior),
(modify_visitors_at_site,":village_scene"),
(reset_visitors),
(party_get_slot, ":village_elder_troop", "$current_town",slot_town_elder),
(set_visitor, 11, ":village_elder_troop"),
(call_script, "script_init_town_walkers"),
(try_begin),
(check_quest_active, "qst_hunt_down_fugitive"),
(neg|is_currently_night),
(quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_target_center, "$current_town"),
(neg|check_quest_succeeded, "qst_hunt_down_fugitive"),
(neg|check_quest_failed, "qst_hunt_down_fugitive"),
(set_visitor, 45, "trp_fugitive"),
(try_end),
(set_jump_mission,"mt_village_center"),
(jump_to_scene,":village_scene"),
(change_screen_mission),
(try_end),
],"Door to the village center."),
("village_buy_food",[(party_slot_eq, "$current_town", slot_village_state, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
],"Buy supplies from the peasants.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(party_get_slot, ":merchant_troop", "$current_town", slot_town_elder),
(change_screen_trade, ":merchant_troop"),
(try_end),
]),
("village_attack_bandits",[(party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),],
"Attack the bandits.",
[(party_get_slot, ":bandit_troop", "$current_town", slot_village_infested_by_bandits),
(party_get_slot, ":scene_to_use", "$current_town", slot_castle_exterior),
(modify_visitors_at_site,":scene_to_use"),
(reset_visitors),
(set_visitors, 0, ":bandit_troop", "$qst_eliminate_bandits_infesting_village_num_bandits"),
(set_visitors, 2, "trp_farmer", "$qst_eliminate_bandits_infesting_village_num_villagers"),
(set_party_battle_mode),
(set_battle_advantage, 0),
(assign, "$g_battle_result", 0),
(set_jump_mission,"mt_village_attack_bandits"),
(jump_to_scene, ":scene_to_use"),
(assign, "$g_next_menu", "mnu_village_infest_bandits_result"),
(jump_to_menu, "mnu_battle_debrief"),
(assign, "$g_mt_mode", vba_normal),
(change_screen_mission),
]),
("village_wait",
[(party_slot_eq, "$current_town", slot_center_has_manor, 1),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
],
"Wait here for some time.",
[
(assign,"$auto_enter_town","$current_town"),
(assign, "$g_last_rest_center", "$current_town"),
(try_begin),
(party_is_active, "p_main_party"),
(party_get_current_terrain, ":cur_terrain", "p_main_party"),
(try_begin),
(eq, ":cur_terrain", rt_desert),
(unlock_achievement, ACHIEVEMENT_SARRANIDIAN_NIGHTS),
(try_end),
(try_end),
(rest_for_hours_interactive, 24 * 7, 5, 1), #rest while attackable
(change_screen_return),
]),
("collect_taxes_qst",[(party_slot_eq, "$current_town", slot_village_state, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(check_quest_active, "qst_collect_taxes"),
(quest_get_slot, ":quest_giver_troop", "qst_collect_taxes", slot_quest_giver_troop),
(quest_slot_eq, "qst_collect_taxes", slot_quest_target_center, "$current_town"),
(neg|quest_slot_eq, "qst_collect_taxes", slot_quest_current_state, 4),
(str_store_troop_name, s1, ":quest_giver_troop"),
(quest_get_slot, reg5, "qst_collect_taxes", slot_quest_current_state),
], "{reg5?Continue collecting taxes:Collect taxes} due to {s1}.",
[(jump_to_menu, "mnu_collect_taxes"),]),
("train_peasants_against_bandits_qst",
[
(party_slot_eq, "$current_town", slot_village_state, 0),
(check_quest_active, "qst_train_peasants_against_bandits"),
(neg|check_quest_concluded, "qst_train_peasants_against_bandits"),
(quest_slot_eq, "qst_train_peasants_against_bandits", slot_quest_target_center, "$current_town"),
], "Train the peasants.",
[(jump_to_menu, "mnu_train_peasants_against_bandits"),]),
("village_hostile_action",[(party_slot_eq, "$current_town", slot_village_state, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(neq, "$players_kingdom", "$g_encountered_party_faction"),
], "Take a hostile action.",
[(jump_to_menu,"mnu_village_hostile_action"),
]),
("village_reports",[(eq, "$cheat_mode", 1),], "{!}CHEAT! Show reports.",
[(jump_to_menu,"mnu_center_reports"),
]),
("village_leave",[],"Leave...",[(change_screen_return,0)]),
],
),
(
"village_hostile_action",0,
"What action do you have in mind?",
"none",
[],
[
("village_take_food",[
(party_slot_eq, "$current_town", slot_village_state, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(party_get_slot, ":merchant_troop", "$current_town", slot_town_elder),
(assign, ":town_stores_not_empty", 0),
(try_for_range, ":slot_no", num_equipment_kinds, max_inventory_items + num_equipment_kinds),
(troop_get_inventory_slot, ":slot_item", ":merchant_troop", ":slot_no"),
(ge, ":slot_item", 0),
(assign, ":town_stores_not_empty", 1),
(try_end),
(eq, ":town_stores_not_empty", 1),
],"Force the peasants to give you supplies.",
[
(jump_to_menu, "mnu_village_take_food_confirm")
]),
("village_steal_cattle",
[
(party_slot_eq, "$current_town", slot_village_state, 0),
(party_slot_eq, "$current_town", slot_village_player_can_not_steal_cattle, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(party_get_slot, ":num_cattle", "$current_town", slot_village_number_of_cattle),
(neg|party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(gt, ":num_cattle", 0),
],"Steal cattle.",
[
(jump_to_menu, "mnu_village_steal_cattle_confirm")
]),
("village_loot",[(party_slot_eq, "$current_town", slot_village_state, 0),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(store_faction_of_party, ":center_faction", "$current_town"),
(store_relation, ":reln", "fac_player_supporters_faction", ":center_faction"),
(lt, ":reln", 0),
],
"Loot and burn this village.",
[
# (party_clear, "$current_town"),
# (party_add_template, "$current_town", "pt_villagers_in_raid"),
(jump_to_menu, "mnu_village_start_attack"),
]),
("forget_it",[],
"Forget it.",[(jump_to_menu,"mnu_village")]),
],
),
(
"recruit_volunteers",0,
"{s18}",
"none",
[(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 10),#10 denars per man
(assign, ":party_capacity", ":free_capacity"),
(val_min, ":party_capacity", ":gold_capacity"),
(try_begin),
(gt, ":party_capacity", 0),
(val_min, ":volunteer_amount", ":party_capacity"),
(try_end),
(assign, reg5, ":volunteer_amount"),
(assign, reg7, 0),
(try_begin),
(gt, ":volunteer_amount", ":gold_capacity"),
(assign, reg7, 1), #not enough money
(try_end),
(try_begin),
(eq, ":volunteer_amount", 0),
(str_store_string, s18, "@No one here seems to be willing to join your party."),
(else_try),
(store_mul, reg6, ":volunteer_amount", 10),#10 denars per man
(str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
(try_begin),
(eq, reg5, 1),
(str_store_string, s18, "@One {s3} volunteers to follow you."),
(else_try),
(str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
(try_end),
(set_background_mesh, "mesh_pic_recruits"),
(try_end),
],
[
("continue_not_enough_gold",
[
(eq, reg7, 1),
],
"I don't have enough money...",
[
(jump_to_menu,"mnu_village"),
]),
("continue",
[
(eq, reg7, 0),
(eq, reg5, 0),
], #noone willing to join
"Continue...",
[
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(jump_to_menu,"mnu_village"),
]),
("recruit_them",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Recruit them ({reg6} denars).",
[
(call_script, "script_village_recruit_volunteers_recruit"),
(jump_to_menu,"mnu_village"),
]),
("forget_it",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Forget it.",
[
(jump_to_menu,"mnu_village"),
]),
],
),
(
"village_hunt_down_fugitive_defeated",0,
"A heavy blow from the fugitive sends you to the ground, and your vision spins and goes dark.\
Time passes. When you open your eyes again you find yourself battered and bloody,\
but luckily none of the wounds appear to be lethal.",
"none",
[],
[
("continue",[],"Continue...",[(jump_to_menu, "mnu_village"),]),
],
),
(
"village_infest_bandits_result",mnf_scale_picture,
"{s9}",
"none",
[(try_begin),
(eq, "$g_battle_result", 1),
(jump_to_menu, "mnu_village_infestation_removed"),
(else_try),
(str_store_string, s9, "@Try as you might, you could not defeat the bandits.\
Infuriated, they raze the village to the ground to punish the peasants,\
and then leave the burning wasteland behind to find greener pastures to plunder."),
(set_background_mesh, "mesh_pic_looted_village"),
(try_end),
],
[
("continue",[],"Continue...",
[(party_set_slot, "$g_encountered_party", slot_village_infested_by_bandits, 0),
(call_script, "script_village_set_state", "$current_town", svs_looted),
(party_set_slot, "$current_town", slot_village_raid_progress, 0),
(party_set_slot, "$current_town", slot_village_recover_progress, 0),
(try_begin),
(check_quest_active, "qst_eliminate_bandits_infesting_village"),
(quest_slot_eq, "qst_eliminate_bandits_infesting_village", slot_quest_target_center, "$g_encountered_party"),
(call_script, "script_change_player_relation_with_center", "$g_encountered_party", -5),
(call_script, "script_fail_quest", "qst_eliminate_bandits_infesting_village"),
(call_script, "script_end_quest", "qst_eliminate_bandits_infesting_village"),
(else_try),
(check_quest_active, "qst_deal_with_bandits_at_lords_village"),
(quest_slot_eq, "qst_deal_with_bandits_at_lords_village", slot_quest_target_center, "$g_encountered_party"),
(call_script, "script_change_player_relation_with_center", "$g_encountered_party", -4),
(call_script, "script_fail_quest", "qst_deal_with_bandits_at_lords_village"),
(call_script, "script_end_quest", "qst_deal_with_bandits_at_lords_village"),
(else_try),
(call_script, "script_change_player_relation_with_center", "$g_encountered_party", -3),
(try_end),
(jump_to_menu, "mnu_village"),]),
],
),
(
"village_infestation_removed",mnf_disable_all_keys,
"In a battle worthy of song, you and your men drive the bandits out of the village, making it safe once more.\
The villagers have little left in the way of wealth after their ordeal,\
but they offer you all they can find.",
"none",
[(party_get_slot, ":bandit_troop", "$g_encountered_party", slot_village_infested_by_bandits),
(party_set_slot, "$g_encountered_party", slot_village_infested_by_bandits, 0),
(party_clear, "p_temp_party"),
(party_add_members, "p_temp_party", ":bandit_troop", "$qst_eliminate_bandits_infesting_village_num_bandits"),
(assign, "$g_strength_contribution_of_player", 50),
(call_script, "script_party_give_xp_and_gold", "p_temp_party"),
(try_begin),
(check_quest_active, "qst_eliminate_bandits_infesting_village"),
(quest_slot_eq, "qst_eliminate_bandits_infesting_village", slot_quest_target_center, "$g_encountered_party"),
(call_script, "script_end_quest", "qst_eliminate_bandits_infesting_village"),
#Add quest reward
(call_script, "script_change_player_relation_with_center", "$g_encountered_party", 5),
(else_try),
(check_quest_active, "qst_deal_with_bandits_at_lords_village"),
(quest_slot_eq, "qst_deal_with_bandits_at_lords_village", slot_quest_target_center, "$g_encountered_party"),
(call_script, "script_succeed_quest", "qst_deal_with_bandits_at_lords_village"),
(call_script, "script_change_player_relation_with_center", "$g_encountered_party", 3),
(else_try),
#Add normal reward
(call_script, "script_change_player_relation_with_center", "$g_encountered_party", 4),
(try_end),
(party_get_slot, ":merchant_troop", "$current_town", slot_town_elder),
(try_for_range, ":slot_no", num_equipment_kinds ,max_inventory_items + num_equipment_kinds),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 70),
(troop_set_inventory_slot, ":merchant_troop", ":slot_no", -1),
(try_end),
],
[
("village_bandits_defeated_accept",[],"Take it as your just due.",[(jump_to_menu, "mnu_village"),
(party_get_slot, ":merchant_troop", "$current_town", slot_town_elder),
(troop_sort_inventory, ":merchant_troop"),
(change_screen_loot, ":merchant_troop"),
]),
("village_bandits_defeated_cont",[], "Refuse, stating that they need these items more than you do.",
[ (call_script, "script_change_player_relation_with_center", "$g_encountered_party", 3),
(call_script, "script_change_player_honor", 1),
(jump_to_menu, "mnu_village")]),
],
),
(
"center_manage",0,
"{s19}^{reg6?^^You are\
currently building {s7}. The building will be completed after {reg8} day{reg9?s:}.:}",
"none",
[(assign, ":num_improvements", 0),
(str_clear, s18),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(assign, ":begin", village_improvements_begin),
(assign, ":end", village_improvements_end),
(str_store_string, s17, "@village"),
(else_try),
(assign, ":begin", walled_center_improvements_begin),
(assign, ":end", walled_center_improvements_end),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(str_store_string, s17, "@town"),
(else_try),
(str_store_string, s17, "@castle"),
(try_end),
(try_for_range, ":improvement_no", ":begin", ":end"),
(party_slot_ge, "$g_encountered_party", ":improvement_no", 1),
(val_add, ":num_improvements", 1),
(call_script, "script_get_improvement_details", ":improvement_no"),
(try_begin),
(eq, ":num_improvements", 1),
(str_store_string, s18, "@{!}{s0}"),
(else_try),
(str_store_string, s18, "@{!}{s18}, {s0}"),
(try_end),
(try_end),
(try_begin),
(eq, ":num_improvements", 0),
(str_store_string, s19, "@The {s17} has no improvements."),
(else_try),
(str_store_string, s19, "@The {s17} has the following improvements:{s18}."),
(try_end),
(assign, reg6, 0),
(try_begin),
(party_get_slot, ":cur_improvement", "$g_encountered_party", slot_center_current_improvement),
(gt, ":cur_improvement", 0),
(call_script, "script_get_improvement_details", ":cur_improvement"),
(str_store_string, s7, s0),
(assign, reg6, 1),
(store_current_hours, ":cur_hours"),
(party_get_slot, ":finish_time", "$g_encountered_party", slot_center_improvement_end_hour),
(val_sub, ":finish_time", ":cur_hours"),
(store_div, reg8, ":finish_time", 24),
(val_max, reg8, 1),
(store_sub, reg9, reg8, 1),
(try_end),
],
[
("center_build_manor",[(eq, reg6, 0),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(party_slot_eq, "$g_encountered_party", slot_center_has_manor, 0),
],
"Build a manor.",[(assign, "$g_improvement_type", slot_center_has_manor),
(jump_to_menu, "mnu_center_improve"),]),
("center_build_fish_pond",[(eq, reg6, 0),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(party_slot_eq, "$g_encountered_party", slot_center_has_fish_pond, 0),
],
"Build a mill.",[(assign, "$g_improvement_type", slot_center_has_fish_pond),
(jump_to_menu, "mnu_center_improve"),]),
("center_build_watch_tower",[(eq, reg6, 0),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(party_slot_eq, "$g_encountered_party", slot_center_has_watch_tower, 0),
],
"Build a watch tower.",[(assign, "$g_improvement_type", slot_center_has_watch_tower),
(jump_to_menu, "mnu_center_improve"),]),
("center_build_school",[(eq, reg6, 0),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(party_slot_eq, "$g_encountered_party", slot_center_has_school, 0),
],
"Build a school.",[(assign, "$g_improvement_type", slot_center_has_school),
(jump_to_menu, "mnu_center_improve"),]),
("center_build_messenger_post",[(eq, reg6, 0),
(party_slot_eq, "$g_encountered_party", slot_center_has_messenger_post, 0),
],
"Build a messenger post.",[(assign, "$g_improvement_type", slot_center_has_messenger_post),
(jump_to_menu, "mnu_center_improve"),]),
("center_build_prisoner_tower",[(eq, reg6, 0),
(this_or_next|party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle),
(party_slot_eq, "$g_encountered_party", slot_center_has_prisoner_tower, 0),
],
"Build a prisoner tower.",[(assign, "$g_improvement_type", slot_center_has_prisoner_tower),
(jump_to_menu, "mnu_center_improve"),]),
("go_back_dot",[],"Go back.",[(jump_to_menu, "$g_next_menu")]),
],
),
(
"center_improve",0,
"{s19} As the party member with the highest engineer skill ({reg2}), {reg3?you reckon:{s3} reckons} that building the {s4} will cost you\
{reg5} denars and will take {reg6} days.",
"none",
[(call_script, "script_get_improvement_details", "$g_improvement_type"),
(assign, ":improvement_cost", reg0),
(str_store_string, s4, s0),
(str_store_string, s19, s1),
(call_script, "script_get_max_skill_of_player_party", "skl_engineer"),
(assign, ":max_skill", reg0),
(assign, ":max_skill_owner", reg1),
(assign, reg2, ":max_skill"),
(store_sub, ":multiplier", 20, ":max_skill"),
(val_mul, ":improvement_cost", ":multiplier"),
(val_div, ":improvement_cost", 20),
(store_div, ":improvement_time", ":improvement_cost", 100),
(val_add, ":improvement_time", 3),
(assign, reg5, ":improvement_cost"),
(assign, reg6, ":improvement_time"),
(try_begin),
(eq, ":max_skill_owner", "trp_player"),
(assign, reg3, 1),
(else_try),
(assign, reg3, 0),
(str_store_troop_name, s3, ":max_skill_owner"),
(try_end),
],
[
("improve_cont",[(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", reg5)],
"Go on.", [(troop_remove_gold, "trp_player", reg5),
(party_set_slot, "$g_encountered_party", slot_center_current_improvement, "$g_improvement_type"),
(store_current_hours, ":cur_hours"),
(store_mul, ":hours_takes", reg6, 24),
(val_add, ":hours_takes", ":cur_hours"),
(party_set_slot, "$g_encountered_party", slot_center_improvement_end_hour, ":hours_takes"),
(jump_to_menu,"mnu_center_manage"),
]),
("forget_it",[(store_troop_gold, ":cur_gold", "trp_player"),
(ge, ":cur_gold", reg5)],
"Forget it.", [(jump_to_menu,"mnu_center_manage")]),
("improve_not_enough_gold",[(store_troop_gold, ":cur_gold", "trp_player"),
(lt, ":cur_gold", reg5)],
"I don't have enough money for that.", [(jump_to_menu, "mnu_center_manage"),]),
],
),
(
"town_bandits_failed",mnf_disable_all_keys,
"{s4} {s5}",
"none",
[
# (call_script, "script_loot_player_items", 0),
(store_troop_gold, ":total_gold", "trp_player"),
(store_div, ":gold_loss", ":total_gold", 30),
(store_random_in_range, ":random_loss", 40, 100),
(val_add, ":gold_loss", ":random_loss"),
(val_min, ":gold_loss", ":total_gold"),
(troop_remove_gold, "trp_player",":gold_loss"),
(party_set_slot, "$current_town", slot_center_has_bandits, 0),
(party_get_num_companions, ":num_companions", "p_main_party"),
(str_store_string, s4, "@The assasins beat you down and leave you for dead. ."),
(str_store_string, s4, "@You have fallen. The bandits quickly search your body for every coin they can find,\
then vanish into the night. They have left you alive, if only barely."),
(try_begin),
(gt, ":num_companions", 2),
(str_store_string, s5, "@Luckily some of your companions come to search for you when you do not return, and find you lying by the side of the road. They hurry you to safety and dress your wounds."),
(else_try),
(str_store_string, s5, "@Luckily some passing townspeople find you lying by the side of the road, and recognise you as something other than a simple beggar. They carry you to the nearest inn and dress your wounds."),
(try_end),
],
[
("continue",[],"Continue...",[(change_screen_return)]),
],
),
(
"town_bandits_succeeded",mnf_disable_all_keys,
"The bandits fall before you as wheat to a scythe! Soon you stand alone in the streets\
while most of your attackers lie unconscious, dead or dying.\
Searching the bodies, you find a purse which must have belonged to a previous victim of these brutes.\
Or perhaps, it was given to them by someone who wanted to arrange a suitable ending to your life.",
"none",
[
(party_set_slot, "$current_town", slot_center_has_bandits, 0),
(assign, "$g_last_defeated_bandits_town", "$g_encountered_party"),
(try_begin),
(check_quest_active, "qst_deal_with_night_bandits"),
(neg|check_quest_succeeded, "qst_deal_with_night_bandits"),
(quest_slot_eq, "qst_deal_with_night_bandits", slot_quest_target_center, "$g_encountered_party"),
(call_script, "script_succeed_quest", "qst_deal_with_night_bandits"),
(try_end),
(store_mul, ":xp_reward", "$num_center_bandits", 117),
(add_xp_to_troop, ":xp_reward", "trp_player"),
(store_mul, ":gold_reward", "$num_center_bandits", 50),
(call_script, "script_troop_add_gold","trp_player",":gold_reward"),
],
[
("continue",[],"Continue...",[(change_screen_return)]),
],
),
(
"village_steal_cattle_confirm",0,
"As the party member with the highest looting skill ({reg2}), {reg3?you reckon:{s1} reckons} that you can steal as many as {reg4} heads of village's cattle.",
"none",
[
(call_script, "script_get_max_skill_of_player_party", "skl_looting"),
(assign, reg2, reg0),
(assign, ":max_skill_owner", reg1),
(try_begin),
(eq, ":max_skill_owner", "trp_player"),
(assign, reg3, 1),
(else_try),
(assign, reg3, 0),
(str_store_troop_name, s1, ":max_skill_owner"),
(try_end),
(call_script, "script_calculate_amount_of_cattle_can_be_stolen", "$current_town"),
(assign, reg4, reg0),
],
[
("village_steal_cattle_confirm",[],"Go on.",
[
(rest_for_hours_interactive, 3, 5, 1), #rest while attackable
(assign, "$auto_menu", "mnu_village_steal_cattle"),
(change_screen_return),
]),
("forget_it",[],"Forget it.",[(change_screen_return)]),
],
),
(
"village_steal_cattle",mnf_disable_all_keys,
"{s1}",
"none",
[
(call_script, "script_calculate_amount_of_cattle_can_be_stolen", "$current_town"),
(assign, ":max_value", reg0),
(val_add, ":max_value", 1),
(store_random_in_range, ":random_value", 0, ":max_value"),
(party_set_slot, "$current_town", slot_village_player_can_not_steal_cattle, 1),
(party_get_slot, ":lord", "$current_town", slot_town_lord),
(try_begin),
(le, ":random_value", 0),
(call_script, "script_change_player_relation_with_center", "$current_town", -3),
(str_store_string, s1, "@You fail to steal any cattle."),
(else_try),
(assign, reg17, ":random_value"),
(store_sub, reg12, ":random_value", 1),
(try_begin),
(gt, ":lord", 0),
(call_script, "script_change_player_relation_with_troop", ":lord", -3),
(call_script, "script_add_log_entry", logent_player_stole_cattles_from_village, "trp_player", "$current_town", ":lord", "$g_encountered_party_faction"),
(try_end),
(call_script, "script_change_player_relation_with_center", "$current_town", -5),
(str_store_string, s1, "@You drive away {reg17} {reg12?heads:head} of cattle from the village's herd."),
(try_begin),
(eq, ":random_value", 3),
(unlock_achievement, ACHIEVEMENT_GOT_MILK),
(try_end),
(call_script, "script_create_cattle_herd", "$current_town", ":random_value"),
(party_get_slot, ":num_cattle", "$current_town", slot_village_number_of_cattle),
(val_sub, ":num_cattle", ":random_value"),
(party_set_slot, "$current_town", slot_village_number_of_cattle, ":num_cattle"),
(try_end),
],
[
("continue",[],"Continue...",
[
(change_screen_return),
]),
],
),
(
"village_take_food_confirm",0,
"It will be difficult to force and threaten the peasants into giving their precious supplies. You think you will need at least one hour.",
#TODO: mention looting skill?
"none",
[],
[
("village_take_food_confirm",[],"Go ahead.",
[
(rest_for_hours_interactive, 1, 5, 0), #rest while not attackable
(assign, "$auto_enter_town", "$current_town"),
(assign, "$g_town_visit_after_rest", 1),
(assign, "$auto_enter_menu_in_center", "mnu_village_take_food"),
(change_screen_return),
]),
("forget_it",[],"Forget it.",[(jump_to_menu, "mnu_village_hostile_action")]),
],
),
(
"village_take_food",0,
"The villagers grudgingly bring out what they have for you.",
"none",
[
(call_script, "script_party_count_members_with_full_health","p_main_party"),
(assign, ":player_party_size", reg0),
(call_script, "script_party_count_members_with_full_health","$current_town"),
(assign, ":villagers_party_size", reg0),
(try_begin),
(lt, ":player_party_size", 6),
(ge, ":villagers_party_size", 40),
(neg|party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(jump_to_menu, "mnu_village_start_attack"),
(try_end),
],
[
("take_supplies",[],"Take the supplies.",
[
(try_begin),
(party_slot_ge, "$current_town", slot_center_player_relation, -55),
(try_begin),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(call_script, "script_change_player_relation_with_center", "$current_town", -1),
(else_try),
(call_script, "script_change_player_relation_with_center", "$current_town", -3),
(try_end),
(try_end),
(party_get_slot, ":village_lord", "$current_town", slot_town_lord),
(try_begin),
(gt, ":village_lord", 1),
(call_script, "script_change_player_relation_with_troop", ":village_lord", -1),
(try_end),
(party_get_slot, ":merchant_troop", "$current_town", slot_town_elder),
(party_get_skill_level, ":player_party_looting", "p_main_party", "skl_looting"),
(val_mul, ":player_party_looting", 3),
(store_sub, ":random_chance", 70, ":player_party_looting"), #Increases the chance of looting by 3% per skill level
(try_for_range, ":slot_no", num_equipment_kinds ,max_inventory_items + num_equipment_kinds),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", ":random_chance"),
(troop_set_inventory_slot, ":merchant_troop", ":slot_no", -1),
(try_end),
###NPC companion changes begin
(call_script, "script_objectionable_action", tmt_humanitarian, "str_steal_from_villagers"),
#NPC companion changes end
#Troop commentary changes begin
(call_script, "script_add_log_entry", logent_village_extorted, "trp_player", "$current_town", -1, -1),
(store_faction_of_party,":village_faction", "$current_town"),
(call_script, "script_faction_inflict_war_damage_on_faction", "$players_kingdom", ":village_faction", 5),
#Troop commentary changes end
(jump_to_menu, "mnu_village"),
(troop_sort_inventory, ":merchant_troop"),
(change_screen_loot, ":merchant_troop"),
]),
("let_them_keep_it",[],"Let them keep it.",[(jump_to_menu, "mnu_village")]),
],
),
(
"village_start_attack",mnf_disable_all_keys|mnf_scale_picture,
"Some of the angry villagers grab their tools and prepare to resist you.\
It looks like you'll have a fight on your hands if you continue.",
"none",
[
(set_background_mesh, "mesh_pic_villageriot"),
(call_script, "script_party_count_members_with_full_health","p_main_party"),
(assign, ":player_party_size", reg0),
(call_script, "script_party_count_members_with_full_health","$current_town"),
(assign, ":villagers_party_size", reg0),
(try_begin),
(gt, ":player_party_size", 25),
(jump_to_menu, "mnu_village_loot_no_resist"),
(else_try),
(this_or_next|eq, ":villagers_party_size", 0),
(eq, "$g_battle_result", 1),
(try_begin),
(eq, "$g_battle_result", 1),
(store_random_in_range, ":enmity", -30, -15),
(call_script, "script_change_player_relation_with_center", "$current_town", ":enmity"),
(party_get_slot, ":town_lord", "$current_town", slot_town_lord),
(gt, ":town_lord", 0),
(call_script, "script_change_player_relation_with_troop", ":town_lord", -3),
(try_end),
(jump_to_menu, "mnu_village_loot_no_resist"),
(else_try),
(eq, "$g_battle_result", -1),
(jump_to_menu, "mnu_village_loot_defeat"),
(try_end),
],
[
("village_raid_attack",[],"Charge them.",[
(store_random_in_range, ":enmity", -10, -5),
(call_script, "script_change_player_relation_with_center", "$current_town", ":enmity"),
(try_begin),
(party_get_slot, ":town_lord", "$current_town", slot_town_lord),
(gt, ":town_lord", 0),
(call_script, "script_change_player_relation_with_troop", ":town_lord", -3),
(try_end),
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(assign, "$g_battle_result", 0),
(assign, "$g_village_raid_evil", 1),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$current_town", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(assign, "$g_next_menu", "mnu_village_start_attack"),
(call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
###NPC companion changes begin
(call_script, "script_objectionable_action", tmt_humanitarian, "str_loot_village"),
#NPC companion changes end
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
("village_raid_leave",[],"Leave this village alone.",[(change_screen_return)]),
],
),
(
"village_loot_no_resist",0,
"The villagers here are few and frightened, and they quickly scatter and run before you.\
The village is at your mercy.",
"none",
[],
[
("village_loot",[], "Plunder the village, then raze it.",
[
(call_script, "script_village_set_state", "$current_town", svs_being_raided),
(party_set_slot, "$current_town", slot_village_raided_by, "p_main_party"),
(assign,"$g_player_raiding_village","$current_town"),
(try_begin),
(store_faction_of_party, ":village_faction", "$current_town"),
(store_relation, ":relation", "$players_kingdom", ":village_faction"),
(ge, ":relation", 0),
(call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$current_town"),
(try_end),
(rest_for_hours, 3, 5, 1), #rest while attackable (3 hours will be extended by the trigger)
(change_screen_return),
]),
("village_raid_leave",[],"Leave this village alone.",[(change_screen_return)]),
],
),
(
"village_loot_complete",mnf_disable_all_keys,
"On your orders your troops sack the village, pillaging everything of any value,\
and then put the buildings to the torch. From the coins and valuables that are found, you get your share of {reg1} denars.",
"none",
[
(get_achievement_stat, ":number_of_village_raids", ACHIEVEMENT_THE_BANDIT, 0),
(get_achievement_stat, ":number_of_caravan_raids", ACHIEVEMENT_THE_BANDIT, 1),
(val_add, ":number_of_village_raids", 1),
(set_achievement_stat, ACHIEVEMENT_THE_BANDIT, 0, ":number_of_village_raids"),
(try_begin),
(ge, ":number_of_village_raids", 3),
(ge, ":number_of_caravan_raids", 3),
(unlock_achievement, ACHIEVEMENT_THE_BANDIT),
(try_end),
(party_get_slot, ":village_lord", "$current_town", slot_town_lord),
(try_begin),
(gt, ":village_lord", 0),
(call_script, "script_change_player_relation_with_troop", ":village_lord", -5),
(try_end),
(store_random_in_range, ":enmity", -35, -25),
(call_script, "script_change_player_relation_with_center", "$current_town", ":enmity"),
(store_faction_of_party, ":village_faction", "$current_town"),
(store_relation, ":relation", ":village_faction", "fac_player_supporters_faction"),
(try_begin),
(lt, ":relation", 0),
(call_script, "script_change_player_relation_with_faction", ":village_faction", -3),
(try_end),
(assign, ":money_gained", 50),
(party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
(store_mul, ":prosperity_of_village_mul_5", ":prosperity", 5),
(val_add, ":money_gained", ":prosperity_of_village_mul_5"),
(call_script, "script_troop_add_gold", "trp_player", ":money_gained"),
(assign, ":morale_increase", 3),
(store_div, ":money_gained_div_100", ":money_gained", 100),
(val_add, ":morale_increase", ":money_gained_div_100"),
(call_script, "script_change_player_party_morale", ":morale_increase"),
(faction_get_slot, ":faction_morale", ":village_faction", slot_faction_morale_of_player_troops),
(store_mul, ":morale_increase_mul_2", ":morale_increase", 200),
(val_sub, ":faction_morale", ":morale_increase_mul_2"),
(faction_set_slot, ":village_faction", slot_faction_morale_of_player_troops, ":faction_morale"),
#NPC companion changes begin
(call_script, "script_objectionable_action", tmt_humanitarian, "str_loot_village"),
#NPC companion changes end
(assign, reg1, ":money_gained"),
],
[
("continue",[], "Continue...",
[
(jump_to_menu, "mnu_close"),
(call_script, "script_calculate_amount_of_cattle_can_be_stolen", "$current_town"),
(assign, ":max_cattle", reg0),
(val_mul, ":max_cattle", 3),
(val_div, ":max_cattle", 2),
(party_get_slot, ":num_cattle", "$current_town", slot_village_number_of_cattle),
(val_min, ":max_cattle", ":num_cattle"),
(val_add, ":max_cattle", 1),
(store_random_in_range, ":random_value", 0, ":max_cattle"),
(try_begin),
(gt, ":random_value", 0),
(call_script, "script_create_cattle_herd", "$current_town", ":random_value"),
(val_sub, ":num_cattle", ":random_value"),
(party_set_slot, "$current_town", slot_village_number_of_cattle, ":num_cattle"),
(try_end),
(troop_clear_inventory, "trp_temp_troop"),
(reset_item_probabilities,100),
(troop_add_merchandise,"trp_temp_troop",itp_type_goods,45),
(troop_sort_inventory, "trp_temp_troop"),
(change_screen_loot, "trp_temp_troop"),
]),
],
),
(
"village_loot_defeat",mnf_scale_picture,
"Fighting with courage and determination, the villagers manage to hold together and drive off your forces.",
"none",
[
(set_background_mesh, "mesh_pic_villageriot"),
],
[
("continue",[],"Continue...",[(change_screen_return)]),
],
),
(
"village_loot_continue",0,
"Do you wish to continue looting this village?",
"none",
[],
[
("disembark_yes",[],"Yes.",[ (rest_for_hours, 3, 5, 1), #rest while attackable (3 hours will be extended by the trigger)
(change_screen_return),
]),
("disembark_no",[],"No.",[(call_script, "script_village_set_state", "$current_town", 0),
(party_set_slot, "$current_town", slot_village_raided_by, -1),
(assign, "$g_player_raiding_village", 0),
(change_screen_return)]),
],
),
(
"close",0,
"Nothing.",
"none",
[
(change_screen_return),
],
[],
),
(
"town",mnf_enable_hot_keys|mnf_scale_picture,
"{s10} {s14}^{s11}{s12}{s13}",
"none",
[
(try_begin),
(eq, "$sneaked_into_town", 1),
(call_script, "script_music_set_situation_with_culture", mtf_sit_town_infiltrate),
(else_try),
(call_script, "script_music_set_situation_with_culture", mtf_sit_travel),
(try_end),
(store_encountered_party, "$current_town"),
(call_script, "script_update_center_recon_notes", "$current_town"),
(assign, "$g_defending_against_siege", 0),
(str_clear, s3),
(party_get_battle_opponent, ":besieger_party", "$current_town"),
(store_faction_of_party, ":encountered_faction", "$g_encountered_party"),
(store_relation, ":faction_relation", ":encountered_faction", "fac_player_supporters_faction"),
(try_begin),
(gt, ":besieger_party", 0),
(ge, ":faction_relation", 0),
(store_faction_of_party, ":besieger_party_faction", ":besieger_party"),
(store_relation, ":besieger_party_relation", ":besieger_party_faction", "fac_player_supporters_faction"),
(lt, ":besieger_party_relation", 0),
(assign, "$g_defending_against_siege", 1),
(assign, "$g_siege_first_encounter", 1),
(jump_to_menu, "mnu_siege_started_defender"),
(try_end),
(try_begin),
(is_between, "$g_encountered_party", towns_begin, towns_end),
(store_sub, ":encountered_town_no", "$g_encountered_party", towns_begin),
(set_achievement_stat, ACHIEVEMENT_MIGRATING_COCONUTS, ":encountered_town_no", 1),
(assign, ":there_are_villages_not_visited", 0),
(try_for_range, ":cur_town", towns_begin, towns_end),
(store_sub, ":encountered_town_no", ":cur_town", towns_begin),
(get_achievement_stat, ":town_is_visited", ACHIEVEMENT_MIGRATING_COCONUTS, ":encountered_town_no"),
(eq, ":town_is_visited", 0),
(assign, ":there_are_villages_not_visited", 1),
(try_end),
(try_begin),
(eq, ":there_are_villages_not_visited", 0),
(unlock_achievement, ACHIEVEMENT_MIGRATING_COCONUTS),
(try_end),
(try_end),
#Quest menus
(assign, "$qst_collect_taxes_currently_collecting", 0),
(try_begin),
(gt, "$quest_auto_menu", 0),
(jump_to_menu, "$quest_auto_menu"),
(assign, "$quest_auto_menu", 0),
(try_end),
(try_begin),
## (eq, "$g_center_under_siege_battle", 1),
## (jump_to_menu,"mnu_siege_started_defender"),
## (else_try),
(eq, "$g_town_assess_trade_goods_after_rest", 1),
(assign, "$g_town_assess_trade_goods_after_rest", 0),
(jump_to_menu,"mnu_town_trade_assessment"),
(try_end),
(assign, "$talk_context", 0),
(assign,"$all_doors_locked",0),
(try_begin),
(eq, "$g_town_visit_after_rest", 1),
(assign, "$g_town_visit_after_rest", 0),
(assign, "$town_entered", 1),
(try_end),
(try_begin),
(eq,"$g_leave_town",1),
(assign,"$g_leave_town",0),
(assign,"$g_permitted_to_center",0),
(leave_encounter),
(change_screen_return),
(try_end),
(str_store_party_name, s2, "$current_town"),
(party_get_slot, ":center_lord", "$current_town", slot_town_lord),
(store_faction_of_party, ":center_faction", "$current_town"),
(str_store_faction_name, s9, ":center_faction"),
(try_begin),
(ge, ":center_lord", 0),
(str_store_troop_name,s8,":center_lord"),
(str_store_string,s7,"@{s8} of {s9}"),
(try_end),
(try_begin),
(party_slot_eq,"$current_town",slot_party_type, spt_town),
(str_store_string, s60, s2),
(party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
(try_begin),
(ge, "$cheat_mode", 1),
(assign, reg4, ":prosperity",),
(display_message, "@{!}DEBUG -- Prosperity: {reg4}"),
(try_end),
# (val_add, ":prosperity", 5),
(store_div, ":str_id", ":prosperity", 10),
(val_min, ":str_id", 9),
(val_add, ":str_id", "str_town_prosperity_0"),
(str_store_string, s10, ":str_id"),
(store_div, ":str_id", ":prosperity", 20),
(val_min, ":str_id", 4),
(val_add, ":str_id", "str_town_alt_prosperity_0"),
(str_store_string, s14, ":str_id"),
(else_try),
(str_clear, s14),
(str_store_string,s10,"@You are at {s2}."),
(try_end),
(try_begin),
(party_slot_eq,"$current_town",slot_party_type, spt_castle),
(try_begin),
(eq, ":center_lord", "trp_player"),
(str_store_string,s11,"@ Your own banner flies over the castle gate."),
(else_try),
(gt, ":center_lord", -1),
(troop_slot_eq, ":center_lord", slot_troop_spouse, "trp_player"),
(str_store_string,s11,"str__you_see_the_banner_of_your_wifehusband_s7_over_the_castle_gate"),
(else_try),
(ge, ":center_lord", 0),
(str_store_string,s11,"@ You see the banner of {s7} over the castle gate."),
(else_try),
## (str_store_string,s11,"@ This castle seems to belong to no one."),
(str_store_string,s11,"@ This castle has no garrison."),
(try_end),
(else_try),
(try_begin),
(eq, ":center_lord", "trp_player"),
(str_store_string,s11,"@ Your own banner flies over the town gates."),
(else_try),
(gt, ":center_lord", -1),
(troop_slot_eq, ":center_lord", slot_troop_spouse, "trp_player"),
(str_store_string,s11,"str__the_banner_of_your_wifehusband_s7_flies_over_the_town_gates"),
(else_try),
(ge, ":center_lord", 0),
(str_store_string,s11,"@ You see the banner of {s7} over the town gates."),
(else_try),
## (str_store_string,s11,"@ The townsfolk here have declared their independence."),
(str_store_string,s11,"@ This town has no garrison."),
(try_end),
(try_end),
(str_clear, s12),
(try_begin),
(party_slot_eq,"$current_town",slot_party_type, spt_town),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(call_script, "script_describe_center_relation_to_s3", ":center_relation"),
(assign, reg9, ":center_relation"),
(str_store_string, s12, "@{!} {s3} ({reg9})."),
(try_end),
(str_clear, s13),
(try_begin),
(gt,"$entry_to_town_forbidden",0),
(str_store_string, s13, "@ You have successfully sneaked in."),
(else_try),
(faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, ":center_faction", slot_faction_ai_object, "$current_town"),
(str_store_string, s13, "str__the_lord_is_currently_holding_a_feast_in_his_hall"),
(try_end),
#forbidden to enter?
(try_begin),
(store_time_of_day,reg(12)),
(ge,reg(12),5),
(lt,reg(12),21),
(assign,"$town_nighttime",0),
(else_try),
(assign,"$town_nighttime",1),
(party_slot_eq,"$current_town",slot_party_type, spt_town),
(str_store_string, s13, "str_town_nighttime"),
(try_end),
(try_begin),
(party_slot_ge, "$current_town", slot_town_has_tournament, 1),
(neg|is_currently_night),
(party_set_slot, "$current_town", slot_town_has_tournament, 1),
(str_store_string, s13, "@{s13} A tournament will be held here soon."),
(try_end),
(assign,"$castle_undefended",0),
(party_get_num_companions, ":castle_garrison_size", "p_collective_enemy"),
(try_begin),
(eq,":castle_garrison_size",0),
(assign,"$castle_undefended",1),
(try_end),
(call_script, "script_set_town_picture"),
# (str_clear, s5), #alert player that there are new rumors
# (try_begin),
# (eq, 1, 0),
# (neg|is_currently_night),
# (str_store_string, s5, "@^The buzz of excited voices as you come near the gate suggests to you that news of some import is circulating among the townsfolk."),
# (lt, "$last_town_log_entry_checked", "$num_log_entries"),
# (assign, "$g_town_rumor_log_entry", 0),
# (try_for_range, ":log_entry", "$last_town_log_entry_checked", "$num_log_entries"),
# (eq, ":log_entry", 4123), #placeholder to avoid having unused variable error message
# (try_end),
# (assign, "$last_town_log_entry_checked", "$num_log_entries"),
# (try_end),
],
[
("castle_castle",
[
(party_slot_eq,"$current_town",slot_party_type, spt_castle),
(eq, "$sneaked_into_town", 0),
(str_clear, s1),
(try_begin),
(store_faction_of_party, ":center_faction", "$current_town"),
(faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, ":center_faction", slot_faction_ai_object, "$current_town"),
(str_store_string, s1, "str__join_the_feast"),
(try_end),
],"Go to the Lord's hall{s1}.",
[
(try_begin),
(this_or_next|eq, "$all_doors_locked", 1),
(eq, "$sneaked_into_town", 1),
(display_message,"str_door_locked",0xFFFFAAAA),
(else_try),
(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 50),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 125),
(neq, "$g_player_eligible_feast_center_no", "$current_town"),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$g_encountered_party"),
(neg|check_quest_active, "qst_wed_betrothed"),
(neg|check_quest_active, "qst_wed_betrothed_female"),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin), #Married players always make the cut
(jump_to_menu, "mnu_cannot_enter_court"),
(else_try),
(assign, "$town_entered", 1),
(call_script, "script_enter_court", "$current_town"),
(try_end),
], "Door to the castle."),
("join_tournament", [(neg|is_currently_night),(party_slot_ge, "$current_town", slot_town_has_tournament, 1),]
,"Join the tournament.",
[
(call_script, "script_fill_tournament_participants_troop", "$current_town", 1),
(assign, "$g_tournament_cur_tier", 0),
(assign, "$g_tournament_player_team_won", -1),
(assign, "$g_tournament_bet_placed", 0),
(assign, "$g_tournament_bet_win_amount", 0),
(assign, "$g_tournament_last_bet_tier", -1),
(assign, "$g_tournament_next_num_teams", 0),
(assign, "$g_tournament_next_team_size", 0),
(jump_to_menu, "mnu_town_tournament"),
]),
("town_castle",[
(party_slot_eq,"$current_town",slot_party_type, spt_town),
(eq,"$entry_to_town_forbidden",0),
(str_clear, s1),
(try_begin),
(store_faction_of_party, ":center_faction", "$current_town"),
(faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, ":center_faction", slot_faction_ai_object, "$current_town"),
(str_store_string, s1, "str__join_the_feast"),
(try_end),
],"Go to the castle{s1}.",
[
(try_begin),
(this_or_next|eq, "$all_doors_locked", 1),
(eq, "$sneaked_into_town", 1),
(display_message,"str_door_locked",0xFFFFAAAA),
(else_try),
(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 50),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 125),
(neq, "$g_player_eligible_feast_center_no", "$current_town"),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$g_encountered_party"),
(neg|check_quest_active, "qst_wed_betrothed"),
(neg|check_quest_active, "qst_wed_betrothed_female"),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin), #Married players always make the cut
(jump_to_menu, "mnu_cannot_enter_court"),
(else_try),
(assign, "$town_entered", 1),
(call_script, "script_enter_court", "$current_town"),
(try_end),
], "Door to the castle."),
("town_center",
[
(party_slot_eq, "$current_town", slot_party_type, spt_town),
(this_or_next|eq,"$entry_to_town_forbidden",0),
(eq, "$sneaked_into_town",1)
],
"Take a walk around the streets.",
[
#If the player is fighting his or her way out
(try_begin),
(eq, "$talk_context", tc_prison_break),
(assign, "$talk_context", tc_escape),
(assign, "$g_mt_mode", tcm_escape),
(store_faction_of_party, ":town_faction", "$current_town"),
(faction_get_slot, ":tier_2_troop", ":town_faction", slot_faction_tier_3_troop),
(faction_get_slot, ":tier_3_troop", ":town_faction", slot_faction_tier_3_troop),
(faction_get_slot, ":tier_4_troop", ":town_faction", slot_faction_tier_4_troop),
(party_get_slot, ":town_scene", "$current_town", slot_town_center),
(modify_visitors_at_site, ":town_scene"),
(reset_visitors),
#ideally we could alarm troops at locations
(try_begin),
#if guards have not gone to some other important happening at nearby villages, then spawn 4 guards. (example : fire)
(party_get_slot, ":last_nearby_fire_time", "$current_town", slot_town_last_nearby_fire_time),
(store_current_hours, ":cur_time"),
(store_add, ":fire_finish_time", ":last_nearby_fire_time", fire_duration),
(neg|is_between, ":cur_time", ":last_nearby_fire_time", ":fire_finish_time"),
(store_time_of_day, ":cur_day_hour"),
(try_begin), #there are 6 guards at day time (no fire ext)
(ge, ":cur_day_hour", 6),
(lt, ":cur_day_hour", 22),
(set_visitors, 25, ":tier_2_troop", 2),
(set_visitors, 26, ":tier_2_troop", 1),
(set_visitors, 27, ":tier_3_troop", 2),
(set_visitors, 28, ":tier_4_troop", 1),
(else_try), #only 4 guards because of night
(set_visitors, 25, ":tier_2_troop", 1),
(set_visitors, 26, ":tier_2_troop", 1),
(set_visitors, 27, ":tier_3_troop", 1),
(set_visitors, 28, ":tier_4_troop", 1),
(try_end),
(else_try),
#if guards have gone to some other important happening at nearby villages, then spawn only 1 guard. (example : fire)
(store_time_of_day, ":cur_day_hour"),
(try_begin), #only 2 guard because there is a fire at one owned village
(ge, ":cur_day_hour", 6),
(lt, ":cur_day_hour", 22),
(set_visitors, 25, ":tier_2_troop", 1),
(set_visitors, 26, ":tier_2_troop", 0),
(set_visitors, 27, ":tier_3_troop", 1),
(set_visitors, 28, ":tier_4_troop", 0),
(else_try), #only 1 guard because both night and there is a fire at one owned village
(set_visitors, 25, ":tier_2_troop", 1),
(set_visitors, 26, ":tier_2_troop", 0),
(set_visitors, 27, ":tier_3_troop", 0),
(set_visitors, 28, ":tier_4_troop", 0),
(try_end),
(try_end),
(set_jump_mission,"mt_town_center"),
(jump_to_scene, ":town_scene"),
(change_screen_mission),
#If you're already at escape, then talk context will reset
(else_try),
(assign, "$talk_context", 0),
(call_script, "script_cf_enter_center_location_bandit_check"),
#All other circumstances...
(else_try),
(party_get_slot, ":town_scene", "$current_town", slot_town_center),
(modify_visitors_at_site, ":town_scene"),
(reset_visitors),
(assign, "$g_mt_mode", tcm_default),
(store_faction_of_party, ":town_faction","$current_town"),
(try_begin),
(neq, ":town_faction", "fac_player_supporters_faction"),
(faction_get_slot, ":troop_prison_guard", "$g_encountered_party_faction", slot_faction_prison_guard_troop),
(faction_get_slot, ":troop_castle_guard", "$g_encountered_party_faction", slot_faction_castle_guard_troop),
(faction_get_slot, ":tier_2_troop", ":town_faction", slot_faction_tier_2_troop),
(faction_get_slot, ":tier_3_troop", ":town_faction", slot_faction_tier_3_troop),
(else_try),
(party_get_slot, ":town_original_faction", "$current_town", slot_center_original_faction),
(faction_get_slot, ":troop_prison_guard", ":town_original_faction", slot_faction_prison_guard_troop),
(faction_get_slot, ":troop_castle_guard", ":town_original_faction", slot_faction_castle_guard_troop),
(faction_get_slot, ":tier_2_troop", ":town_original_faction", slot_faction_tier_2_troop),
(faction_get_slot, ":tier_3_troop", ":town_original_faction", slot_faction_tier_3_troop),
(try_end),
(try_begin), #think about this, should castle guard have to go nearby fire too? If he do not go, killing 2 armored guard is too hard for player. For now he goes too.
#if guards have not gone to some other important happening at nearby villages, then spawn 4 guards. (example : fire)
(party_get_slot, ":last_nearby_fire_time", "$current_town", slot_town_last_nearby_fire_time),
(store_current_hours, ":cur_time"),
(store_add, ":fire_finish_time", ":last_nearby_fire_time", fire_duration),
(neg|is_between, ":cur_time", ":last_nearby_fire_time", ":fire_finish_time"),
(set_visitor, 23, ":troop_castle_guard"),
(try_end),
(set_visitor, 24, ":troop_prison_guard"),
(try_begin),
(gt,":tier_2_troop", 0),
(assign,reg0,":tier_3_troop"),
(assign,reg1,":tier_3_troop"),
(assign,reg2,":tier_2_troop"),
(assign,reg3,":tier_2_troop"),
(else_try),
(assign,reg0,"trp_vaegir_infantry"),
(assign,reg1,"trp_vaegir_infantry"),
(assign,reg2,"trp_vaegir_archer"),
(assign,reg3,"trp_vaegir_footman"),
(try_end),
(shuffle_range,0,4),
(try_begin),
#if guards have not gone to some other important happening at nearby villages, then spawn 4 guards. (example : fire)
(party_get_slot, ":last_nearby_fire_time", "$current_town", slot_town_last_nearby_fire_time),
(store_current_hours, ":cur_time"),
(store_add, ":fire_finish_time", ":last_nearby_fire_time", fire_duration),
(neg|is_between, ":cur_time", ":last_nearby_fire_time", ":fire_finish_time"),
(set_visitor,25,reg0),
(set_visitor,26,reg1),
(set_visitor,27,reg2),
(set_visitor,28,reg3),
(try_end),
(party_get_slot, ":spawned_troop", "$current_town", slot_town_armorer),
(set_visitor, 9, ":spawned_troop"),
(party_get_slot, ":spawned_troop", "$current_town", slot_town_weaponsmith),
(set_visitor, 10, ":spawned_troop"),
(party_get_slot, ":spawned_troop", "$current_town", slot_town_elder),
(set_visitor, 11, ":spawned_troop"),
(party_get_slot, ":spawned_troop", "$current_town", slot_town_horse_merchant),
(set_visitor, 12, ":spawned_troop"),
(call_script, "script_init_town_walkers"),
(set_jump_mission,"mt_town_center"),
(assign, ":override_state", af_override_horse),
(try_begin),
(eq, "$sneaked_into_town", 1), #setup disguise
(assign, ":override_state", af_override_all),
(try_end),
(mission_tpl_entry_set_override_flags, "mt_town_center", 0, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_town_center", 2, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_town_center", 3, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_town_center", 4, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_town_center", 5, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_town_center", 6, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_town_center", 7, ":override_state"),
(try_begin),
(eq, "$town_entered", 0),
(assign, "$town_entered", 1),
(eq, "$town_nighttime", 0),
(set_jump_entry, 1),
(try_end),
(jump_to_scene, ":town_scene"),
(change_screen_mission),
(try_end),
],"Door to the town center."),
("town_tavern",[
(party_slot_eq,"$current_town",slot_party_type, spt_town),
(this_or_next|eq,"$entry_to_town_forbidden",0),
(eq, "$sneaked_into_town",1),
# (party_get_slot, ":scene", "$current_town", slot_town_tavern),
# (scene_slot_eq, ":scene", slot_scene_visited, 1), #check if scene has been visited before to allow entry from menu. Otherwise scene will only be accessible from the town center.
]
,"Visit the tavern.",
[
(try_begin),
(eq,"$all_doors_locked",1),
(display_message,"str_door_locked",0xFFFFAAAA),
(else_try),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(assign, "$town_entered", 1),
(set_jump_mission, "mt_town_default"),
(mission_tpl_entry_set_override_flags, "mt_town_default", 0, af_override_horse),
(try_begin),
(eq, "$sneaked_into_town",1),
(mission_tpl_entry_set_override_flags, "mt_town_default", 0, af_override_all),
(try_end),
(party_get_slot, ":cur_scene", "$current_town", slot_town_tavern),
(jump_to_scene, ":cur_scene"),
(scene_set_slot, ":cur_scene", slot_scene_visited, 1),
(assign, "$talk_context", tc_tavern_talk),
(call_script, "script_initialize_tavern_variables"),
(store_random_in_range, ":randomize_attacker_placement", 0, 4),
(modify_visitors_at_site, ":cur_scene"),
(reset_visitors),
(assign, ":cur_entry", 17),
#this is just a cheat right now
#(troop_set_slot, "trp_belligerent_drunk", slot_troop_cur_center, "$g_encountered_party"),
(try_begin),
(eq, "$cheat_mode", 1),
(troop_get_slot, ":drunk_location", "trp_belligerent_drunk", slot_troop_cur_center),
(try_begin),
(eq, "$cheat_mode", 0),
(else_try),
(is_between, ":drunk_location", centers_begin, centers_end),
(str_store_party_name, s4, ":drunk_location"),
(display_message, "str_belligerent_drunk_in_s4"),
(else_try),
(display_message, "str_belligerent_drunk_not_found"),
(try_end),
(troop_get_slot, ":promoter_location", "trp_fight_promoter", slot_troop_cur_center),
(try_begin),
(eq, "$cheat_mode", 0),
(else_try),
(is_between, ":promoter_location", centers_begin, centers_end),
(str_store_party_name, s4, ":promoter_location"),
(display_message, "str_roughlooking_character_in_s4"),
(else_try),
(display_message, "str_roughlooking_character_not_found"),
(try_end),
(try_end),
#this determines whether or not a lord who dislikes you will commission an assassin
(try_begin),
(store_current_hours, ":hours"),
(store_sub, ":hours_since_last_attempt", ":hours", "$g_last_assassination_attempt_time"),
(gt, ":hours_since_last_attempt", 168),
(try_for_range, ":lord", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":lord", slot_lord_reputation_type, lrep_debauched),
(troop_get_slot, ":led_party", ":lord", slot_troop_leaded_party),
(party_is_active, ":led_party"),
(party_get_attached_to, ":led_party_attached", ":led_party"),
(eq, ":led_party_attached", "$g_encountered_party"),
(call_script, "script_troop_get_relation_with_troop", "trp_player", ":lord"),
(lt, reg0, -20),
(assign, "$g_last_assassination_attempt_time", ":hours"),
# (assign, "$g_last_assassination_attempt_location", "$g_encountered_party"),
# (assign, "$g_last_assassination_attempt_perpetrator", ":lord"),
(troop_set_slot, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),
(try_end),
(try_end),
(try_begin),
(eq, ":randomize_attacker_placement", 0),
(call_script, "script_setup_tavern_attacker", ":cur_entry"),
(val_add, ":cur_entry", 1),
(try_end),
(try_begin),
(eq, 1, 0),
(troop_slot_eq, "trp_fight_promoter", slot_troop_cur_center, "$current_town"),
(set_visitor, ":cur_entry", "trp_fight_promoter"),
(val_add, ":cur_entry", 1),
(try_end),
(party_get_slot, ":mercenary_troop", "$current_town", slot_center_mercenary_troop_type),
(party_get_slot, ":mercenary_amount", "$current_town", slot_center_mercenary_troop_amount),
(try_begin),
(gt, ":mercenary_troop", 0),
(gt, ":mercenary_amount", 0),
(set_visitor, ":cur_entry", ":mercenary_troop"),
(val_add, ":cur_entry", 1),
(try_end),
(try_begin),
(eq, ":randomize_attacker_placement", 1),
(call_script, "script_setup_tavern_attacker", ":cur_entry"),
(val_add, ":cur_entry", 1),
(try_end),
(try_for_range, ":companion_candidate", companions_begin, companions_end),
(troop_slot_eq, ":companion_candidate", slot_troop_occupation, 0),
(troop_slot_eq, ":companion_candidate", slot_troop_cur_center, "$current_town"),
(neg|troop_slot_ge, ":companion_candidate", slot_troop_prisoner_of_party, centers_begin),
(set_visitor, ":cur_entry", ":companion_candidate"),
(val_add, ":cur_entry", 1),
(try_end),
(try_begin),
(eq, ":randomize_attacker_placement", 2),
(call_script, "script_setup_tavern_attacker", ":cur_entry"),
(val_add, ":cur_entry", 1),
(try_end),
(try_begin), #this doubles the incidence of ransom brokers and (below) minstrels
(party_get_slot, ":ransom_broker", "$current_town", slot_center_ransom_broker),
(gt, ":ransom_broker", 0),
(assign, reg0, ":ransom_broker"),
(assign, reg1, "$current_town"),
(set_visitor, ":cur_entry", ":ransom_broker"),
(val_add, ":cur_entry", 1),
(else_try),
(is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
(store_add, ":alternative_town", "$current_town", 9),
(try_begin),
(ge, ":alternative_town", towns_end),
(val_sub, ":alternative_town", 22),
(try_end),
(try_begin),
(eq, "$cheat_mode", 1),
(str_store_party_name, s3, "$current_town"),
(str_store_party_name, s4, ":alternative_town"),
(display_message, "@{!}DEBUG - Current town is {s3}, but also checking {s4}"),
(try_end),
(party_get_slot, ":ransom_broker", ":alternative_town", slot_center_ransom_broker),
(gt, ":ransom_broker", 0),
(set_visitor, ":cur_entry", ":ransom_broker"),
(val_add, ":cur_entry", 1),
(try_end),
(try_begin),
(party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
(gt, ":tavern_traveler", 0),
(set_visitor, ":cur_entry", ":tavern_traveler"),
(val_add, ":cur_entry", 1),
(try_end),
(try_begin),
(party_get_slot, ":tavern_minstrel", "$current_town", slot_center_tavern_minstrel),
(gt, ":tavern_minstrel", 0),
(set_visitor, ":cur_entry", ":tavern_minstrel"),
(val_add, ":cur_entry", 1),
(else_try),
(store_add, ":alternative_town", "$current_town", 9),
(try_begin),
(ge, ":alternative_town", towns_end),
(val_sub, ":alternative_town", 22),
(try_end),
(party_get_slot, ":tavern_minstrel", ":alternative_town", slot_center_tavern_minstrel),
(gt, ":tavern_minstrel", 0),
(set_visitor, ":cur_entry", ":tavern_minstrel"),
(val_add, ":cur_entry", 1),
(try_end),
(try_begin),
(party_get_slot, ":tavern_bookseller", "$current_town", slot_center_tavern_bookseller),
(gt, ":tavern_bookseller", 0),
(set_visitor, ":cur_entry", ":tavern_bookseller"),
(val_add, ":cur_entry", 1),
(try_end),
(try_begin),
(eq, ":randomize_attacker_placement", 3),
(call_script, "script_setup_tavern_attacker", ":cur_entry"),
(val_add, ":cur_entry", 1),
(try_end),
(try_begin),
(neg|check_quest_active, "qst_eliminate_bandits_infesting_village"),
(neg|check_quest_active, "qst_deal_with_bandits_at_lords_village"),
(assign, ":end_cond", villages_end),
(try_for_range, ":cur_village", villages_begin, ":end_cond"),
(party_slot_eq, ":cur_village", slot_village_bound_center, "$current_town"),
(party_slot_ge, ":cur_village", slot_village_infested_by_bandits, 1),
(neg|party_slot_eq, ":cur_village", slot_town_lord, "trp_player"),
(set_visitor, ":cur_entry", "trp_farmer_from_bandit_village"),
(val_add, ":cur_entry", 1),
(assign, ":end_cond", 0),
(try_end),
(try_end),
(try_begin),
(eq, "$g_starting_town", "$current_town"),
(this_or_next|neg|check_quest_finished, "qst_collect_men"),
(this_or_next|neg|check_quest_finished, "qst_learn_where_merchant_brother_is"),
(this_or_next|neg|check_quest_finished, "qst_save_relative_of_merchant"),
(this_or_next|neg|check_quest_finished, "qst_save_town_from_bandits"),
(eq, "$g_do_one_more_meeting_with_merchant", 1),
(assign, ":troop_of_merchant", 0),
(try_begin),
(eq, "$g_encountered_party_faction", "fac_kingdom_1"),
(assign, ":troop_of_merchant", "trp_swadian_merchant"),
(else_try),
(eq, "$g_encountered_party_faction", "fac_kingdom_2"),
(assign, ":troop_of_merchant", "trp_vaegir_merchant"),
(else_try),
(eq, "$g_encountered_party_faction", "fac_kingdom_3"),
(assign, ":troop_of_merchant", "trp_khergit_merchant"),
(else_try),
(eq, "$g_encountered_party_faction", "fac_kingdom_4"),
(assign, ":troop_of_merchant", "trp_nord_merchant"),
(else_try),
(eq, "$g_encountered_party_faction", "fac_kingdom_5"),
(assign, ":troop_of_merchant", "trp_rhodok_merchant"),
(else_try),
(eq, "$g_encountered_party_faction", "fac_kingdom_6"),
(assign, ":troop_of_merchant", "trp_sarranid_merchant"),
(try_end),
(gt, ":troop_of_merchant", 0),
(set_visitor, ":cur_entry", ":troop_of_merchant"),
(val_add, ":cur_entry", 1),
(try_end),
(change_screen_mission),
(try_end),
],"Door to the tavern."),
# ("town_smithy",[
# (eq,"$entry_to_town_forbidden",0),
# (eq,"$town_nighttime",0),
# ],
# "Visit the smithy.",
# [
# (set_jump_mission,"mt_town_default"),
# (jump_to_scene,"$pout_scn_smithy"),
# (change_screen_mission,0),
# ]),
("town_merchant",
[(party_slot_eq,"$current_town",slot_party_type, spt_town),
(eq, 1, 0),
(eq,"$town_nighttime",0),
(this_or_next|eq,"$entry_to_town_forbidden",0),
(eq, "$sneaked_into_town",1),
# (party_get_slot, ":scene", "$current_town", slot_town_store),
# (scene_slot_eq, ":scene", slot_scene_visited, 1), #check if scene has been visited before to allow entry from menu. Otherwise scene will only be accessible from the town center.
],
"Speak with the merchant.",
[
(try_begin),
(this_or_next|eq,"$all_doors_locked",1),
(eq,"$town_nighttime",1),
(display_message,"str_door_locked",0xFFFFAAAA),
(else_try),
(assign, "$town_entered", 1),
(set_jump_mission, "mt_town_default"),
(mission_tpl_entry_set_override_flags, "mt_town_default", 0, af_override_horse),
(try_begin),
(eq, "$sneaked_into_town",1),
(mission_tpl_entry_set_override_flags, "mt_town_default", 0, af_override_all),
(try_end),
(party_get_slot, ":cur_scene", "$current_town", slot_town_store),
(jump_to_scene, ":cur_scene"),
(scene_set_slot, ":cur_scene", slot_scene_visited, 1),
(change_screen_mission),
(try_end),
],"Door to the shop."),
("town_arena",
[(party_slot_eq,"$current_town",slot_party_type, spt_town),
(eq, "$sneaked_into_town", 0),
# (party_get_slot, ":scene", "$current_town", slot_town_arena),
# (scene_slot_eq, ":scene", slot_scene_visited, 1), #check if scene has been visited before to allow entry from menu. Otherwise scene will only be accessible from the town center.
],
"Enter the arena.",
[
(try_begin),
(this_or_next|eq,"$all_doors_locked",1),
(eq,"$town_nighttime",1),
(display_message,"str_door_locked",0xFFFFAAAA),
(else_try),
(assign, "$g_mt_mode", abm_visit),
(assign, "$town_entered", 1),
(set_jump_mission, "mt_arena_melee_fight"),
(party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
(modify_visitors_at_site, ":arena_scene"),
(reset_visitors),
(set_visitor, 43, "trp_veteran_fighter"),
(set_visitor, 44, "trp_hired_blade"),
(set_jump_entry, 50),
(jump_to_scene, ":arena_scene"),
(scene_set_slot, ":arena_scene", slot_scene_visited, 1),
(change_screen_mission),
(try_end),
],"Door to the arena."),
("town_dungeon",
[(eq, 1, 0)],
"Never: Enter the prison.",
[
(try_begin),
(eq, "$talk_context", tc_prison_break),
(gt, "$g_main_attacker_agent", 0),
(neg|agent_is_alive, "$g_main_attacker_agent"),
(agent_get_troop_id, ":agent_type", "$g_main_attacker_agent"),
(try_begin),
(eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
(party_get_slot, ":prison_guard_faction", "$current_town", slot_center_original_faction),
(else_try),
(assign, ":prison_guard_faction", "$g_encountered_party_faction"),
(try_end),
(faction_slot_eq, ":prison_guard_faction", slot_faction_prison_guard_troop, ":agent_type"),
(call_script, "script_deduct_casualties_from_garrison"),
(call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
(else_try),
(eq,"$all_doors_locked",1),
(display_message,"str_door_locked",0xFFFFAAAA),
(else_try),
(this_or_next|party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(eq, "$g_encountered_party_faction", "$players_kingdom"),
(assign, "$town_entered", 1),
(call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
(else_try),
(display_message,"str_door_locked",0xFFFFAAAA),
(try_end),
],"Door to the dungeon."),
("castle_inspect",
[
(party_slot_eq,"$current_town",slot_party_type, spt_castle),
],
"Take a walk around the courtyard.",
[
(try_begin),
(eq, "$talk_context", tc_prison_break),
(assign, "$talk_context", tc_escape),
(party_get_slot, ":cur_castle_exterior", "$current_town", slot_castle_exterior),
(modify_visitors_at_site, ":cur_castle_exterior"),
(reset_visitors),
(assign, ":guard_no", 40),
(party_get_num_companion_stacks, ":num_stacks", "$g_encountered_party"),
(try_for_range, ":troop_iterator", 0, ":num_stacks"),
#nearby fire condition start
(party_get_slot, ":last_nearby_fire_time", "$current_town", slot_town_last_nearby_fire_time),
(store_current_hours, ":cur_time"),
(store_add, ":fire_finish_time", ":last_nearby_fire_time", fire_duration),
(this_or_next|eq, ":guard_no", 40),
(neg|is_between, ":cur_time", ":last_nearby_fire_time", ":fire_finish_time"),
#nearby fire condition end
(lt, ":guard_no", 47),
(party_stack_get_troop_id, ":cur_troop_id", "$g_encountered_party", ":troop_iterator"),
(neg|troop_is_hero, ":cur_troop_id"),
(party_stack_get_size, ":stack_size","$g_encountered_party",":troop_iterator"),
(party_stack_get_num_wounded, ":num_wounded","$g_encountered_party",":troop_iterator"),
(val_sub, ":stack_size", ":num_wounded"),
(gt, ":stack_size", 0),
(party_stack_get_troop_dna,":troop_dna", "$g_encountered_party", ":troop_iterator"),
(set_visitor, ":guard_no", ":cur_troop_id", ":troop_dna"),
(val_add, ":guard_no", 1),
(try_end),
#(set_jump_entry, 1),
(set_visitor, 7, "$g_player_troop"),
(set_jump_mission,"mt_castle_visit"),
(jump_to_scene, ":cur_castle_exterior"),
(change_screen_mission),
#If you're already at escape, then talk context will reset
(else_try),
(assign, "$talk_context", tc_town_talk),
(assign, "$g_mt_mode", tcm_default),
(party_get_slot, ":cur_castle_exterior", "$current_town", slot_castle_exterior),
(modify_visitors_at_site,":cur_castle_exterior"),
(reset_visitors),
(try_begin),
(neq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
(faction_get_slot, ":troop_prison_guard", "$g_encountered_party_faction", slot_faction_prison_guard_troop),
(else_try),
(party_get_slot, ":town_original_faction", "$current_town", slot_center_original_faction),
(faction_get_slot, ":troop_prison_guard", ":town_original_faction", slot_faction_prison_guard_troop),
(try_end),
(set_visitor, 24, ":troop_prison_guard"),
(assign, ":guard_no", 40),
(party_get_num_companion_stacks, ":num_stacks", "$g_encountered_party"),
(try_for_range, ":troop_iterator", 0, ":num_stacks"),
#nearby fire condition start
(party_get_slot, ":last_nearby_fire_time", "$current_town", slot_town_last_nearby_fire_time),
(store_current_hours, ":cur_time"),
(store_add, ":fire_finish_time", ":last_nearby_fire_time", fire_duration),
(neg|is_between, ":cur_time", ":fire_finish_time", ":last_nearby_fire_time"),
(lt, ":guard_no", 47),
(party_stack_get_troop_id, ":cur_troop_id", "$g_encountered_party", ":troop_iterator"),
(neg|troop_is_hero, ":cur_troop_id"),
(party_stack_get_size, ":stack_size","$g_encountered_party",":troop_iterator"),
(party_stack_get_num_wounded, ":num_wounded","$g_encountered_party",":troop_iterator"),
(val_sub, ":stack_size", ":num_wounded"),
(gt, ":stack_size", 0),
(party_stack_get_troop_dna,":troop_dna","$g_encountered_party",":troop_iterator"),
(set_visitor, ":guard_no", ":cur_troop_id", ":troop_dna"),
(val_add, ":guard_no", 1),
(try_end),
(try_begin),
(eq, "$town_entered", 0),
(assign, "$town_entered", 1),
(try_end),
(set_jump_entry, 1),
(assign, ":override_state", af_override_horse),
(try_begin),
(eq, "$sneaked_into_town", 1), #setup disguise
(assign, ":override_state", af_override_all),
(try_end),
(set_jump_mission, "mt_castle_visit"),
(mission_tpl_entry_set_override_flags, "mt_castle_visit", 0, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_castle_visit", 1, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_castle_visit", 2, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_castle_visit", 3, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_castle_visit", 4, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_castle_visit", 5, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_castle_visit", 6, ":override_state"),
(mission_tpl_entry_set_override_flags, "mt_castle_visit", 7, ":override_state"),
(jump_to_scene, ":cur_castle_exterior"),
(change_screen_mission),
(try_end),
], "To the castle courtyard."),
("town_enterprise",
[
(party_slot_eq,"$current_town",slot_party_type, spt_town),
(party_get_slot, ":item_produced", "$current_town", slot_center_player_enterprise),
(gt, ":item_produced", 1),
(eq,"$entry_to_town_forbidden",0),
(call_script, "script_get_enterprise_name", ":item_produced"),
(str_store_string, s3, reg0),
],
"Visit your {s3}.",
[
(store_sub, ":town_order", "$current_town", towns_begin),
(store_add, ":master_craftsman", "trp_town_1_master_craftsman", ":town_order"),
(party_get_slot, ":item_produced", "$current_town", slot_center_player_enterprise),
(assign, ":enterprise_scene", "scn_enterprise_mill"),
(try_begin),
(eq, ":item_produced", "itm_bread"),
(assign, ":enterprise_scene", "scn_enterprise_mill"),
(else_try),
(eq, ":item_produced", "itm_ale"),
(assign, ":enterprise_scene", "scn_enterprise_brewery"),
(else_try),
(eq, ":item_produced", "itm_oil"),
(assign, ":enterprise_scene", "scn_enterprise_oil_press"),
(else_try),
(eq, ":item_produced", "itm_wine"),
(assign, ":enterprise_scene", "scn_enterprise_winery"),
(else_try),
(eq, ":item_produced", "itm_leatherwork"),
(assign, ":enterprise_scene", "scn_enterprise_tannery"),
(else_try),
(eq, ":item_produced", "itm_wool_cloth"),
(assign, ":enterprise_scene", "scn_enterprise_wool_weavery"),
(else_try),
(eq, ":item_produced", "itm_linen"),
(assign, ":enterprise_scene", "scn_enterprise_linen_weavery"),
(else_try),
(eq, ":item_produced", "itm_velvet"),
(assign, ":enterprise_scene", "scn_enterprise_dyeworks"),
(else_try),
(eq, ":item_produced", "itm_tools"),
(assign, ":enterprise_scene", "scn_enterprise_smithy"),
(try_end),
(modify_visitors_at_site,":enterprise_scene"),
(reset_visitors),
(set_visitor,0,"trp_player"),
(set_visitor,17,":master_craftsman"),
(set_jump_mission,"mt_town_default"),
(jump_to_scene,":enterprise_scene"),
(change_screen_mission),
],"Door to your enterprise."),
("visit_lady",
[
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, kingdom_ladies_begin),
(assign, "$love_interest_in_town", 0),
(assign, "$love_interest_in_town_2", 0),
(assign, "$love_interest_in_town_3", 0),
(assign, "$love_interest_in_town_4", 0),
(assign, "$love_interest_in_town_5", 0),
(assign, "$love_interest_in_town_6", 0),
(assign, "$love_interest_in_town_7", 0),
(assign, "$love_interest_in_town_8", 0),
(try_for_range, ":lady_no", kingdom_ladies_begin, kingdom_ladies_end),
(troop_slot_eq, ":lady_no", slot_troop_cur_center, "$current_town"),
(call_script, "script_get_kingdom_lady_social_determinants", ":lady_no"),
(assign, ":lady_guardian", reg0),
(troop_slot_eq, ":lady_no", slot_troop_spouse, -1),
(ge, ":lady_guardian", 0), #not sure when this would not be the case
#must have spoken to either father or lady
(this_or_next|troop_slot_ge, ":lady_no", slot_troop_met, 2),
(troop_slot_eq, ":lady_guardian", slot_lord_granted_courtship_permission, 1),
(neg|troop_slot_eq, ":lady_no", slot_troop_met, 4),
#must have approached father
# (this_or_next|troop_slot_eq, ":lady_guardian", slot_lord_granted_courtship_permission, 1),
# (troop_slot_eq, ":lady_guardian", slot_lord_granted_courtship_permission, -1),
(try_begin),
(eq, "$love_interest_in_town", 0),
(assign, "$love_interest_in_town", ":lady_no"),
(else_try),
(eq, "$love_interest_in_town_2", 0),
(assign, "$love_interest_in_town_2", ":lady_no"),
(else_try),
(eq, "$love_interest_in_town_3", 0),
(assign, "$love_interest_in_town_3", ":lady_no"),
(else_try),
(eq, "$love_interest_in_town_4", 0),
(assign, "$love_interest_in_town_4", ":lady_no"),
(else_try),
(eq, "$love_interest_in_town_5", 0),
(assign, "$love_interest_in_town_5", ":lady_no"),
(else_try),
(eq, "$love_interest_in_town_6", 0),
(assign, "$love_interest_in_town_6", ":lady_no"),
(else_try),
(eq, "$love_interest_in_town_7", 0),
(assign, "$love_interest_in_town_7", ":lady_no"),
(else_try),
(eq, "$love_interest_in_town_8", 0),
(assign, "$love_interest_in_town_8", ":lady_no"),
(try_end),
(try_end),
(gt, "$love_interest_in_town", 0),
],
"Attempt to visit a lady",
[
(jump_to_menu, "mnu_lady_visit"),
], "Door to the garden."),
("trade_with_merchants",
[
(party_slot_eq,"$current_town",slot_party_type, spt_town)
],
"Go to the marketplace.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu,"mnu_town_trade"),
(try_end),
]),
("walled_center_manage",
[
(neg|party_slot_eq, "$current_town", slot_village_state, svs_under_siege),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(assign, reg0, 1),
(try_begin),
(party_slot_eq, "$current_town", slot_party_type, spt_castle),
(assign, reg0, 0),
(try_end),
],
"Manage this {reg0?town:castle}.",
[
(assign, "$g_next_menu", "mnu_town"),
(jump_to_menu, "mnu_center_manage"),
]),
("walled_center_move_court",
[
(neg|party_slot_eq, "$current_town", slot_village_state, svs_under_siege),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
(neq, "$g_player_court", "$current_town"),
],
"Move your court here.",
[
(jump_to_menu, "mnu_establish_court"),
]),
("castle_station_troops",
[
(party_get_slot, ":town_lord", "$current_town", slot_town_lord),
(str_clear, s10),
(assign, ":player_can_draw_from_garrison", 0),
(try_begin), #option 1 - player is town lord
(eq, ":town_lord", "trp_player"),
(assign, ":player_can_draw_from_garrison", 1),
(else_try), #option 2 - town is unassigned and part of the player faction
(store_faction_of_party, ":faction", "$g_encountered_party"),
(eq, ":faction", "fac_player_supporters_faction"),
(neg|party_slot_ge, "$g_encountered_party", slot_town_lord, active_npcs_begin), #ie, zero or -1
(assign, ":player_can_draw_from_garrison", 1),
(else_try), #option 3 - town was captured by player
(lt, ":town_lord", 0), #ie, unassigned
(store_faction_of_party, ":castle_faction", "$g_encountered_party"),
(eq, "$players_kingdom", ":castle_faction"),
(eq, "$g_encountered_party", "$g_castle_requested_by_player"),
(str_store_string, s10, "str_retrieve_garrison_warning"),
(assign, ":player_can_draw_from_garrison", 1),
(else_try),
(lt, ":town_lord", 0), #ie, unassigned
(store_faction_of_party, ":castle_faction", "$g_encountered_party"),
(eq, "$players_kingdom", ":castle_faction"),
(store_party_size_wo_prisoners, ":party_size", "$g_encountered_party"),
(eq, ":party_size", 0),
(str_store_string, s10, "str_retrieve_garrison_warning"),
(assign, ":player_can_draw_from_garrison", 1),
(else_try),
(party_slot_ge, "$g_encountered_party", slot_town_lord, active_npcs_begin),
(store_faction_of_party, ":castle_faction", "$g_encountered_party"),
(eq, "$players_kingdom", ":castle_faction"),
(troop_slot_eq, "trp_player", slot_troop_spouse, ":town_lord"),
(assign, ":player_can_draw_from_garrison", 1),
(try_end),
(eq, ":player_can_draw_from_garrison", 1),
],
"Manage the garrison {s10}",
[
(change_screen_exchange_members,1),
]),
("castle_wait",
[
#(party_slot_eq,"$current_town",slot_party_type, spt_castle),
(this_or_next|ge, "$g_encountered_party_relation", 0),
(eq,"$castle_undefended",1),
(assign, ":can_rest", 1),
(str_clear, s1),
(try_begin),
(neg|party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
(troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
(neg|party_slot_eq, "$current_town", slot_town_lord, ":player_spouse"),
(party_slot_ge, "$current_town", slot_town_lord, "trp_player"), #can rest for free in castles and towns with unassigned lords
(store_faction_of_party, ":current_town_faction", "$current_town"),
(neq, ":current_town_faction", "fac_player_supporters_faction"),
(party_get_num_companions, ":num_men", "p_main_party"),
(store_div, reg1, ":num_men", 4),
(val_add, reg1, 1),
(str_store_string, s1, "@ ({reg1} denars per night)"),
(store_troop_gold, ":gold", "trp_player"),
(lt, ":gold", reg1),
(assign, ":can_rest", 0),
(try_end),
(eq, ":can_rest", 1),
],
"Wait here for some time{s1}.",
[
(assign, "$auto_enter_town", "$current_town"),
(assign, "$g_town_visit_after_rest", 1),
(assign, "$g_last_rest_center", "$current_town"),
(assign, "$g_last_rest_payment_until", -1),
(try_begin),
(party_is_active, "p_main_party"),
(party_get_current_terrain, ":cur_terrain", "p_main_party"),
(try_begin),
(eq, ":cur_terrain", rt_desert),
(unlock_achievement, ACHIEVEMENT_SARRANIDIAN_NIGHTS),
(try_end),
(try_end),
(rest_for_hours_interactive, 24 * 7, 5, 0), #rest while not attackable
(change_screen_return),
]),
## ("rest_until_morning",
## [
## (this_or_next|ge, "$g_encountered_party_relation", 0),
## (eq,"$castle_undefended",1),
## (store_time_of_day,reg(1)),(neg|is_between,reg(1), 5, 18),
## (eq, "$g_defending_against_siege", 0),
## ],
## "Rest until morning.",
## [
## (store_time_of_day,reg(1)),
## (assign, reg(2), 30),
## (val_sub,reg(2),reg(1)),
## (val_mod,reg(2),24),
## (assign,"$auto_enter_town","$current_town"),
## (assign, "$g_town_visit_after_rest", 1),
## (rest_for_hours_interactive, reg(2)),
## (change_screen_return),
## ]),
##
## ("rest_until_evening",
## [
## (this_or_next|ge, "$g_encountered_party_relation", 0),
## (eq,"$castle_undefended",1),
## (store_time_of_day,reg(1)), (is_between,reg(1), 5, 18),
## (eq, "$g_defending_against_siege", 0),
## ],
## "Rest until evening.",
## [
## (store_time_of_day,reg(1)),
## (assign, reg(2), 20),
## (val_sub,reg(2),reg(1)),
## (assign,"$auto_enter_town","$current_town"),
## (assign, "$g_town_visit_after_rest", 1),
## (rest_for_hours_interactive, reg(2)),
## (change_screen_return),
## ]),
("town_alley",
[
(party_slot_eq,"$current_town",slot_party_type, spt_town),
(eq, "$cheat_mode", 1),
],
"{!}CHEAT: Go to the alley.",
[
(party_get_slot, reg11, "$current_town", slot_town_alley),
(set_jump_mission, "mt_ai_training"),
(jump_to_scene, reg11),
(change_screen_mission),
]),
("collect_taxes_qst",
[
(check_quest_active, "qst_collect_taxes"),
(quest_slot_eq, "qst_collect_taxes", slot_quest_target_center, "$current_town"),
(neg|quest_slot_eq, "qst_collect_taxes", slot_quest_current_state, 4),
(quest_get_slot, ":quest_giver_troop", "qst_collect_taxes", slot_quest_giver_troop),
(str_store_troop_name, s1, ":quest_giver_troop"),
(quest_get_slot, reg5, "qst_collect_taxes", slot_quest_current_state),
],
"{reg5?Continue collecting taxes:Collect taxes} due to {s1}.",
[
(jump_to_menu, "mnu_collect_taxes"),
]),
("town_leave",[],"Leave...",
[
(assign, "$g_permitted_to_center",0),
(change_screen_return,0),
],"Leave Area."),
("castle_cheat_interior",
[
(eq, "$cheat_mode", 1),
],
"{!}CHEAT! Interior.",
[
(set_jump_mission,"mt_ai_training"),
(party_get_slot, ":castle_scene", "$current_town", slot_town_castle),
(jump_to_scene,":castle_scene"),
(change_screen_mission),
]),
("castle_cheat_town_exterior",
[
(eq, "$cheat_mode", 1),
],
"{!}CHEAT! Exterior.",
[
(try_begin),
(party_slot_eq, "$current_town",slot_party_type, spt_castle),
(party_get_slot, ":scene", "$current_town", slot_castle_exterior),
(else_try),
(party_get_slot, ":scene", "$current_town", slot_town_center),
(try_end),
(set_jump_mission,"mt_ai_training"),
(jump_to_scene,":scene"),
(change_screen_mission),
]),
("castle_cheat_dungeon",
[
(eq, "$cheat_mode", 1),
],
"{!}CHEAT! Prison.",
[
(set_jump_mission,"mt_ai_training"),
(party_get_slot, ":castle_scene", "$current_town", slot_town_prison),
(jump_to_scene,":castle_scene"),
(change_screen_mission),
]),
("castle_cheat_town_walls",
[
(eq, "$cheat_mode", 1),
(party_slot_eq,"$current_town",slot_party_type, spt_town),
],
"{!}CHEAT! Town Walls.",
[
(party_get_slot, ":scene", "$current_town", slot_town_walls),
(set_jump_mission,"mt_ai_training"),
(jump_to_scene,":scene"),
(change_screen_mission),
]),
("cheat_town_start_siege",
[
(eq, "$cheat_mode", 1),
(party_slot_eq, "$g_encountered_party", slot_center_is_besieged_by, -1),
(lt, "$g_encountered_party_2", 1),
(call_script, "script_party_count_fit_for_battle","p_main_party"),
(gt, reg(0), 1),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
(assign, reg6, 1),
(else_try),
(assign, reg6, 0),
(try_end),
],
"{!}CHEAT: Besiege the {reg6?town:castle}...",
[
(assign,"$g_player_besiege_town","$g_encountered_party"),
(jump_to_menu, "mnu_castle_besiege"),
]),
("center_reports",
[
(eq, "$cheat_mode", 1),
],
"{!}CHEAT! Show reports.",
[
(jump_to_menu,"mnu_center_reports"),
]),
("sail_from_port",
[
(party_slot_eq,"$current_town",slot_party_type, spt_town),
(eq, "$cheat_mode", 1),
#(party_slot_eq,"$current_town",slot_town_near_shore, 1),
],
"{!}CHEAT: Sail from port.",
[
(assign, "$g_player_icon_state", pis_ship),
(party_set_flags, "p_main_party", pf_is_ship, 1),
(party_get_position, pos1, "p_main_party"),
(map_get_water_position_around_position, pos2, pos1, 6),
(party_set_position, "p_main_party", pos2),
(assign, "$g_main_ship_party", -1),
(change_screen_return),
]),
]
),
(
"cannot_enter_court",0,
"There is a feast in progress in the lord's hall, but you are not of sufficient status to be invited inside. Perhaps increasing your renown would win you admittance -- or you might also try distinguishing yourself at a tournament while the feast is in progress...",
"none",
[],
[
("continue", [],"Continue",
[
(jump_to_menu, "mnu_town"),
]),
]),
(
"lady_visit",0,
"Whom do you wish to visit?",
"none",
[],
[
("visit_lady_1", [
(gt, "$love_interest_in_town", 0),
(str_store_troop_name, s12, "$love_interest_in_town"),
],
"Visit {s12}",
[
(assign, "$love_interest_in_town", "$love_interest_in_town"),
(jump_to_menu, "mnu_garden"),
]),
("visit_lady_2", [
(gt, "$love_interest_in_town_2", 0),
(str_store_troop_name, s12, "$love_interest_in_town_2"),
],
"Visit {s12}",
[
(assign, "$love_interest_in_town", "$love_interest_in_town_2"),
(jump_to_menu, "mnu_garden"),
]),
("visit_lady_3", [
(gt, "$love_interest_in_town_3", 0),
(str_store_troop_name, s12, "$love_interest_in_town_3"),
],
"Visit {s12}",
[
(assign, "$love_interest_in_town", "$love_interest_in_town_3"),
(jump_to_menu, "mnu_garden")], "Door to the garden."),
("visit_lady_4", [(gt, "$love_interest_in_town_4", 0),(str_store_troop_name, s12, "$love_interest_in_town_4"),],
"Visit {s12}",[(assign, "$love_interest_in_town", "$love_interest_in_town_4"),(jump_to_menu, "mnu_garden"),]),
("visit_lady_5", [(gt, "$love_interest_in_town_5", 0),(str_store_troop_name, s12, "$love_interest_in_town_5"),],
"Visit {s12}",[(assign, "$love_interest_in_town", "$love_interest_in_town_5"),(jump_to_menu, "mnu_garden"),]),
("visit_lady_6",[(gt, "$love_interest_in_town_6", 0),(str_store_troop_name, s12, "$love_interest_in_town_6"),],
"Visit {s12}",[(assign, "$love_interest_in_town", "$love_interest_in_town_6"),(jump_to_menu, "mnu_garden"),]),
("visit_lady_7",[(gt, "$love_interest_in_town_7", 0),(str_store_troop_name, s12, "$love_interest_in_town_7"),],
"Visit {s12}",[(assign, "$love_interest_in_town", "$love_interest_in_town_7"),(jump_to_menu, "mnu_garden"),]),
("visit_lady_8",[(gt, "$love_interest_in_town_8", 0),(str_store_troop_name, s12, "$love_interest_in_town_8"),],
"Visit {s12}",[(assign, "$love_interest_in_town", "$love_interest_in_town_8"),(jump_to_menu, "mnu_garden"),]),
("leave",[], "Leave",[(jump_to_menu, "mnu_town")]),
]
),
(
"town_tournament_lost",0,
"You have been eliminated from the tournament.{s8}",
"none",
[
(str_clear, s8),
(try_begin),
(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 50),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 125),
(gt, "$g_player_tournament_placement", 4),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$g_encountered_party"),
(str_store_string, s8, "str__however_you_have_sufficiently_distinguished_yourself_to_be_invited_to_attend_the_ongoing_feast_in_the_lords_castle"),
(try_end),
],
[
("continue", [], "Continue...",
[(jump_to_menu, "mnu_town_tournament_won_by_another"),
]),
]
),
(
"town_tournament_won",mnf_disable_all_keys,
"You have won the tournament of {s3}! You are filled with pride as the crowd cheers your name.\
In addition to honour, fame and glory, you earn a prize of {reg9} denars. {s8}",
"none",
[
(str_store_party_name, s3, "$current_town"),
(call_script, "script_change_troop_renown", "trp_player", 20),
(call_script, "script_change_player_relation_with_center", "$current_town", 1),
(assign, reg9, 200),
(add_xp_to_troop, 250, "trp_player"),
(troop_add_gold, "trp_player", reg9),
(str_clear, s8),
(store_add, ":total_win", "$g_tournament_bet_placed", "$g_tournament_bet_win_amount"),
(try_begin),
(gt, "$g_tournament_bet_win_amount", 0),
(assign, reg8, ":total_win"),
(str_store_string, s8, "@Moreover, you earn {reg8} denars from the clever bets you placed on yourself..."),
(try_end),
(try_begin),
(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 70),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 145),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$g_encountered_party"),
(str_store_string, s8, "str_s8_you_are_also_invited_to_attend_the_ongoing_feast_in_the_castle"),
(try_end),
(troop_add_gold, "trp_player", ":total_win"),
(assign, ":player_odds_sub", 0),
(store_div, ":player_odds_sub", "$g_tournament_bet_win_amount", 5),
(party_get_slot, ":player_odds", "$current_town", slot_town_player_odds),
(val_sub, ":player_odds", ":player_odds_sub"),
(val_max, ":player_odds", 250),
(party_set_slot, "$current_town", slot_town_player_odds, ":player_odds"),
(call_script, "script_play_victorious_sound"),
(unlock_achievement, ACHIEVEMENT_MEDIEVAL_TIMES),
],
[
("continue", [], "Continue...",
[(jump_to_menu, "mnu_town"),
]),
]
),
(
"town_tournament_won_by_another",mnf_disable_all_keys,
"As the only {reg3?fighter:man} to remain undefeated this day, {s1} wins the lists and the glory of this tournament.",
"none",
[
(call_script, "script_get_num_tournament_participants"),
(store_sub, ":needed_to_remove_randomly", reg0, 1),
(try_begin),
(troop_slot_eq, "trp_tournament_participants", 0, 0), #delete player from the participants
(troop_set_slot, "trp_tournament_participants", 0, -1),
(val_sub, ":needed_to_remove_randomly", 1),
(try_end),
(call_script, "script_remove_tournament_participants_randomly", ":needed_to_remove_randomly"),
(call_script, "script_sort_tournament_participant_troops"),
(troop_get_slot, ":winner_troop", "trp_tournament_participants", 0),
(str_store_troop_name, s1, ":winner_troop"),
(try_begin),
(troop_is_hero, ":winner_troop"),
(call_script, "script_change_troop_renown", ":winner_troop", 20),
(try_end),
(troop_get_type, reg3, ":winner_troop"),
],
[
("continue", [], "Continue...",
[(jump_to_menu, "mnu_town"),
]),
]
),
(
"town_tournament",mnf_disable_all_keys,
"{s1}You are at tier {reg0} of the tournament, with {reg1} participants remaining. In the next round, there will be {reg2} teams with {reg3} {reg4?fighters:fighter} each.",
"none",
[
(party_set_slot, "$current_town", slot_town_has_tournament, 0), #No way to return back if this menu is left
(call_script, "script_sort_tournament_participant_troops"),#Moving trp_player to the top of the list
(call_script, "script_get_num_tournament_participants"),
(assign, ":num_participants", reg0),
(try_begin),
(neg|troop_slot_eq, "trp_tournament_participants", 0, 0),#Player is defeated
(assign, ":player_odds_add", 0),
(store_div, ":player_odds_add", "$g_tournament_bet_placed", 5),
(party_get_slot, ":player_odds", "$current_town", slot_town_player_odds),
(val_add, ":player_odds", ":player_odds_add"),
(val_min, ":player_odds", 4000),
(party_set_slot, "$current_town", slot_town_player_odds, ":player_odds"),
(jump_to_menu, "mnu_town_tournament_lost"),
(else_try),
(eq, ":num_participants", 1),#Tournament won
(jump_to_menu, "mnu_town_tournament_won"),
(else_try),
(try_begin),
(le, "$g_tournament_next_num_teams", 0),
(call_script, "script_get_random_tournament_team_amount_and_size"),
(assign, "$g_tournament_next_num_teams", reg0),
(assign, "$g_tournament_next_team_size", reg1),
(try_end),
(assign, reg2, "$g_tournament_next_num_teams"),
(assign, reg3, "$g_tournament_next_team_size"),
(store_sub, reg4, reg3, 1),
(str_clear, s1),
(try_begin),
(eq, "$g_tournament_player_team_won", 1),
(str_store_string, s1, "@Victory is yours! You have won this melee, but now you must prepare yourself for the next round. "),
(else_try),
(eq, "$g_tournament_player_team_won", 0),
(str_store_string, s1, "@You have been bested in this melee, but the master of ceremonies declares a recognition of your skill and bravery, allowing you to take part in the next round. "),
(try_end),
(assign, reg1, ":num_participants"),
(store_add, reg0, "$g_tournament_cur_tier", 1),
(try_end),
],
[
("tournament_view_participants", [], "View participants.",
[(jump_to_menu, "mnu_tournament_participants"),
]),
("tournament_bet", [(neq, "$g_tournament_cur_tier", "$g_tournament_last_bet_tier")], "Place a bet on yourself.",
[(jump_to_menu, "mnu_tournament_bet"),
]),
("tournament_join_next_fight", [], "Fight in the next round.",
[
(party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
(modify_visitors_at_site, ":arena_scene"),
(reset_visitors),
#Assuming that there are enough participants for the teams
(assign, "$g_player_tournament_placement", "$g_tournament_cur_tier"),
(try_begin),
(gt, "$g_player_tournament_placement", 4),
(assign, "$g_player_eligible_feast_center_no", "$current_town"),
(try_end),
(val_add, "$g_tournament_cur_tier", 1),
(store_mul, "$g_tournament_num_participants_for_fight", "$g_tournament_next_num_teams", "$g_tournament_next_team_size"),
(troop_set_slot, "trp_tournament_participants", 0, -1),#Removing trp_player from the list
(troop_set_slot, "trp_temp_array_a", 0, "trp_player"),
(try_for_range, ":slot_no", 1, "$g_tournament_num_participants_for_fight"),
(call_script, "script_get_random_tournament_participant"),
(troop_set_slot, "trp_temp_array_a", ":slot_no", reg0),
(try_end),
(call_script, "script_shuffle_troop_slots", "trp_temp_array_a", 0, "$g_tournament_num_participants_for_fight"),
(try_for_range, ":slot_no", 0, 4),#shuffle teams
(troop_set_slot, "trp_temp_array_b", ":slot_no", ":slot_no"),
(try_end),
(call_script, "script_shuffle_troop_slots", "trp_temp_array_b", 0, 4),
(assign, ":cur_slot", 0),
(try_for_range, ":cur_team_offset", 0, "$g_tournament_next_num_teams"),
(troop_get_slot, ":cur_team", "trp_temp_array_b", ":cur_team_offset"),
(try_for_range, ":slot_no", 0, 8),#shuffle entry_points
(troop_set_slot, "trp_temp_array_c", ":slot_no", ":slot_no"),
(try_end),
(call_script, "script_shuffle_troop_slots", "trp_temp_array_c", 0, 8),
(try_for_range, ":cur_index", 0, "$g_tournament_next_team_size"),
(store_mul, ":cur_entry_point", ":cur_team", 8),
(troop_get_slot, ":entry_offset", "trp_temp_array_c", ":cur_index"),
(val_add, ":cur_entry_point", ":entry_offset"),
(troop_get_slot, ":troop_no", "trp_temp_array_a", ":cur_slot"),
(set_visitor, ":cur_entry_point", ":troop_no"),
(val_add, ":cur_slot", 1),
(try_end),
(try_end),
(assign, "$g_tournament_next_num_teams", 0),
(assign, "$g_tournament_next_team_size", 0),
(assign, "$g_mt_mode", abm_tournament),
(party_get_slot, ":town_original_faction", "$current_town", slot_center_original_faction),
(assign, ":town_index_within_faction", 0),
(assign, ":end_cond", towns_end),
(try_for_range, ":cur_town", towns_begin, ":end_cond"),
(try_begin),
(eq, ":cur_town", "$current_town"),
(assign, ":end_cond", 0), #break
(else_try),
(party_slot_eq, ":cur_town", slot_center_original_faction, ":town_original_faction"),
(val_add, ":town_index_within_faction", 1),
(try_end),
(try_end),
(set_jump_mission, "mt_arena_melee_fight"),
(try_begin),
(eq, ":town_original_faction", "fac_kingdom_1"),
#Swadia
(store_mod, ":mod", ":town_index_within_faction", 4),
(try_begin),
(eq, ":mod", 0),
(call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
(else_try),
(eq, ":mod", 1),
(call_script, "script_set_items_for_tournament", 100, 100, 0, 0, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
(else_try),
(eq, ":mod", 2),
(call_script, "script_set_items_for_tournament", 100, 0, 100, 0, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
(else_try),
(eq, ":mod", 3),
(call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 40, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
(try_end),
(else_try),
(eq, ":town_original_faction", "fac_kingdom_2"),
#Vaegirs
(store_mod, ":mod", ":town_index_within_faction", 4),
(try_begin),
(eq, ":mod", 0),
(call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 0, 0, 0, 0, "itm_arena_armor_red", "itm_steppe_helmet_red"),
(else_try),
(eq, ":mod", 1),
(call_script, "script_set_items_for_tournament", 100, 50, 0, 0, 0, 20, 30, 0, "itm_arena_armor_red", "itm_steppe_helmet_red"),
(else_try),
(eq, ":mod", 2),
(call_script, "script_set_items_for_tournament", 100, 0, 50, 0, 0, 20, 30, 0, "itm_arena_armor_red", "itm_steppe_helmet_red"),
(else_try),
(eq, ":mod", 3),
(call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 30, 0, 60, 0, "itm_arena_armor_red", "itm_steppe_helmet_red"),
(try_end),
(else_try),
(eq, ":town_original_faction", "fac_kingdom_3"),
#Khergit
(store_mod, ":mod", ":town_index_within_faction", 2),
(try_begin),
(eq, ":mod", 0),
(call_script, "script_set_items_for_tournament", 100, 0, 0, 0, 0, 40, 60, 0, "itm_arena_tunic_red", "itm_steppe_helmet_red"),
(else_try),
(eq, ":mod", 1),
(call_script, "script_set_items_for_tournament", 100, 50, 25, 0, 0, 30, 50, 0, "itm_arena_tunic_red", "itm_steppe_helmet_red"),
(try_end),
(else_try),
(eq, ":town_original_faction", "fac_kingdom_4"),
#Nords
(store_mod, ":mod", ":town_index_within_faction", 3),
(try_begin),
(eq, ":mod", 0),
(call_script, "script_set_items_for_tournament", 0, 0, 50, 80, 0, 0, 0, 0, "itm_arena_armor_red", -1),
(else_try),
(eq, ":mod", 1),
(call_script, "script_set_items_for_tournament", 0, 0, 50, 80, 50, 0, 0, 0, "itm_arena_armor_red", -1),
(else_try),
(eq, ":mod", 2),
(call_script, "script_set_items_for_tournament", 40, 0, 0, 100, 0, 0, 0, 0, "itm_arena_armor_red", -1),
(try_end),
(else_try),
#Rhodoks
(eq, ":town_original_faction", "fac_kingdom_5"),
(call_script, "script_set_items_for_tournament", 25, 100, 60, 0, 30, 0, 30, 50, "itm_arena_tunic_red", "itm_arena_helmet_red"),
(else_try),
#Sarranids
(store_mod, ":mod", ":town_index_within_faction", 2),
(try_begin),
(eq, ":mod", 0),
(call_script, "script_set_items_for_tournament", 100, 40, 60, 0, 30, 30, 0, 0, "itm_arena_tunic_red", "itm_arena_turban_red"),
(else_try),
(call_script, "script_set_items_for_tournament", 50, 0, 60, 0, 30, 30, 0, 0, "itm_arena_tunic_red", "itm_arena_turban_red"),
(try_end),
(try_end),
(jump_to_scene, ":arena_scene"),
(change_screen_mission),
]),
("leave_tournament",[],"Withdraw from the tournament.",
[
(jump_to_menu, "mnu_tournament_withdraw_verify"),
]),
]
),
(
"tournament_withdraw_verify",0,
"Are you sure you want to withdraw from the tournament?",
"none",
[],
[
("tournament_withdraw_yes", [], "Yes. This is a pointless affectation.",
[(jump_to_menu, "mnu_town_tournament_won_by_another"),
]),
("tournament_withdraw_no", [], "No, not as long as there is a chance of victory!",
[(jump_to_menu, "mnu_town_tournament"),
]),
]
),
(
"tournament_bet",0,
"The odds against you are {reg5} to {reg6}.{reg1? You have already bet {reg1} denars on yourself, and if you win, you will earn {reg2} denars.:} How much do you want to bet?",
"none",
[
(assign, reg1, "$g_tournament_bet_placed"),
(store_add, reg2, "$g_tournament_bet_win_amount", "$g_tournament_bet_placed"),
(call_script, "script_get_win_amount_for_tournament_bet"),
(assign, ":player_odds", reg0),
(assign, ":min_dif", 100000),
(assign, ":min_dif_divisor", 1),
(assign, ":min_dif_multiplier", 1),
(try_for_range, ":cur_multiplier", 1, 50),
(try_for_range, ":cur_divisor", 1, 50),
(store_mul, ":result", 100, ":cur_multiplier"),
(val_div, ":result", ":cur_divisor"),
(store_sub, ":difference", ":player_odds", ":result"),
(val_abs, ":difference"),
(lt, ":difference", ":min_dif"),
(assign, ":min_dif", ":difference"),
(assign, ":min_dif_divisor", ":cur_divisor"),
(assign, ":min_dif_multiplier", ":cur_multiplier"),
(try_end),
(try_end),
(assign, reg5, ":min_dif_multiplier"),
(assign, reg6, ":min_dif_divisor"),
],
[
("bet_100_denars", [(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", 100)
],
"100 denars.",
[
(assign, "$temp", 100),
(jump_to_menu, "mnu_tournament_bet_confirm"),
]),
("bet_50_denars", [(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", 50)
],
"50 denars.",
[
(assign, "$temp", 50),
(jump_to_menu, "mnu_tournament_bet_confirm"),
]),
("bet_20_denars", [(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", 20)
],
"20 denars.",
[
(assign, "$temp", 20),
(jump_to_menu, "mnu_tournament_bet_confirm"),
]),
("bet_10_denars", [(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", 10)
],
"10 denars.",
[
(assign, "$temp", 10),
(jump_to_menu, "mnu_tournament_bet_confirm"),
]),
("bet_5_denars", [(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", 5)
],
"5 denars.",
[
(assign, "$temp", 5),
(jump_to_menu, "mnu_tournament_bet_confirm"),
]),
("go_back_dot", [], "Go back.",
[
(jump_to_menu, "mnu_town_tournament"),
]),
]
),
(
"tournament_bet_confirm",0,
"If you bet {reg1} denars, you will earn {reg2} denars if you win the tournament. Is that all right?",
"none",
[
(call_script, "script_get_win_amount_for_tournament_bet"),
(assign, ":win_amount", reg0),
(val_mul, ":win_amount", "$temp"),
(val_div, ":win_amount", 100),
(assign, reg1, "$temp"),
(assign, reg2, ":win_amount"),
],
[
("tournament_bet_accept", [],
"Go ahead.",
[
(call_script, "script_tournament_place_bet", "$temp"),
(jump_to_menu, "mnu_town_tournament"),
]),
("tournament_bet_cancel", [],
"Forget it.",
[
(jump_to_menu, "mnu_tournament_bet"),
]),
]
),
(
"tournament_participants",0,
"You ask one of the criers for the names of the tournament participants. They are:^{s11}",
"none",
[
(str_clear, s11),
(call_script, "script_sort_tournament_participant_troops"),
(call_script, "script_get_num_tournament_participants"),
(assign, ":num_participants", reg0),
(try_for_range, ":cur_slot", 0, ":num_participants"),
(troop_get_slot, ":troop_no", "trp_tournament_participants", ":cur_slot"),
(str_store_troop_name, s12, ":troop_no"),
(str_store_string, s11, "@{!}{s11}^{s12}"),
(try_end),
],
[
("go_back_dot", [], "Go back.",
[(jump_to_menu, "mnu_town_tournament"),
]),
]
),
(
"collect_taxes",mnf_disable_all_keys,
"As the party member with the highest trade skill ({reg2}), {reg3?you expect:{s1} expects} that collecting taxes from here will take {reg4} days...",
"none",
[(call_script, "script_get_max_skill_of_player_party", "skl_trade"),
(assign, ":max_skill", reg0),
(assign, reg2, reg0),
(assign, ":max_skill_owner", reg1),
(try_begin),
(eq, ":max_skill_owner", "trp_player"),
(assign, reg3, 1),
(else_try),
(assign, reg3, 0),
(str_store_troop_name, s1, ":max_skill_owner"),
(try_end),
(assign, ":tax_quest_expected_revenue", 3000),
(try_begin),
(party_slot_eq, "$current_town", slot_party_type, spt_town),
(assign, ":tax_quest_expected_revenue", 6000),
(try_end),
(try_begin),
(quest_slot_eq, "qst_collect_taxes", slot_quest_current_state, 0),
(store_add, ":max_skill_plus_thirty", ":max_skill", 30),
(try_begin),
(party_slot_eq, "$current_town", slot_party_type, spt_town),
(store_div, "$qst_collect_taxes_total_hours", 24* 7 * 30, ":max_skill_plus_thirty"),
(else_try),
#Village
(store_div, "$qst_collect_taxes_total_hours", 24 * 3 * 30, ":max_skill_plus_thirty"),
(try_end),
(call_script, "script_party_count_fit_for_battle", "p_main_party"),
(val_add, reg0, 20),
(val_mul, "$qst_collect_taxes_total_hours", 20),
(val_div, "$qst_collect_taxes_total_hours", reg0),
(quest_set_slot, "qst_collect_taxes", slot_quest_target_amount, "$qst_collect_taxes_total_hours"),
(store_div, ":menu_begin_time", "$qst_collect_taxes_total_hours", 20),#between %5-%25
(store_div, ":menu_end_time", "$qst_collect_taxes_total_hours", 4),
(assign, ":unrest_begin_time", ":menu_end_time"),#between %25-%75
(store_mul, ":unrest_end_time", "$qst_collect_taxes_total_hours", 3),
(val_div, ":unrest_end_time", 4),
(val_mul, ":tax_quest_expected_revenue", 2),
(store_div, "$qst_collect_taxes_hourly_income", ":tax_quest_expected_revenue", "$qst_collect_taxes_total_hours"),
(store_random_in_range, "$qst_collect_taxes_menu_counter", ":menu_begin_time", ":menu_end_time"),
(store_random_in_range, "$qst_collect_taxes_unrest_counter", ":unrest_begin_time", ":unrest_end_time"),
(assign, "$qst_collect_taxes_halve_taxes", 0),
(try_end),
(quest_get_slot, ":target_hours", "qst_collect_taxes", slot_quest_target_amount),
(store_div, ":target_days", ":target_hours", 24),
(val_mul, ":target_days", 24),
(try_begin),
(lt, ":target_days", ":target_hours"),
(val_add, ":target_days", 24),
(try_end),
(val_div, ":target_days", 24),
(assign, reg4, ":target_days"),
],
[
("start_collecting", [], "Start collecting.",
[(assign, "$qst_collect_taxes_currently_collecting", 1),
(try_begin),
(quest_slot_eq, "qst_collect_taxes", slot_quest_current_state, 0),
(quest_set_slot, "qst_collect_taxes", slot_quest_current_state, 1),
(try_end),
(rest_for_hours_interactive, 1000, 5, 0), #rest while not attackable
(assign,"$auto_enter_town","$current_town"),
(assign, "$g_town_visit_after_rest", 1),
(change_screen_return),
]),
("collect_later", [], "Put it off until later.",
[(try_begin),
(party_slot_eq, "$current_town", slot_party_type, spt_town),
(jump_to_menu, "mnu_town"),
(else_try),
(jump_to_menu, "mnu_village"),
(try_end),
]),
]
),
(
"collect_taxes_complete",mnf_disable_all_keys,
"You've collected {reg3} denars in taxes from {s3}. {s19} will be expecting you to take the money to him.",
"none",
[(str_store_party_name, s3, "$current_town"),
(quest_get_slot, ":quest_giver", "qst_collect_taxes", slot_quest_giver_troop),
(str_store_troop_name, s19, ":quest_giver"),
(quest_get_slot, reg3, "qst_collect_taxes", slot_quest_gold_reward),
(try_begin),
(eq, "$qst_collect_taxes_halve_taxes", 0),
(call_script, "script_change_player_relation_with_center", "$current_town", -2),
(try_end),
(call_script, "script_succeed_quest", "qst_collect_taxes"),
],
[
("continue", [], "Continue...",
[(change_screen_return),
]),
]
),
(
"collect_taxes_rebels_killed",0,
"Your quick action and strong arm have successfully put down the revolt.\
Surely, anyone with a mind to rebel against you will think better of it after this.",
"none",
[
],
[
("continue", [], "Continue...",
[(change_screen_map),
]),
]
),
(
"collect_taxes_failed",mnf_disable_all_keys,
"You could collect only {reg3} denars as tax from {s3} before the revolt broke out.\
{s1} won't be happy, but some silver will placate him better than nothing at all...",
"none",
[(str_store_party_name, s3, "$current_town"),
(quest_get_slot, ":quest_giver", "qst_collect_taxes", slot_quest_giver_troop),
(str_store_troop_name, s1, ":quest_giver"),
(quest_get_slot, reg3, "qst_collect_taxes", slot_quest_gold_reward),
(call_script, "script_fail_quest", "qst_collect_taxes"),
(quest_set_slot, "qst_collect_taxes", slot_quest_current_state, 4),
(rest_for_hours, 0, 0, 0), #stop resting
],
[
("continue", [], "Continue...",
[(change_screen_map),
]),
]
),
(
"collect_taxes_revolt_warning",0,
"The people of {s3} are outraged at your demands and decry it as nothing more than extortion.\
They're getting very restless, and they may react badly if you keep pressing them.",
"none",
[(str_store_party_name, s3, "$current_town"),
],
[
("continue_collecting_taxes", [], "Ignore them and continue.",
[(change_screen_return),]),
("halve_taxes", [(quest_get_slot, ":quest_giver_troop", "qst_collect_taxes", slot_quest_giver_troop),
(str_store_troop_name, s1, ":quest_giver_troop"),],
"Agree to reduce your collection by half. ({s1} may be upset)",
[(assign, "$qst_collect_taxes_halve_taxes", 1),
(change_screen_return),
]),
]
),
(
"collect_taxes_revolt",0,
"You are interrupted while collecting the taxes at {s3}. A large band of angry {reg9?peasants:townsmen} is marching nearer,\
shouting about the exorbitant taxes and waving torches and weapons. It looks like they aim to fight you!",
"none",
[(str_store_party_name, s3, "$current_town"),
(assign, reg9, 0),
(try_begin),
(party_slot_eq, "$current_town", slot_party_type, spt_village),
(assign, reg9, 1),
(try_end),
],
[
("continue", [], "Continue...",
[(set_jump_mission,"mt_back_alley_revolt"),
(quest_get_slot, ":target_center", "qst_collect_taxes", slot_quest_target_center),
(try_begin),
(party_slot_eq, ":target_center", slot_party_type, spt_town),
(party_get_slot, ":town_alley", ":target_center", slot_town_alley),
(else_try),
(party_get_slot, ":town_alley", ":target_center", slot_castle_exterior),
(try_end),
(modify_visitors_at_site,":town_alley"),
(reset_visitors),
(assign, ":num_rebels", 6),
(store_character_level, ":level", "trp_player"),
(val_div, ":level", 5),
(val_add, ":num_rebels", ":level"),
(set_visitors, 1, "trp_tax_rebel", ":num_rebels"),
(jump_to_scene,":town_alley"),
(change_screen_mission),
]),
]
),
# They must learn field discipline and the steadiness to follow orders in combat before they can be thought to use arms.",
(
"train_peasants_against_bandits",0,
"As the party member with the highest training skill ({reg2}), {reg3?you expect:{s1} expects} that getting some peasants ready for practice will take {reg4} hours.",
"none",
[(call_script, "script_get_max_skill_of_player_party", "skl_trainer"),
(assign, ":max_skill", reg0),
(assign, reg2, reg0),
(assign, ":max_skill_owner", reg1),
(try_begin),
(eq, ":max_skill_owner", "trp_player"),
(assign, reg3, 1),
(else_try),
(assign, reg3, 0),
(str_store_troop_name, s1, ":max_skill_owner"),
(try_end),
(store_sub, ":needed_hours", 20, ":max_skill"),
(val_mul, ":needed_hours", 3),
(val_div, ":needed_hours", 5),
(store_sub, reg4, ":needed_hours", "$qst_train_peasants_against_bandits_num_hours_trained"),
],
[
("make_preparation", [], "Train them.",
[
(assign, "$qst_train_peasants_against_bandits_currently_training", 1),
(rest_for_hours_interactive, 1000, 5, 0), #rest while not attackable
(assign, "$auto_enter_town", "$current_town"),
(assign, "$g_town_visit_after_rest", 1),
(change_screen_return),
]),
("train_later", [], "Put it off until later.",
[
(jump_to_menu, "mnu_village"),
]),
]
),
(
"train_peasants_against_bandits_ready",0,
"You put the peasants through the basics of soldiering, discipline and obedience.\
You think {reg0} of them {reg1?have:has} fully grasped the training and {reg1?are:is} ready for some practice.",
"none",
[
(store_character_level, ":level", "trp_player"),
(val_div, ":level", 10),
(val_add, ":level", 1),
(quest_get_slot, ":quest_target_amount", "qst_train_peasants_against_bandits", slot_quest_target_amount),
(quest_get_slot, ":quest_current_state", "qst_train_peasants_against_bandits", slot_quest_current_state),
(val_sub, ":quest_target_amount", ":quest_current_state"),
(assign, ":max_random", ":level"),
(val_min, ":max_random", ":quest_target_amount"),
(val_add, ":max_random", 1),
(store_random_in_range, ":random_number", 1, ":max_random"),
(assign, "$g_train_peasants_against_bandits_num_peasants", ":random_number"),
(assign, reg0, ":random_number"),
(store_sub, reg1, ":random_number", 1),
(str_store_troop_name_by_count, s0, "trp_trainee_peasant", ":random_number"),
],
[
("peasant_start_practice", [], "Start the practice fight.",
[
(set_jump_mission,"mt_village_training"),
(quest_get_slot, ":target_center", "qst_train_peasants_against_bandits", slot_quest_target_center),
(party_get_slot, ":village_scene", ":target_center", slot_castle_exterior),
(modify_visitors_at_site, ":village_scene"),
(reset_visitors),
(set_visitor, 0, "trp_player"),
(set_visitors, 1, "trp_trainee_peasant", "$g_train_peasants_against_bandits_num_peasants"),
(set_jump_entry, 11),
(jump_to_scene, ":village_scene"),
(jump_to_menu, "mnu_train_peasants_against_bandits_training_result"),
(music_set_situation, 0),
(change_screen_mission),
]),
]
),
(
"train_peasants_against_bandits_training_result",mnf_disable_all_keys,
"{s0}",
"none",
[
(assign, reg5, "$g_train_peasants_against_bandits_num_peasants"),
(str_store_troop_name_by_count, s0, "trp_trainee_peasant", "$g_train_peasants_against_bandits_num_peasants"),
(try_begin),
(eq, "$g_train_peasants_against_bandits_training_succeeded", 0),
(str_store_string, s0, "@You were beaten. The peasants are heartened by their success, but the lesson you wanted to teach them probably didn't get through..."),
(else_try),
(str_store_string, s0, "@After beating your last opponent, you explain to the peasants how to better defend themselves against such an attack. Hopefully they'll take the experience on board and will be prepared next time."),
(quest_get_slot, ":quest_current_state", "qst_train_peasants_against_bandits", slot_quest_current_state),
(val_add, ":quest_current_state", "$g_train_peasants_against_bandits_num_peasants"),
(quest_set_slot, "qst_train_peasants_against_bandits", slot_quest_current_state, ":quest_current_state"),
(try_end),
],
[
("continue", [], "Continue...",
[
(try_begin),
(quest_get_slot, ":quest_current_state", "qst_train_peasants_against_bandits", slot_quest_current_state),
(quest_slot_eq, "qst_train_peasants_against_bandits", slot_quest_target_amount, ":quest_current_state"),
(jump_to_menu, "mnu_train_peasants_against_bandits_attack"),
(else_try),
(change_screen_map),
(try_end),
]),
]
),
(
"train_peasants_against_bandits_attack",0,
"As you get ready to continue the training, a sentry from the village runs up to you, shouting alarums.\
The bandits have been spotted on the horizon, riding hard for {s3}.\
The elder begs that you organize your newly-trained militia and face them.",
"none",
[
(str_store_party_name, s3, "$current_town"),
],
[
("peasants_against_bandits_attack_resist", [], "Prepare for a fight!",
[
(store_random_in_range, ":random_no", 0, 3),
(try_begin),
(eq, ":random_no", 0),
(assign, ":bandit_troop", "trp_bandit"),
(else_try),
(eq, ":random_no", 1),
(assign, ":bandit_troop", "trp_mountain_bandit"),
(else_try),
(assign, ":bandit_troop", "trp_forest_bandit"),
(try_end),
(party_get_slot, ":scene_to_use", "$g_encountered_party", slot_castle_exterior),
(modify_visitors_at_site, ":scene_to_use"),
(reset_visitors),
(store_character_level, ":level", "trp_player"),
(val_div, ":level", 2),
(store_add, ":min_bandits", ":level", 16),
(store_add, ":max_bandits", ":min_bandits", 6),
(store_random_in_range, ":random_no", ":min_bandits", ":max_bandits"),
(set_visitors, 0, ":bandit_troop", ":random_no"),
(assign, ":num_villagers", ":max_bandits"),
(set_visitors, 2, "trp_trainee_peasant", ":num_villagers"),
(set_party_battle_mode),
(set_battle_advantage, 0),
(assign, "$g_battle_result", 0),
(set_jump_mission,"mt_village_attack_bandits"),
(jump_to_scene, ":scene_to_use"),
(assign, "$g_next_menu", "mnu_train_peasants_against_bandits_attack_result"),
(jump_to_menu, "mnu_battle_debrief"),
(assign, "$g_mt_mode", vba_after_training),
(change_screen_mission),
]),
]
),
(
"train_peasants_against_bandits_attack_result",mnf_scale_picture|mnf_disable_all_keys,
"{s9}",
"none",
[
(try_begin),
(eq, "$g_battle_result", 1),
(str_store_string, s9, "@The bandits are broken!\
Those few who remain alive and conscious run off with their tails between their legs,\
terrified of the peasants and their new champion."),
(call_script, "script_succeed_quest", "qst_train_peasants_against_bandits"),
(jump_to_menu, "mnu_train_peasants_against_bandits_success"),
(else_try),
(call_script, "script_fail_quest", "qst_train_peasants_against_bandits"),
(str_store_string, s9, "@Try as you might, you could not defeat the bandits.\
Infuriated, they raze the village to the ground to punish the peasants,\
and then leave the burning wasteland behind to find greener pastures to plunder."),
(set_background_mesh, "mesh_pic_looted_village"),
(try_end),
],
[
("continue", [], "Continue...",
[(try_begin),
(call_script, "script_village_set_state", "$current_town", svs_looted),
(party_set_slot, "$current_town", slot_village_raid_progress, 0),
(party_set_slot, "$current_town", slot_village_recover_progress, 0),
(call_script, "script_change_player_relation_with_center", "$g_encountered_party", -3),
(call_script, "script_end_quest", "qst_train_peasants_against_bandits"),
(try_end),
(change_screen_map),
]),
]
),
(
"train_peasants_against_bandits_success",mnf_disable_all_keys,
"The bandits are broken!\
Those few who remain run off with their tails between their legs,\
terrified of the peasants and their new champion.\
The villagers have little left in the way of wealth after their ordeal,\
but they offer you all they can find to show their gratitude.",
"none",
[(party_clear, "p_temp_party"),
(call_script, "script_end_quest", "qst_train_peasants_against_bandits"),
(call_script, "script_change_player_relation_with_center", "$g_encountered_party", 4),
(party_get_slot, ":merchant_troop", "$current_town", slot_town_elder),
(try_for_range, ":slot_no", num_equipment_kinds ,max_inventory_items + num_equipment_kinds),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 50),
(troop_set_inventory_slot, ":merchant_troop", ":slot_no", -1),
(try_end),
(call_script, "script_add_log_entry", logent_helped_peasants, "trp_player", "$current_town", -1, -1),
],
[
("village_bandits_defeated_accept",[],"Take it as your just due.",[(jump_to_menu, "mnu_auto_return_to_map"),
(party_get_slot, ":merchant_troop", "$current_town", slot_town_elder),
(troop_sort_inventory, ":merchant_troop"),
(change_screen_loot, ":merchant_troop"),
]),
("village_bandits_defeated_cont",[], "Refuse, stating that they need these items more than you do.",[
(call_script, "script_change_player_relation_with_center", "$g_encountered_party", 3),
(call_script, "script_change_player_honor", 1),
(change_screen_map)]),
],
),
(
"disembark",0,
"Do you wish to disembark?",
"none",
[],
[
("disembark_yes", [], "Yes.",
[(assign, "$g_player_icon_state", pis_normal),
(party_set_flags, "p_main_party", pf_is_ship, 0),
(party_get_position, pos1, "p_main_party"),
(party_set_position, "p_main_party", pos0),
(try_begin),
(le, "$g_main_ship_party", 0),
(set_spawn_radius, 0),
(spawn_around_party, "p_main_party", "pt_none"),
(assign, "$g_main_ship_party", reg0),
(party_set_flags, "$g_main_ship_party", pf_is_static|pf_always_visible|pf_hide_defenders|pf_is_ship, 1),
(str_store_troop_name, s1, "trp_player"),
(party_set_name, "$g_main_ship_party", "@{s1}'s Ship"),
(party_set_icon, "$g_main_ship_party", "icon_ship"),
(party_set_slot, "$g_main_ship_party", slot_party_type, spt_ship),
(try_end),
(enable_party, "$g_main_ship_party"),
(party_set_position, "$g_main_ship_party", pos0),
(party_set_icon, "$g_main_ship_party", "icon_ship_on_land"),
(assign, "$g_main_ship_party", -1),
(change_screen_return),
]),
("disembark_no", [], "No.",
[(change_screen_return),
]),
]
),
(
"ship_reembark",0,
"Do you wish to embark?",
"none",
[],
[
("reembark_yes", [], "Yes.",
[(assign, "$g_player_icon_state", pis_ship),
(party_set_flags, "p_main_party", pf_is_ship, 1),
(party_get_position, pos1, "p_main_party"),
(map_get_water_position_around_position, pos2, pos1, 6),
(party_set_position, "p_main_party", pos2),
(assign, "$g_main_ship_party", "$g_encountered_party"),
(disable_party, "$g_encountered_party"),
(change_screen_return),
]),
("reembark_no", [], "No.",
[(change_screen_return),
]),
]
),
(
"center_reports",0,
"Town Name: {s1}^Rent Income: {reg1} denars^Tariff Income: {reg2} denars^Food Stock: for {reg3} days",
"none",
[(party_get_slot, ":town_food_store", "$g_encountered_party", slot_party_food_store),
(call_script, "script_center_get_food_consumption", "$g_encountered_party"),
(assign, ":food_consumption", reg0),
(try_begin),
(gt, ":food_consumption", 0),
(store_div, reg3, ":town_food_store", ":food_consumption"),
(else_try),
(assign, reg3, 9999),
(try_end),
(str_store_party_name, s1, "$g_encountered_party"),
(party_get_slot, reg1, "$g_encountered_party", slot_center_accumulated_rents),
(party_get_slot, reg2, "$g_encountered_party", slot_center_accumulated_tariffs),
],
[
("to_price_and_productions", [], "Show prices and productions.",
[(jump_to_menu, "mnu_price_and_production"),
]),
("go_back_dot",[],"Go back.",
[(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(jump_to_menu, "mnu_village"),
(else_try),
(jump_to_menu, "mnu_town"),
(try_end),
]),
]
),
(
"price_and_production",0,
"Productions are:^(Note: base/modified by raw materials/modified by materials plus prosperity)^{s1}^^Price factors are:^{s2}",
"none",
[
(assign, ":calradian_average_urban_hardship", 0),
(assign, ":calradian_average_rural_hardship", 0),
(try_for_range, ":center", towns_begin, towns_end),
(call_script, "script_center_get_goods_availability", ":center"),
(val_add, ":calradian_average_urban_hardship", reg0),
(try_end),
(try_for_range, ":center", villages_begin, villages_end),
(call_script, "script_center_get_goods_availability", ":center"),
(val_add, ":calradian_average_rural_hardship", reg0),
(try_end),
(val_div, ":calradian_average_rural_hardship", 110),
(val_div, ":calradian_average_urban_hardship", 22),
(call_script, "script_center_get_goods_availability", "$g_encountered_party"),
(assign, reg1, ":calradian_average_urban_hardship"),
(assign, reg2, ":calradian_average_rural_hardship"),
(try_begin),
(ge, "$cheat_mode", 1),
(str_store_string, s1, "str___hardship_index_reg0_avg_towns_reg1_avg_villages_reg2__"),
(display_message, "@{!}DEBUG - {s1}"),
(try_end),
(try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
(neq, ":cur_good", "itm_pork"), #tied to price of grain
(neq, ":cur_good", "itm_chicken"), #tied to price of grain
(neq, ":cur_good", "itm_butter"), #tied to price of cheese
(neq, ":cur_good", "itm_cattle_meat"),
(neq, ":cur_good", "itm_cabbages"), #possibly include later
(call_script, "script_center_get_production", "$g_encountered_party", ":cur_good"),
(assign, ":production", reg0),
(assign, ":base_production", reg2),
(assign, ":base_production_modded_by_raw_materials", reg1),
(call_script, "script_center_get_consumption", "$g_encountered_party", ":cur_good"),
(assign, ":consumer_consumption", reg2),
(assign, ":raw_material_consumption", reg1),
(assign, ":consumption", reg0),
(store_sub, ":cur_good_price_slot", ":cur_good", trade_goods_begin),
(val_add, ":cur_good_price_slot", slot_town_trade_good_prices_begin),
(party_get_slot, ":price", "$g_encountered_party", ":cur_good_price_slot"),
(assign, ":total_centers", 0),
(assign, ":calradian_average_price", 0),
(assign, ":calradian_average_production", 0),
(assign, ":calradian_average_consumption", 0),
(try_for_range, ":center", centers_begin, centers_end),
(neg|is_between, ":center", castles_begin, castles_end),
(val_add, ":total_centers", 1),
(call_script, "script_center_get_production", ":center", ":cur_good"),
(assign, ":center_production", reg2),
(call_script, "script_center_get_consumption", ":center", ":cur_good"),
(store_add, ":center_consumption", reg1, reg2),
(party_get_slot, ":center_price", ":center", ":cur_good_price_slot"),
(val_add, ":calradian_average_price", ":center_price"),
(val_add, ":calradian_average_production", ":center_production"),
(val_add, ":calradian_average_consumption", ":center_consumption"),
(try_end),
(assign, ":calradian_total_production", ":calradian_average_production"),
(assign, ":calradian_total_consumption", ":calradian_average_consumption"),
(val_div, ":calradian_average_price", ":total_centers"),
(val_div, ":calradian_average_production", ":total_centers"),
(val_div, ":calradian_average_consumption", ":total_centers"),
(str_store_item_name, s3, ":cur_good"),
(assign, reg1, ":base_production"),
(assign, reg2, ":base_production_modded_by_raw_materials"),
(assign, reg3, ":production"),
(assign, reg4, ":price"),
(assign, reg5, ":calradian_average_production"),
(assign, reg6, ":calradian_average_price"),
(assign, reg7, ":consumer_consumption"),
(assign, reg8, ":raw_material_consumption"),
(assign, reg9, ":consumption"),
(assign, reg10, ":calradian_average_consumption"),
(item_get_slot, ":production_slot", ":cur_good", slot_item_production_slot),
(party_get_slot, ":production_number", "$g_encountered_party", ":production_slot"),
(assign, reg11, ":production_number"),
(assign, reg12, ":calradian_total_production"),
(assign, reg13, ":calradian_total_consumption"),
(item_get_slot, ":production_string", ":cur_good", slot_item_production_string),
(str_store_string, s4, ":production_string"),
(str_store_string, s1, "str___s3_price_=_reg4_calradian_average_reg6_capital_reg11_s4_base_reg1modified_by_raw_material_reg2modified_by_prosperity_reg3_calradian_average_production_base_reg5_total_reg12_consumed_reg7used_as_raw_material_reg8modified_total_reg9_calradian_consumption_base_reg10_total_reg13s1_"),
(try_end),
],
[
("go_back_dot",[],"Go back.",
[(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(jump_to_menu, "mnu_village"),
(else_try),
(jump_to_menu, "mnu_town"),
(try_end),
]),
]
),
(
"town_trade",0,
"You head towards the marketplace.",
"none",
[],
[
("assess_prices",
[
(store_faction_of_party, ":current_town_faction", "$current_town"),
(store_relation, ":reln", ":current_town_faction", "fac_player_supporters_faction"),
(ge, ":reln", 0),
],
"Assess the local prices.",
[
(jump_to_menu,"mnu_town_trade_assessment_begin"),
]),
("trade_with_arms_merchant",[(party_slot_ge, "$current_town", slot_town_weaponsmith, 1)],
"Trade with the arms merchant.",
[
(party_get_slot, ":merchant_troop", "$current_town", slot_town_weaponsmith),
(change_screen_trade, ":merchant_troop"),
]),
("trade_with_armor_merchant",[(party_slot_ge, "$current_town", slot_town_armorer, 1)],
"Trade with the armor merchant.",
[
(party_get_slot, ":merchant_troop", "$current_town", slot_town_armorer),
(change_screen_trade, ":merchant_troop"),
]),
("trade_with_horse_merchant",[(party_slot_ge, "$current_town", slot_town_horse_merchant, 1)],
"Trade with the horse merchant.",
[
(party_get_slot, ":merchant_troop", "$current_town", slot_town_horse_merchant),
(change_screen_trade, ":merchant_troop"),
]),
("trade_with_goods_merchant",[(party_slot_ge, "$current_town", slot_town_merchant, 1)],
"Trade with the goods merchant.",
[
(party_get_slot, ":merchant_troop", "$current_town", slot_town_merchant),
(change_screen_trade, ":merchant_troop"),
]),
("back_to_town_menu",[],"Head back.",
[
(jump_to_menu,"mnu_town"),
]),
]
),
(
"town_trade_assessment_begin",0,
#"You overhear the following details about the roads out of town :^(experimental feature -- this may go into dialogs)^{s42}^You also overhear several discussions about the price of trade goods across the local area.^You listen closely, trying to work out the best deals around.",
"You overhear several discussions about the price of trade goods across the local area.^You listen closely, trying to work out the best deals around.",
"none",
[
(str_clear, s42),
## (call_script, "script_merchant_road_info_to_s42", "$g_encountered_party"),
],
[
("continue",[],"Continue...",
[
(assign,"$auto_enter_town", "$current_town"),
(assign, "$g_town_assess_trade_goods_after_rest", 1),
(call_script, "script_get_max_skill_of_player_party", "skl_trade"),
(val_div, reg0, 2),
(store_sub, ":num_hours", 6, reg0),
(assign, "$g_last_rest_center", "$current_town"),
(assign, "$g_last_rest_payment_until", -1),
(rest_for_hours, ":num_hours", 5, 0), #rest while not attackable
(change_screen_return),
]),
("go_back_dot",[],"Go back.",
[
(jump_to_menu,"mnu_town_trade"),
]),
]
),
(
"town_trade_assessment",mnf_disable_all_keys,
"As the party member with the highest trade skill ({reg2}), {reg3?you try to figure out:{s1} tries to figure out} the best goods to trade in. {s2}",
"none",
[(call_script, "script_get_max_skill_of_player_party", "skl_trade"),
(assign, ":max_skill", reg0),
(assign, ":max_skill_owner", reg1),
(assign, ":num_best_results", 0),
(assign, ":best_result_1_item", -1),
(assign, ":best_result_1_town", -1),
(assign, ":best_result_1_profit", 0),
(assign, ":best_result_2_item", -1),
(assign, ":best_result_2_town", -1),
(assign, ":best_result_2_profit", 0),
(assign, ":best_result_3_item", -1),
(assign, ":best_result_3_town", -1),
(assign, ":best_result_3_profit", 0),
(store_sub, ":num_towns", towns_end, towns_begin),
(store_sub, ":num_goods", trade_goods_end, trade_goods_begin),
(store_mul, ":max_iteration", ":num_towns", ":num_goods"),
(val_mul, ":max_iteration", ":max_skill"),
(val_div, ":max_iteration", 20),
(assign, ":org_encountered_party", "$g_encountered_party"),
(try_for_range, ":unused", 0, ":max_iteration"),
(store_random_in_range, ":random_trade_good", trade_goods_begin, trade_goods_end),
(store_random_in_range, ":random_town", towns_begin, towns_end),
(assign, ":already_best", 0),
(try_begin),
(eq, ":random_trade_good", ":best_result_1_item"),
(eq, ":random_town", ":best_result_1_town"),
(val_add, ":already_best", 1),
(else_try),
(eq, ":random_trade_good", ":best_result_2_item"),
(eq, ":random_town", ":best_result_2_town"),
(val_add, ":already_best", 1),
(else_try),
(eq, ":random_trade_good", ":best_result_3_item"),
(eq, ":random_town", ":best_result_3_town"),
(val_add, ":already_best", 1),
(try_end),
(eq, ":already_best", 0),
(store_item_value, ":random_trade_good_price", ":random_trade_good"),
(assign, "$g_encountered_party", ":org_encountered_party"),
(call_script, "script_game_get_item_buy_price_factor", ":random_trade_good"),
(store_mul, ":random_trade_good_buy_price", ":random_trade_good_price", reg0),
(val_div, ":random_trade_good_buy_price", 100),
(val_max, ":random_trade_good_buy_price", 1),
(assign, "$g_encountered_party", ":random_town"),
(call_script, "script_game_get_item_sell_price_factor", ":random_trade_good"),
(store_mul, ":random_trade_good_sell_price", ":random_trade_good_price", reg0),
(val_div, ":random_trade_good_sell_price", 100),
(val_max, ":random_trade_good_sell_price", 1),
(store_sub, ":difference", ":random_trade_good_sell_price", ":random_trade_good_buy_price"),
(try_begin),
(gt, ":difference", ":best_result_1_profit"),
(val_add, ":num_best_results", 1),
(val_min, ":num_best_results", 3),
(assign, ":best_result_3_item", ":best_result_2_item"),
(assign, ":best_result_3_town", ":best_result_2_town"),
(assign, ":best_result_3_profit", ":best_result_2_profit"),
(assign, ":best_result_2_item", ":best_result_1_item"),
(assign, ":best_result_2_town", ":best_result_1_town"),
(assign, ":best_result_2_profit", ":best_result_1_profit"),
(assign, ":best_result_1_item", ":random_trade_good"),
(assign, ":best_result_1_town", ":random_town"),
(assign, ":best_result_1_profit", ":difference"),
(else_try),
(gt, ":difference", ":best_result_2_profit"),
(val_add, ":num_best_results", 1),
(val_min, ":num_best_results", 3),
(assign, ":best_result_3_item", ":best_result_2_item"),
(assign, ":best_result_3_town", ":best_result_2_town"),
(assign, ":best_result_3_profit", ":best_result_2_profit"),
(assign, ":best_result_2_item", ":random_trade_good"),
(assign, ":best_result_2_town", ":random_town"),
(assign, ":best_result_2_profit", ":difference"),
(else_try),
(gt, ":difference", ":best_result_3_profit"),
(val_add, ":num_best_results", 1),
(val_min, ":num_best_results", 3),
(assign, ":best_result_3_item", ":random_trade_good"),
(assign, ":best_result_3_town", ":random_town"),
(assign, ":best_result_3_profit", ":difference"),
(try_end),
(try_end),
(assign, "$g_encountered_party", ":org_encountered_party"),
(str_clear, s3),
(assign, reg2, ":max_skill"),
(try_begin),
(eq, ":max_skill_owner", "trp_player"),
(assign, reg3, 1),
(else_try),
(assign, reg3, 0),
(str_store_troop_name, s1, ":max_skill_owner"),
(try_end),
(try_begin),
(le, ":num_best_results", 0),
(str_store_string, s2, "@However, {reg3?You are:{s1} is} unable to find any trade goods that would bring a profit."),
(else_try),
(try_begin),
(ge, ":best_result_3_item", 0),
(assign, reg6, ":best_result_3_profit"),
(str_store_item_name, s4, ":best_result_3_item"),
(str_store_party_name, s5, ":best_result_3_town"),
(str_store_string, s3, "@^Buying {s4} here and selling it at {s5} would bring a profit of {reg6} denars per item.{s3}"),
(try_end),
(try_begin),
(ge, ":best_result_2_item", 0),
(assign, reg6, ":best_result_2_profit"),
(str_store_item_name, s4, ":best_result_2_item"),
(str_store_party_name, s5, ":best_result_2_town"),
(str_store_string, s3, "@^Buying {s4} here and selling it at {s5} would bring a profit of {reg6} denars per item.{s3}"),
(try_end),
(try_begin),
(ge, ":best_result_1_item", 0),
(assign, reg6, ":best_result_1_profit"),
(str_store_item_name, s4, ":best_result_1_item"),
(str_store_party_name, s5, ":best_result_1_town"),
(str_store_string, s3, "@^Buying {s4} here and selling it at {s5} would bring a profit of {reg6} denars per item.{s3}"),
(try_end),
(str_store_string, s2, "@{reg3?You find:{s1} finds} out the following:^{s3}"),
(try_end),
],
[
("continue",[],"Continue...",
[
(jump_to_menu,"mnu_town_trade"),
]),
]
),
(
"sneak_into_town_suceeded",0,
"Disguised in the garments of a poor pilgrim, you fool the guards and make your way into the town.",
"none",
[],
[
("continue",[],"Continue...",
[
(assign, "$sneaked_into_town",1),
(jump_to_menu,"mnu_town"),
]),
]
),
(
"sneak_into_town_caught",0,
"As you try to sneak in, one of the guards recognizes you and raises the alarm!\
You must flee back through the gates before all the guards in the town come down on you!",
"none",
[
(assign,"$auto_menu","mnu_captivity_start_castle_surrender"),
],
[
("sneak_caught_fight",[],"Try to fight your way out!",
[
(assign,"$all_doors_locked",1),
(party_get_slot, ":sneak_scene", "$current_town", slot_town_center), # slot_town_gate),
(modify_visitors_at_site,":sneak_scene"),
(reset_visitors),
(try_begin),
(this_or_next|eq, "$talk_context", tc_escape),
(eq, "$talk_context", tc_prison_break),
(set_jump_entry, 7),
(else_try),
(party_slot_eq, "$current_town", slot_party_type, spt_town),
#(set_visitor,0,"trp_player"),
(set_jump_entry, 0),
(else_try),
#(set_visitor,1,"trp_player"),
(set_jump_entry, 1),
(try_end),
#(store_faction_of_party, ":town_faction","$current_town"),
#(faction_get_slot, ":tier_2_troop", ":town_faction", slot_faction_tier_2_troop),
#(faction_get_slot, ":tier_3_troop", ":town_faction", slot_faction_tier_3_troop),
#(try_begin),
# (gt, ":tier_2_troop", 0),
# (gt, ":tier_3_troop", 0),
# (assign,reg0,":tier_3_troop"),
# (assign,reg1,":tier_3_troop"),
# (assign,reg2,":tier_2_troop"),
# (assign,reg3,":tier_2_troop"),
#(else_try),
# (assign,reg0,"trp_swadian_skirmisher"),
# (assign,reg1,"trp_swadian_crossbowman"),
# (assign,reg2,"trp_swadian_infantry"),
# (assign,reg3,"trp_swadian_crossbowman"),
#(try_end),
#(assign,reg4,-1),
#(shuffle_range,0,5),
#(set_visitor,2,reg0),
#(set_visitor,3,reg1),
#(set_visitor,4,reg2),
#(set_visitor,5,reg3),
(set_jump_mission,"mt_sneak_caught_fight"),
(set_passage_menu,"mnu_town"),
(jump_to_scene,":sneak_scene"),
(change_screen_mission),
]),
("sneak_caught_surrender",[],"Surrender.",
[
(jump_to_menu,"mnu_captivity_start_castle_surrender"),
]),
]
),
(
"sneak_into_town_caught_dispersed_guards",0,
"You drive off the guards and cover your trail before running off, easily losing your pursuers in the maze of streets.",
"none",
[],
[
("continue",[],"Continue...",
[
(assign, "$sneaked_into_town",1),
(assign, "$town_entered", 1),
(jump_to_menu,"mnu_town"),
]),
]
),
(
"sneak_into_town_caught_ran_away",0,
"You make your way back through the gates and quickly retreat to the safety of the countryside.{s11}",
"none",
[
(str_clear, s11),
(assign, ":at_least_one_escaper_caught", 0),
(assign, ":end_cond", kingdom_ladies_end),
(try_for_range, ":prisoner", active_npcs_begin, ":end_cond"),
(try_begin),
(troop_slot_eq, ":prisoner", slot_troop_mission_participation, mp_prison_break_escaped),
(assign, "$talk_context", tc_hero_freed),
(assign, reg14, ":prisoner"),
(call_script, "script_setup_troop_meeting", ":prisoner", -1),
(troop_set_slot, ":prisoner", slot_troop_mission_participation, -1),
(troop_get_slot, ":prison_center", ":prisoner", slot_troop_prisoner_of_party),
(party_remove_prisoners, ":prison_center", ":prisoner", 1),
(troop_set_slot, ":prisoner", slot_troop_prisoner_of_party, -1),
(assign, ":end_cond", -1),
(else_try),
(troop_slot_eq, ":prisoner", slot_troop_mission_participation, mp_prison_break_caught),
(str_store_troop_name, s12, ":prisoner"),
(try_begin),
(eq, ":at_least_one_escaper_caught", 0),
(str_store_string, s11, "str_s11_unfortunately_s12_was_wounded_and_had_to_be_left_behind"),
(else_try),
(str_store_string, s11, "str_s11_also_s12_was_wounded_and_had_to_be_left_behind"),
(try_end),
(assign, ":at_least_one_escaper_caught", 1),
(try_end),
(troop_set_slot, ":prisoner", slot_troop_mission_participation, 0), #new
(try_end),
],
[
("continue",[],"Continue...",
[
(assign,"$auto_menu",-1),
(store_encountered_party,"$last_sneak_attempt_town"),
(store_current_hours,"$last_sneak_attempt_time"),
(change_screen_return),
]),
]
),
(
"enemy_offer_ransom_for_prisoner",0,
"{s2} offers you a sum of {reg12} denars in silver if you are willing to sell him {s1}.",
"none",
[(call_script, "script_calculate_ransom_amount_for_troop", "$g_ransom_offer_troop"),
(assign, reg12, reg0),
(str_store_troop_name, s1, "$g_ransom_offer_troop"),
(store_troop_faction, ":faction_no", "$g_ransom_offer_troop"),
(str_store_faction_name, s2, ":faction_no"),
],
[
("ransom_accept",[],"Accept the offer.",
[(troop_add_gold, "trp_player", reg12),
(party_remove_prisoners, "$g_ransom_offer_party", "$g_ransom_offer_troop", 1),
#(troop_set_slot, "$g_ransom_offer_troop", slot_troop_is_prisoner, 0),
(call_script, "script_remove_troop_from_prison", "$g_ransom_offer_troop"),
(change_screen_return),
]),
("ransom_reject",[],"Reject the offer.",
[
(call_script, "script_change_player_relation_with_troop", "$g_ransom_offer_troop", -4),
(call_script, "script_change_player_honor", -1),
(assign, "$g_ransom_offer_rejected", 1),
(change_screen_return),
]),
]
),
(
"training_ground",0,
"You approach a training field where you can practice your martial skills. What kind of training do you want to do?",
"none",
[
(store_add, "$g_training_ground_melee_training_scene", "scn_training_ground_ranged_melee_1", "$g_encountered_party"),
(val_sub, "$g_training_ground_melee_training_scene", training_grounds_begin),
(try_begin),
(ge, "$g_training_ground_training_count", 3),
(assign, "$g_training_ground_training_count", 0),
(rest_for_hours, 1, 5, 1), #rest while attackable
(assign, "$auto_enter_town", "$g_encountered_party"),
(change_screen_return),
(try_end),
],
[
("camp_trainer",
[], "Speak with the trainer.",
[
(set_jump_mission, "mt_training_ground_trainer_talk"),
(modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
(reset_visitors),
(set_jump_entry, 5),
(jump_to_scene, "$g_training_ground_melee_training_scene"),
(change_screen_mission),
(music_set_situation, 0),
]),
("camp_train_melee",
[
(neg|troop_is_wounded, "trp_player"),
(call_script, "script_party_count_fit_for_battle", "p_main_party"),
(gt, reg0, 1),
], "Sparring practice.",
[
(assign, "$g_mt_mode", ctm_melee),
(jump_to_menu, "mnu_training_ground_selection_details_melee_1"),
(music_set_situation, 0),
]),
("camp_train_archery",[], "Ranged weapon practice.",
[
(jump_to_menu, "mnu_training_ground_selection_details_ranged_1"),
(music_set_situation, 0),
]),
("camp_train_mounted",[], "Horseback practice.",
[
(assign, "$g_mt_mode", ctm_mounted),
(jump_to_menu, "mnu_training_ground_selection_details_mounted"),
(music_set_situation, 0),
]),
("go_to_track",[(eq, "$cheat_mode", 1)],"{!}Cheat: Go to track.",
[
(set_jump_mission, "mt_ai_training"),
(store_add, ":scene_no", "scn_training_ground_horse_track_1", "$g_encountered_party"),
(val_sub, ":scene_no", training_grounds_begin),
(jump_to_scene, ":scene_no"),
(change_screen_mission),
]
),
("go_to_range",[(eq, "$cheat_mode", 1)],"{!}Cheat: Go to range.",
[
(set_jump_mission, "mt_ai_training"),
(jump_to_scene, "$g_training_ground_melee_training_scene"),
(change_screen_mission),
]
),
("leave",[],"Leave.",
[(change_screen_return),
]),
]
),
("training_ground_selection_details_melee_1",0,
"How many opponents will you go against?",
"none",
[
(call_script, "script_write_fit_party_members_to_stack_selection", "p_main_party", 1),
(troop_get_slot, "$temp", "trp_stack_selection_amounts", 1), #number of men fit
(assign, "$temp_2", 1),
],
[
("camp_train_melee_num_men_1",[(ge, "$temp", 1)], "One.",
[
(assign, "$temp", 1),
(jump_to_menu, "mnu_training_ground_selection_details_melee_2"),
]),
("camp_train_melee_num_men_2",[(ge, "$temp", 2)], "Two.",
[
(assign, "$temp", 2),
(jump_to_menu, "mnu_training_ground_selection_details_melee_2"),
]),
("camp_train_melee_num_men_3",[(ge, "$temp", 3)], "Three.",
[
(assign, "$temp", 3),
(jump_to_menu, "mnu_training_ground_selection_details_melee_2"),
]),
("camp_train_melee_num_men_4",[(ge, "$temp", 4)], "Four.",
[
(assign, "$temp", 4),
(jump_to_menu, "mnu_training_ground_selection_details_melee_2"),
]),
("go_back_dot",[],"Cancel.",
[
(jump_to_menu, "mnu_training_ground"),
]),
]
),
("training_ground_selection_details_melee_2",0,
"Choose your opponent #{reg1}:",
"none",
[
(assign, reg1, "$temp_2"),
(troop_get_slot, "$temp_3", "trp_stack_selection_amounts", 0), #number of slots
],
[
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 1),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 1),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 2),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 2),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 3),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 3),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 4),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 4),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 5),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 5),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 6),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 6),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 7),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 7),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 8),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 8),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 9),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 9),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 10),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 10),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 11),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 11),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 12),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 12),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 13),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 13),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 14),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 14),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 15),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 15),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 16),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 16),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 17),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 17),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 18),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 18),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 19),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 19),]),
("s0", [(call_script, "script_cf_training_ground_sub_routine_1_for_melee_details", 20),], "{s0}",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", 20),]),
("training_ground_selection_details_melee_random", [], "Choose randomly.",
[(call_script, "script_training_ground_sub_routine_2_for_melee_details", -1),]),
("go_back_dot",[],"Go back.",
[(jump_to_menu, "mnu_training_ground"),
]
),
]
),
("training_ground_selection_details_mounted",0,
"What kind of weapon do you want to train with?",
"none",
[],
[
("camp_train_mounted_details_1",[], "One handed weapon.",
[
(call_script, "script_start_training_at_training_ground", itp_type_one_handed_wpn, 0),
]),
("camp_train_mounted_details_2",[], "Polearm.",
[
(call_script, "script_start_training_at_training_ground", itp_type_polearm, 0),
]),
("camp_train_mounted_details_3",[], "Bow.",
[
(call_script, "script_start_training_at_training_ground", itp_type_bow, 0),
]),
("camp_train_mounted_details_4",[], "Thrown weapon.",
[
(call_script, "script_start_training_at_training_ground", itp_type_thrown, 0),
]),
("go_back_dot",[],"Go back.",
[(jump_to_menu, "mnu_training_ground"),
]
),
]
),
("training_ground_selection_details_ranged_1",0,
"What kind of ranged weapon do you want to train with?",
"none",
[],
[
("camp_train_ranged_weapon_bow",[], "Bow and arrows.",
[
(assign, "$g_mt_mode", ctm_ranged),
(assign, "$temp", itp_type_bow),
(jump_to_menu, "mnu_training_ground_selection_details_ranged_2"),
]),
("camp_train_ranged_weapon_crossbow",[], "Crossbow.",
[
(assign, "$g_mt_mode", ctm_ranged),
(assign, "$temp", itp_type_crossbow),
(jump_to_menu, "mnu_training_ground_selection_details_ranged_2"),
]),
("camp_train_ranged_weapon_thrown",[], "Throwing Knives.",
[
(assign, "$g_mt_mode", ctm_ranged),
(assign, "$temp", itp_type_thrown),
(jump_to_menu, "mnu_training_ground_selection_details_ranged_2"),
]),
("go_back_dot",[],"Go back.",
[(jump_to_menu, "mnu_training_ground"),
]
),
]
),
("training_ground_selection_details_ranged_2",0,
"What range do you want to practice at?",
"none",
[],
[
("camp_train_ranged_details_1",[], "10 yards.",
[
(call_script, "script_start_training_at_training_ground", "$temp", 10),
]),
("camp_train_ranged_details_2",[], "20 yards.",
[
(call_script, "script_start_training_at_training_ground", "$temp", 20),
]),
("camp_train_ranged_details_3",[], "30 yards.",
[
(call_script, "script_start_training_at_training_ground", "$temp", 30),
]),
("camp_train_ranged_details_4",[], "40 yards.",
[
(call_script, "script_start_training_at_training_ground", "$temp", 40),
]),
("camp_train_ranged_details_5",[(eq, "$g_mt_mode", ctm_ranged),], "50 yards.",
[
(call_script, "script_start_training_at_training_ground", "$temp", 50),
]),
("camp_train_ranged_details_6",[(eq, "$g_mt_mode", ctm_ranged),], "60 yards.",
[
(call_script, "script_start_training_at_training_ground", "$temp", 60),
]),
("camp_train_ranged_details_7",[(eq, "$g_mt_mode", ctm_ranged),], "70 yards.",
[
(call_script, "script_start_training_at_training_ground", "$temp", 70),
]),
("go_back_dot",[],"Go back.",
[(jump_to_menu, "mnu_training_ground"),
]
),
]
),
("training_ground_description",0,
"{s0}",
"none",
[],
[
("continue", [], "Continue...",
[
(jump_to_scene, "$g_training_ground_training_scene"),
(change_screen_mission),
]
),
]
),
("training_ground_training_result",mnf_disable_all_keys,
"{s7}{s2}",
"none",
[
(store_skill_level, ":trainer_skill", "skl_trainer", "trp_player"),
(store_add, ":trainer_skill_multiplier", 5, ":trainer_skill"),
(call_script, "script_write_fit_party_members_to_stack_selection", "p_main_party", 1),
(str_clear, s2),
(troop_get_slot, ":num_fit", "trp_stack_selection_amounts", 1),
(troop_get_slot, ":num_slots", "trp_stack_selection_amounts", 0),
(try_begin),
(gt, "$g_training_ground_training_success_ratio", 0),
(store_mul, ":xp_ratio_to_add", "$g_training_ground_training_success_ratio", "$g_training_ground_training_success_ratio"),
(try_begin),
(eq, "$g_training_ground_training_success_ratio", 100),
(val_mul, ":xp_ratio_to_add", 2), #2x when perfect
(try_end),
(try_begin),
(eq, "$g_mt_mode", ctm_melee),
(val_div, ":xp_ratio_to_add", 2),
(try_end),
(val_div, ":xp_ratio_to_add", 10), # value over 1000
(try_begin),
(gt, ":num_fit", 8),
(val_mul, ":xp_ratio_to_add", 3),
(assign, ":divisor", ":num_fit"),
(convert_to_fixed_point, ":divisor"),
(store_sqrt, ":divisor", ":divisor"),
(convert_to_fixed_point, ":xp_ratio_to_add"),
(val_div, ":xp_ratio_to_add", ":divisor"),
(try_end),
## (assign, reg0, ":xp_ratio_to_add"),
## (display_message, "@xp earn ratio: {reg0}/1000"),
(store_mul, ":xp_ratio_to_add_with_trainer_skill", ":xp_ratio_to_add", ":trainer_skill_multiplier"),
(val_div, ":xp_ratio_to_add_with_trainer_skill", 10),
(party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
(store_add, ":end_cond", ":num_slots", 2),
(try_for_range, ":i_slot", 2, ":end_cond"),
(troop_get_slot, ":amount", "trp_stack_selection_amounts", ":i_slot"),
(troop_get_slot, ":troop_id", "trp_stack_selection_ids", ":i_slot"),
(assign, ":end_cond_2", ":num_stacks"),
(try_for_range, ":stack_no", 0, ":end_cond_2"),
(party_stack_get_troop_id, ":stack_troop", "p_main_party", ":stack_no"),
(eq, ":stack_troop", ":troop_id"),
(assign, ":end_cond_2", 0), #break
(call_script, "script_cf_training_ground_sub_routine_for_training_result", ":troop_id", ":stack_no", ":amount", ":xp_ratio_to_add_with_trainer_skill"),
(str_store_troop_name_by_count, s1, ":troop_id", ":amount"),
(assign, reg1, ":amount"),
(str_store_string, s2, "@{s2}^{reg1} {s1} earned {reg0} experience."),
(try_end),
(try_end),
(try_begin),
(eq, "$g_mt_mode", ctm_melee),
(store_mul, ":special_xp_ratio_to_add", ":xp_ratio_to_add", 3),
(val_div, ":special_xp_ratio_to_add", 2),
(try_for_range, ":enemy_index", 0, "$g_training_ground_training_num_enemies"),
(troop_get_slot, ":troop_id", "trp_temp_array_a", ":enemy_index"),
(assign, ":end_cond_2", ":num_stacks"),
(try_for_range, ":stack_no", 0, ":end_cond_2"),
(party_stack_get_troop_id, ":stack_troop", "p_main_party", ":stack_no"),
(eq, ":stack_troop", ":troop_id"),
(assign, ":end_cond_2", 0), #break
(call_script, "script_cf_training_ground_sub_routine_for_training_result", ":troop_id", ":stack_no", 1, ":special_xp_ratio_to_add"),
(str_store_troop_name, s1, ":troop_id"),
(str_store_string, s2, "@{s2}^{s1} earned an additional {reg0} experience."),
(try_end),
(try_end),
(try_end),
(try_begin),
(call_script, "script_cf_training_ground_sub_routine_for_training_result", "trp_player", -1, 1, ":xp_ratio_to_add"),
(str_store_string, s2, "@^You earned {reg0} experience.{s2}"),
(try_end),
(try_end),
(try_begin),
(eq, "$g_training_ground_training_success_ratio", 0),
(str_store_string, s7, "@The training didn't go well at all."),
(else_try),
(lt, "$g_training_ground_training_success_ratio", 25),
(str_store_string, s7, "@The training didn't go well at all."),
(else_try),
(lt, "$g_training_ground_training_success_ratio", 50),
(str_store_string, s7, "@The training didn't go very well."),
(else_try),
(lt, "$g_training_ground_training_success_ratio", 75),
(str_store_string, s7, "@The training went quite well."),
(else_try),
(lt, "$g_training_ground_training_success_ratio", 99),
(str_store_string, s7, "@The training went very well."),
(else_try),
(str_store_string, s7, "@The training went perfectly."),
(try_end),
],
[
("continue",[],"Continue...",
[(jump_to_menu, "mnu_training_ground"),
]
),
]
),
("marshall_selection_candidate_ask",0,
"{s15} will soon select a new marshall for {s23}. Some of the lords have suggested your name as a likely candidate.",
"none",
[
(try_begin),
(eq, "$g_presentation_marshall_selection_ended", 1),
(change_screen_return),
(try_end),
(faction_get_slot, ":king", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s15, ":king"),
(str_store_faction_name, s23, "$players_kingdom"),
],
[
("marshall_candidate_accept", [], "Let {s15} learn that you are willing to serve as marshall.",
[
(start_presentation, "prsnt_marshall_selection"),
]
),
("marshall_candidate_reject", [], "Tell everyone that you are too busy these days.",
[
(try_begin),
(eq, "$g_presentation_marshall_selection_max_renown_2_troop", "trp_player"),
(assign, "$g_presentation_marshall_selection_max_renown_2", "$g_presentation_marshall_selection_max_renown_3"),
(assign, "$g_presentation_marshall_selection_max_renown_2_troop", "$g_presentation_marshall_selection_max_renown_3_troop"),
(else_try),
(assign, "$g_presentation_marshall_selection_max_renown_1", "$g_presentation_marshall_selection_max_renown_2"),
(assign, "$g_presentation_marshall_selection_max_renown_1_troop", "$g_presentation_marshall_selection_max_renown_2_troop"),
(assign, "$g_presentation_marshall_selection_max_renown_2", "$g_presentation_marshall_selection_max_renown_3"),
(assign, "$g_presentation_marshall_selection_max_renown_2_troop", "$g_presentation_marshall_selection_max_renown_3_troop"),
(try_end),
(start_presentation, "prsnt_marshall_selection"),
]
),
]
),
## [
## ("renew_oath",[],"Renew your oath to {s1} for another month.",[
## (store_current_day, ":cur_day"),
## (store_add, "$g_oath_end_day", ":cur_day", 30),
## (change_screen_return)]),
## ("dont_renew_oath",[],"Become free of your bond.",[
## (assign, "$players_kingdom",0),
## (assign, "$g_player_permitted_castles", 0),
## (change_screen_return)]),
## ]
## ),
#####################################################################
## Captivity....
#####################################################################
#####################################################################
#####################################################################
#####################################################################
(
"captivity_avoid_wilderness",0,
"Suddenly all the world goes black around you.\
Many hours later you regain your conciousness and find yourself at the spot you fell.\
Your enemies must have taken you up for dead and left you there.\
However, it seems that none of your wound were lethal,\
and altough you feel awful, you find out that can still walk.\
You get up and try to look for any other survivors from your party.",
"none",
[
],
[]
),
(
"captivity_start_wilderness",0,
"Stub",
"none",
[
(assign, "$g_player_is_captive", 1),
(try_begin),
(eq,"$g_player_surrenders",1),
(jump_to_menu, "mnu_captivity_start_wilderness_surrender"),
(else_try),
(jump_to_menu, "mnu_captivity_start_wilderness_defeat"),
(try_end),
],
[]
),
(
"captivity_start_wilderness_surrender",0,
"Stub",
"none",
[
(assign, "$g_player_is_captive", 1),
(assign,"$auto_menu",-1), #We need this since we may come here by something other than auto_menu
(assign, "$capturer_party", "$g_encountered_party"),
(jump_to_menu, "mnu_captivity_wilderness_taken_prisoner"),
],
[]
),
(
"captivity_start_wilderness_defeat",0,
"Your enemies take you prisoner.",
"none",
[
(assign, "$g_player_is_captive", 1),
(assign,"$auto_menu",-1),
(assign, "$capturer_party", "$g_encountered_party"),
(try_begin),
(party_stack_get_troop_id, ":party_leader", "$g_encountered_party", 0),
(is_between, ":party_leader", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":party_leader", slot_troop_occupation, slto_kingdom_hero),
(store_sub, ":kingdom_hero_id", ":party_leader", active_npcs_begin),
(set_achievement_stat, ACHIEVEMENT_BARON_GOT_BACK, ":kingdom_hero_id", 1),
(try_end),
(jump_to_menu, "mnu_captivity_wilderness_taken_prisoner"),
],
[]
),
(
"captivity_start_castle_surrender",0,
"Stub",
"none",
[
(assign, "$g_player_is_captive", 1),
(assign,"$auto_menu",-1),
(assign, "$capturer_party", "$g_encountered_party"),
(jump_to_menu, "mnu_captivity_castle_taken_prisoner"),
],
[]
),
(
"captivity_start_castle_defeat",0,
"Stub",
"none",
[
(assign, "$g_player_is_captive", 1),
(assign,"$auto_menu",-1),
(assign, "$capturer_party", "$g_encountered_party"),
(jump_to_menu, "mnu_captivity_castle_taken_prisoner"),
],
[]
),
(
"captivity_start_under_siege_defeat",0,
"Your enemies take you prisoner.",
"none",
[
(assign, "$g_player_is_captive", 1),
(assign,"$auto_menu",-1),
(assign, "$capturer_party", "$g_encountered_party"),
(jump_to_menu, "mnu_captivity_castle_taken_prisoner"),
],
[]
),
(
"captivity_wilderness_taken_prisoner",mnf_scale_picture,
"Your enemies take you prisoner.",
"none",
[
(set_background_mesh, "mesh_pic_prisoner_wilderness"),
],
[
("continue",[],"Continue...",
[
(try_for_range, ":npc", companions_begin, companions_end),
(main_party_has_troop, ":npc"),
(store_random_in_range, ":rand", 0, 100),
(lt, ":rand", 30),
(remove_member_from_party, ":npc", "p_main_party"),
(troop_set_slot, ":npc", slot_troop_occupation, 0),
(troop_set_slot, ":npc", slot_troop_playerparty_history, pp_history_scattered),
(assign, "$last_lost_companion", ":npc"),
(store_faction_of_party, ":victorious_faction", "$g_encountered_party"),
(troop_set_slot, ":npc", slot_troop_playerparty_history_string, ":victorious_faction"),
(troop_set_health, ":npc", 100),
(store_random_in_range, ":rand_town", towns_begin, towns_end),
(troop_set_slot, ":npc", slot_troop_cur_center, ":rand_town"),
(assign, ":nearest_town_dist", 1000),
(try_for_range, ":town_no", towns_begin, towns_end),
(store_faction_of_party, ":town_fac", ":town_no"),
(store_relation, ":reln", ":town_fac", "fac_player_faction"),
(ge, ":reln", 0),
(store_distance_to_party_from_party, ":dist", ":town_no", "p_main_party"),
(lt, ":dist", ":nearest_town_dist"),
(assign, ":nearest_town_dist", ":dist"),
(troop_set_slot, ":npc", slot_troop_cur_center, ":town_no"),
(try_end),
(try_end),
(set_camera_follow_party, "$capturer_party"),
(assign, "$g_player_is_captive", 1),
(store_random_in_range, ":random_hours", 18, 30),
(call_script, "script_event_player_captured_as_prisoner"),
(call_script, "script_stay_captive_for_hours", ":random_hours"),
(assign,"$auto_menu","mnu_captivity_wilderness_check"),
(change_screen_return),
]),
]
),
(
"captivity_wilderness_check",0,
"stub",
"none",
[(jump_to_menu,"mnu_captivity_end_wilderness_escape")],
[]
),
(
"captivity_end_wilderness_escape", mnf_scale_picture,
"After painful days of being dragged about as a prisoner, you find a chance and escape from your captors!",
"none",
[
(play_cue_track, "track_escape"),
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 1),
(set_background_mesh, "mesh_pic_escape_1_fem"),
(else_try),
(set_background_mesh, "mesh_pic_escape_1"),
(try_end),
],
[
("continue",[],"Continue...",
[
(assign, "$g_player_is_captive", 0),
(try_begin),
(party_is_active, "$capturer_party"),
(party_relocate_near_party, "p_main_party", "$capturer_party", 2),
(try_end),
(call_script, "script_set_parties_around_player_ignore_player", 2, 4),
(assign, "$g_player_icon_state", pis_normal),
(set_camera_follow_party, "p_main_party"),
(rest_for_hours, 0, 0, 0), #stop resting
(change_screen_return),
]),
]
),
(
"captivity_castle_taken_prisoner",0,
"You are quickly surrounded by guards who take away your weapons. With curses and insults, they throw you into the dungeon where you must while away the miserable days of your captivity.",
"none",
[
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 1),
(set_background_mesh, "mesh_pic_prisoner_fem"),
(else_try),
(set_background_mesh, "mesh_pic_prisoner_man"),
(try_end),
],
[
("continue",[],"Continue...",
[
(assign, "$g_player_is_captive", 1),
(store_random_in_range, ":random_hours", 16, 22),
(call_script, "script_event_player_captured_as_prisoner"),
(call_script, "script_stay_captive_for_hours", ":random_hours"),
(assign,"$auto_menu", "mnu_captivity_castle_check"),
(change_screen_return)
]),
]
),
(
"captivity_rescue_lord_taken_prisoner",0,
"You remain in disguise for as long as possible before revealing yourself.\
The guards are outraged and beat you savagely before throwing you back into the cell for God knows how long...",
"none",
[
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 1),
(set_background_mesh, "mesh_pic_prisoner_fem"),
(else_try),
(set_background_mesh, "mesh_pic_prisoner_man"),
(try_end),
],
[
("continue",[],"Continue...",
[
(assign, "$g_player_is_captive", 1),
(store_random_in_range, ":random_hours", 16, 22),
(call_script, "script_event_player_captured_as_prisoner"),
(call_script, "script_stay_captive_for_hours", ":random_hours"),
(assign,"$auto_menu", "mnu_captivity_castle_check"),
(change_screen_return),
]),
]
),
(
"captivity_castle_check",0,
"stub",
"none",
[
(store_random_in_range, reg(7), 0, 10),
(try_begin),
(party_is_active, "$capturer_party"),
(store_faction_of_party, ":capturer_faction", "$capturer_party"),
(is_between, ":capturer_faction", kingdoms_begin, kingdoms_end),
(store_relation, ":relation_w_player_faction", ":capturer_faction", "fac_player_faction"),
(ge, ":relation_w_player_faction", 0),
(jump_to_menu,"mnu_captivity_end_exchanged_with_prisoner"),
(else_try),
(lt, reg(7), 4),
(store_character_level, ":player_level", "trp_player"),
(store_mul, "$player_ransom_amount", ":player_level", 50),
(val_add, "$player_ransom_amount", 100),
(store_troop_gold, reg3, "trp_player"),
(store_div, ":player_gold_div_20", reg3, 20),
(val_add, "$player_ransom_amount", ":player_gold_div_20"),
(gt, reg3, "$player_ransom_amount"),
(jump_to_menu,"mnu_captivity_end_propose_ransom"),
(else_try),
(lt, reg7, 7),
(jump_to_menu,"mnu_captivity_end_exchanged_with_prisoner"),
(else_try),
(jump_to_menu,"mnu_captivity_castle_remain"),
(try_end),
],
[]
),
(
"captivity_end_exchanged_with_prisoner",0,
"After days of imprisonment, you are finally set free when your captors exchange you with another prisoner.",
"none",
[
(play_cue_track, "track_escape"),
],
[
("continue",[],"Continue...",
[
(assign, "$g_player_is_captive", 0),
(try_begin),
(party_is_active, "$capturer_party"),
(party_relocate_near_party, "p_main_party", "$capturer_party", 2),
(try_end),
(call_script, "script_set_parties_around_player_ignore_player", 2, 12),
(assign, "$g_player_icon_state", pis_normal),
(set_camera_follow_party, "p_main_party"),
(rest_for_hours, 0, 0, 0), #stop resting
(change_screen_return),
]),
]
),
(
"captivity_end_propose_ransom",0,
"You spend long hours in the sunless dank of the dungeon, more than you can count.\
Suddenly one of your captors enters your cell with an offer;\
he proposes to free you in return for {reg5} denars of your hidden wealth. You decide to...",
"none",
[
(assign, reg5, "$player_ransom_amount"),
],
[
("captivity_end_ransom_accept",
[
(store_troop_gold,":player_gold", "trp_player"),
(ge, ":player_gold","$player_ransom_amount")
],"Accept the offer.",
[
(play_cue_track, "track_escape"),
(assign, "$g_player_is_captive", 0),
(troop_remove_gold, "trp_player", "$player_ransom_amount"),
(try_begin),
(party_is_active, "$capturer_party"),
(party_relocate_near_party, "p_main_party", "$capturer_party", 1),
(try_end),
(call_script, "script_set_parties_around_player_ignore_player", 2, 6),
(assign, "$g_player_icon_state", pis_normal),
(set_camera_follow_party, "p_main_party"),
(rest_for_hours, 0, 0, 0), #stop resting
(change_screen_return),
]),
("captivity_end_ransom_deny",
[
],"Refuse him, wait for something better.",
[
(assign, "$g_player_is_captive", 1),
(store_random_in_range, reg(8), 16, 22),
(call_script, "script_stay_captive_for_hours", reg8),
(assign,"$auto_menu", "mnu_captivity_castle_check"),
(change_screen_return),
]),
]
),
(
"captivity_castle_remain",mnf_scale_picture|mnf_disable_all_keys,
"More days pass in the darkness of your cell. You get through them as best you can,\
enduring the kicks and curses of the guards, watching your underfed body waste away more and more...",
"none",
[
(troop_get_type, ":is_female", "trp_player"),
(try_begin),
(eq, ":is_female", 1),
(set_background_mesh, "mesh_pic_prisoner_fem"),
(else_try),
(set_background_mesh, "mesh_pic_prisoner_man"),
(try_end),
(store_random_in_range, ":random_hours", 16, 22),
(call_script, "script_stay_captive_for_hours", ":random_hours"),
(assign,"$auto_menu", "mnu_captivity_castle_check"),
],
[
("continue",[],"Continue...",
[
(assign, "$g_player_is_captive", 1),
(change_screen_return),
]),
]
),
(
"kingdom_army_quest_report_to_army",mnf_scale_picture,
"{s8} sends word that he wishes you to join {reg4?her:his} new military campaign.\
You need to bring at least {reg13} troops to the army,\
and are instructed to raise more men with all due haste if you do not have enough.",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(quest_get_slot, ":quest_target_troop", "qst_report_to_army", slot_quest_target_troop),
(quest_get_slot, ":quest_target_amount", "qst_report_to_army", slot_quest_target_amount),
(call_script, "script_get_information_about_troops_position", ":quest_target_troop", 0),
(str_clear, s9),
(try_begin),
(eq, reg0, 1), #troop is found and text is correct
(str_store_string, s9, s1),
(try_end),
(str_store_troop_name, s8, ":quest_target_troop"),
(assign, reg13, ":quest_target_amount"),
(troop_get_type, reg4, ":quest_target_troop"),
],
[
("continue",[],"Continue...",
[
(quest_get_slot, ":quest_target_troop", "qst_report_to_army", slot_quest_target_troop),
(quest_get_slot, ":quest_target_amount", "qst_report_to_army", slot_quest_target_amount),
(str_store_troop_name_link, s13, ":quest_target_troop"),
(assign, reg13, ":quest_target_amount"),
(setup_quest_text, "qst_report_to_army"),
(str_store_string, s2, "@{s13} asked you to report to him with at least {reg13} troops."),
(call_script, "script_start_quest", "qst_report_to_army", ":quest_target_troop"),
(call_script, "script_report_quest_troop_positions", "qst_report_to_army", ":quest_target_troop", 3),
(change_screen_return),
]),
]
),
(
"kingdom_army_quest_messenger",mnf_scale_picture,
"{s8} sends word that he wishes to speak with you about a task he needs performed.\
He requests you to come and see him as soon as possible.",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall),
(str_store_troop_name, s8, ":faction_marshall"),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"kingdom_army_quest_join_siege_order",mnf_scale_picture,
"{s8} sends word that you are to join the siege of {s9} in preparation for a full assault.\
Your troops are to take {s9} at all costs.",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall),
(quest_get_slot, ":quest_target_center", "qst_join_siege_with_army", slot_quest_target_center),
(str_store_troop_name, s8, ":faction_marshall"),
(str_store_party_name, s9, ":quest_target_center"),
],
[
("continue",[],"Continue...",
[
(call_script, "script_end_quest", "qst_follow_army"),
(quest_get_slot, ":quest_target_center", "qst_join_siege_with_army", slot_quest_target_center),
(faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall),
(str_store_troop_name_link, s13, ":faction_marshall"),
(str_store_party_name_link, s14, ":quest_target_center"),
(setup_quest_text, "qst_join_siege_with_army"),
(str_store_string, s2, "@{s13} ordered you to join the assault against {s14}."),
(call_script, "script_start_quest", "qst_join_siege_with_army", ":faction_marshall"),
(change_screen_return),
]),
]
),
(
"kingdom_army_follow_failed",mnf_scale_picture,
"You have failed to follow {s8}. The marshal assumes that you were otherwise engaged, but would have appreciated your support.",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall),
(str_store_troop_name, s8, ":faction_marshall"),
(call_script, "script_abort_quest", "qst_follow_army", 1),
# (call_script, "script_change_player_relation_with_troop", ":faction_marshall", -3),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"invite_player_to_faction_without_center",mnf_scale_picture,
"You receive an offer of vassalage!^^\
{s8} of {s9} has sent a royal herald to bring you an invititation in his own hand.\
You would be granted the honour of becoming a vassal {lord/lady} of {s9},\
and in return {s8} asks you to swear an oath of homage to him and fight in his military campaigns,\
although he offers you no lands or titles.\
He will surely be offended if you do not take the offer...",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(faction_get_slot, "$g_invite_faction_lord", "$g_invite_faction", slot_faction_leader),
(str_store_troop_name, s8, "$g_invite_faction_lord"),
(str_store_faction_name, s9, "$g_invite_faction"),
],
[
("faction_accept",[],"Accept!",
[(str_store_troop_name,s1,"$g_invite_faction_lord"),
(setup_quest_text,"qst_join_faction"),
(str_store_troop_name_link, s3, "$g_invite_faction_lord"),
(str_store_faction_name_link, s4, "$g_invite_faction"),
(quest_set_slot, "qst_join_faction", slot_quest_giver_troop, "$g_invite_faction_lord"),
(quest_set_slot, "qst_join_faction", slot_quest_expiration_days, 30),
(quest_set_slot, "qst_join_faction", slot_quest_failure_consequence, 0),
(str_store_string, s2, "@Find and speak with {s3} of {s4} to give him your oath of homage."),
(call_script, "script_start_quest", "qst_join_faction", "$g_invite_faction_lord"),
(call_script, "script_report_quest_troop_positions", "qst_join_faction", "$g_invite_faction_lord", 3),
(jump_to_menu, "mnu_invite_player_to_faction_accepted"),
]),
("faction_reject",[],"Decline the invitation.",
[(call_script, "script_change_player_relation_with_troop", "$g_invite_faction_lord", -3),
(call_script, "script_change_player_relation_with_faction", "$g_invite_faction", -10),
(assign, "$g_invite_faction", 0),
(assign, "$g_invite_faction_lord", 0),
(assign, "$g_invite_offered_center", 0),
(change_screen_return),
]),
]
),
(
"invite_player_to_faction",mnf_scale_picture,
"You receive an offer of vassalage!^^\
{s8} of {s9} has sent a royal herald to bring you an invititation in his own hand.\
You would be granted the honour of becoming a vassal {lord/lady} of {s9},\
and in return {s8} asks you to swear an oath of homage to him and fight in his military campaigns,\
offering you the fief of {s2} for your loyal service.\
He will surely be offended if you do not take the offer...",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(faction_get_slot, "$g_invite_faction_lord", "$g_invite_faction", slot_faction_leader),
(str_store_troop_name, s8, "$g_invite_faction_lord"),
(str_store_faction_name, s9, "$g_invite_faction"),
(str_store_party_name, s2, "$g_invite_offered_center"),
],
[
("faction_accept",[],"Accept!",
[(str_store_troop_name,s1,"$g_invite_faction_lord"),
(setup_quest_text,"qst_join_faction"),
(str_store_troop_name_link, s3, "$g_invite_faction_lord"),
(str_store_faction_name_link, s4, "$g_invite_faction"),
(quest_set_slot, "qst_join_faction", slot_quest_giver_troop, "$g_invite_faction_lord"),
(quest_set_slot, "qst_join_faction", slot_quest_expiration_days, 30),
(str_store_string, s2, "@Find and speak with {s3} of {s4} to give him your oath of homage."),
(call_script, "script_start_quest", "qst_join_faction", "$g_invite_faction_lord"),
(call_script, "script_report_quest_troop_positions", "qst_join_faction", "$g_invite_faction_lord", 3),
(jump_to_menu, "mnu_invite_player_to_faction_accepted"),
]),
("faction_reject",[],"Decline the invitation.",
[(call_script, "script_change_player_relation_with_troop", "$g_invite_faction_lord", -3),
(assign, "$g_invite_faction", 0),
(assign, "$g_invite_faction_lord", 0),
(assign, "$g_invite_offered_center", 0),
(change_screen_return),
]),
]
),
(
"invite_player_to_faction_accepted",0,
"In order to become a vassal, you must swear an oath of homage to {s3}.\
You shall have to find him and give him your oath in person. {s5}",
"none",
[
(call_script, "script_get_information_about_troops_position", "$g_invite_faction_lord", 0),
(str_store_troop_name, s3, "$g_invite_faction_lord"),
(str_store_string, s5, "@{!}{s1}"),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"question_peace_offer",0,
"You Receive a Peace Offer^^The {s1} offers you a peace agreement. What is your answer?",
"none",
[
(str_store_faction_name, s1, "$g_notification_menu_var1"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_banner", "$g_notification_menu_var1", pos0),
],
[
("peace_offer_accept",[],"Accept",
[
(call_script, "script_diplomacy_start_peace_between_kingdoms", "fac_player_supporters_faction", "$g_notification_menu_var1", 1),
(change_screen_return),
]),
("peace_offer_reject",[],"Reject",
[
(call_script, "script_change_player_relation_with_faction", "$g_notification_menu_var1", -5),
(change_screen_return),
]),
]
),
(
"notification_truce_expired",0,
"Truce Has Expired^^The truce between {s1} and {s2} has expired.",
"none",
[
(str_store_faction_name, s1, "$g_notification_menu_var1"),
(str_store_faction_name, s2, "$g_notification_menu_var2"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_banner", "$g_notification_menu_var1", pos0),
],
[
("continue",[],"Continue",
[
(change_screen_return),
]),
]
),
(
"notification_feast_quest_expired",0,
"{s10}",
"none",
[
(str_store_string, s10, "str_feast_quest_expired"),
],
[
("continue",[],"Continue",
[
(change_screen_return),
]),
]
),
(
"notification_sortie_possible",0,
"Enemy Sighted: Enemies have been sighted outside the walls of {s4}, and {s5} and others are preparing for a sortie. You may join them if you wish.",
"none",
[
(str_store_party_name, s4, "$g_notification_menu_var1"),
(party_stack_get_troop_id, ":leader", "$g_notification_menu_var2", 0),
(str_store_troop_name, s5, ":leader"),
],
[
("continue",[],"Continue",
[
#stop auto-clock
(change_screen_return),
]),
]
),
(
"notification_casus_belli_expired",0,
"Kingdom Fails to Respond^^The {s1} has not responded to the {s2}'s provocations, and {s3} suffers a loss of face among {reg4?her:his} more bellicose subjects...^",
"none",
[
(str_store_faction_name, s1, "$g_notification_menu_var1"),
(str_store_faction_name, s2, "$g_notification_menu_var2"),
(faction_get_slot, ":faction_leader", "$g_notification_menu_var1", slot_faction_leader),
(str_store_troop_name, s3, ":faction_leader"),
(troop_get_type, reg4, ":faction_leader"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_banner", "$g_notification_menu_var1", pos0),
],
[
("continue",[],"Continue",
[
(call_script, "script_faction_follows_controversial_policy", "$g_notification_menu_var1", logent_policy_ruler_ignores_provocation),
(change_screen_return),
]),
]
),
(
"notification_lord_defects",0,
"Defection: {s4} has abandoned the {s5} and joined the {s7}, taking {reg4?her:his} his fiefs with him",
"none",
[
(assign, ":defecting_lord", "$g_notification_menu_var1"),
(assign, ":old_faction", "$g_notification_menu_var2"),
(str_store_troop_name, s4, ":defecting_lord"),
(str_store_faction_name, s5, ":old_faction"),
(store_faction_of_troop, ":new_faction", ":defecting_lord"),
(str_store_faction_name, s7, ":new_faction"),
(troop_get_type, reg4, ":defecting_lord"),
],
[
("continue",[],"Continue",
[
(change_screen_return),
]),
]
),
(
"notification_treason_indictment",0,
"Treason Indictment^^{s9}",
"none",
[
(assign, ":indicted_lord", "$g_notification_menu_var1"),
(assign, ":former_faction", "$g_notification_menu_var2"),
(faction_get_slot, ":former_faction_leader", ":former_faction", slot_faction_leader),
#Set up string
(try_begin),
(eq, ":indicted_lord", "trp_player"),
(str_store_troop_name, s7, ":former_faction_leader"),
(str_store_string, s9, "str_you_have_been_indicted_for_treason_to_s7_your_properties_have_been_confiscated_and_you_would_be_well_advised_to_flee_for_your_life"),
(else_try),
(str_store_troop_name, s4, ":indicted_lord"),
(str_store_faction_name, s5, ":former_faction"),
(str_store_troop_name, s6, ":former_faction_leader"),
(troop_get_type, reg4, ":indicted_lord"),
(store_faction_of_troop, ":new_faction", ":indicted_lord"),
(try_begin),
(is_between, ":new_faction", kingdoms_begin, kingdoms_end),
(str_store_faction_name, s10, ":new_faction"),
(str_store_string, s11, "str_with_the_s10"),
(else_try),
(str_store_string, s11, "str_outside_calradia"),
(try_end),
(str_store_string, s9, "str_by_order_of_s6_s4_of_the_s5_has_been_indicted_for_treason_the_lord_has_been_stripped_of_all_reg4herhis_properties_and_has_fled_for_reg4herhis_life_he_is_rumored_to_have_gone_into_exile_s11"),
(try_end),
],
[
("continue",[],"Continue",
[
(change_screen_return),
]),
]
),
(
"notification_border_incident",0,
"Border incident^^Word reaches you that {s9}. Though you don't know whether or not the rumors are true, you do know one thing -- this seemingly minor incident has raised passions among the {s4}, making it easier for them to go to war against the {s3}, if they want it...",
"none",
[
(assign, ":acting_village", "$g_notification_menu_var1"),
(assign, ":target_village", "$g_notification_menu_var2"),
(store_faction_of_party, ":acting_faction", ":acting_village"),
(try_begin),
(eq, ":target_village", -1),
(party_get_slot, ":target_faction", ":acting_village", slot_center_original_faction),
(try_begin),
(this_or_next|eq, ":target_faction", ":acting_faction"),
(neg|faction_slot_eq, ":target_faction", slot_faction_state, sfs_active),
(party_get_slot, ":target_faction", ":acting_village", slot_center_ex_faction),
(try_end),
(str_store_party_name, s1, ":acting_village"),
(str_store_faction_name, s3, ":acting_faction"),
(str_store_faction_name, s4, ":target_faction"),
(faction_get_slot, ":target_leader", ":target_faction", slot_faction_leader),
(str_store_troop_name, s5, ":target_leader"),
(str_store_string, s9, "str_local_notables_from_s1_a_village_claimed_by_the_s4_have_been_mistreated_by_their_overlords_from_the_s3_and_petition_s5_for_protection"),
(display_log_message, "@There has been an alleged border incident: {s9}"),
(call_script, "script_add_log_entry", logent_border_incident_subjects_mistreated, ":acting_village", -1, -1, ":acting_faction"),
(else_try),
(store_faction_of_party, ":target_faction", ":target_village"),
(str_store_party_name, s1, ":acting_village"),
(str_store_party_name, s2, ":target_village"),
(store_random_in_range, ":random", 0, 3),
(try_begin),
(eq, ":random", 0),
(str_store_string, s9, "str_villagers_from_s1_stole_some_cattle_from_s2"),
(display_log_message, "@There has been an alleged border incident: {s9}"),
(call_script, "script_add_log_entry", logent_border_incident_cattle_stolen, ":acting_village", ":target_village", -1,":acting_faction"),
(else_try),
(eq, ":random", 1),
(str_store_string, s9, "str_villagers_from_s1_abducted_a_woman_from_a_prominent_family_in_s2_to_marry_one_of_their_boys"),
(display_log_message, "@There has been an alleged border incident: {s9}"),
(call_script, "script_add_log_entry", logent_border_incident_bride_abducted, ":acting_village", ":target_village", -1, ":acting_faction"),
(else_try),
(eq, ":random", 2),
(str_store_string, s9, "str_villagers_from_s1_killed_some_farmers_from_s2_in_a_fight_over_the_diversion_of_a_stream"),
(display_log_message, "@There has been an alleged border incident: {s9}"),
(call_script, "script_add_log_entry", logent_border_incident_villagers_killed, ":acting_village", ":target_village", -1,":acting_faction"),
(try_end),
(try_end),
(str_store_faction_name, s3, ":acting_faction"),
(str_store_faction_name, s4, ":target_faction"),
(store_add, ":slot_provocation_days", ":acting_faction", slot_faction_provocation_days_with_factions_begin),
(val_sub, ":slot_provocation_days", kingdoms_begin),
(faction_set_slot, ":target_faction", ":slot_provocation_days", 30),
],
[
("continue",[],"Continue",
[
(change_screen_return),
]),
]
),
(
"notification_player_faction_active",0,
"You now possess land in your name, without being tied to any kingdom. This makes you a monarch in your own right, with your court temporarily located at {s12}. However, the other kings in Calradia will at first consider you a threat, for if any upstart warlord can grab a throne, then their own legitimacy is called into question.^^You may find it desirable at this time to pledge yourself to an existing kingdom. If you want to continue as a sovereign monarch, then your first priority should be to establish an independent right to rule. You can establish your right to rule through several means -- marrying into a high-born family, recruiting new lords, governing your lands, treating with other kings, or dispatching your companions on missions.^^At any rate, your first step should be to appoint a chief minister from among your companions, to handle affairs of state. Different companions have different capabilities.^You may appoint new ministers from time to time. You may also change the location of your court, by speaking to the minister.",
"none",
[
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_banner", "fac_player_supporters_faction", pos0),
(unlock_achievement, ACHIEVEMENT_CALRADIAN_TEA_PARTY),
(play_track, "track_coronation"),
(try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
(lt, "$g_player_court", walled_centers_begin),
(store_faction_of_party, ":walled_center_faction", ":walled_center"),
(eq, ":walled_center_faction", "fac_player_supporters_faction"),
(assign, "$g_player_court", ":walled_center"),
(try_begin),
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(is_between, ":spouse", kingdom_ladies_begin, kingdom_ladies_end),
(troop_set_slot, ":spouse", slot_troop_cur_center, "$g_player_court"),
(try_end),
(str_store_party_name, s12, "$g_player_court"),
(try_end),
],
[
("appoint_spouse",[
(troop_slot_ge, "trp_player", slot_troop_spouse, 1),
(troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
(neg|troop_slot_eq, ":player_spouse", slot_troop_occupation, slto_kingdom_hero),
(str_store_troop_name, s10, ":player_spouse"),
],"Appoint your wife, {s10}...",
[
(troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
(assign, "$g_player_minister", ":player_spouse"),
(jump_to_menu, "mnu_minister_confirm"),
]),
("appoint_npc1",[
(main_party_has_troop, "trp_npc1"),
(str_store_troop_name, s10, "trp_npc1"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc1"),
(jump_to_menu, "mnu_minister_confirm"),
]),
("appoint_npc2",[
(main_party_has_troop, "trp_npc2"),
(str_store_troop_name, s10, "trp_npc2"),],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc2"),
(jump_to_menu, "mnu_minister_confirm"),]),
("appoint_npc3",[
(main_party_has_troop, "trp_npc3"),
(str_store_troop_name, s10, "trp_npc3"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc3"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc4",[
(main_party_has_troop, "trp_npc4"),
(str_store_troop_name, s10, "trp_npc4"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc4"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc5",[
(main_party_has_troop, "trp_npc5"),
(str_store_troop_name, s10, "trp_npc5"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc5"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc6",[
(main_party_has_troop, "trp_npc6"),
(str_store_troop_name, s10, "trp_npc6"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc6"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc7",[
(main_party_has_troop, "trp_npc7"),
(str_store_troop_name, s10, "trp_npc7"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc7"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc8",[
(main_party_has_troop, "trp_npc8"),
(str_store_troop_name, s10, "trp_npc8"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc8"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc9",[
(main_party_has_troop, "trp_npc9"),
(str_store_troop_name, s10, "trp_npc9"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc9"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc10",[ #was npc9
(main_party_has_troop, "trp_npc10"),
(str_store_troop_name, s10, "trp_npc10"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc10"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc11",[
(main_party_has_troop, "trp_npc11"),
(str_store_troop_name, s10, "trp_npc11"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc11"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc12",[
(main_party_has_troop, "trp_npc12"),
(str_store_troop_name, s10, "trp_npc12"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc12"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc13",[
(main_party_has_troop, "trp_npc13"),
(str_store_troop_name, s10, "trp_npc13"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc13"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc14",[
(main_party_has_troop, "trp_npc14"),
(str_store_troop_name, s10, "trp_npc14"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc14"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc15",[
(main_party_has_troop, "trp_npc15"),
(str_store_troop_name, s10, "trp_npc15"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc15"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_npc16",[
(main_party_has_troop, "trp_npc16"),
(str_store_troop_name, s10, "trp_npc16"),
],"Appoint {s10}",
[
(assign, "$g_player_minister", "trp_npc16"),
(jump_to_menu, "mnu_minister_confirm"), ]),
("appoint_default",[],"Appoint a prominent citizen from the area...",
[
(assign, "$g_player_minister", "trp_temporary_minister"),
(troop_set_faction, "trp_temporary_minister", "fac_player_supporters_faction"),
(jump_to_menu, "mnu_minister_confirm"),
]),
]
),
(
"minister_confirm",0,
"{s9}can be found at your court in {s12}. You should consult periodically, to avoid the accumulation of unresolved issues that may sap your authority...",
"none",
[
(try_begin),
(eq, "$players_kingdom_name_set", 1),
(change_screen_return),
(try_end),
(try_begin),
(eq, "$g_player_minister", "trp_temporary_minister"),
(str_store_string, s9, "str_your_new_minister_"),
(else_try),
(str_store_troop_name, s10, "$g_player_minister"),
(str_store_string, s9, "str_s10_is_your_new_minister_and_"),
(try_end),
(try_begin),
(main_party_has_troop, "$g_player_minister"),
(remove_member_from_party, "$g_player_minister", "p_main_party"),
(try_end),
],
[
("continue",[],"Continue...",
[
(start_presentation, "prsnt_name_kingdom"),
]),
]
),
(
"notification_court_lost",0,
"{s12}",
"none",
[
(try_begin),
(is_between, "$g_player_court", centers_begin, centers_end),
(str_store_party_name, s10, "$g_player_court"),
(str_store_party_name, s11, "$g_player_court"),
(else_try),
(str_store_string, s10, "str_your_previous_court_some_time_ago"),
(str_store_string, s11, "str_your_previous_court_some_time_ago"),
(try_end),
(assign, "$g_player_court", -1),
(str_store_string, s14, "str_after_to_the_fall_of_s11_your_court_has_nowhere_to_go"),
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),
(str_store_string, s14, "str_as_you_no_longer_maintain_an_independent_kingdom_you_no_longer_maintain_a_court"),
(try_end),
(try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
(eq, "$g_player_court", -1),
(store_faction_of_party, ":walled_center_faction", ":walled_center"),
(eq, ":walled_center_faction", "fac_player_supporters_faction"),
(neg|party_slot_ge, ":walled_center", slot_town_lord, active_npcs_begin),
(assign, "$g_player_court", ":walled_center"),
(try_begin),
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(is_between, ":spouse", kingdom_ladies_begin, kingdom_ladies_end),
(troop_set_slot, ":spouse", slot_troop_cur_center, "$g_player_court"),
(str_store_party_name, s11, "$g_player_court"),
(try_end),
(str_store_string, s14, "str_due_to_the_fall_of_s10_your_court_has_been_relocated_to_s12"),
(try_end),
(try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
(eq, "$g_player_court", -1),
(store_faction_of_party, ":walled_center_faction", ":walled_center"),
(eq, ":walled_center_faction", "fac_player_supporters_faction"),
(assign, "$g_player_court", ":walled_center"),
(try_begin),
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(is_between, ":spouse", kingdom_ladies_begin, kingdom_ladies_end),
(troop_set_slot, ":spouse", slot_troop_cur_center, "$g_player_court"),
(try_end),
(party_get_slot, ":town_lord", ":walled_center", slot_town_lord),
(str_store_party_name, s11, "$g_player_court"),
(str_store_troop_name, s9, ":town_lord"),
(str_store_string, s14, "str_after_to_the_fall_of_s10_your_faithful_vassal_s9_has_invited_your_court_to_s11_"),
(try_end),
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),
(str_store_string, s14, "str_as_you_no_longer_maintain_an_independent_kingdom_you_no_longer_maintain_a_court"),
(try_end),
(str_store_string, s12, s14),
],
[
("continue",[],"Continue...",[
(change_screen_return),
]),
],
),
(
"notification_player_faction_deactive",0,
"Your kingdom no longer holds any land.",
"none",
[
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_banner", "fac_player_supporters_faction", pos0),
],
[
("continue",[],"Continue...",
[
(try_begin),
(try_end),
(assign, "$g_player_minister", -1),
(change_screen_return),
]),
]
),
(
"notification_player_wedding_day",mnf_scale_picture,
"{s8} wishes to inform you that preparations for your wedding at {s10} have been complete, and that your presence is expected imminently .",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(str_store_troop_name, s8, "$g_notification_menu_var1"),
(str_store_party_name, s10, "$g_notification_menu_var2"),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_player_kingdom_holds_feast",mnf_scale_picture,
"{s11}",
"none",
[
(set_background_mesh, "mesh_pic_messenger"),
(str_store_troop_name, s8, "$g_notification_menu_var1"),
(store_faction_of_troop, ":host_faction", "$g_notification_menu_var1"),
(str_store_faction_name, s9, ":host_faction"),
# (str_store_faction_name, s9, "$players_kingdom"),
(str_store_party_name, s10, "$g_notification_menu_var2"),
(str_clear, s12),
(try_begin),
(check_quest_active, "qst_wed_betrothed"),
(quest_get_slot, ":giver_troop", "qst_wed_betrothed", slot_quest_giver_troop),
(store_faction_of_troop, ":giver_troop_faction", ":giver_troop"),
(eq, ":giver_troop_faction", "$players_kingdom"),
(str_store_string, s12, "str_feast_wedding_opportunity"),
(try_end),
(str_store_string, s11, "str_s8_wishes_to_inform_you_that_the_lords_of_s9_will_be_gathering_for_a_feast_at_his_great_hall_in_s10_and_invites_you_to_be_part_of_this_august_assembly"),
(try_begin),
(eq, "$g_notification_menu_var1", 0),
(str_store_string, s11, "str_the_great_lords_of_your_kingdom_plan_to_gather_at_your_hall_in_s10_for_a_feast"),
(try_end),
(str_store_string, s11, "@{!}{s11}{s12}"),
(try_begin),
(ge, "$cheat_mode", 1),
(store_current_hours, ":hours_since_last_feast"),
(faction_get_slot, ":last_feast_start_time", "$players_kingdom", slot_faction_last_feast_start_time),
(val_sub, ":hours_since_last_feast", ":last_feast_start_time"),
(assign, reg4, ":hours_since_last_feast"),
(display_message, "@{!}DEBUG -- Hours since last feast started: {reg4}"),
(try_end),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_center_under_siege",0,
"{s1} has been besieged by {s2} of {s3}!",
"none",
[
(str_store_party_name, s1, "$g_notification_menu_var1"),
(str_store_troop_name, s2, "$g_notification_menu_var2"),
(store_troop_faction, ":troop_faction", "$g_notification_menu_var2"),
(str_store_faction_name, s3, ":troop_faction"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 62),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(set_game_menu_tableau_mesh, "tableau_center_note_mesh", "$g_notification_menu_var1", pos0),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_village_raided",0,
"Enemies have Laid Waste to a Fief^^{s1} has been raided by {s2} of {s3}!",
"none",
[
(str_store_party_name, s1, "$g_notification_menu_var1"),
(str_store_troop_name, s2, "$g_notification_menu_var2"),
(store_troop_faction, ":troop_faction", "$g_notification_menu_var2"),
(str_store_faction_name, s3, ":troop_faction"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 62),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(set_game_menu_tableau_mesh, "tableau_center_note_mesh", "$g_notification_menu_var1", pos0),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_village_raid_started",0,
"Your Village is under Attack!^^{s2} of {s3} is laying waste to {s1}.",
"none",
[
(str_store_party_name, s1, "$g_notification_menu_var1"),
(str_store_troop_name, s2, "$g_notification_menu_var2"),
(store_troop_faction, ":troop_faction", "$g_notification_menu_var2"),
(str_store_faction_name, s3, ":troop_faction"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 62),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(set_game_menu_tableau_mesh, "tableau_center_note_mesh", "$g_notification_menu_var1", pos0),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_one_faction_left",0,
"Calradia Conquered by One Kingdom^^{s1} has defeated all rivals and stands as the sole kingdom.",
"none",
[
(str_store_faction_name, s1, "$g_notification_menu_var1"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(try_begin),
(is_between, "$g_notification_menu_var1", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_for_menu", "$g_notification_menu_var1", pos0),
(else_try),
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_banner", "$g_notification_menu_var1", pos0),
(try_end),
(try_begin),
(faction_slot_eq, "$g_notification_menu_var1", slot_faction_leader, "trp_player"),
(unlock_achievement, ACHIEVEMENT_THE_GOLDEN_THRONE),
(else_try),
(unlock_achievement, ACHIEVEMENT_MANIFEST_DESTINY),
(try_end),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_oath_renounced_faction_defeated",0,
"Your Old Faction was Defeated^^You won the battle against {s1}! This ends your struggle which started after you renounced your oath to them.",
"none",
[
(str_store_faction_name, s1, "$g_notification_menu_var1"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(try_begin),
(is_between, "$g_notification_menu_var1", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_for_menu", "$g_notification_menu_var1", pos0),
(else_try),
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_banner", "$g_notification_menu_var1", pos0),
(try_end),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_center_lost",0,
"An Estate was Lost^^You have lost {s1} to {s2}.",
"none",
[
(str_store_party_name, s1, "$g_notification_menu_var1"),
(str_store_faction_name, s2, "$g_notification_menu_var2"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 62),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(set_game_menu_tableau_mesh, "tableau_center_note_mesh", "$g_notification_menu_var1", pos0),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_troop_left_players_faction",0,
"Betrayal!^^{s1} has left {s2} and joined {s3}.",
"none",
[
(str_store_troop_name, s1, "$g_notification_menu_var1"),
(str_store_faction_name, s2, "$players_kingdom"),
(str_store_faction_name, s3, "$g_notification_menu_var2"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 55),
(position_set_y, pos0, 20),
(position_set_z, pos0, 100),
(set_game_menu_tableau_mesh, "tableau_troop_note_mesh", "$g_notification_menu_var1", pos0),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_troop_joined_players_faction",0,
"Good news!^^ {s1} has left {s2} and joined {s3}.",
"none",
[
(str_store_troop_name, s1, "$g_notification_menu_var1"),
(str_store_faction_name, s2, "$g_notification_menu_var2"),
(str_store_faction_name, s3, "$players_kingdom"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 55),
(position_set_y, pos0, 20),
(position_set_z, pos0, 100),
(set_game_menu_tableau_mesh, "tableau_troop_note_mesh", "$g_notification_menu_var1", pos0),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_war_declared",0,
"Declaration of War^^{s1} has declared war against {s2}!",
"none",
[
# (try_begin),
# (eq, "$g_include_diplo_explanation", "$g_notification_menu_var1"),
# (assign, "$g_include_diplo_explanation", 0),
# (str_store_string, s57, "$g_notification_menu_var1"),
# (else_try),
# (str_clear, s57),
# (try_end),
#to do the reason, have war_damage = 0 yield pre-war reasons
(try_begin),
# (eq, "$g_notification_menu_var1", "fac_player_supporters_faction"),
# (str_store_faction_name, s1, "$g_notification_menu_var2"),
# (str_store_string, s2, "@you"),
# (else_try),
# (eq, "$g_notification_menu_var2", "fac_player_supporters_faction"),
# (str_store_faction_name, s1, "$g_notification_menu_var1"),
# (str_store_string, s2, "@you"),
# (else_try),
(str_store_faction_name, s1, "$g_notification_menu_var1"),
(str_store_faction_name, s2, "$g_notification_menu_var2"),
(try_end),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(store_sub, ":faction_1", "$g_notification_menu_var1", kingdoms_begin),
(store_sub, ":faction_2", "$g_notification_menu_var2", kingdoms_begin),
(val_mul, ":faction_1", 128),
(val_add, ":faction_1", ":faction_2"),
(set_game_menu_tableau_mesh, "tableau_2_factions_mesh", ":faction_1", pos0),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_peace_declared",0,
"Peace Agreement^^{s1} and {s2} have made peace!^{s57}",
"none",
[
(try_begin),
(eq, 1, 0), #Alas, this does not seem to work
(eq, "$g_include_diplo_explanation", "$g_notification_menu_var1"),
(assign, "$g_include_diplo_explanation", 0),
(else_try),
(str_clear, s57),
(try_end),
(str_store_faction_name, s1, "$g_notification_menu_var1"),
(str_store_faction_name, s2, "$g_notification_menu_var2"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(store_sub, ":faction_1", "$g_notification_menu_var1", kingdoms_begin),
(store_sub, ":faction_2", "$g_notification_menu_var2", kingdoms_begin),
(val_mul, ":faction_1", 128),
(val_add, ":faction_1", ":faction_2"),
(set_game_menu_tableau_mesh, "tableau_2_factions_mesh", ":faction_1", pos0),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_faction_defeated",0,
"Faction Eliminated^^{s1} is no more!",
"none",
[
(str_store_faction_name, s1, "$g_notification_menu_var1"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(try_begin),
(is_between, "$g_notification_menu_var1", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_for_menu", "$g_notification_menu_var1", pos0),
(else_try),
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_banner", "$g_notification_menu_var1", pos0),
(try_end),
],
[
("continue",[],"Continue...",
[
(try_begin),
(is_between, "$supported_pretender", pretenders_begin, pretenders_end),
(troop_slot_eq, "$supported_pretender", slot_troop_original_faction, "$g_notification_menu_var1"),
#All rebels switch to kingdom
(try_for_range, ":cur_troop", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":cur_faction", ":cur_troop"),
(eq, ":cur_faction", "fac_player_supporters_faction"),
(troop_set_faction, ":cur_troop", "$g_notification_menu_var1"),
(call_script, "script_troop_set_title_according_to_faction", ":cur_troop", "$g_notification_menu_var1"),
(try_begin),
(this_or_next|eq, "$g_notification_menu_var1", "$players_kingdom"),
(eq, "$g_notification_menu_var1", "fac_player_supporters_faction"),
(call_script, "script_check_concilio_calradi_achievement"),
(try_end),
(else_try), #all loyal lords gain a small bonus with the player
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(store_troop_faction, ":cur_faction", ":cur_troop"),
(eq, ":cur_faction", "$g_notification_menu_var1"),
(call_script, "script_troop_change_relation_with_troop", ":cur_troop", "trp_player", 5),
(try_end),
(try_for_parties, ":cur_party"),
(store_faction_of_party, ":cur_faction", ":cur_party"),
(eq, ":cur_faction", "fac_player_supporters_faction"),
(party_set_faction, ":cur_party", "$g_notification_menu_var1"),
(try_end),
(assign, "$players_kingdom", "$g_notification_menu_var1"),
(try_begin),
(troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
(is_between, ":spouse", kingdom_ladies_begin, kingdom_ladies_end),
(troop_set_faction, ":spouse", "$g_notification_menu_var1"),
(try_end),
(call_script, "script_add_notification_menu", "mnu_notification_rebels_switched_to_faction", "$g_notification_menu_var1", "$supported_pretender"),
(faction_set_slot, "$g_notification_menu_var1", slot_faction_state, sfs_active),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),
(faction_get_slot, ":old_leader", "$g_notification_menu_var1", slot_faction_leader),
(troop_set_slot, ":old_leader", slot_troop_change_to_faction, "fac_commoners"),
(faction_set_slot, "$g_notification_menu_var1", slot_faction_leader, "$supported_pretender"),
(troop_set_faction, "$supported_pretender", "$g_notification_menu_var1"),
(faction_get_slot, ":old_marshall", "$g_notification_menu_var1", slot_faction_marshall),
(try_begin),
(ge, ":old_marshall", 0),
(troop_get_slot, ":old_marshall_party", ":old_marshall", slot_troop_leaded_party),
(party_is_active, ":old_marshall_party"),
(party_set_marshall, ":old_marshall_party", 0),
(try_end),
(faction_set_slot, "$g_notification_menu_var1", slot_faction_marshall, "trp_player"),
(faction_set_slot, "$g_notification_menu_var1", slot_faction_ai_state, sfai_default),
(faction_set_slot, "$g_notification_menu_var1", slot_faction_ai_object, -1),
(troop_set_slot, "$supported_pretender", slot_troop_occupation, slto_kingdom_hero),
(troop_set_slot, "$supported_pretender", slot_troop_renown, 1000),
(party_remove_members, "p_main_party", "$supported_pretender", 1),
(call_script, "script_set_player_relation_with_faction", "$g_notification_menu_var1", 0),
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(neq, ":cur_kingdom", "$g_notification_menu_var1"),
(store_relation, ":reln", ":cur_kingdom", "fac_player_supporters_faction"),
(set_relation, ":cur_kingdom", "$g_notification_menu_var1", ":reln"),
(try_end),
(assign, "$supported_pretender", 0),
(assign, "$supported_pretender_old_faction", 0),
(assign, "$g_recalculate_ais", 1),
(call_script, "script_update_all_notes"),
(try_end),
(change_screen_return),
]),
]
),
(
"notification_rebels_switched_to_faction",0,
"Rebellion Success^^ Your rebellion is victorious! Your faction now has the sole claim to the title of {s11}, with {s12} as the single ruler.",
"none",
[
(str_store_faction_name, s11, "$g_notification_menu_var1"),
(str_store_troop_name, s12, "$g_notification_menu_var2"),
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 65),
(position_set_y, pos0, 30),
(position_set_z, pos0, 170),
(try_begin),
(is_between, "$g_notification_menu_var1", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_for_menu", "$g_notification_menu_var1", pos0),
(else_try),
(set_game_menu_tableau_mesh, "tableau_faction_note_mesh_banner", "$g_notification_menu_var1", pos0),
(try_end),
],
[
("continue",[],"Continue...",
[
(assign, "$talk_context", tc_rebel_thanks),
(start_map_conversation, "$g_notification_menu_var2", -1),
(change_screen_return),
]),
]
),
(
"notification_player_should_consult",0,
"Your minister send words that there are problems brewing in the realm which, if left untreated, could sap your authority. You should consult with him at your earliest convenience",
"none",
[
],
[
("continue",[],"Continue...",
[
(setup_quest_text, "qst_consult_with_minister"),
(str_store_troop_name, s11, "$g_player_minister"),
(str_store_party_name, s12, "$g_player_court"),
(str_store_string, s2, "str_consult_with_s11_at_your_court_in_s12"),
(call_script, "script_start_quest", "qst_consult_with_minister", -1),
(quest_set_slot, "qst_consult_with_minister", slot_quest_expiration_days, 30),
(quest_set_slot, "qst_consult_with_minister", slot_quest_giver_troop, "$g_player_minister"),
(change_screen_return),
]),
]
),
(
"notification_player_feast_in_progress",0,
"Feast in Preparation^^Your wife has started preparations for a feast in your hall in {s11}",
"none",
[
(str_store_party_name, s11, "$g_notification_menu_var1"),
],
[
("continue",[],"Continue...",
[(change_screen_return),
]),
]
),
(
"notification_lady_requests_visit",0, #add this once around seven days after the last visit, or three weeks, or three months
"An elderly woman approaches your party and passes one of your men a letter, sealed in plain wax. It is addressed to you. When you break the seal, you see it is from {s15}. It reads, 'I so enjoyed your last visit. {s14} I am currently in {s10}.{s12}'",
"none",
[
(assign, ":lady_no", "$g_notification_menu_var1"),
(assign, ":center_no", "$g_notification_menu_var2"),
(str_store_troop_name, s15, ":lady_no"),
(str_store_party_name, s10, ":center_no"),
(store_current_hours, ":hours_since_last_visit"),
(troop_get_slot, ":last_visit_hours", ":lady_no", slot_troop_last_talk_time),
(val_sub, ":hours_since_last_visit", ":last_visit_hours"),
(call_script, "script_get_kingdom_lady_social_determinants", ":lady_no"),
(assign, ":lady_guardian", reg0),
(str_store_troop_name, s16, ":lady_guardian"),
(call_script, "script_troop_get_family_relation_to_troop", ":lady_guardian", ":lady_no"),
(str_clear, s14),
(try_begin),
(lt, ":hours_since_last_visit", 336),
(try_begin),
(troop_slot_eq, ":lady_no", slot_lord_reputation_type, lrep_otherworldly),
(str_store_string, s14, "str_as_brief_as_our_separation_has_been_the_longing_in_my_heart_to_see_you_has_made_it_seem_as_many_years"),
(else_try),
(str_store_string, s14, "str_although_it_has_only_been_a_short_time_since_your_departure_but_i_would_be_most_pleased_to_see_you_again"),
(try_end),
(else_try),
(ge, ":hours_since_last_visit", 336),
(try_begin),
(troop_slot_eq, ":lady_no", slot_lord_reputation_type, lrep_ambitious),
(str_store_string, s14, "str_although_i_have_received_no_word_from_you_for_quite_some_time_i_am_sure_that_you_must_have_been_very_busy_and_that_your_failure_to_come_see_me_in_no_way_indicates_that_your_attentions_to_me_were_insincere_"),
(else_try),
(troop_slot_eq, ":lady_no", slot_lord_reputation_type, lrep_moralist),
(str_store_string, s14, "str_i_trust_that_you_have_comported_yourself_in_a_manner_becoming_a_gentleman_during_our_long_separation_"),
(else_try),
(str_store_string, s14, "str_it_has_been_many_days_since_you_came_and_i_would_very_much_like_to_see_you_again"),
(try_end),
(try_end),
(str_clear, s12),
(str_clear, s18),
(try_begin),
(troop_slot_eq, ":lady_guardian", slot_lord_granted_courtship_permission, 0),
(str_store_string, s12, "str__you_should_ask_my_s11_s16s_permission_but_i_have_no_reason_to_believe_that_he_will_prevent_you_from_coming_to_see_me"),
(str_store_string, s18, "str__you_should_first_ask_her_s11_s16s_permission"),
(else_try),
(troop_slot_eq, ":lady_guardian", slot_lord_granted_courtship_permission, -1),
(str_store_string, s12, "str__alas_as_we_know_my_s11_s16_will_not_permit_me_to_see_you_however_i_believe_that_i_can_arrange_away_for_you_to_enter_undetected"),
(else_try),
(troop_slot_eq, ":lady_guardian", slot_lord_granted_courtship_permission, 1),
(str_store_string, s12, "str__as_my_s11_s16_has_already_granted_permission_for_you_to_see_me_i_shall_expect_your_imminent_arrival"),
(try_end),
],
[
("continue",[],"Tell the woman to inform her mistress that you will come shortly",
[
(assign, ":lady_to_visit", "$g_notification_menu_var1"),
(str_store_troop_name_link, s3, ":lady_to_visit"),
(str_store_party_name_link, s4, "$g_notification_menu_var2"),
(str_store_string, s2, "str_visit_s3_who_was_last_at_s4s18"),
(call_script, "script_start_quest", "qst_visit_lady", ":lady_to_visit"),
(quest_set_slot, "qst_visit_lady", slot_quest_giver_troop, ":lady_to_visit"), #don't know why this is necessary
(try_begin),
(eq, "$cheat_mode", 1),
(quest_get_slot, ":giver_troop", "qst_visit_lady", slot_quest_giver_troop),
(str_store_troop_name, s2, ":giver_troop"),
(display_message, "str_giver_troop_=_s2"),
(try_end),
(quest_set_slot, "qst_visit_lady", slot_quest_expiration_days, 30),
(change_screen_return),
]),
("continue",[],"Tell the woman to inform her mistress that you are indisposed",
[
(troop_set_slot, "$g_notification_menu_var1", slot_lady_no_messages, 1),
(change_screen_return),
]),
]
),
( #pre lady visit
"garden",0,
"{s12}",
"none",
[
(call_script, "script_get_kingdom_lady_social_determinants", "$love_interest_in_town"),
(assign, ":guardian_lord", reg0),
(str_store_troop_name, s11, "$love_interest_in_town"),
(try_begin),
(call_script, "script_npc_decision_checklist_male_guardian_assess_suitor", ":guardian_lord", "trp_player"),
(lt, reg0, 0),
(troop_set_slot, ":guardian_lord", slot_lord_granted_courtship_permission, -1),
(try_end),
(assign, "$nurse_assists_entry", 0),
(try_begin),
(troop_slot_eq, ":guardian_lord", slot_lord_granted_courtship_permission, 1),
(str_store_string, s12, "str_the_guards_at_the_gate_have_been_ordered_to_allow_you_through_you_might_be_imagining_things_but_you_think_one_of_them_may_have_given_you_a_wink"),
(else_try), #the circumstances under which the lady arranges for a surreptitious entry
(call_script, "script_troop_get_relation_with_troop", "trp_player", "$love_interest_in_town"),
(gt, reg0, 0),
(assign, ":player_completed_quest", 0),
(try_begin),
(check_quest_active, "qst_visit_lady"),
(quest_slot_eq, "qst_visit_lady", slot_quest_giver_troop, "$love_interest_in_town"),
(assign, ":player_completed_quest", 1),
(else_try),
(check_quest_active, "qst_formal_marriage_proposal"),
(quest_slot_eq, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$love_interest_in_town"),
(this_or_next|check_quest_succeeded, "qst_formal_marriage_proposal"),
(check_quest_failed, "qst_formal_marriage_proposal"),
(assign, ":player_completed_quest", 1),
(else_try),
(check_quest_active, "qst_duel_courtship_rival"),
(quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$love_interest_in_town"),
(this_or_next|check_quest_succeeded, "qst_duel_courtship_rival"),
(check_quest_failed, "qst_duel_courtship_rival"),
(assign, ":player_completed_quest", 1),
(try_end),
(try_begin),
(store_current_hours, ":hours_since_last_visit"),
(troop_get_slot, ":last_visit_time", "$love_interest_in_town", slot_troop_last_talk_time),
(val_sub, ":hours_since_last_visit", ":last_visit_time"),
(this_or_next|ge, ":hours_since_last_visit", 96), #at least four days
(eq, ":player_completed_quest", 1),
(try_begin),
(is_between, "$g_encountered_party", towns_begin, towns_end),
(str_store_string, s12, "str_the_guards_glare_at_you_and_you_know_better_than_to_ask_permission_to_enter_however_as_you_walk_back_towards_your_lodgings_an_elderly_lady_dressed_in_black_approaches_you_i_am_s11s_nurse_she_whispers_urgently_don_this_dress_and_throw_the_hood_over_your_face_i_will_smuggle_you_inside_the_castle_to_meet_her_in_the_guise_of_a_skullery_maid__the_guards_will_not_look_too_carefully_but_i_beg_you_for_all_of_our_sakes_be_discrete"),
(assign, "$nurse_assists_entry", 1),
(else_try),
(str_store_string, s12, "str_the_guards_glare_at_you_and_you_know_better_than_to_ask_permission_to_enter_however_as_you_walk_back_towards_your_lodgings_an_elderly_lady_dressed_in_black_approaches_you_i_am_s11s_nurse_she_whispers_urgently_wait_for_a_while_by_the_spring_outside_the_walls_i_will_smuggle_her_ladyship_out_to_meet_you_dressed_in_the_guise_of_a_shepherdess_but_i_beg_you_for_all_of_our_sakes_be_discrete"),
(assign, "$nurse_assists_entry", 2),
(try_end),
(else_try),
(str_store_string, s12, "str_the_guards_glare_at_you_and_you_know_better_than_to_ask_permission_to_enter_however_as_you_walk_back_towards_your_lodgings_an_elderly_lady_dressed_in_black_approaches_you_i_am_s11s_nurse_she_whispers_urgently_her_ladyship_asks_me_to_say_that_yearns_to_see_you_but_that_you_should_bide_your_time_a_bit_her_ladyship_says_that_to_arrange_a_clandestine_meeting_so_soon_after_your_last_encounter_would_be_too_dangerous"),
(try_end),
(else_try),
(str_store_string, s12, "str_the_guards_glare_at_you_and_you_know_better_than_to_ask_permission_to_enter"),
(try_end),
],
[
("enter",
[
(call_script, "script_get_kingdom_lady_social_determinants", "$love_interest_in_town"),
(troop_slot_eq, reg0, slot_lord_granted_courtship_permission, 1)
], "Enter",
[
(jump_to_menu, "mnu_town"),
(call_script, "script_setup_meet_lady", "$love_interest_in_town", "$g_encountered_party"),
]
),
("nurse",
[
(eq, "$nurse_assists_entry", 1),
], "Go with the nurse",
[
(jump_to_menu, "mnu_town"),
(call_script, "script_setup_meet_lady", "$love_interest_in_town", "$g_encountered_party"),
]
),
("nurse",
[
(eq, "$nurse_assists_entry", 2),
], "Wait by the spring",
[
(jump_to_menu, "mnu_town"),
(call_script, "script_setup_meet_lady", "$love_interest_in_town", "$g_encountered_party"),
]
),
("leave",
[],
"Leave",
[(jump_to_menu, "mnu_town")]),
]
),
(
"kill_local_merchant_begin",0,
"You spot your victim and follow him, observing as he turns a corner into a dark alley.\
This will surely be your best opportunity to attack him.",
"none",
[
],
[
("continue",[],"Continue...",
[(set_jump_mission,"mt_back_alley_kill_local_merchant"),
(party_get_slot, ":town_alley", "$qst_kill_local_merchant_center", slot_town_alley),
(modify_visitors_at_site,":town_alley"),
(reset_visitors),
(set_visitor, 0, "trp_player"),
(set_visitor, 1, "trp_local_merchant"),
(jump_to_menu, "mnu_town"),
(jump_to_scene,":town_alley"),
(change_screen_mission),
]),
]
),
(
"debug_alert_from_s65",0,
"DEBUG ALERT: {s65}",
"none",
[
],
[
("continue",[],"Continue...",
[
(assign, "$debug_message_in_queue", 0),
(change_screen_return),
]),
]
),
(
"auto_return_to_map",0,
"stub",
"none",
[(change_screen_map)],
[]
),
(
"bandit_lair",0,
"{s3}",
"none",
[
(try_begin),
(eq, "$loot_screen_shown", 1),
(try_for_range, ":bandit_template", "pt_steppe_bandits", "pt_deserters"),
(party_template_slot_eq, ":bandit_template", slot_party_template_lair_party, "$g_encountered_party"),
(party_template_set_slot, ":bandit_template", slot_party_template_lair_party, 0),
(try_end),
(try_begin),
(ge, "$g_encountered_party", 0),
(party_is_active, "$g_encountered_party"),
(party_get_template_id, ":template", "$g_encountered_party"),
(neq, ":template", "pt_looter_lair"),
(remove_party, "$g_encountered_party"),
(try_end),
(assign, "$g_leave_encounter", 0),
(change_screen_return),
(else_try),
(party_stack_get_troop_id, ":bandit_type", "$g_encountered_party", 0),
(str_store_troop_name_plural, s4, ":bandit_type"),
(str_store_string, s5, "str_bandit_approach_defile"),
(try_begin),
(eq, ":bandit_type", "trp_desert_bandit"),
(str_store_string, s5, "str_bandit_approach_defile"),
(else_try),
(eq, ":bandit_type", "trp_mountain_bandit"),
(str_store_string, s5, "str_bandit_approach_cliffs"),
(else_try),
(eq, ":bandit_type", "trp_forest_bandit"),
(str_store_string, s5, "str_bandit_approach_swamp"),
(else_try),
(eq, ":bandit_type", "trp_taiga_bandit"),
(str_store_string, s5, "str_bandit_approach_swamp"),
(else_try),
(eq, ":bandit_type", "trp_steppe_bandit"),
(str_store_string, s5, "str_bandit_approach_thickets"),
(else_try),
(eq, ":bandit_type", "trp_sea_raider"),
(str_store_string, s5, "str_bandit_approach_cove"),
(try_end),
(try_begin),
(party_slot_eq, "$g_encountered_party", slot_party_ai_substate, 0), #used in place of global variable
(str_store_string, s3, "str_bandit_hideout_preattack"),
(else_try),
(party_get_template_id, ":template", "$g_encountered_party"),
(eq, ":template", "pt_looter_lair"),
(party_slot_eq, "$g_encountered_party", slot_party_ai_substate, 1), #used in place of global variable
(str_store_string, s3, "str_lost_startup_hideout_attack"),
(else_try),
(party_slot_eq, "$g_encountered_party", slot_party_ai_substate, 1), #used in place of global variable
(str_store_string, s3, "str_bandit_hideout_failure"),
(else_try),
(party_slot_eq, "$g_encountered_party", slot_party_ai_substate, 2), #used in place of global variable
(str_store_string, s3, "str_bandit_hideout_success"),
(try_end),
(try_end),
],
[
("continue_1",
[
(party_slot_eq, "$g_encountered_party", slot_party_ai_substate, 0), #used in place of global variable
],
"Attack the hideout...",
[
(party_set_slot, "$g_encountered_party", slot_party_ai_substate, 1),
(party_get_template_id, ":template", "$g_encountered_party"),
(assign, "$g_enemy_party", "$g_encountered_party"),
(try_begin),
(eq, ":template", "pt_sea_raider_lair"),
(assign, ":bandit_troop", "trp_sea_raider"),
(assign, ":scene_to_use", "scn_lair_sea_raiders"),
(else_try),
(eq, ":template", "pt_forest_bandit_lair"),
(assign, ":bandit_troop", "trp_forest_bandit"),
(assign, ":scene_to_use", "scn_lair_forest_bandits"),
(else_try),
(eq, ":template", "pt_desert_bandit_lair"),
(assign, ":bandit_troop", "trp_desert_bandit"),
(assign, ":scene_to_use", "scn_lair_desert_bandits"),
(else_try),
(eq, ":template", "pt_mountain_bandit_lair"),
(assign, ":bandit_troop", "trp_mountain_bandit"),
(assign, ":scene_to_use", "scn_lair_mountain_bandits"),
(else_try),
(eq, ":template", "pt_taiga_bandit_lair"),
(assign, ":bandit_troop", "trp_taiga_bandit"),
(assign, ":scene_to_use", "scn_lair_taiga_bandits"),
(else_try),
(eq, ":template", "pt_steppe_bandit_lair"),
(assign, ":bandit_troop", "trp_steppe_bandit"),
(assign, ":scene_to_use", "scn_lair_steppe_bandits"),
(else_try),
(eq, ":template", "pt_looter_lair"),
(assign, ":bandit_troop", "trp_looter"),
(store_faction_of_party, ":starting_town_faction", "$g_starting_town"),
(try_begin),
(eq, ":starting_town_faction", "fac_kingdom_1"), #player selected swadian city as starting town.
(assign, ":scene_to_use", "scn_lair_forest_bandits"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_2"), #player selected Vaegir city as starting town.
(assign, ":scene_to_use", "scn_lair_taiga_bandits"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_3"), #player selected Khergit city as starting town.
(assign, ":scene_to_use", "scn_lair_steppe_bandits"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_4"), #player selected Nord city as starting town.
(assign, ":scene_to_use", "scn_lair_sea_raiders"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_5"), #player selected Rhodok city as starting town.
(assign, ":scene_to_use", "scn_lair_mountain_bandits"),
(else_try),
(eq, ":starting_town_faction", "fac_kingdom_6"), #player selected Sarranid city as starting town.
(assign, ":scene_to_use", "scn_lair_desert_bandits"),
(try_end),
(try_end),
(modify_visitors_at_site,":scene_to_use"),
(reset_visitors),
(store_character_level, ":player_level", "trp_player"),
(store_add, ":number_of_bandits_will_be_spawned_at_each_period", 5, ":player_level"),
(val_div, ":number_of_bandits_will_be_spawned_at_each_period", 3),
(try_for_range, ":unused", 0, ":number_of_bandits_will_be_spawned_at_each_period"),
(store_random_in_range, ":random_entry_point", 2, 11),
(set_visitor, ":random_entry_point", ":bandit_troop", 1),
(try_end),
(party_clear, "p_temp_casualties"),
(set_party_battle_mode),
(set_battle_advantage, 0),
(assign, "$g_battle_result", 0),
(set_jump_mission,"mt_bandit_lair"),
(jump_to_scene, ":scene_to_use"),
(change_screen_mission),
]),
("leave_no_attack",
[
(party_slot_eq, "$g_encountered_party", slot_party_ai_substate, 0),
],
"Leave...",
[
(change_screen_return),
]),
("leave_victory",
[
(party_slot_eq, "$g_encountered_party", slot_party_ai_substate, 2),
],
"Continue...",
[
(try_for_range, ":bandit_template", "pt_steppe_bandits", "pt_deserters"),
(party_template_slot_eq, ":bandit_template", slot_party_template_lair_party, "$g_encountered_party"),
(party_template_set_slot, ":bandit_template", slot_party_template_lair_party, 0),
(try_end),
(party_get_template_id, ":template", "$g_encountered_party"),
(try_begin),
(neq, ":template", "pt_looter_lair"),
(check_quest_active, "qst_destroy_bandit_lair"),
(quest_slot_eq, "qst_destroy_bandit_lair", slot_quest_target_party, "$g_encountered_party"),
(call_script, "script_succeed_quest", "qst_destroy_bandit_lair"),
(try_end),
(assign, "$g_leave_encounter", 0),
(change_screen_return),
(try_begin),
(eq, "$loot_screen_shown", 0),
(assign, "$loot_screen_shown", 1),
(try_begin),
(gt, "$g_ally_party", 0),
(call_script, "script_party_add_party", "$g_ally_party", "p_temp_party"), #Add remaining prisoners to ally TODO: FIX it.
(else_try),
(party_get_num_attached_parties, ":num_quick_attachments", "p_main_party"),
(gt, ":num_quick_attachments", 0),
(party_get_attached_party_with_rank, ":helper_party", "p_main_party", 0),
(call_script, "script_party_add_party", ":helper_party", "p_temp_party"), #Add remaining prisoners to our reinforcements
(try_end),
(troop_clear_inventory, "trp_temp_troop"),
(party_get_num_companion_stacks, ":num_stacks", "p_temp_casualties"),
(try_for_range, ":stack_no", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", "p_temp_casualties", ":stack_no"),
(try_begin),
(party_stack_get_size, ":stack_size", "p_temp_casualties", ":stack_no"),
(party_stack_get_troop_id, ":stack_troop", "p_temp_casualties", ":stack_no"),
(gt, ":stack_size", 0),
(party_add_members, "p_total_enemy_casualties", ":stack_troop", ":stack_size"), #addition_to_p_total_enemy_casualties
(party_stack_get_num_wounded, ":stack_wounded_size", "p_temp_casualties", ":stack_no"),
(gt, ":stack_wounded_size", 0),
(party_wound_members, "p_total_enemy_casualties", ":stack_troop", ":stack_wounded_size"),
(try_end),
(try_end),
(call_script, "script_party_calculate_loot", "p_total_enemy_casualties"), #p_encountered_party_backup changed to total_enemy_casualties
(gt, reg0, 0),
(troop_sort_inventory, "trp_temp_troop"),
(change_screen_loot, "trp_temp_troop"),
(try_end),
(try_begin),
(ge, "$g_encountered_party", 0),
(party_is_active, "$g_encountered_party"),
(party_get_template_id, ":template", "$g_encountered_party"),
(eq, ":template", "pt_looter_lair"),
(remove_party, "$g_encountered_party"),
(try_end),
]),
("leave_defeat",
[
(party_slot_eq, "$g_encountered_party", slot_party_ai_substate, 1),
],
"Continue...",
[
(try_for_range, ":bandit_template", "pt_steppe_bandits", "pt_deserters"),
(party_template_slot_eq, ":bandit_template", slot_party_template_lair_party, "$g_encountered_party"),
(party_template_set_slot, ":bandit_template", slot_party_template_lair_party, 0),
(try_end),
(try_begin),
(party_get_template_id, ":template", "$g_encountered_party"),
(neq, ":template", "pt_looter_lair"),
(check_quest_active, "qst_destroy_bandit_lair"),
(quest_slot_eq, "qst_destroy_bandit_lair", slot_quest_target_party, "$g_encountered_party"),
(call_script, "script_fail_quest", "qst_destroy_bandit_lair"),
(try_end),
(try_begin),
(ge, "$g_encountered_party", 0),
(party_is_active, "$g_encountered_party"),
(party_get_template_id, ":template", "$g_encountered_party"),
(neq, ":template", "pt_looter_lair"),
(remove_party, "$g_encountered_party"),
(try_end),
(assign, "$g_leave_encounter", 0),
(try_begin),
(party_is_active, "$g_encountered_party"),
(party_set_slot, "$g_encountered_party", slot_party_ai_substate, 0),
(try_end),
(change_screen_return),
]),
]
),
(
"notification_player_faction_political_issue_resolved",0,
"After consulting with the peers of the realm, {s10} has decided to confer {s11} on {s12}.",
"none",
[
(assign, ":faction_issue_resolved", "$g_notification_menu_var1"),
(assign, ":faction_decision", "$g_notification_menu_var2"),
(faction_get_slot, ":leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s10, ":leader"),
(try_begin),
(eq, ":faction_issue_resolved", 1),
(str_store_string, s11, "str_the_marshalship"),
(else_try),
(str_store_party_name, s11, ":faction_issue_resolved"),
(try_end),
(str_store_troop_name, s12, ":faction_decision"),
],
[
("continue",
[],"Continue...",
[
(change_screen_return),
]),
]
),
(
"notification_player_faction_political_issue_resolved_for_player",0,
"After consulting with the peers of the realm, {s10} has decided to confer {s11} on you. You may decline the honor, but it will probably mean that you will not receive other awards for a little while.{s12}",
"none",
[
(faction_get_slot, ":leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s10, ":leader"),
(faction_get_slot, ":issue", "$players_kingdom", slot_faction_political_issue),
(try_begin),
(eq, ":issue", 1),
(str_store_string, s11, "str_the_marshalship"),
(str_store_string, s12, "@^^Note that so long as you remain marshal, the lords of the realm will be expecting you to lead them on campaign. So, if you are awaiting a feast, either for a wedding or for other purposes, you may wish to resign the marshalship by speaking to your liege."),
(else_try),
(str_clear, s12),
(str_store_party_name, s11, ":issue"),
(try_end),
],
[
("accept",
[],"Accept the honor",
[
(faction_get_slot, ":issue", "$players_kingdom", slot_faction_political_issue),
(try_begin),
(eq, ":issue", 1),
(call_script, "script_check_and_finish_active_army_quests_for_faction", "$players_kingdom"),
(call_script, "script_appoint_faction_marshall", "$players_kingdom", "trp_player"),
(unlock_achievement, ACHIEVEMENT_AUTONOMOUS_COLLECTIVE),
(else_try),
(call_script, "script_give_center_to_lord", ":issue", "trp_player", 0), #Zero means don't add garrison
(try_end),
(faction_set_slot, "$players_kingdom", slot_faction_political_issue, 0),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":active_npc_faction", ":active_npc"),
(eq, ":active_npc_faction", "$players_kingdom"),
(troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
(try_end),
(change_screen_return),
]),
("decline",
[],"Decline the honor",
[
(faction_get_slot, ":issue", "$players_kingdom", slot_faction_political_issue),
(try_begin),
(is_between, ":issue", centers_begin, centers_end),
(assign, "$g_dont_give_fief_to_player_days", 30),
(else_try),
(assign, "$g_dont_give_marshalship_to_player_days", 30),
(try_end),
(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
(store_faction_of_troop, ":active_npc_faction", ":active_npc"),
(eq, ":active_npc_faction", "$players_kingdom"),
(troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
(try_end),
(change_screen_return),
]),
]
),
("start_phase_2_5",mnf_disable_all_keys,
"{!}{s16}",
"none",
[
(str_store_party_name, s1, "$g_starting_town"),
(str_store_string, s16, "$g_journey_string"),
],
[
("continue",[], "Continue...",
[
(jump_to_menu, "mnu_start_phase_3"),
]),
]
),
("start_phase_3",mnf_disable_all_keys,
"{s16}^^You are exhausted by the time you find the inn in {s1}, and fall asleep quickly. However, you awake before dawn and are eager to explore your surroundings. You venture out onto the streets, which are still deserted. All of a sudden, you hear a sound that stands the hairs of your neck on end -- the rasp of a blade sliding from its scabbard...",
"none",
[
(assign, ":continue", 1),
(try_begin),
(eq, "$current_startup_quest_phase", 1),
(try_begin),
(eq, "$g_killed_first_bandit", 1),
(str_store_string, s11, "str_killed_bandit_at_alley_fight"),
(else_try),
(str_store_string, s11, "str_wounded_by_bandit_at_alley_fight"),
(try_end),
(jump_to_menu, "mnu_start_phase_4"),
(assign, ":continue", 0),
(else_try),
(eq, "$current_startup_quest_phase", 3),
(try_begin),
(eq, "$g_killed_first_bandit", 1),
(str_store_string, s11, "str_killed_bandit_at_alley_fight"),
(else_try),
(str_store_string, s11, "str_wounded_by_bandit_at_alley_fight"),
(try_end),
(jump_to_menu, "mnu_start_phase_4"),
(assign, ":continue", 0),
(try_end),
(str_store_party_name, s1, "$g_starting_town"),
(str_clear, s16),
(eq, ":continue", 1),
],
[
("continue",[], "Continue...",
[
(assign, "$g_starting_town", "$current_town"),
(call_script, "script_player_arrived"),
(party_set_morale, "p_main_party", 100),
(set_encountered_party, "$current_town"),
(call_script, "script_prepare_alley_to_fight"),
]),
]
),
("start_phase_4",mnf_disable_all_keys,
"{s11}",
"none",
[
(assign, ":continue", 1),
(try_begin),
(eq, "$current_startup_quest_phase", 2),
(change_screen_return),
(assign, ":continue", 0),
(else_try),
(eq, "$current_startup_quest_phase", 3),
(str_store_string, s11, "str_merchant_and_you_call_some_townsmen_and_guards_to_get_ready_and_you_get_out_from_tavern"),
(else_try),
(eq, "$current_startup_quest_phase", 4),
(try_begin),
(eq, "$g_killed_first_bandit", 1),
(str_store_string, s11, "str_town_fight_ended_you_and_citizens_cleaned_town_from_bandits"),
(else_try),
(str_store_string, s11, "str_town_fight_ended_you_and_citizens_cleaned_town_from_bandits_you_wounded"),
(try_end),
(try_end),
(eq, ":continue", 1),
],
[
("continue",
[
(this_or_next|eq, "$current_startup_quest_phase", 1),
(eq, "$current_startup_quest_phase", 4),
],
"Continue...",
[
(assign, "$town_entered", 1),
(try_begin),
(eq, "$current_town", "p_town_1"),
(assign, ":town_merchant", "trp_nord_merchant"),
(assign, ":town_room_scene", "scn_town_1_room"),
(else_try),
(eq, "$current_town", "p_town_5"),
(assign, ":town_merchant", "trp_rhodok_merchant"),
(assign, ":town_room_scene", "scn_town_5_room"),
(else_try),
(eq, "$current_town", "p_town_6"),
(assign, ":town_merchant", "trp_swadian_merchant"),
(assign, ":town_room_scene", "scn_town_6_room"),
(else_try),
(eq, "$current_town", "p_town_8"),
(assign, ":town_merchant", "trp_vaegir_merchant"),
(assign, ":town_room_scene", "scn_town_8_room"),
(else_try),
(eq, "$current_town", "p_town_10"),
(assign, ":town_merchant", "trp_khergit_merchant"),
(assign, ":town_room_scene", "scn_town_10_room"),
(else_try),
(eq, "$current_town", "p_town_19"),
(assign, ":town_merchant", "trp_sarranid_merchant"),
(assign, ":town_room_scene", "scn_town_19_room"),
(try_end),
(modify_visitors_at_site, ":town_room_scene"),
(reset_visitors),
(set_visitor, 0, "trp_player"),
(set_visitor, 9, ":town_merchant"),
(assign, "$talk_context", tc_merchants_house),
(assign, "$dialog_with_merchant_ended", 0),
(set_jump_mission, "mt_meeting_merchant"),
(jump_to_scene, ":town_room_scene"),
(change_screen_mission),
]),
("continue",
[
(eq, "$current_startup_quest_phase", 3),
],
"Continue...",
[
(call_script, "script_prepare_town_to_fight"),
]),
]
),
("lost_tavern_duel",mnf_disable_all_keys,
"{s11}",
"none",
[
(try_begin),
(agent_get_troop_id, ":type", "$g_main_attacker_agent"),
(eq, ":type", "trp_belligerent_drunk"),
(str_store_string, s11, "str_lost_tavern_duel_ordinary"),
(else_try),
(agent_get_troop_id, ":type", "$g_main_attacker_agent"),
(eq, ":type", "trp_hired_assassin"),
(str_store_string, s11, "str_lost_tavern_duel_assassin"),
(try_end),
(troop_set_slot, "trp_hired_assassin", slot_troop_cur_center, -1),
],
[
("continue",[],"Continue...",
[
(jump_to_menu, "mnu_town"),
]),
]
),
("establish_court",mnf_disable_all_keys,
"To establish {s4} as your court will require a small refurbishment. In particular, you will need a set of tools and a bolt of velvet. it may also take a short while for some of your followers to relocate here. Do you wish to proceed?",
"none",
[
(str_store_party_name, s4, "$g_encountered_party"),
],
[
("establish",[
(player_has_item, "itm_tools"),
(player_has_item, "itm_velvet"),
],"Establish {s4} as your court",
[
(assign, "$g_player_court", "$current_town"),
(troop_remove_item, "trp_player", "itm_tools"),
(troop_remove_item, "trp_player", "itm_velvet"),
(jump_to_menu, "mnu_town"),
]),
("continue",[],"Hold off...",
[
(jump_to_menu, "mnu_town"),
]),
]
),
("notification_relieved_as_marshal", mnf_disable_all_keys,
"{s4} wishes to inform you that your services as marshal are no longer required. In honor of valiant efforts on behalf of the realm over the last {reg4} days, however, {reg8?she:he} offers you a purse of {reg5} denars.",
"none",
[
(assign, reg4, "$g_player_days_as_marshal"),
(store_div, ":renown_gain", "$g_player_days_as_marshal",4),
(val_min, ":renown_gain", 20),
(store_mul, ":denar_gain", "$g_player_days_as_marshal", 50),
(val_max, ":denar_gain", 200),
(val_min, ":denar_gain", 4000),
(troop_add_gold, "trp_player", ":denar_gain"),
(call_script, "script_change_troop_renown", "trp_player", ":renown_gain"),
(assign, "$g_player_days_as_marshal", 0),
(assign, "$g_dont_give_marshalship_to_player_days", 15),
(assign, reg5, ":denar_gain"),
(faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s4, ":faction_leader"),
(troop_get_type, reg8, ":faction_leader"),
],
[
("continue",[],"Continue",
[
(change_screen_return),
]),
]
),
]
| Python |
from header_skins import *
from ID_particle_systems import *
####################################################################################################################
# Each skin record contains the following fields:
# 1) Skin id: used for referencing skins.
# 2) Skin flags. Not used yet. Should be 0.
# 3) Body mesh.
# 4) Calf mesh (left one).
# 5) Hand mesh (left one).
# 6) Head mesh.
# 7) Face keys (list)
# 8) List of hair meshes.
# 9) List of beard meshes.
# 10) List of hair textures.
# 11) List of beard textures.
# 12) List of face textures.
# 13) List of voices.
# 14) Skeleton name
# 15) Scale (doesn't fully work yet)
# 16) Blood particles 1 (do not add this if you wish to use the default particles)
# 17) Blood particles 2 (do not add this if you wish to use the default particles)
# 17) Face key constraints (do not add this if you do not wish to use it)
####################################################################################################################
man_face_keys = [
(20,0, 0.7,-0.6, "Chin Size"),
(260,0, -0.6,1.4, "Chin Shape"),
(10,0,-0.5,0.9, "Chin Forward"),
(240,0,0.9,-0.8, "Jaw Width"),
(210,0,-0.5,1.0, "Jaw Position"),
(250,0,0.8,-1.0, "Mouth-Nose Distance"),
(200,0,-0.3,1.0, "Mouth Width"),
(50,0,-1.5,1.0, "Cheeks"),
(60,0,-0.4,1.35, "Nose Height"),
(70,0,-0.6,0.7, "Nose Width"),
(80,0,1.0,-0.1, "Nose Size"),
(270,0,-0.5,1.0, "Nose Shape"),
(90,0,-0.2,1.4, "Nose Bridge"),
(100,0,-0.3,1.5, "Cheek Bones"),
(150,0,-0.2,3.0, "Eye Width"),
(110,0,1.5,-0.9, "Eye to Eye Dist"),
(120,0,1.9,-1.0, "Eye Shape"),
(130,0,-0.5, 1.1, "Eye Depth"),
(140,0,1.0,-1.2, "Eyelids"),
(160,0,1.3,-0.2, "Eyebrow Position"),
(170,0,-0.1,1.9, "Eyebrow Height"),
(220,0,-0.1,0.9, "Eyebrow Depth"),
(180,0,-1.1,1.6, "Eyebrow Shape"),
(230,0,1.2,-0.7, "Temple Width"),
(30,0,-0.6,0.9, "Face Depth"),
(40,0,0.9,-0.6, "Face Ratio"),
(190,0,0.0,0.95, "Face Width"),
(280,0,0.0,1.0, "Post-Edit"),
]
# Face width-Jaw width Temple width
woman_face_keys = [
(230,0,0.8,-1.0, "Chin Size"),
(220,0,-1.0,1.0, "Chin Shape"),
(10,0,-1.2,1.0, "Chin Forward"),
(20,0, -0.6, 1.2, "Jaw Width"),
(40,0,-0.7,1.0, "Jaw Position"),
(270,0,0.9,-0.9, "Mouth-Nose Distance"),
(30,0,-0.5,1.0, "Mouth Width"),
(50,0, -0.5,1.0, "Cheeks"),
(60,0,-0.5,1.0, "Nose Height"),
(70,0,-0.5,1.1, "Nose Width"),
(80,0,1.5,-0.3, "Nose Size"),
(240,0,-1.0,0.8, "Nose Shape"),
(90,0, 0.0,1.1, "Nose Bridge"),
(100,0,-0.5,1.5, "Cheek Bones"),
(150,0,-0.4,1.0, "Eye Width"),
(110,0,1.0,0.0, "Eye to Eye Dist"),
(120,0,-0.2,1.0, "Eye Shape"),
(130,0,-0.1,1.6, "Eye Depth"),
(140,0,-0.2,1.0, "Eyelids"),
(160,0,-0.2,1.2, "Eyebrow Position"),
(170,0,-0.2,0.7, "Eyebrow Height"),
(250,0,-0.4,0.9, "Eyebrow Depth"),
(180,0,-1.5,1.2, "Eyebrow Shape"),
(260,0,1.0,-0.7, "Temple Width"),
(200,0,-0.5,1.0, "Face Depth"),
(210,0,-0.5,0.9, "Face Ratio"),
(190,0,-0.4,0.8, "Face Width"),
(280,0,0.0,1.0, "Post-Edit"),
]
undead_face_keys = []
chin_size = 0
chin_shape = 1
chin_forward = 2
jaw_width = 3
jaw_position = 4
mouth_nose_distance = 5
mouth_width = 6
cheeks = 7
nose_height = 8
nose_width = 9
nose_size = 10
nose_shape = 11
nose_bridge = 12
cheek_bones = 13
eye_width = 14
eye_to_eye_dist = 15
eye_shape = 16
eye_depth = 17
eyelids = 18
eyebrow_position = 19
eyebrow_height = 20
eyebrow_depth = 21
eyebrow_shape = 22
temple_width = 23
face_depth = 24
face_ratio = 25
face_width = 26
comp_less_than = -1;
comp_greater_than = 1;
skins = [
(
"man", 0,
"man_body", "man_calf_l", "m_handL",
"male_head", man_face_keys,
["man_hair_s","man_hair_m","man_hair_n","man_hair_o", "man_hair_y10", "man_hair_y12","man_hair_p","man_hair_r","man_hair_q","man_hair_v","man_hair_t","man_hair_y6","man_hair_y3","man_hair_y7","man_hair_y9","man_hair_y11","man_hair_u","man_hair_y","man_hair_y2","man_hair_y4"], #man_hair_meshes ,"man_hair_y5","man_hair_y8",
["beard_e","beard_d","beard_k","beard_l","beard_i","beard_j","beard_z","beard_m","beard_n","beard_y","beard_p","beard_o", "beard_v", "beard_f", "beard_b", "beard_c","beard_t","beard_u","beard_r","beard_s","beard_a","beard_h","beard_g",], #beard meshes ,"beard_q"
["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures
["beard_blonde","beard_red","beard_brunette","beard_black","beard_white"], #beard_materials
[("manface_young_2",0xffcbe0e0,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19]),
("manface_midage",0xffdfefe1,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff632e18, 0xff502a19, 0xff19100c]),
("manface_young",0xffd0e0e0,["hair_blonde"],[0xff83301a, 0xff502a19, 0xff19100c, 0xff0c0d19]),
# ("manface_old",0xffd0d0d0,["hair_white","hair_brunette","hair_red","hair_blonde"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
("manface_young_3",0xffdceded,["hair_blonde"],[0xff2f180e, 0xff171313, 0xff007080c]),
("manface_7",0xffc0c8c8,["hair_blonde"],[0xff171313, 0xff007080c]),
("manface_midage_2",0xfde4c8d8,["hair_blonde"],[0xff502a19, 0xff19100c, 0xff0c0d19]),
("manface_rugged",0xffb0aab5,["hair_blonde"],[0xff171313, 0xff007080c]),
# ("manface_young_4",0xffe0e8e8,["hair_blonde"],[0xff2f180e, 0xff171313, 0xff007080c]),
("manface_african",0xff807c8a,["hair_blonde"],[0xff120808, 0xff007080c]),
# ("manface_old_2",0xffd5d5c5,["hair_white"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
], #man_face_textures,
[(voice_die,"snd_man_die"),(voice_hit,"snd_man_hit"),(voice_grunt,"snd_man_grunt"),(voice_grunt_long,"snd_man_grunt_long"),(voice_yell,"snd_man_yell"),(voice_stun,"snd_man_stun"),(voice_victory,"snd_man_victory")], #voice sounds
"skel_human", 1.0,
psys_game_blood,psys_game_blood_2,
[[1.7, comp_greater_than, (1.0,face_width), (1.0,temple_width)], #constraints: ex: 1.7 > (face_width + temple_width)
[0.3, comp_less_than, (1.0,face_width), (1.0,temple_width)],
[1.7, comp_greater_than, (1.0,face_width), (1.0,face_depth)],
[0.3, comp_less_than, (1.0,eyebrow_height), (1.0,eyebrow_position)],
[1.7, comp_greater_than, (1.0,eyebrow_height), (1.0,eyebrow_position)],
[-0.7, comp_less_than, (1.0,nose_size), (-1.0,nose_shape)],
[0.7, comp_greater_than, (1.0,nose_size), (-1.0,nose_shape)],
[2.7, comp_greater_than, (1.0,chin_size), (1.0,mouth_nose_distance), (1.0,nose_height), (-1.0,face_width)],
]
),
(
"woman", skf_use_morph_key_10,
"woman_body", "woman_calf_l", "f_handL",
"female_head", woman_face_keys,
["woman_hair_p","woman_hair_n","woman_hair_o","woman_hair_q","woman_hair_r","woman_hair_t","woman_hair_s"], #woman_hair_meshes
# ["woman_hair_a","woman_hair_b","woman_hair_c","woman_hair_d","woman_hair_e","woman_hair_f","woman_hair_g"], #woman_hair_meshes
[],
["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures
[],
[("womanface_young",0xffe3e8ef,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19, 0xff19100c]),
("womanface_b",0xffdfdfdf,["hair_blonde"],[0xffa5481f, 0xff502a19, 0xff19100c, 0xff0c0d19]),
("womanface_a",0xffe8dfe5,["hair_blonde"],[0xff502a19, 0xff19100c, 0xff0c0d19]),
("womanface_brown",0xffaf9f7e,["hair_blonde"],[0xff19100c, 0xff0c0d19, 0xff007080c]),
("womanface_african",0xff808080,["hair_blonde"],[0xff120808, 0xff007080c]),
# ("womanface_midage",0xffe5eaf0,["hair_black","hair_brunette","hair_red","hair_white"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
],#woman_face_textures
[(voice_die,"snd_woman_die"),(voice_hit,"snd_woman_hit"),(voice_yell,"snd_woman_yell")], #voice sounds
"skel_human", 1.0,
psys_game_blood,psys_game_blood_2,
),
## (
## "undead", 0,
## "undead_body", "undead_calf_l", "undead_handL",
## "undead_head", undead_face_keys,
## [],
## [],
## [],
## [],
## [("undeadface_a",0xffffffff,[]),
## ("undeadface_b",0xffcaffc0,[]),
## ], #undead_face_textures
## [], #voice sounds
## "skel_human", 1.0,
## ),
]
| Python |
scn_random_scene = 0
scn_conversation_scene = 1
scn_water = 2
scn_random_scene_steppe = 3
scn_random_scene_plain = 4
scn_random_scene_snow = 5
scn_random_scene_desert = 6
scn_random_scene_steppe_forest = 7
scn_random_scene_plain_forest = 8
scn_random_scene_snow_forest = 9
scn_random_scene_desert_forest = 10
scn_camp_scene = 11
scn_camp_scene_horse_track = 12
scn_four_ways_inn = 13
scn_test_scene = 14
scn_quick_battle_1 = 15
scn_quick_battle_2 = 16
scn_quick_battle_3 = 17
scn_quick_battle_4 = 18
scn_quick_battle_5 = 19
scn_quick_battle_6 = 20
scn_quick_battle_7 = 21
scn_salt_mine = 22
scn_novice_ground = 23
scn_zendar_arena = 24
scn_dhorak_keep = 25
scn_reserved4 = 26
scn_reserved5 = 27
scn_reserved6 = 28
scn_reserved7 = 29
scn_reserved8 = 30
scn_reserved9 = 31
scn_reserved10 = 32
scn_reserved11 = 33
scn_reserved12 = 34
scn_training_ground = 35
scn_tutorial_1 = 36
scn_tutorial_2 = 37
scn_tutorial_3 = 38
scn_tutorial_4 = 39
scn_tutorial_5 = 40
scn_training_ground_horse_track_1 = 41
scn_training_ground_horse_track_2 = 42
scn_training_ground_horse_track_3 = 43
scn_training_ground_horse_track_4 = 44
scn_training_ground_horse_track_5 = 45
scn_training_ground_ranged_melee_1 = 46
scn_training_ground_ranged_melee_2 = 47
scn_training_ground_ranged_melee_3 = 48
scn_training_ground_ranged_melee_4 = 49
scn_training_ground_ranged_melee_5 = 50
scn_zendar_center = 51
scn_the_happy_boar = 52
scn_zendar_merchant = 53
scn_town_1_center = 54
scn_town_2_center = 55
scn_town_3_center = 56
scn_town_4_center = 57
scn_town_5_center = 58
scn_town_6_center = 59
scn_town_7_center = 60
scn_town_8_center = 61
scn_town_9_center = 62
scn_town_10_center = 63
scn_town_11_center = 64
scn_town_12_center = 65
scn_town_13_center = 66
scn_town_14_center = 67
scn_town_15_center = 68
scn_town_16_center = 69
scn_town_17_center = 70
scn_town_18_center = 71
scn_town_19_center = 72
scn_town_20_center = 73
scn_town_21_center = 74
scn_town_22_center = 75
scn_town_1_castle = 76
scn_town_2_castle = 77
scn_town_3_castle = 78
scn_town_4_castle = 79
scn_town_5_castle = 80
scn_town_6_castle = 81
scn_town_7_castle = 82
scn_town_8_castle = 83
scn_town_9_castle = 84
scn_town_10_castle = 85
scn_town_11_castle = 86
scn_town_12_castle = 87
scn_town_13_castle = 88
scn_town_14_castle = 89
scn_town_15_castle = 90
scn_town_16_castle = 91
scn_town_17_castle = 92
scn_town_18_castle = 93
scn_town_19_castle = 94
scn_town_20_castle = 95
scn_town_21_castle = 96
scn_town_22_castle = 97
scn_town_1_tavern = 98
scn_town_2_tavern = 99
scn_town_3_tavern = 100
scn_town_4_tavern = 101
scn_town_5_tavern = 102
scn_town_6_tavern = 103
scn_town_7_tavern = 104
scn_town_8_tavern = 105
scn_town_9_tavern = 106
scn_town_10_tavern = 107
scn_town_11_tavern = 108
scn_town_12_tavern = 109
scn_town_13_tavern = 110
scn_town_14_tavern = 111
scn_town_15_tavern = 112
scn_town_16_tavern = 113
scn_town_17_tavern = 114
scn_town_18_tavern = 115
scn_town_19_tavern = 116
scn_town_20_tavern = 117
scn_town_21_tavern = 118
scn_town_22_tavern = 119
scn_town_1_store = 120
scn_town_2_store = 121
scn_town_3_store = 122
scn_town_4_store = 123
scn_town_5_store = 124
scn_town_6_store = 125
scn_town_7_store = 126
scn_town_8_store = 127
scn_town_9_store = 128
scn_town_10_store = 129
scn_town_11_store = 130
scn_town_12_store = 131
scn_town_13_store = 132
scn_town_14_store = 133
scn_town_15_store = 134
scn_town_16_store = 135
scn_town_17_store = 136
scn_town_18_store = 137
scn_town_19_store = 138
scn_town_20_store = 139
scn_town_21_store = 140
scn_town_22_store = 141
scn_town_1_arena = 142
scn_town_2_arena = 143
scn_town_3_arena = 144
scn_town_4_arena = 145
scn_town_5_arena = 146
scn_town_6_arena = 147
scn_town_7_arena = 148
scn_town_8_arena = 149
scn_town_9_arena = 150
scn_town_10_arena = 151
scn_town_11_arena = 152
scn_town_12_arena = 153
scn_town_13_arena = 154
scn_town_14_arena = 155
scn_town_15_arena = 156
scn_town_16_arena = 157
scn_town_17_arena = 158
scn_town_18_arena = 159
scn_town_19_arena = 160
scn_town_20_arena = 161
scn_town_21_arena = 162
scn_town_22_arena = 163
scn_town_1_prison = 164
scn_town_2_prison = 165
scn_town_3_prison = 166
scn_town_4_prison = 167
scn_town_5_prison = 168
scn_town_6_prison = 169
scn_town_7_prison = 170
scn_town_8_prison = 171
scn_town_9_prison = 172
scn_town_10_prison = 173
scn_town_11_prison = 174
scn_town_12_prison = 175
scn_town_13_prison = 176
scn_town_14_prison = 177
scn_town_15_prison = 178
scn_town_16_prison = 179
scn_town_17_prison = 180
scn_town_18_prison = 181
scn_town_19_prison = 182
scn_town_20_prison = 183
scn_town_21_prison = 184
scn_town_22_prison = 185
scn_town_1_walls = 186
scn_town_2_walls = 187
scn_town_3_walls = 188
scn_town_4_walls = 189
scn_town_5_walls = 190
scn_town_6_walls = 191
scn_town_7_walls = 192
scn_town_8_walls = 193
scn_town_9_walls = 194
scn_town_10_walls = 195
scn_town_11_walls = 196
scn_town_12_walls = 197
scn_town_13_walls = 198
scn_town_14_walls = 199
scn_town_15_walls = 200
scn_town_16_walls = 201
scn_town_17_walls = 202
scn_town_18_walls = 203
scn_town_19_walls = 204
scn_town_20_walls = 205
scn_town_21_walls = 206
scn_town_22_walls = 207
scn_town_1_alley = 208
scn_town_2_alley = 209
scn_town_3_alley = 210
scn_town_4_alley = 211
scn_town_5_alley = 212
scn_town_6_alley = 213
scn_town_7_alley = 214
scn_town_8_alley = 215
scn_town_9_alley = 216
scn_town_10_alley = 217
scn_town_11_alley = 218
scn_town_12_alley = 219
scn_town_13_alley = 220
scn_town_14_alley = 221
scn_town_15_alley = 222
scn_town_16_alley = 223
scn_town_17_alley = 224
scn_town_18_alley = 225
scn_town_19_alley = 226
scn_town_20_alley = 227
scn_town_21_alley = 228
scn_town_22_alley = 229
scn_castle_1_exterior = 230
scn_castle_1_interior = 231
scn_castle_1_prison = 232
scn_castle_2_exterior = 233
scn_castle_2_interior = 234
scn_castle_2_prison = 235
scn_castle_3_exterior = 236
scn_castle_3_interior = 237
scn_castle_3_prison = 238
scn_castle_4_exterior = 239
scn_castle_4_interior = 240
scn_castle_4_prison = 241
scn_castle_5_exterior = 242
scn_castle_5_interior = 243
scn_castle_5_prison = 244
scn_castle_6_exterior = 245
scn_castle_6_interior = 246
scn_castle_6_prison = 247
scn_castle_7_exterior = 248
scn_castle_7_interior = 249
scn_castle_7_prison = 250
scn_castle_8_exterior = 251
scn_castle_8_interior = 252
scn_castle_8_prison = 253
scn_castle_9_exterior = 254
scn_castle_9_interior = 255
scn_castle_9_prison = 256
scn_castle_10_exterior = 257
scn_castle_10_interior = 258
scn_castle_10_prison = 259
scn_castle_11_exterior = 260
scn_castle_11_interior = 261
scn_castle_11_prison = 262
scn_castle_12_exterior = 263
scn_castle_12_interior = 264
scn_castle_12_prison = 265
scn_castle_13_exterior = 266
scn_castle_13_interior = 267
scn_castle_13_prison = 268
scn_castle_14_exterior = 269
scn_castle_14_interior = 270
scn_castle_14_prison = 271
scn_castle_15_exterior = 272
scn_castle_15_interior = 273
scn_castle_15_prison = 274
scn_castle_16_exterior = 275
scn_castle_16_interior = 276
scn_castle_16_prison = 277
scn_castle_17_exterior = 278
scn_castle_17_interior = 279
scn_castle_17_prison = 280
scn_castle_18_exterior = 281
scn_castle_18_interior = 282
scn_castle_18_prison = 283
scn_castle_19_exterior = 284
scn_castle_19_interior = 285
scn_castle_19_prison = 286
scn_castle_20_exterior = 287
scn_castle_20_interior = 288
scn_castle_20_prison = 289
scn_castle_21_exterior = 290
scn_castle_21_interior = 291
scn_castle_21_prison = 292
scn_castle_22_exterior = 293
scn_castle_22_interior = 294
scn_castle_22_prison = 295
scn_castle_23_exterior = 296
scn_castle_23_interior = 297
scn_castle_23_prison = 298
scn_castle_24_exterior = 299
scn_castle_24_interior = 300
scn_castle_24_prison = 301
scn_castle_25_exterior = 302
scn_castle_25_interior = 303
scn_castle_25_prison = 304
scn_castle_26_exterior = 305
scn_castle_26_interior = 306
scn_castle_26_prison = 307
scn_castle_27_exterior = 308
scn_castle_27_interior = 309
scn_castle_27_prison = 310
scn_castle_28_exterior = 311
scn_castle_28_interior = 312
scn_castle_28_prison = 313
scn_castle_29_exterior = 314
scn_castle_29_interior = 315
scn_castle_29_prison = 316
scn_castle_30_exterior = 317
scn_castle_30_interior = 318
scn_castle_30_prison = 319
scn_castle_31_exterior = 320
scn_castle_31_interior = 321
scn_castle_31_prison = 322
scn_castle_32_exterior = 323
scn_castle_32_interior = 324
scn_castle_32_prison = 325
scn_castle_33_exterior = 326
scn_castle_33_interior = 327
scn_castle_33_prison = 328
scn_castle_34_exterior = 329
scn_castle_34_interior = 330
scn_castle_34_prison = 331
scn_castle_35_exterior = 332
scn_castle_35_interior = 333
scn_castle_35_prison = 334
scn_castle_36_exterior = 335
scn_castle_36_interior = 336
scn_castle_36_prison = 337
scn_castle_37_exterior = 338
scn_castle_37_interior = 339
scn_castle_37_prison = 340
scn_castle_38_exterior = 341
scn_castle_38_interior = 342
scn_castle_38_prison = 343
scn_castle_39_exterior = 344
scn_castle_39_interior = 345
scn_castle_39_prison = 346
scn_castle_40_exterior = 347
scn_castle_40_interior = 348
scn_castle_40_prison = 349
scn_castle_41_exterior = 350
scn_castle_41_interior = 351
scn_castle_41_prison = 352
scn_castle_42_exterior = 353
scn_castle_42_interior = 354
scn_castle_42_prison = 355
scn_castle_43_exterior = 356
scn_castle_43_interior = 357
scn_castle_43_prison = 358
scn_castle_44_exterior = 359
scn_castle_44_interior = 360
scn_castle_44_prison = 361
scn_castle_45_exterior = 362
scn_castle_45_interior = 363
scn_castle_45_prison = 364
scn_castle_46_exterior = 365
scn_castle_46_interior = 366
scn_castle_46_prison = 367
scn_castle_47_exterior = 368
scn_castle_47_interior = 369
scn_castle_47_prison = 370
scn_castle_48_exterior = 371
scn_castle_48_interior = 372
scn_castle_48_prison = 373
scn_village_1 = 374
scn_village_2 = 375
scn_village_3 = 376
scn_village_4 = 377
scn_village_5 = 378
scn_village_6 = 379
scn_village_7 = 380
scn_village_8 = 381
scn_village_9 = 382
scn_village_10 = 383
scn_village_11 = 384
scn_village_12 = 385
scn_village_13 = 386
scn_village_14 = 387
scn_village_15 = 388
scn_village_16 = 389
scn_village_17 = 390
scn_village_18 = 391
scn_village_19 = 392
scn_village_20 = 393
scn_village_21 = 394
scn_village_22 = 395
scn_village_23 = 396
scn_village_24 = 397
scn_village_25 = 398
scn_village_26 = 399
scn_village_27 = 400
scn_village_28 = 401
scn_village_29 = 402
scn_village_30 = 403
scn_village_31 = 404
scn_village_32 = 405
scn_village_33 = 406
scn_village_34 = 407
scn_village_35 = 408
scn_village_36 = 409
scn_village_37 = 410
scn_village_38 = 411
scn_village_39 = 412
scn_village_40 = 413
scn_village_41 = 414
scn_village_42 = 415
scn_village_43 = 416
scn_village_44 = 417
scn_village_45 = 418
scn_village_46 = 419
scn_village_47 = 420
scn_village_48 = 421
scn_village_49 = 422
scn_village_50 = 423
scn_village_51 = 424
scn_village_52 = 425
scn_village_53 = 426
scn_village_54 = 427
scn_village_55 = 428
scn_village_56 = 429
scn_village_57 = 430
scn_village_58 = 431
scn_village_59 = 432
scn_village_60 = 433
scn_village_61 = 434
scn_village_62 = 435
scn_village_63 = 436
scn_village_64 = 437
scn_village_65 = 438
scn_village_66 = 439
scn_village_67 = 440
scn_village_68 = 441
scn_village_69 = 442
scn_village_70 = 443
scn_village_71 = 444
scn_village_72 = 445
scn_village_73 = 446
scn_village_74 = 447
scn_village_75 = 448
scn_village_76 = 449
scn_village_77 = 450
scn_village_78 = 451
scn_village_79 = 452
scn_village_80 = 453
scn_village_81 = 454
scn_village_82 = 455
scn_village_83 = 456
scn_village_84 = 457
scn_village_85 = 458
scn_village_86 = 459
scn_village_87 = 460
scn_village_88 = 461
scn_village_89 = 462
scn_village_90 = 463
scn_village_91 = 464
scn_village_92 = 465
scn_village_93 = 466
scn_village_94 = 467
scn_village_95 = 468
scn_village_96 = 469
scn_village_97 = 470
scn_village_98 = 471
scn_village_99 = 472
scn_village_100 = 473
scn_village_101 = 474
scn_village_102 = 475
scn_village_103 = 476
scn_village_104 = 477
scn_village_105 = 478
scn_village_106 = 479
scn_village_107 = 480
scn_village_108 = 481
scn_village_109 = 482
scn_village_110 = 483
scn_field_1 = 484
scn_field_2 = 485
scn_field_3 = 486
scn_field_4 = 487
scn_field_5 = 488
scn_test2 = 489
scn_test3 = 490
scn_multi_scene_1 = 491
scn_multi_scene_2 = 492
scn_multi_scene_3 = 493
scn_multi_scene_4 = 494
scn_multi_scene_5 = 495
scn_multi_scene_6 = 496
scn_multi_scene_7 = 497
scn_multi_scene_8 = 498
scn_multi_scene_9 = 499
scn_multi_scene_10 = 500
scn_multi_scene_11 = 501
scn_multi_scene_12 = 502
scn_multi_scene_13 = 503
scn_multi_scene_14 = 504
scn_multi_scene_15 = 505
scn_multi_scene_16 = 506
scn_multi_scene_17 = 507
scn_multi_scene_18 = 508
scn_random_multi_plain_medium = 509
scn_random_multi_plain_large = 510
scn_random_multi_steppe_medium = 511
scn_random_multi_steppe_large = 512
scn_multiplayer_maps_end = 513
scn_wedding = 514
scn_lair_steppe_bandits = 515
scn_lair_taiga_bandits = 516
scn_lair_desert_bandits = 517
scn_lair_forest_bandits = 518
scn_lair_mountain_bandits = 519
scn_lair_sea_raiders = 520
scn_quick_battle_scene_1 = 521
scn_quick_battle_scene_2 = 522
scn_quick_battle_scene_3 = 523
scn_quick_battle_scene_4 = 524
scn_quick_battle_scene_5 = 525
scn_quick_battle_maps_end = 526
scn_tutorial_training_ground = 527
scn_town_1_room = 528
scn_town_5_room = 529
scn_town_6_room = 530
scn_town_8_room = 531
scn_town_10_room = 532
scn_town_19_room = 533
scn_meeting_scene_steppe = 534
scn_meeting_scene_plain = 535
scn_meeting_scene_snow = 536
scn_meeting_scene_desert = 537
scn_meeting_scene_steppe_forest = 538
scn_meeting_scene_plain_forest = 539
scn_meeting_scene_snow_forest = 540
scn_meeting_scene_desert_forest = 541
scn_enterprise_tannery = 542
scn_enterprise_winery = 543
scn_enterprise_mill = 544
scn_enterprise_smithy = 545
scn_enterprise_dyeworks = 546
scn_enterprise_linen_weavery = 547
scn_enterprise_wool_weavery = 548
scn_enterprise_brewery = 549
scn_enterprise_oil_press = 550
| Python |
from header_sounds import *
sounds = [
("click", sf_2d|sf_vol_1,["drum_3.ogg"]),
("tutorial_1", sf_2d|sf_vol_7,["tutorial_1.ogg"]),
("tutorial_2", sf_2d|sf_vol_7,["tutorial_2.ogg"]),
("gong", sf_2d|sf_priority_9|sf_vol_7, ["s_cymbals.ogg"]),
("quest_taken", sf_2d|sf_priority_9|sf_vol_7, []),
("quest_completed", sf_2d|sf_priority_9|sf_vol_7, ["quest_completed.ogg"]),
("quest_succeeded", sf_2d|sf_priority_9|sf_vol_7, ["quest_succeeded.ogg"]),
("quest_concluded", sf_2d|sf_priority_9|sf_vol_7, ["quest_concluded.ogg"]),
("quest_failed", sf_2d|sf_priority_9|sf_vol_7, ["quest_failed.ogg"]),
("quest_cancelled", sf_2d|sf_priority_9|sf_vol_7, ["quest_cancelled.ogg"]),
("rain",sf_2d|sf_priority_10|sf_vol_4|sf_looping, ["rain_1.ogg"]),
("money_received",sf_2d|sf_priority_10|sf_vol_6, ["coins_dropped_1.ogg"]),
("money_paid",sf_2d|sf_priority_10|sf_vol_10, ["coins_dropped_2.ogg"]),
("sword_clash_1", 0,["sword_clank_metal_09.ogg","sword_clank_metal_09b.ogg","sword_clank_metal_10.ogg","sword_clank_metal_10b.ogg","sword_clank_metal_12.ogg","sword_clank_metal_12b.ogg","sword_clank_metal_13.ogg","sword_clank_metal_13b.ogg"]),
("sword_clash_2", 0,["s_swordClash2.wav"]),
("sword_clash_3", 0,["s_swordClash3.wav"]),
("sword_swing", sf_vol_8|sf_priority_2,["s_swordSwing.wav"]),
("footstep_grass", sf_vol_4|sf_priority_1,["footstep_1.ogg","footstep_2.ogg","footstep_3.ogg","footstep_4.ogg"]),
("footstep_wood", sf_vol_6|sf_priority_1,["footstep_wood_1.ogg","footstep_wood_2.ogg","footstep_wood_4.ogg"]),
# ("footstep_wood", sf_vol_3|sf_priority_1,["footstep_stone_1.ogg","footstep_stone_3.ogg","footstep_stone_4.ogg"]),
("footstep_water", sf_vol_4|sf_priority_3,["water_walk_1.ogg","water_walk_2.ogg","water_walk_3.ogg","water_walk_4.ogg"]),
("footstep_horse",sf_priority_3|sf_vol_15, ["footstep_horse_5.ogg","footstep_horse_2.ogg","footstep_horse_3.ogg","footstep_horse_4.ogg"]),
# ("footstep_horse",0, ["s_footstep_horse_4b.wav","s_footstep_horse_4f.wav","s_footstep_horse_5b.wav","s_footstep_horse_5f.wav"]),
("footstep_horse_1b",sf_priority_3|sf_vol_15, ["s_footstep_horse_4b.wav","s_footstep_horse_4f.wav","s_footstep_horse_5b.wav","s_footstep_horse_5f.wav"]),
("footstep_horse_1f",sf_priority_3|sf_vol_15, ["s_footstep_horse_2b.wav","s_footstep_horse_2f.wav","s_footstep_horse_3b.wav","s_footstep_horse_3f.wav"]),
# ("footstep_horse_1f",sf_priority_3|sf_vol_15, ["footstep_horse_5.ogg","footstep_horse_2.ogg","footstep_horse_3.ogg","footstep_horse_4.ogg"]),
("footstep_horse_2b",sf_priority_3|sf_vol_15, ["s_footstep_horse_2b.wav"]),
("footstep_horse_2f",sf_priority_3|sf_vol_15, ["s_footstep_horse_2f.wav"]),
("footstep_horse_3b",sf_priority_3|sf_vol_15, ["s_footstep_horse_3b.wav"]),
("footstep_horse_3f",sf_priority_3|sf_vol_15, ["s_footstep_horse_3f.wav"]),
("footstep_horse_4b",sf_priority_3|sf_vol_15, ["s_footstep_horse_4b.wav"]),
("footstep_horse_4f",sf_priority_3|sf_vol_15, ["s_footstep_horse_4f.wav"]),
("footstep_horse_5b",sf_priority_3|sf_vol_15, ["s_footstep_horse_5b.wav"]),
("footstep_horse_5f",sf_priority_3|sf_vol_15, ["s_footstep_horse_5f.wav"]),
("jump_begin", sf_vol_7|sf_priority_9,["jump_begin.ogg"]),
("jump_end", sf_vol_5|sf_priority_9,["jump_end.ogg"]),
("jump_begin_water", sf_vol_4|sf_priority_9,["jump_begin_water.ogg"]),
("jump_end_water", sf_vol_4|sf_priority_9,["jump_end_water.ogg"]),
("horse_jump_begin", sf_vol_12|sf_priority_9,["horse_jump_begin.ogg"]),
("horse_jump_end", sf_vol_12|sf_priority_9,["horse_jump_end.ogg"]),
("horse_jump_begin_water", sf_vol_6|sf_priority_9,["jump_begin_water.ogg"]),
("horse_jump_end_water", sf_vol_6|sf_priority_9,["jump_end_water.ogg"]),
("release_bow",sf_vol_5, ["release_bow_1.ogg"]),
("release_crossbow",sf_vol_7, ["release_crossbow_1.ogg"]),
("throw_javelin",sf_vol_5, ["throw_javelin_2.ogg"]),
("throw_axe",sf_vol_7, ["throw_axe_1.ogg"]),
("throw_knife",sf_vol_5, ["throw_knife_1.ogg"]),
("throw_stone",sf_vol_7, ["throw_stone_1.ogg"]),
("reload_crossbow",sf_vol_3, ["reload_crossbow_1.ogg"]),
("reload_crossbow_continue",sf_vol_6, ["put_back_dagger.ogg"]),
("pull_bow",sf_vol_4, ["pull_bow_1.ogg"]),
("pull_arrow",sf_vol_5, ["pull_arrow.ogg"]),
("arrow_pass_by",0, ["arrow_pass_by_1.ogg","arrow_pass_by_2.ogg","arrow_pass_by_3.ogg","arrow_pass_by_4.ogg"]),
("bolt_pass_by",0, ["bolt_pass_by_1.ogg"]),
("javelin_pass_by",0, ["javelin_pass_by_1.ogg","javelin_pass_by_2.ogg"]),
("stone_pass_by",sf_vol_9, ["stone_pass_by_1.ogg"]),
("axe_pass_by",0, ["axe_pass_by_1.ogg"]),
("knife_pass_by",0, ["knife_pass_by_1.ogg"]),
("bullet_pass_by",0, ["arrow_whoosh_1.ogg"]),
("incoming_arrow_hit_ground",sf_priority_7|sf_vol_7, ["arrow_hit_ground_2.ogg","arrow_hit_ground_3.ogg","incoming_bullet_hit_ground_1.ogg"]),
("incoming_bolt_hit_ground",sf_priority_7|sf_vol_7, ["arrow_hit_ground_2.ogg","arrow_hit_ground_3.ogg","incoming_bullet_hit_ground_1.ogg"]),
("incoming_javelin_hit_ground",sf_priority_7|sf_vol_7, ["incoming_javelin_hit_ground_1.ogg"]),
("incoming_stone_hit_ground",sf_priority_7|sf_vol_7, ["incoming_stone_hit_ground_1.ogg"]),
("incoming_axe_hit_ground",sf_priority_7|sf_vol_7, ["incoming_javelin_hit_ground_1.ogg"]),
("incoming_knife_hit_ground",sf_priority_7|sf_vol_7, ["incoming_stone_hit_ground_1.ogg"]),
("incoming_bullet_hit_ground",sf_priority_7|sf_vol_7, ["incoming_bullet_hit_ground_1.ogg"]),
("outgoing_arrow_hit_ground",sf_priority_7|sf_vol_7, ["outgoing_arrow_hit_ground.ogg"]),
("outgoing_bolt_hit_ground",sf_priority_7|sf_vol_7, ["outgoing_arrow_hit_ground.ogg"]),
("outgoing_javelin_hit_ground",sf_priority_7|sf_vol_10, ["outgoing_arrow_hit_ground.ogg"]),
("outgoing_stone_hit_ground",sf_priority_7|sf_vol_7, ["incoming_stone_hit_ground_1.ogg"]),
("outgoing_axe_hit_ground",sf_priority_7|sf_vol_7, ["incoming_javelin_hit_ground_1.ogg"]),
("outgoing_knife_hit_ground",sf_priority_7|sf_vol_7, ["incoming_stone_hit_ground_1.ogg"]),
("outgoing_bullet_hit_ground",sf_priority_7|sf_vol_7, ["incoming_bullet_hit_ground_1.ogg"]),
("draw_sword",sf_priority_4, ["draw_sword.ogg"]),
("put_back_sword",sf_priority_4, ["put_back_sword.ogg"]),
("draw_greatsword",sf_priority_4, ["draw_greatsword.ogg"]),
("put_back_greatsword",sf_priority_4, ["put_back_sword.ogg"]),
("draw_axe",sf_priority_4, ["draw_mace.ogg"]),
("put_back_axe",sf_priority_4, ["put_back_to_holster.ogg"]),
("draw_greataxe",sf_priority_4, ["draw_greataxe.ogg"]),
("put_back_greataxe",sf_priority_4, ["put_back_to_leather.ogg"]),
("draw_spear",sf_priority_4, ["draw_spear.ogg"]),
("put_back_spear",sf_priority_4, ["put_back_to_leather.ogg"]),
("draw_crossbow",sf_priority_4, ["draw_crossbow.ogg"]),
("put_back_crossbow",sf_priority_4, ["put_back_to_leather.ogg"]),
("draw_revolver",sf_priority_4, ["draw_from_holster.ogg"]),
("put_back_revolver",sf_priority_4, ["put_back_to_holster.ogg"]),
("draw_dagger",sf_priority_4, ["draw_dagger.ogg"]),
("put_back_dagger",sf_priority_4, ["put_back_dagger.ogg"]),
("draw_bow",sf_priority_4, ["draw_bow.ogg"]),
("put_back_bow",sf_priority_4, ["put_back_to_holster.ogg"]),
("draw_shield",sf_priority_4|sf_vol_7, ["draw_shield.ogg"]),
("put_back_shield",sf_priority_4|sf_vol_7, ["put_back_shield.ogg"]),
("draw_other",sf_priority_4, ["draw_other.ogg"]),
("put_back_other",sf_priority_4, ["draw_other2.ogg"]),
("body_fall_small",sf_priority_6|sf_vol_10, ["body_fall_small_1.ogg","body_fall_small_2.ogg"]),
("body_fall_big",sf_priority_6|sf_vol_10, ["body_fall_1.ogg","body_fall_2.ogg","body_fall_3.ogg"]),
# ("body_fall_very_big",sf_priority_9|sf_vol_10, ["body_fall_very_big_1.ogg"]),
("horse_body_fall_begin",sf_priority_6|sf_vol_10, ["horse_body_fall_begin_1.ogg"]),
("horse_body_fall_end",sf_priority_6|sf_vol_10, ["horse_body_fall_end_1.ogg","body_fall_2.ogg","body_fall_very_big_1.ogg"]),
## ("clang_metal",sf_priority_9, ["clang_metal_1.ogg","clang_metal_2.ogg","s_swordClash1.wav","s_swordClash2.wav","s_swordClash3.wav"]),
("hit_wood_wood",sf_priority_7|sf_vol_10, ["hit_wood_wood_1.ogg","hit_wood_wood_2.ogg","hit_wood_wood_3.ogg","hit_wood_wood_4.ogg","hit_wood_metal_4.ogg","hit_wood_metal_5.ogg","hit_wood_metal_6.ogg"]),#dummy
("hit_metal_metal",sf_priority_7|sf_vol_10, ["hit_metal_metal_3.ogg","hit_metal_metal_4.ogg",
"hit_metal_metal_5.ogg","hit_metal_metal_6.ogg","hit_metal_metal_7.ogg","hit_metal_metal_8.ogg",
"hit_metal_metal_9.ogg","hit_metal_metal_10.ogg",
"clang_metal_1.ogg","clang_metal_2.ogg"]),
("hit_wood_metal",sf_priority_7|sf_vol_10, ["hit_metal_metal_1.ogg","hit_metal_metal_2.ogg","hit_wood_metal_7.ogg"]),
# ("clang_metal", sf_priority_9,["sword_clank_metal_09.ogg","sword_clank_metal_10.ogg","sword_clank_metal_12.ogg","sword_clank_metal_13.ogg"]),
## ("shield_hit_cut",sf_priority_5, ["shield_hit_cut_3.ogg","shield_hit_cut_4.ogg","shield_hit_cut_5.ogg"]),
("shield_hit_wood_wood",sf_priority_7|sf_vol_10, ["shield_hit_wood_wood_1.ogg","shield_hit_wood_wood_2.ogg","shield_hit_wood_wood_3.ogg"]),
("shield_hit_metal_metal",sf_priority_7|sf_vol_10, ["shield_hit_metal_metal_1.ogg","shield_hit_metal_metal_2.ogg","shield_hit_metal_metal_3.ogg","shield_hit_metal_metal_4.ogg"]),
("shield_hit_wood_metal",sf_priority_7|sf_vol_10, ["shield_hit_cut_3.ogg","shield_hit_cut_4.ogg","shield_hit_cut_5.ogg","shield_hit_cut_10.ogg"]), #(shield is wood)
("shield_hit_metal_wood",sf_priority_7|sf_vol_10, ["shield_hit_metal_wood_1.ogg","shield_hit_metal_wood_2.ogg","shield_hit_metal_wood_3.ogg"]),#(shield is metal)
("shield_broken",sf_priority_9, ["shield_broken.ogg"]),
("man_hit",sf_priority_7|sf_vol_10, ["man_hit_5.ogg","man_hit_6.ogg","man_hit_7.ogg","man_hit_8.ogg","man_hit_9.ogg","man_hit_10.ogg","man_hit_11.ogg","man_hit_12.ogg","man_hit_13.ogg","man_hit_14.ogg","man_hit_15.ogg",
"man_hit_17.ogg","man_hit_18.ogg","man_hit_19.ogg","man_hit_22.ogg","man_hit_29.ogg","man_hit_32.ogg","man_hit_47.ogg","man_hit_57.ogg","man_hit_59.ogg"]),
("man_die",sf_priority_10, ["man_death_1.ogg","man_death_8.ogg","man_death_8b.ogg","man_death_11.ogg","man_death_14.ogg","man_death_16.ogg","man_death_18.ogg","man_death_21.ogg","man_death_29.ogg","man_death_40.ogg","man_death_44.ogg","man_death_46.ogg","man_death_48.ogg","man_death_64.ogg"]),# ["man_fall_1.ogg","man_fall_2.ogg","man_fall_3.ogg","man_fall_4.ogg"]),
("woman_hit",sf_priority_7, ["woman_hit_2.ogg","woman_hit_3.ogg",
"woman_hit_b_2.ogg","woman_hit_b_4.ogg","woman_hit_b_6.ogg","woman_hit_b_7.ogg","woman_hit_b_8.ogg",
"woman_hit_b_11.ogg","woman_hit_b_14.ogg","woman_hit_b_16.ogg"]),
("woman_die",sf_priority_10, ["woman_fall_1.ogg","woman_hit_b_5.ogg"]),
("woman_yell",sf_priority_10|sf_vol_10, ["woman_yell_1.ogg","woman_yell_2.ogg"]),
("hide",0, ["s_hide.wav"]),
("unhide",0, ["s_unhide.wav"]),
("neigh",0, ["horse_exterior_whinny_01.ogg","horse_exterior_whinny_02.ogg","horse_exterior_whinny_03.ogg","horse_exterior_whinny_04.ogg","horse_exterior_whinny_05.ogg","horse_whinny.ogg"]),
("gallop",sf_vol_3, ["horse_gallop_3.ogg","horse_gallop_4.ogg","horse_gallop_5.ogg"]),
("battle",sf_vol_4, ["battle.ogg"]),
# ("bow_shoot_player",sf_priority_10|sf_vol_10, ["bow_shoot_4.ogg"]),
# ("bow_shoot",sf_priority_4, ["bow_shoot_4.ogg"]),
# ("crossbow_shoot",sf_priority_4, ["bow_shoot_2.ogg"]),
("arrow_hit_body",sf_priority_4, ["arrow_hit_body_1.ogg","arrow_hit_body_2.ogg","arrow_hit_body_3.ogg"]),
("metal_hit_low_armor_low_damage",sf_priority_5|sf_vol_9, ["sword_hit_lo_armor_lo_dmg_1.ogg","sword_hit_lo_armor_lo_dmg_2.ogg","sword_hit_lo_armor_lo_dmg_3.ogg"]),
("metal_hit_low_armor_high_damage",sf_priority_5|sf_vol_9, ["sword_hit_lo_armor_hi_dmg_1.ogg","sword_hit_lo_armor_hi_dmg_2.ogg","sword_hit_lo_armor_hi_dmg_3.ogg"]),
("metal_hit_high_armor_low_damage",sf_priority_5|sf_vol_9, ["metal_hit_high_armor_low_damage.ogg","metal_hit_high_armor_low_damage_2.ogg","metal_hit_high_armor_low_damage_3.ogg"]),
("metal_hit_high_armor_high_damage",sf_priority_5|sf_vol_9, ["sword_hit_hi_armor_hi_dmg_1.ogg","sword_hit_hi_armor_hi_dmg_2.ogg","sword_hit_hi_armor_hi_dmg_3.ogg"]),
("wooden_hit_low_armor_low_damage",sf_priority_5|sf_vol_9, ["blunt_hit_low_1.ogg","blunt_hit_low_2.ogg","blunt_hit_low_3.ogg"]),
("wooden_hit_low_armor_high_damage",sf_priority_5|sf_vol_9, ["blunt_hit_high_1.ogg","blunt_hit_high_2.ogg","blunt_hit_high_3.ogg"]),
("wooden_hit_high_armor_low_damage",sf_priority_5|sf_vol_9, ["wooden_hit_high_armor_low_damage.ogg","wooden_hit_high_armor_low_damage_2.ogg"]),
("wooden_hit_high_armor_high_damage",sf_priority_5|sf_vol_9, ["blunt_hit_high_1.ogg","blunt_hit_high_2.ogg","blunt_hit_high_3.ogg"]),
("mp_arrow_hit_target",sf_2d|sf_priority_10|sf_vol_9, ["mp_arrow_hit_target.ogg"]),
("blunt_hit",sf_priority_5|sf_vol_9, ["punch_1.ogg","punch_4.ogg","punch_4.ogg","punch_5.ogg"]),
("player_hit_by_arrow",sf_priority_10|sf_vol_10, ["player_hit_by_arrow.ogg"]),
("pistol_shot",sf_priority_10|sf_vol_10, ["fl_pistol.wav"]),
("man_grunt",sf_priority_6|sf_vol_4, ["man_excercise_1.ogg","man_excercise_2.ogg","man_excercise_4.ogg"]),
("man_breath_hard",sf_priority_3|sf_vol_8, ["man_ugh_1.ogg","man_ugh_2.ogg","man_ugh_4.ogg","man_ugh_7.ogg","man_ugh_12.ogg","man_ugh_13.ogg","man_ugh_17.ogg"]),
("man_stun",sf_priority_3|sf_vol_9, ["man_stun_1.ogg"]),
("man_grunt_long",sf_priority_5|sf_vol_8, ["man_grunt_1.ogg","man_grunt_2.ogg","man_grunt_3.ogg","man_grunt_5.ogg","man_grunt_13.ogg","man_grunt_14.ogg"]),
("man_yell",sf_priority_6|sf_vol_10, ["man_yell_4.ogg","man_yell_4_2.ogg","man_yell_7.ogg","man_yell_9.ogg","man_yell_11.ogg","man_yell_13.ogg","man_yell_15.ogg","man_yell_16.ogg","man_yell_17.ogg","man_yell_20.ogg","man_shortyell_4.ogg","man_shortyell_5.ogg","man_shortyell_6.ogg","man_shortyell_9.ogg","man_shortyell_11.ogg","man_shortyell_11b.ogg",
"man_yell_b_18.ogg","man_yell_22.ogg", "man_yell_c_20.ogg"]),
## not adequate, removed: "man_yell_b_21.ogg","man_yell_b_22.ogg","man_yell_b_23.ogg"]),
#TODONOW:
("man_warcry",sf_priority_6, ["man_insult_2.ogg","man_insult_3.ogg","man_insult_7.ogg","man_insult_9.ogg","man_insult_13.ogg","man_insult_15.ogg","man_insult_16.ogg"]),
("encounter_looters",sf_2d|sf_vol_8, ["encounter_river_pirates_5.ogg","encounter_river_pirates_6.ogg","encounter_river_pirates_9.ogg","encounter_river_pirates_10.ogg","encounter_river_pirates_4.ogg"]),
("encounter_bandits",sf_2d|sf_vol_8, ["encounter_bandit_2.ogg","encounter_bandit_9.ogg","encounter_bandit_12.ogg","encounter_bandit_13.ogg","encounter_bandit_15.ogg","encounter_bandit_16.ogg","encounter_bandit_10.ogg",]),
("encounter_farmers",sf_2d|sf_vol_8, ["encounter_farmer_2.ogg","encounter_farmer_5.ogg","encounter_farmer_7.ogg","encounter_farmer_9.ogg"]),
("encounter_sea_raiders",sf_2d|sf_vol_8, ["encounter_sea_raider_5.ogg","encounter_sea_raider_9.ogg","encounter_sea_raider_9b.ogg","encounter_sea_raider_10.ogg"]),
("encounter_steppe_bandits",sf_2d|sf_vol_8, ["encounter_steppe_bandit_3.ogg","encounter_steppe_bandit_3b.ogg","encounter_steppe_bandit_8.ogg","encounter_steppe_bandit_10.ogg","encounter_steppe_bandit_12.ogg"]),
("encounter_nobleman",sf_2d|sf_vol_8, ["encounter_nobleman_1.ogg"]),
("encounter_vaegirs_ally",sf_2d|sf_vol_8, ["encounter_vaegirs_ally.ogg","encounter_vaegirs_ally_2.ogg"]),
("encounter_vaegirs_neutral",sf_2d|sf_vol_8, ["encounter_vaegirs_neutral.ogg","encounter_vaegirs_neutral_2.ogg","encounter_vaegirs_neutral_3.ogg","encounter_vaegirs_neutral_4.ogg"]),
("encounter_vaegirs_enemy",sf_2d|sf_vol_8, ["encounter_vaegirs_neutral.ogg","encounter_vaegirs_neutral_2.ogg","encounter_vaegirs_neutral_3.ogg","encounter_vaegirs_neutral_4.ogg"]),
("sneak_town_halt",sf_2d, ["sneak_halt_1.ogg","sneak_halt_2.ogg"]),
("horse_walk",sf_priority_3|sf_vol_12, ["horse_walk_1.ogg","horse_walk_2.ogg","horse_walk_3.ogg","horse_walk_4.ogg"]),
("horse_trot",sf_priority_3|sf_vol_13, ["horse_trot_1.ogg","horse_trot_2.ogg","horse_trot_3.ogg","horse_trot_4.ogg"]),
("horse_canter",sf_priority_3|sf_vol_14, ["horse_canter_1.ogg","horse_canter_2.ogg","horse_canter_3.ogg","horse_canter_4.ogg"]),
("horse_gallop",sf_priority_3|sf_vol_15, ["horse_gallop_6.ogg","horse_gallop_7.ogg","horse_gallop_8.ogg","horse_gallop_9.ogg"]),
("horse_breath",sf_priority_3|sf_priority_9|sf_vol_10, ["horse_breath_4.ogg","horse_breath_5.ogg","horse_breath_6.ogg","horse_breath_7.ogg"]),
("horse_snort",sf_priority_5|sf_vol_10, ["horse_snort_1.ogg","horse_snort_2.ogg","horse_snort_3.ogg","horse_snort_4.ogg","horse_snort_5.ogg"]),
("horse_low_whinny",sf_vol_12, ["horse_whinny-1.ogg","horse_whinny-2.ogg"]),
("block_fist",0, ["block_fist_3.ogg","block_fist_4.ogg"]),
("man_hit_blunt_weak",sf_priority_5|sf_vol_10, ["man_hit_13.ogg","man_hit_29.ogg","man_hit_32.ogg","man_hit_47.ogg","man_hit_57.ogg"]),
("man_hit_blunt_strong",sf_priority_5|sf_vol_10, ["man_hit_13.ogg","man_hit_29.ogg","man_hit_32.ogg","man_hit_47.ogg","man_hit_57.ogg"]),
("man_hit_pierce_weak",sf_priority_5|sf_vol_10, ["man_hit_13.ogg","man_hit_29.ogg","man_hit_32.ogg","man_hit_47.ogg","man_hit_57.ogg"]),
("man_hit_pierce_strong",sf_priority_5|sf_vol_10, ["man_hit_13.ogg","man_hit_29.ogg","man_hit_32.ogg","man_hit_47.ogg","man_hit_57.ogg"]),
("man_hit_cut_weak",sf_priority_5|sf_vol_10, ["man_hit_13.ogg","man_hit_29.ogg","man_hit_32.ogg","man_hit_47.ogg","man_hit_57.ogg"]),
("man_hit_cut_strong",sf_priority_5|sf_vol_10, ["man_hit_13.ogg","man_hit_29.ogg","man_hit_32.ogg","man_hit_47.ogg","man_hit_57.ogg"]),
("man_victory",sf_priority_5|sf_vol_10, ["man_victory_3.ogg","man_victory_4.ogg","man_victory_5.ogg","man_victory_8.ogg","man_victory_15.ogg","man_victory_49.ogg","man_victory_52.ogg","man_victory_54.ogg","man_victory_57.ogg","man_victory_71.ogg"]),
("fire_loop",sf_priority_9|sf_vol_4|sf_looping|sf_start_at_random_pos, ["Fire_Torch_Loop3.ogg"]),
("torch_loop",sf_priority_9|sf_vol_4|sf_looping|sf_start_at_random_pos, ["Fire_Torch_Loop3.ogg"]),
("dummy_hit",sf_priority_9, ["shield_hit_cut_3.ogg","shield_hit_cut_5.ogg"]),
("dummy_destroyed",sf_priority_9, ["shield_broken.ogg"]),
("gourd_destroyed",sf_priority_9, ["shield_broken.ogg"]),#TODO
("cow_moo", sf_2d|sf_priority_9|sf_vol_8, ["cow_moo_1.ogg"]),
("cow_slaughter", sf_2d|sf_priority_9|sf_vol_8, ["cow_slaughter.ogg"]),
("distant_dog_bark", sf_2d|sf_priority_8|sf_vol_8, ["d_dog1.ogg","d_dog2.ogg","d_dog3.ogg","d_dog7.ogg"]),
("distant_owl", sf_2d|sf_priority_8|sf_vol_9, ["d_owl2.ogg","d_owl3.ogg","d_owl4.ogg"]),
("distant_chicken", sf_2d|sf_priority_8|sf_vol_8, ["d_chicken1.ogg","d_chicken2.ogg"]),
("distant_carpenter", sf_2d|sf_priority_8|sf_vol_3, ["d_carpenter1.ogg","d_saw_short3.ogg"]),
("distant_blacksmith", sf_2d|sf_priority_8|sf_vol_4, ["d_blacksmith2.ogg"]),
("arena_ambiance", sf_2d|sf_priority_8|sf_vol_3|sf_looping, ["arena_loop11.ogg"]),
("town_ambiance", sf_2d|sf_priority_8|sf_vol_3|sf_looping, ["town_loop_3.ogg"]),
("tutorial_fail", sf_2d|sf_vol_7,["cue_failure.ogg"]),
("your_flag_taken", sf_2d|sf_priority_10|sf_vol_10, ["your_flag_taken.ogg"]),
("enemy_flag_taken", sf_2d|sf_priority_10|sf_vol_10, ["enemy_flag_taken.ogg"]),
("flag_returned", sf_2d|sf_priority_10|sf_vol_10, ["your_flag_returned.ogg"]),
("team_scored_a_point", sf_2d|sf_priority_10|sf_vol_10, ["you_scored_a_point.ogg"]),
("enemy_scored_a_point", sf_2d|sf_priority_10|sf_vol_10, ["enemy_scored_a_point.ogg"]),
]
| Python |
import string
import types
from module_info import *
from module_game_menus import *
from process_common import *
from process_operations import *
def save_game_menu_item(ofile,variable_list,variable_uses,menu_item,tag_uses,quick_strings):
ofile.write(" mno_%s "%(menu_item[0]))
save_statement_block(ofile,0, 1, menu_item[1], variable_list, variable_uses,tag_uses,quick_strings)
ofile.write(" %s "%(string.replace(menu_item[2]," ","_")))
save_statement_block(ofile,0, 1, menu_item[3], variable_list, variable_uses,tag_uses,quick_strings)
door_name = "."
if (len(menu_item) > 4):
door_name = menu_item[4]
ofile.write(" %s "%(string.replace(door_name," ","_")))
def save_game_menus(variable_list,variable_uses,tag_uses,quick_strings):
ofile = open(export_dir + "menus.txt","w")
ofile.write("menusfile version 1\n")
ofile.write(" %d\n"%(len(game_menus)))
for game_menu in game_menus:
ofile.write("menu_%s %d %s %s"%(game_menu[0],game_menu[1],string.replace(game_menu[2]," ","_"),game_menu[3]))
save_statement_block(ofile,0,1, game_menu[4] , variable_list, variable_uses,tag_uses,quick_strings)
menu_items = game_menu[5]
ofile.write("%d\n"%(len(menu_items)))
for menu_item in menu_items:
save_game_menu_item(ofile,variable_list,variable_uses,menu_item,tag_uses,quick_strings)
ofile.write("\n")
ofile.close()
def save_python_header():
ofile = open("./ID_menus.py","w")
for i_game_menu in xrange(len(game_menus)):
ofile.write("menu_%s = %d\n"%(game_menus[i_game_menu][0],i_game_menu))
ofile.close()
print "Exporting game menus data..."
save_python_header()
variable_uses = []
variables = load_variables(export_dir, variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_game_menus(variables,variable_uses,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir, tag_uses)
save_quick_strings(export_dir,quick_strings) | Python |
import string
from module_info import *
from module_map_icons import *
from process_common import *
from process_operations import *
def save_map_icons(variable_list,variable_uses,tag_uses,quick_strings):
ofile = open(export_dir + "map_icons.txt","w")
ofile.write("map_icons_file version 1\n")
ofile.write("%d\n"%len(map_icons))
for map_icon in map_icons:
triggers = []
if (len(map_icon) >= 8):
ofile.write("%s %d %s %f %d %f %f %f "%(map_icon[0],map_icon[1],map_icon[2],map_icon[3],map_icon[4],map_icon[5],map_icon[6],map_icon[7]))
if (len(map_icon) == 9):
triggers = map_icon[8]
else:
ofile.write("%s %d %s %f %d 0 0 0 "%(map_icon[0],map_icon[1],map_icon[2],map_icon[3],map_icon[4]))
if (len(map_icon) == 6):
triggers = map_icon[5]
save_simple_triggers(ofile,triggers, variable_list,variable_uses,tag_uses,quick_strings)
ofile.write("\n")
ofile.close()
def save_python_header():
ofile = open("./ID_map_icons.py","w")
for i_map_icon in xrange(len(map_icons)):
ofile.write("icon_%s = %d\n"%(map_icons[i_map_icon][0],i_map_icon))
ofile.close()
print "Exporting map icons..."
save_python_header()
variable_uses = []
variables = load_variables(export_dir,variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_map_icons(variables,variable_uses,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir,tag_uses)
save_quick_strings(export_dir,quick_strings)
| Python |
snd_click = 0
snd_tutorial_1 = 1
snd_tutorial_2 = 2
snd_gong = 3
snd_quest_taken = 4
snd_quest_completed = 5
snd_quest_succeeded = 6
snd_quest_concluded = 7
snd_quest_failed = 8
snd_quest_cancelled = 9
snd_rain = 10
snd_money_received = 11
snd_money_paid = 12
snd_sword_clash_1 = 13
snd_sword_clash_2 = 14
snd_sword_clash_3 = 15
snd_sword_swing = 16
snd_footstep_grass = 17
snd_footstep_wood = 18
snd_footstep_water = 19
snd_footstep_horse = 20
snd_footstep_horse_1b = 21
snd_footstep_horse_1f = 22
snd_footstep_horse_2b = 23
snd_footstep_horse_2f = 24
snd_footstep_horse_3b = 25
snd_footstep_horse_3f = 26
snd_footstep_horse_4b = 27
snd_footstep_horse_4f = 28
snd_footstep_horse_5b = 29
snd_footstep_horse_5f = 30
snd_jump_begin = 31
snd_jump_end = 32
snd_jump_begin_water = 33
snd_jump_end_water = 34
snd_horse_jump_begin = 35
snd_horse_jump_end = 36
snd_horse_jump_begin_water = 37
snd_horse_jump_end_water = 38
snd_release_bow = 39
snd_release_crossbow = 40
snd_throw_javelin = 41
snd_throw_axe = 42
snd_throw_knife = 43
snd_throw_stone = 44
snd_reload_crossbow = 45
snd_reload_crossbow_continue = 46
snd_pull_bow = 47
snd_pull_arrow = 48
snd_arrow_pass_by = 49
snd_bolt_pass_by = 50
snd_javelin_pass_by = 51
snd_stone_pass_by = 52
snd_axe_pass_by = 53
snd_knife_pass_by = 54
snd_bullet_pass_by = 55
snd_incoming_arrow_hit_ground = 56
snd_incoming_bolt_hit_ground = 57
snd_incoming_javelin_hit_ground = 58
snd_incoming_stone_hit_ground = 59
snd_incoming_axe_hit_ground = 60
snd_incoming_knife_hit_ground = 61
snd_incoming_bullet_hit_ground = 62
snd_outgoing_arrow_hit_ground = 63
snd_outgoing_bolt_hit_ground = 64
snd_outgoing_javelin_hit_ground = 65
snd_outgoing_stone_hit_ground = 66
snd_outgoing_axe_hit_ground = 67
snd_outgoing_knife_hit_ground = 68
snd_outgoing_bullet_hit_ground = 69
snd_draw_sword = 70
snd_put_back_sword = 71
snd_draw_greatsword = 72
snd_put_back_greatsword = 73
snd_draw_axe = 74
snd_put_back_axe = 75
snd_draw_greataxe = 76
snd_put_back_greataxe = 77
snd_draw_spear = 78
snd_put_back_spear = 79
snd_draw_crossbow = 80
snd_put_back_crossbow = 81
snd_draw_revolver = 82
snd_put_back_revolver = 83
snd_draw_dagger = 84
snd_put_back_dagger = 85
snd_draw_bow = 86
snd_put_back_bow = 87
snd_draw_shield = 88
snd_put_back_shield = 89
snd_draw_other = 90
snd_put_back_other = 91
snd_body_fall_small = 92
snd_body_fall_big = 93
snd_horse_body_fall_begin = 94
snd_horse_body_fall_end = 95
snd_hit_wood_wood = 96
snd_hit_metal_metal = 97
snd_hit_wood_metal = 98
snd_shield_hit_wood_wood = 99
snd_shield_hit_metal_metal = 100
snd_shield_hit_wood_metal = 101
snd_shield_hit_metal_wood = 102
snd_shield_broken = 103
snd_man_hit = 104
snd_man_die = 105
snd_woman_hit = 106
snd_woman_die = 107
snd_woman_yell = 108
snd_hide = 109
snd_unhide = 110
snd_neigh = 111
snd_gallop = 112
snd_battle = 113
snd_arrow_hit_body = 114
snd_metal_hit_low_armor_low_damage = 115
snd_metal_hit_low_armor_high_damage = 116
snd_metal_hit_high_armor_low_damage = 117
snd_metal_hit_high_armor_high_damage = 118
snd_wooden_hit_low_armor_low_damage = 119
snd_wooden_hit_low_armor_high_damage = 120
snd_wooden_hit_high_armor_low_damage = 121
snd_wooden_hit_high_armor_high_damage = 122
snd_mp_arrow_hit_target = 123
snd_blunt_hit = 124
snd_player_hit_by_arrow = 125
snd_pistol_shot = 126
snd_man_grunt = 127
snd_man_breath_hard = 128
snd_man_stun = 129
snd_man_grunt_long = 130
snd_man_yell = 131
snd_man_warcry = 132
snd_encounter_looters = 133
snd_encounter_bandits = 134
snd_encounter_farmers = 135
snd_encounter_sea_raiders = 136
snd_encounter_steppe_bandits = 137
snd_encounter_nobleman = 138
snd_encounter_vaegirs_ally = 139
snd_encounter_vaegirs_neutral = 140
snd_encounter_vaegirs_enemy = 141
snd_sneak_town_halt = 142
snd_horse_walk = 143
snd_horse_trot = 144
snd_horse_canter = 145
snd_horse_gallop = 146
snd_horse_breath = 147
snd_horse_snort = 148
snd_horse_low_whinny = 149
snd_block_fist = 150
snd_man_hit_blunt_weak = 151
snd_man_hit_blunt_strong = 152
snd_man_hit_pierce_weak = 153
snd_man_hit_pierce_strong = 154
snd_man_hit_cut_weak = 155
snd_man_hit_cut_strong = 156
snd_man_victory = 157
snd_fire_loop = 158
snd_torch_loop = 159
snd_dummy_hit = 160
snd_dummy_destroyed = 161
snd_gourd_destroyed = 162
snd_cow_moo = 163
snd_cow_slaughter = 164
snd_distant_dog_bark = 165
snd_distant_owl = 166
snd_distant_chicken = 167
snd_distant_carpenter = 168
snd_distant_blacksmith = 169
snd_arena_ambiance = 170
snd_town_ambiance = 171
snd_tutorial_fail = 172
snd_your_flag_taken = 173
snd_enemy_flag_taken = 174
snd_flag_returned = 175
snd_team_scored_a_point = 176
snd_enemy_scored_a_point = 177
| Python |
from header_common import *
from header_animations import *
####################################################################################################################
# There are two animation arrays (one for human and one for horse). Each animation in these arrays contains the following fields:
# 1) Animation id (string): used for referencing animations in other files. The prefix anim_ is automatically added before each animation-id .
# 2) Animation flags: could be anything beginning with acf_ defined in header_animations.py
# 3) Animation master flags: could be anything beginning with amf_ defined in header_animations.py
# 4) Animation sequences (list).
# 4.1) Duration of the sequence.
# 4.2) Name of the animation resource.
# 4.3) Beginning frame of the sequence within the animation resource.
# 4.4) Ending frame of the sequence within the animation resource.
# 4.5) Sequence flags: could be anything beginning with arf_ defined in header_animations.py
#
####################################################################################################################
#plan :
# basic movement : walk ride etc. 0 -20000
# on_foot : 0 - 10000
# horse : 10000 - 20000
# combat : 20000 - 40000
# fall : 4000 - 70000
# act : misc. 70000 - ...
amf_priority_jump = 2
amf_priority_ride = 2
amf_priority_continue = 1
amf_priority_attack = 10
amf_priority_cancel = 12
amf_priority_defend = 14
amf_priority_defend_parry = amf_priority_defend + 1
amf_priority_throw = amf_priority_defend + 1
amf_priority_blocked = amf_priority_defend_parry
amf_priority_parried = amf_priority_defend_parry
amf_priority_kick = 33
amf_priority_jump_end = 33
amf_priority_reload = 60
amf_priority_mount = 64
amf_priority_equip = 70
amf_priority_rear = 74
amf_priority_striked = 80
amf_priority_fall_from_horse= 81
amf_priority_die = 95
horse_move = 10000
combat = 20000
defend = 35000
blow = 40000
attack_parried_duration = 0.6
attack_blocked_duration = 0.3
attack_blocked_duration_thrust = attack_blocked_duration + 0.3
attack_parried_duration_thrust = attack_parried_duration + 0.1
defend_parry_duration_1 = 0.6
defend_parry_duration_2 = 0.6
defend_parry_duration_3 = 0.8
ready_durn = 0.35
defend_duration = 0.75
defend_keep_duration = 2.0
cancel_duration = 0.25
blend_in_defense = arf_blend_in_3
blend_in_ready = arf_blend_in_6
blend_in_release = arf_blend_in_5
blend_in_parry = arf_blend_in_5
blend_in_parried = arf_blend_in_3
blend_in_walk = arf_blend_in_3
blend_in_continue = arf_blend_in_1
#### Animations begin here
# All of the animations are hardcoded. You can edit the individual sequences, resources or times. But each
# animation must stay at the same position, otherwise the game won't run properly. If you want to add a new animation,
# you can change both the ids and values of the animations which are named as unused_human_anim_???
# and unused_horse_anim_??? (??? = any number). You must not change used animations' ids.
animations = [
["stand", 0, amf_client_prediction,
# [3.0, "myanim", 0, 50, arf_cyclic|arf_loop_pos_0_25],
[3.0, "anim_human", 50, 52, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
[3.0, "anim_human", 60, 62, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.75],
[3.0, "anim_human", 70, 72, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
[3.0, "anim_human", 80, 82, arf_use_stand_progress|arf_cyclic|arf_two_handed_blade, 0, (0, 0, 0), 0.5],
## [35.0, "stand_woman", 0, 1059, arf_use_stand_progress|arf_cyclic|arf_two_handed_blade, 0, (0, 0, 0), 0.5],
## [43.0, "stand_woman_public", 0, 1313, arf_use_stand_progress|arf_cyclic|arf_two_handed_blade, 0, (0, 0, 0), 0.5],
# [35.0, "tavern_stand", 0, 472, arf_cyclic|arf_loop_pos_0_25],
],
["stand_man", 0, amf_client_prediction,
[11.0, "stand_man", 0, 315, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
],
["stand_player_first_person", 0, amf_client_prediction,
[3.5, "anim_human", 90, 100, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
[3.5, "anim_human", 110, 120, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
],
["jump", acf_enforce_lowerbody, amf_priority_jump|amf_play|amf_client_prediction|amf_continue_to_next,
## [1.09, "jump", 22, 48, arf_blend_in_1],
[1.0, "jump", 22, 46, arf_blend_in_1],
## [0.8, "anim_human", 270, 272, arf_blend_in_4],
],
["jump_loop", acf_enforce_lowerbody, amf_priority_jump|amf_play|amf_client_prediction,
## [0.8, "jump_loop", 0, 30, arf_blend_in_2|arf_cyclic],
[0.5, "jump_loop", 0, 14, arf_blend_in_3|arf_cyclic],
],
["jump_end", acf_enforce_lowerbody, amf_priority_jump_end|amf_play|amf_client_prediction,
## [0.1, "jump", 48, 55, arf_blend_in_1],
[0.3, "jump", 48, 55, arf_blend_in_2],
],
["jump_end_hard", acf_enforce_lowerbody, amf_priority_jump_end|amf_play|amf_client_prediction,
## [0.8, "jump_end_hard", 29, 54, arf_blend_in_1],
[0.6, "jump_end_hard", 36, 54, arf_blend_in_1],
],
["stand_unarmed", 0, amf_client_prediction,
[8, "noweapon_cstance", 0, 100, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
],
["stand_single", 0, amf_client_prediction,
[9.0, "sword_loop01", 0, 200, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
# [4.0, "sword_loop02", 0, 100, arf_cyclic|arf_loop_pos_0_25],
],
["stand_greatsword", 0, amf_client_prediction,
[6.0, "greatsword_cstance", 0, 91, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
],
["stand_staff", 0, amf_client_prediction,
[2.0, "staff_cstance", 0, 60, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],
],
["stand_crossbow", 0, amf_client_prediction,
[2.0, "staff_cstance", 0, 60, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],
],
["turn_right", acf_enforce_lowerbody, amf_play|amf_client_prediction,
[0.95, "stand_man", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25], #TODO
],
["turn_left", acf_enforce_lowerbody, amf_play|amf_client_prediction,
[0.95, "stand_man", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25], #TODO
],
["turn_right_single", acf_enforce_lowerbody, amf_play|amf_client_prediction,
[0.95, "turn_man_onehanded", 0, 23, arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["turn_left_single", acf_enforce_lowerbody, amf_play|amf_client_prediction,
[0.95, "turn_man_onehanded", 30, 53, arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["turn_right_staff", acf_enforce_lowerbody, amf_play|amf_client_prediction,
[0.95, "turn_man_staff", 0, 20, arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["turn_left_staff", acf_enforce_lowerbody, amf_play|amf_client_prediction,
[0.95, "turn_man_staff", 30, 50, arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["turn_right_greatsword", acf_enforce_lowerbody, amf_play|amf_client_prediction,
[0.95, "turn_man_greatsword", 0, 20, arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["turn_left_greatsword", acf_enforce_lowerbody, amf_play|amf_client_prediction,
[0.95, "turn_man_greatsword", 30, 50, arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["prepare_kick_0", acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_client_prediction|amf_continue_to_next,
[0.05, "kick_rightleg", 10, 12, arf_blend_in_3],
],
["prepare_kick_1", acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_client_prediction|amf_continue_to_next,
[0.05, "kick_rightleg", 12, 12, arf_blend_in_3],
],
["prepare_kick_2", acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_client_prediction|amf_continue_to_next,
[0.05, "kick_rightleg", 12, 12, arf_blend_in_3],
],
["prepare_kick_3", acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_client_prediction|amf_continue_to_next,
[0.05, "kick_rightleg", 12, 12, arf_blend_in_3],
],
["kick_right_leg", acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_client_prediction,
## [1.09, "jump", 22, 48, arf_blend_in_1],
[0.7, "kick_rightleg", 12, 33, arf_blend_in_1],
],
["kick_left_leg", acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_client_prediction,
## [1.09, "jump", 22, 48, arf_blend_in_1],
[0.7, "kick_rightleg", 12, 33, arf_blend_in_1],
],
["run_forward", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "anim_human", 7000, 7040, arf_use_walk_progress|arf_cyclic|blend_in_walk,pack2f(0.4,0.9)],
[0.8, "run_man_forward", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "anim_human", 7000, 7040, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9)],
# [0.8, "run_normal", 0, 12, arf_use_walk_progress|arf_cyclic|blend_in_walk,pack2f(0.4,0.9)],
[0.8, "run_man_forward_onehanded", 0, 24, arf_use_walk_progress|arf_cyclic|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_staff", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "anim_human", 7100, 7140, arf_use_walk_progress|arf_cyclic|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_greatsword", 0, 22, arf_use_walk_progress|arf_cyclic|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_forward_staff", 0, 24, arf_use_walk_progress|arf_cyclic|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_greatsword", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "anim_human", 7200, 7240, arf_use_walk_progress|arf_cyclic|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_greatsword", 0, 22, arf_use_walk_progress|arf_cyclic|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_forward_greatsword", 0, 24, arf_use_walk_progress|arf_cyclic|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "run_forward_hips_right", 0, 22, arf_use_walk_progress|arf_cyclic|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "run_forward_hips_left", 0, 22, arf_use_walk_progress|arf_cyclic|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [0.8, "run_normal", 0, 22, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_man_right", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.8, "run_man_forward_right", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_right_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [0.8, "run_crossright_onehanded", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.8, "run_man_forward_right_onehanded", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_right_staff", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [0.8, "run_crossright_staff", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.8, "run_man_forward_right_stuff", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_right_greatsword", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [0.8, "run_crossright_greatsword", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.8, "run_man_forward_right_greatsword", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_right_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "run_forward_right_hips_right", 0, 22, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_right_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "run_forward_right_hips_left", 0, 19, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [0.8, "run_normal", 0, 22, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_man_left", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.8, "run_man_forward_left", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_left_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [0.8, "run_crossleft_onehanded", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.8, "run_man_forward_left_onehanded", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_left_staff", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [0.8, "run_crossleft_staff", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.8, "run_man_forward_left_stuff", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_left_greatsword", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [0.8, "run_crossleft_greatsword", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.8, "run_man_forward_left_greatsword", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_left_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.6, "run_forward_left_hips_right", 0, 19, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_forward_left_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "run_forward_left_hips_left", 0, 22, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.7, "run_backward", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7040, 7000, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.7, "run_backward", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_staff", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7140, 7100, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.7, "run_backward_staff", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_greatsword", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7240, 7200, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.7, "run_backward_twohanded", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.7, "run_backward_hips_right", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.7, "run_backward_hips_left", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7040, 7000, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [1.0, "run_man_forward", 24, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.7, "run_backward_right", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_right_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7040, 7000, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.7, "run_backward_right", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_right_staff", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7140, 7100, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.7, "run_backward_staff_right", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_right_greatsword", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7240, 7200, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.7, "run_backward_twohanded_right", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_right_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.7, "run_backward_right_hips_right", 0, 19, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_right_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.7, "run_backward_right_hips_left", 0, 22, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7040, 7000, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [1.0, "run_man_forward", 24, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
[0.7, "run_backward_left", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_left_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7040, 7000, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.7, "run_backward_left", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_left_staff", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7140, 7100, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.7, "run_backward_staff_left", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_left_greatsword", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 7240, 7200, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.7, "run_backward_twohanded_left", 0, 21, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_left_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.7, "run_backward_left_hips_right", 0, 22, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_backward_left_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.7, "run_backward_left_hips_left", 0, 19, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.4],
],
["run_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "anim_human", 9000, 9020, arf_use_walk_progress|arf_cyclic|blend_in_walk,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_right_normal", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_man_right", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_right_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "run_right_onehanded", 0, 12, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_right_onehanded", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_man_right_onehanded", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_right_twohanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "run_right_greatsword", 0, 12, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_right_greatsword", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_man_right_greatsword", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_right_polearm", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "run_right_staff", 0, 12, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_right_staff", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_man_right_stuff", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_right_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "run_man_right_stuff", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_right_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "run_right_hips_left", 0, 24, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "anim_human", 9500, 9520, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_left_normal", 0, 24, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_man_left", 0, 24, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_left_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "run_left_onehanded", 0, 12, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_man_left_onehanded", 0, 24, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_left_twohanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "anim_human", 9500, 9520, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk,pack2f(0.4,0.9), (0, 0, 0), 0.0],
# [0.8, "run_left_greatsword", 0, 12, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_left_greatsword", 0, 24, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_man_left_greatsword", 0, 24, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_left_polearm", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [0.8, "run_left_staff", 0, 12, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [0.8, "run_left_staff", 0, 24, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[0.8, "run_man_left_stuff", 0, 24, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_left_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "run_left_hips_right", 0, 24, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["run_left_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "run_man_left_stuff", 0, 24, arf_use_walk_progress|arf_cyclic|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 6000, 6020, arf_walk,pack2f(0.4,0.9)],
[1.0, "man_walk", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 6000, 6020, arf_walk,pack2f(0.4,0.9)],
[1.0, "man_walk", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_staff", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [1.0, "anim_human", 6100, 6120, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[1.0, "man_walk_staff", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_greatsword", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [1.0, "anim_human", 6200, 6220, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[1.0, "man_walk_greatsword", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_forward_hips_right", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_forward_hips_left", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [1.0, "anim_human", 6020, 6000, arf_phase_odd|arf_walk,pack2f(0.4,0.9)],
## [1.0, "anim_human", 6020, 6000, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
## [1.0, "man_walk", 32, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[1.0, "walk_backward", 0, 30, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
# [1.0, "anim_human", 6000, 6020, arf_walk,pack2f(0.4,0.9)],
[1.0, "man_walk", 32, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_staff", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [1.0, "anim_human", 6120, 6100, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[1.0, "man_walk_staff", 32, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_greatsword", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
## [1.0, "anim_human", 6220, 6200, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
[1.0, "man_walk_greatsword", 32, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_backward_hips_right", 0, 30, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_backward_hips_left", 0, 30, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_right_normal", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_right_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_right_onehanded_r", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_right_twohanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_right_greatsword_r", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_right_polearm", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_right_staff_r", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_right_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_right_staff_r", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_right_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_right_hips_left", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_left_normal", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_left_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_left_onehanded_r", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_left_twohanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_left_greatsword", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_left_polearm", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_left_staff", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_left_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_left_hips_right", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_left_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_left_staff", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossright_normal", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_right_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossright_onehanded", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_right_twohanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossright_greatsword", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_right_polearm", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossright_staff", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_right_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_forward_right_hips_right", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_right_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_forward_right_hips_left", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossleft_normal", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_left_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossleft_onehanded", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_left_twohanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossleft_greatsword", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_left_polearm", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossleft_staff", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_left_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_forward_left_hips_right", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_left_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_forward_left_hips_left", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossright_normal", 32, 0, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_left_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossright_onehanded", 32, 0, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_left_twohanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossright_greatsword", 32, 0, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_left_polearm", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossright_staff", 32, 0, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_left_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_backward_left_hips_right", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_left_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_backward_left_hips_left", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossleft_normal", 32, 0, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_right_onehanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossleft_onehanded", 32, 0, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_right_twohanded", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossleft_greatsword", 32, 0, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_right_polearm", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_crossleft_staff", 32, 0, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_right_hips_right", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_backward_right_hips_right", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_backward_right_hips_left", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "walk_backward_right_hips_left", 0, 32, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0],
],
["walk_forward_crouch", acf_enforce_lowerbody, 0,
[1.7, "low_walk", 0, 48, arf_use_walk_progress,pack2f(0.4,0.9)],
],
["stand_to_crouch", acf_enforce_lowerbody, 0,
[1.0, "crouch_down", 0, 81, arf_blend_in_1, 0, (0.0,0,0.0)],
],
["crouch_to_stand", acf_enforce_lowerbody, 0,
[1.0, "crouch_down", 154, 185, arf_blend_in_1, 0, (0.0,0,0.0)],
],
["ride_0", acf_enforce_lowerbody, amf_client_prediction,
## [10.0, "anim_human", horse_move+2000, horse_move+2100, arf_cyclic],
# [3.0, "anim_human_02", 600, 644, arf_cyclic],
## [37.0, "stand_onhorse", 0, 1110, arf_cyclic],
## [22.0, "stand_onhorse_sword", 0, 671, arf_cyclic],
[15.0, "stand_onhorse", 0, 456, arf_cyclic],
],
["ride_1", acf_enforce_lowerbody | acf_synch_with_horse, amf_client_prediction,
[1.0, "anim_human_02", 0, 31, arf_cyclic],
],
["lancer_ride_1", acf_enforce_lowerbody | acf_synch_with_horse, amf_client_prediction|amf_priority_ride|amf_play,
## [0.8, "anim_human", horse_move+210, horse_move+250, arf_cyclic | arf_blend_in_16],
[1.0, "lancer_ride1", 0, 31, arf_cyclic],
],
["lancer_charge_parried",acf_enforce_lowerbody, amf_priority_parried|amf_use_weapon_speed|amf_play,
[1.0, "anim_human", horse_move+210, horse_move+220, arf_blend_in_32],
],
["ride_2", acf_enforce_lowerbody | acf_synch_with_horse, amf_client_prediction,
[0.8, "anim_human_02", 50, 69, arf_cyclic],
],
["ride_3", acf_enforce_lowerbody | acf_synch_with_horse, amf_client_prediction,
[0.6, "anim_human_02", 100, 116, arf_cyclic],
],
["ride_4", acf_enforce_lowerbody | acf_synch_with_horse, amf_client_prediction,
[0.5, "anim_human_02", 150, 165, arf_cyclic|arf_blend_in_32],
],
# ["lancer_ride_4", acf_enforce_lowerbody | acf_synch_with_horse | acf_rot_vertical_sword|acf_anim_length(100), 0,
# [0.5, "anim_human", horse_move+610, horse_move+650, arf_cyclic | arf_blend_in_128],
# ],
["lancer_ride_4", acf_enforce_lowerbody | acf_synch_with_horse | acf_rot_vertical_sword|acf_anim_length(30), amf_rider_rot_couched_lance|amf_client_prediction|amf_priority_ride|amf_play,
[0.5, "lancer_ride4", 0, 15, arf_cyclic | arf_blend_in_128],
],
["lancer_ride_4_no_shield", acf_enforce_lowerbody | acf_synch_with_horse | acf_rot_vertical_sword|acf_anim_length(30), amf_rider_rot_couched_lance|amf_client_prediction|amf_priority_ride|amf_play,
[0.5, "lancer_ride4_no_shield", 0, 15, arf_cyclic | arf_blend_in_128],
],
["ride_rear", acf_enforce_lowerbody|acf_ignore_slope, amf_priority_mount|amf_play|amf_client_prediction,
## [1.4, "anim_human", horse_move+820, horse_move+837, arf_blend_in_16],
## [2.4, "anim_human", horse_move+820, horse_move+837, arf_blend_in_16],
[1.7, "anim_human_02", 265, 297, arf_blend_in_8],
],
["ride_spur", acf_enforce_lowerbody, amf_play|amf_priority_jump,
[0.3, "anim_human", horse_move+860, horse_move+865, arf_blend_in_8],
],
["ride_jump", acf_enforce_lowerbody, amf_client_prediction,
## [1.6, "anim_human_02", 400, 420, arf_blend_in_16],
[1.6, "anim_human_02", 205, 222, arf_blend_in_4],#|arf_end_pos_0_25],
],
["ride_jump_end", acf_enforce_all, amf_client_prediction,
## [0.1, "anim_human", horse_move+935, horse_move+940, arf_blend_in_16],
## [0.3, "anim_human_02", 420, 424, arf_blend_in_16],
[0.1, "anim_human_02", 222, 224, arf_blend_in_16],
],
["ride_turn_right", acf_enforce_lowerbody | acf_synch_with_horse, amf_client_prediction,
[1.0, "anim_human_02", 500, 533, arf_cyclic],
],
["ride_turn_left", acf_enforce_lowerbody | acf_synch_with_horse, amf_client_prediction,
[1.0, "anim_human_02", 450, 483, arf_cyclic],
],
["mount_horse", acf_enforce_all, amf_priority_mount|amf_play|amf_client_prediction,
[1.3, "anim_human", horse_move+1003, horse_move+1045, arf_blend_in_1, 0, (0.0,0,0.0)],
],
["dismount_horse", acf_enforce_lowerbody|acf_displace_position, amf_priority_mount|amf_play|amf_accurate_body|amf_client_prediction,
[1.1, "anim_human", horse_move+1103, horse_move+1145, arf_blend_in_1, 0, (-0.5,0,0)],
],
["lancer_ride_0", acf_enforce_lowerbody, amf_priority_ride|amf_play|amf_client_prediction,
## [4.0, "anim_human", horse_move + 5000, horse_move + 5057, arf_lancer|arf_cyclic],
[43.0, "stand_onhorse_staff", 0, 1300, arf_lancer|arf_cyclic],
],
["equip_default", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.6, "equip_arms", 206, 221, arf_blend_in_0],
],
["unequip_default", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "equip_arms", 207, 200, arf_blend_in_0],
],
["equip_sword", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.8, "equip_sword", 0, 27, arf_blend_in_0],
],
["unequip_sword", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "equip_sword", 6, 0, arf_blend_in_0],
],
["equip_greatsword", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[1.2, "draw_greatsword", 0, 35, arf_blend_in_0],
],
["unequip_greatsword", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "draw_greatsword", 10, 0, arf_blend_in_0],
],
["equip_axe_left_hip", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.8, "draw_axe", 0, 16, arf_blend_in_0],
],
["unequip_axe_left_hip", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "draw_axe", 6, 0, arf_blend_in_0],
],
["equip_crossbow", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[1.2, "equip_greataxe", 0, 20, arf_blend_in_0],
],
["unequip_crossbow", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "equip_greataxe", 10, 0, arf_blend_in_0],
],
["equip_spear", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.8, "equip_arms", 17, 34, arf_blend_in_0],
],
["unequip_spear", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "equip_arms", 15, 10, arf_blend_in_0],
],
["equip_dagger_front_left", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.8, "equip_arms", 253, 276, arf_blend_in_0],
],
["unequip_dagger_front_left", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.2, "equip_arms", 254, 250, arf_blend_in_0],
],
["equip_dagger_front_right", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.8, "equip_arms", 305, 333, arf_blend_in_0],
],
["unequip_dagger_front_right", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.4, "equip_arms", 306, 300, arf_blend_in_0],
],
["equip_axe_back", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[1.0, "equip_greataxe", 0, 17, arf_blend_in_0],
],
["unequip_axe_back", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "equip_greataxe", 7, 0, arf_blend_in_0],
],
["equip_revolver_right", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.6, "equip_arms", 352, 365, arf_blend_in_0],
],
["unequip_revolver_right", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "equip_arms", 354, 350, arf_blend_in_0],
],
["equip_pistol_front_left", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.6, "anim_human", combat+30, combat+45, arf_blend_in_0],
],
["unequip_pistol_front_left", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "anim_human", combat+10, combat+0, arf_blend_in_0],
],
["equip_katana", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.8, "anim_human", combat+30, combat+45, arf_blend_in_0],
],
["unequip_katana", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "anim_human", combat+10, combat+0, arf_blend_in_0],
],
["equip_wakizashi", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.8, "anim_human", combat+30, combat+45, arf_blend_in_0],
],
["unequip_wakizashi", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "anim_human", combat+10, combat+0, arf_blend_in_0],
],
["equip_shield", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.8, "equip_arms", 68, 84, arf_blend_in_0],
],
["unequip_shield", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.4, "equip_arms", 62, 50, arf_blend_in_0],
],
["equip_bow_back", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.7, "equip_arms", 161, 179, arf_blend_in_0],
],
["unequip_bow_back", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "equip_arms", 163, 150, arf_blend_in_0],
],
["equip_bow_left_hip", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.7, "equip_arms", 110, 148, arf_blend_in_0],
],
["unequip_bow_left_hip", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[0.3, "equip_arms", 115, 108, arf_blend_in_0],
],
["cancel_attack_onehanded", 0, amf_priority_cancel|amf_use_weapon_speed|amf_use_inertia|amf_play|amf_rider_rot_thrust,
[cancel_duration, "sword_loop01", 10, 11, arf_blend_in_8],
],
["cancel_attack_twohanded", 0, amf_priority_cancel|amf_use_weapon_speed|amf_use_inertia|amf_play|amf_rider_rot_thrust,
[cancel_duration, "greatsword_cstance", 10, 11, arf_blend_in_8],
],
["cancel_attack_polearm", 0, amf_priority_cancel|amf_use_weapon_speed|amf_use_inertia|amf_play|amf_rider_rot_thrust,
[cancel_duration, "staff_cstance", 10, 11, arf_blend_in_8],
],
#TODO: ready bow, release javelin and reload crossbow should have the same time
# duration and controlled via weapon speed.
["ready_bow", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_bow,
[1.5, "anim_human", combat+500, combat+530, blend_in_ready|arf_make_custom_sound, pack2f(0.14, 0.44)],
],
["release_bow", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_bow,
[0.3, "anim_human", combat+530, combat+532, arf_blend_in_2],
],
#not used
["ready_bow_mounted", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_bow,
[1.5, "anim_human", combat+800, combat+830, blend_in_ready|arf_make_custom_sound, pack2f(0.10, 0.40)],
],
#not used
["release_bow_mounted", acf_rot_vertical_bow|acf_anim_length(100), amf_rider_rot_bow,
[0.3, "anim_human", combat+830, combat+832, arf_blend_in_2],
],
["ready_crossbow", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_crossbow,
[1.5, "anim_human", combat+1300, combat+1320, blend_in_ready],
],
["release_crossbow", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_crossbow,
[0.2, "anim_human", combat+1330, combat+1331, arf_blend_in_1],
],
["reload_crossbow", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
[1.0, "anim_human", combat+1700, combat+1750, arf_blend_in_8|arf_make_custom_sound, pack2f(0.40, 0.94)],
],
["reload_crossbow_horseback", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
[1.6, "anim_human", combat+1800, combat+1877, arf_blend_in_8|arf_make_custom_sound, pack2f(0.27, 0.94)],
],
["ready_javelin", acf_rot_vertical_bow, amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_throw,
[0.6, "throw_javelin2", 0, 30, blend_in_ready],
],
["release_javelin", acf_rot_vertical_bow, amf_priority_throw|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_throw,
[0.9, "throw_javelin2", 55, 100, arf_blend_in_0],
],
["ready_throwing_knife", acf_rot_vertical_bow, amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_throw,
[0.6, "throw_knife", 10, 30, blend_in_ready],
],
["release_throwing_knife", acf_rot_vertical_bow, amf_priority_throw|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_throw,
[0.9, "throw_knife", 30, 70, arf_blend_in_0],
],
["ready_throwing_axe", acf_rot_vertical_bow, amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_throw,
## [0.3, "throw_axe", 0, 40, blend_in_ready],
[0.6, "throwing_axe", 7, 23, blend_in_ready],
],
["release_throwing_axe", acf_rot_vertical_bow, amf_priority_throw|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_throw,
## [0.9, "throw_axe", 40, 90, arf_blend_in_0],
[0.9, "throwing_axe", 23, 60, arf_blend_in_0],
],
["ready_stone", acf_rot_vertical_bow, amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_throw,
#### [0.3, "anim_human", combat+2200, combat+2210, blend_in_ready],
## [0.7, "throw_stone", 0, 21, blend_in_ready],
[0.6, "throwing_stone", 0, 20, blend_in_ready],
],
["release_stone", acf_rot_vertical_bow, amf_priority_throw|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_throw,
#### [1.0, "anim_human", combat+2210, combat+2225, arf_blend_in_0],
## [1.0, "throw_stone", 21, 54, arf_blend_in_0],
[0.9, "throwing_stone", 20, 65, arf_blend_in_0],
],
["ready_pistol", acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_pistol,
[0.3, "anim_human", combat+2500, combat+2515, arf_blend_in_8],
],
["release_pistol", acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_pistol,
[0.3, "anim_human", combat+2520, combat+2527, arf_blend_in_1],
],
["reload_pistol", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
[2.0, "anim_human", combat+2650, combat+2860, arf_blend_in_8],
],
["ready_musket", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_crossbow,
[1.5, "anim_human", combat+1300, combat+1320, blend_in_ready],
],
["release_musket", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_crossbow,
[0.2, "anim_human", combat+1330, combat+1331, arf_blend_in_1],
],
["reload_musket", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
[2.0, "anim_human", combat+2650, combat+2860, arf_blend_in_8],
],
["ready_swingright_fist", 0, amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_swing_right,
[ready_durn, "right_swing", 0, 15, blend_in_ready],
],
["release_swingright_fist", 0, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right,
[0.5, "right_swing", 15, 41, blend_in_release],
],
["release_swingright_fist_continue", 0, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right,
[0.5, "right_swing", 15, 41, blend_in_release],
],
["blocked_swingright_fist", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right,
[attack_blocked_duration, "anim_human", combat+4013, combat+4008, blend_in_parry],
],
["parried_swingright_fist", 0, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right,
[attack_parried_duration, "anim_human", combat+4013, combat+4008, blend_in_parry],
],
["ready_swingleft_fist", 0, amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_swing_left,
[ready_durn, "anim_human", combat+4300, combat+4300, blend_in_ready],
],
["release_swingleft_fist", 0, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left,
[0.5, "anim_human", combat+4300, combat+4335, blend_in_release],
],
["release_swingleft_fist_continue", 0, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left,
[0.5, "anim_human", combat+4300, combat+4335, blend_in_release],
],
["blocked_swingleft_fist", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left,
[attack_blocked_duration, "anim_human", combat+4313, combat+4308, blend_in_parry],
],
["parried_swingleft_fist", 0, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left,
[attack_parried_duration, "anim_human", combat+4313, combat+4308, blend_in_parry],
],
["ready_direct_fist", 0, amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_thrust,
[ready_durn, "direct_fist", 0, 16, blend_in_ready],
],
["release_direct_fist", 0, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[0.5, "direct_fist", 17, 36, blend_in_release],
],
["release_direct_fist_continue", 0, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[0.5, "direct_fist", 17, 36, blend_in_release],
],
["blocked_direct_fist", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_blocked_duration, "anim_human", combat+4613, combat+4608, blend_in_parry],
],
["parried_direct_fist", 0, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_parried_duration, "anim_human", combat+4613, combat+4608, blend_in_parry],
],
["ready_uppercut_fist", 0, amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_thrust,
[ready_durn, "uppercut", 0, 17, blend_in_ready],
],
["release_uppercut_fist", 0, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[0.5, "uppercut", 17, 34, blend_in_release],
],
["release_uppercut_fist_continue", 0, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[0.5, "uppercut", 17, 34, blend_in_release],
],
["blocked_uppercut_fist", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_blocked_duration, "anim_human", combat+4913, combat+4908, blend_in_parry],
],
["parried_uppercut_fist", 0, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_parried_duration, "anim_human", combat+4913, combat+4908, blend_in_parry],
],
["ready_slashright_twohanded", acf_right_cut|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "anim_human", combat+5700, combat+5710, blend_in_ready],
## [ready_durn, "slashright_twohanded", 5, 20, blend_in_ready],
## [ready_durn, "slashright_twohanded", 10, 16, blend_in_ready],
[ready_durn, "slashright_twohanded", 10, 18, blend_in_ready],
],
["release_slashright_twohanded", acf_right_cut|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
## [0.62, "anim_human", combat+5710, combat+5740, blend_in_release],
## [0.62, "slashright_twohanded", 20, 51, blend_in_release],
## [0.62, "slashright_twohanded", 16, 40, blend_in_release],
[0.61, "slashright_twohanded", 18, 38, blend_in_release],
],
["release_slashright_twohanded_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
## [0.3, "slashright_twohanded", 45, 61, blend_in_continue],
[0.5, "slashright_twohanded", 38, 61, blend_in_continue],
],
["blocked_slashright_twohanded",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play,
[attack_blocked_duration, "anim_human", combat+5725, combat+5720, blend_in_parry],
],
["parried_slashright_twohanded",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play,
[attack_parried_duration, "anim_human", combat+5725, combat+5720, blend_in_parry],
],
["ready_slashleft_twohanded", acf_right_cut|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "anim_human", combat+6400, combat+6410, blend_in_ready],
#### [ready_durn, "slashleft_twohanded", 7, 26, blend_in_ready],
## [ready_durn, "slashleft_twohanded", 11, 20, blend_in_ready],
[ready_durn, "slashleft_twohanded", 12, 16, blend_in_ready],
],
["release_slashleft_twohanded", acf_right_cut|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
## [0.62, "anim_human", combat+6410, combat+6436, blend_in_release],
#### [0.62, "slashleft_twohanded", 26, 53, blend_in_release],
## [0.62, "slashleft_twohanded", 20, 45, blend_in_release],
[0.61, "slashleft_twohanded", 16, 38, blend_in_release],
],
["release_slashleft_twohanded_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
[0.5, "slashleft_twohanded", 38, 52, blend_in_continue],
],
["blocked_slashleft_twohanded",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play,
[attack_blocked_duration, "anim_human", combat+6425, combat+6420, blend_in_parry],
],
["parried_slashleft_twohanded",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play,
[attack_parried_duration, "anim_human", combat+6425, combat+6420, blend_in_parry],
],
["ready_thrust_twohanded", acf_thrust|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
[ready_durn, "anim_human", combat+6000, combat+6010, blend_in_ready],
],
["release_thrust_twohanded", acf_thrust|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
[0.61, "anim_human", combat+6010, combat+6031, blend_in_release],
],
["release_thrust_twohanded_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
[0.1, "anim_human", combat+6031, combat+6040, blend_in_continue],
],
["blocked_thrust_twohanded", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play,
[attack_blocked_duration_thrust, "anim_human", combat+6015, combat+6016, blend_in_parry],
],
["parried_thrust_twohanded", 0, amf_priority_parried|amf_use_weapon_speed|amf_play,
[attack_parried_duration_thrust, "anim_human", combat+6015, combat+6016, blend_in_parry],
],
["ready_overswing_twohanded", acf_overswing, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "anim_human", combat+6200, combat+6210, blend_in_ready],
[ready_durn, "attacks_twohanded_overswing", 11, 26, blend_in_ready],
],
["release_overswing_twohanded", acf_overswing, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
## [0.63, "anim_human", combat+6210, combat+6241, blend_in_release],
## [0.63, "attacks_twohanded_overswing", 33, 60, blend_in_release],
[0.61, "attacks_twohanded_overswing", 26, 55, blend_in_release],
],
["release_overswing_twohanded_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
[0.5, "attacks_twohanded_overswing", 55, 66, blend_in_continue],
],
["blocked_overswing_twohanded", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play,
[attack_blocked_duration, "anim_human", combat+6215, combat+6212, blend_in_parry],
],
["parried_overswing_twohanded", 0, amf_priority_parried|amf_use_weapon_speed|amf_play,
[attack_parried_duration, "anim_human", combat+6215, combat+6212, blend_in_parry],
],
["ready_thrust_onehanded", acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_thrust,
## [ready_durn, "anim_human", combat+8500, combat+8510, blend_in_ready],
[ready_durn, "attacks_thrust_onehanded", 5, 13, blend_in_ready],
],
["release_thrust_onehanded", acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_continue_to_next,
## [0.61, "anim_human", combat+8510, combat+8540, blend_in_release],
[0.62, "attacks_thrust_onehanded", 12, 32, blend_in_release],
],
["release_thrust_onehanded_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_client_owner_prediction,
[0.3, "attacks_thrust_onehanded", 32, 54, blend_in_continue],
],
["blocked_thrust_onehanded", acf_enforce_rightside, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_blocked_duration_thrust, "anim_human", combat+8515, combat+8513, blend_in_parry],
],
["parried_thrust_onehanded", acf_enforce_rightside, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_parried_duration_thrust, "anim_human", combat+8515, combat+8513, blend_in_parry],
],
["ready_thrust_onehanded_horseback", acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_thrust,
## [ready_durn, "anim_human", combat+8500, combat+8510, blend_in_ready],
## [ready_durn, "attacks_thrust_onehanded", 0, 16, blend_in_ready],
[ready_durn, "attacks_thrust_onehanded", 5, 13, blend_in_ready],
],
["release_thrust_onehanded_horseback", acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_continue_to_next,
## [0.61, "anim_human", combat+8510, combat+8540, blend_in_release],
## [0.9, "attacks_thrust_onehanded", 16, 54, blend_in_release],
[0.62, "attacks_thrust_onehanded", 12, 32, blend_in_release],
],
["release_thrust_onehanded_horseback_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_client_owner_prediction,
## [0.1, "attacks_thrust_onehanded", 54, 54, blend_in_continue],
[0.3, "attacks_thrust_onehanded", 32, 54, blend_in_continue],
],
["blocked_thrust_onehanded_horseback", acf_enforce_rightside, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_blocked_duration_thrust, "anim_human", combat+8515, combat+8513, blend_in_parry],
],
["parried_thrust_onehanded_horseback", acf_enforce_rightside, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_parried_duration_thrust, "anim_human", combat+8515, combat+8513, blend_in_parry],
],
["ready_thrust_onehanded_lance", acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_thrust,
## [ready_durn, "anim_human", combat+9500, combat+9508, blend_in_ready],
[ready_durn, "thrust_onehanded_lance_hb", 5, 8, blend_in_ready],
],
["release_thrust_onehanded_lance", acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_continue_to_next,
## [0.62, "anim_human", combat+9507, combat+9530, blend_in_release],
[0.62, "thrust_onehanded_lance_hb", 8, 33, blend_in_release],
],
["release_thrust_onehanded_lance_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_client_owner_prediction,
## [0.1, "anim_human", combat+9530, combat+9540, blend_in_continue],
[0.1, "thrust_onehanded_lance_hb", 33, 45, blend_in_continue],
],
["blocked_thrust_onehanded_lance", acf_enforce_rightside, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_blocked_duration_thrust, "anim_human", combat+9515, combat+9513, blend_in_parry],
],
["parried_thrust_onehanded_lance", acf_enforce_rightside, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
[attack_parried_duration_thrust, "anim_human", combat+9515, combat+9513, blend_in_parry],
],
["ready_slashright_onehanded", acf_right_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
#### [ready_durn, "anim_human", combat+8800, combat+8810, blend_in_ready],
## [ready_durn, "attacks_single_righttoleft", 8, 16, blend_in_ready],
## [ready_durn, "attacks_single_righttoleft", 5, 10, blend_in_ready],
[ready_durn, "attacks_single_righttoleft", 2, 5, blend_in_ready],
],
["release_slashright_onehanded", acf_right_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
#### [0.6, "anim_human", combat+8810, combat+8840, blend_in_release],
## [0.6, "attacks_single_righttoleft", 16, 37, blend_in_release],
## [0.6, "attacks_single_righttoleft", 10, 26, blend_in_release],
[0.6, "attacks_single_righttoleft", 5, 28, blend_in_release],
],
["release_slashright_onehanded_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
## [0.4, "attacks_single_righttoleft", 37, 49, blend_in_continue],
## [0.4, "attacks_single_righttoleft", 26, 43, blend_in_continue],
[0.4, "attacks_single_righttoleft", 28, 44, blend_in_continue],
],
["blocked_slashright_onehanded", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play,
## [attack_parried_duration, "anim_human", combat+8820, combat+8815, blend_in_parry],
[attack_blocked_duration, "parry_single_righttoleft", 0, 14, blend_in_parry],
],
["parried_slashright_onehanded", 0, amf_priority_parried|amf_use_weapon_speed|amf_play,
## [attack_parried_duration, "anim_human", combat+8820, combat+8815, blend_in_parry],
[attack_parried_duration, "parry_single_righttoleft", 0, 14, blend_in_parry],
],
## ["ready_slashright_onehanded", acf_left_cut|acf_rot_vertical|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction,
## [ready_durn, "attacks_single", 200, 220, blend_in_ready],
## ],
## ["release_slashright_onehanded", acf_left_cut|acf_rot_vertical|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play,
## [0.6, "attacks_single", 220, 245, blend_in_release],
## ],
## ["parry_slashright_onehanded", 0, amf_priority_parried|acf_rot_vertical|amf_use_weapon_speed|amf_play,
## [attack_parried_duration, "attacks_single", 230, 225, blend_in_parry],
## ],
["ready_slashleft_onehanded", acf_left_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "anim_human", combat+9100, combat+9110, blend_in_ready],
## [ready_durn, "attacks_single_lefttoright", 9, 19, blend_in_ready],
## [ready_durn, "attacks_single_lefttoright", 12, 21, blend_in_ready],
[ready_durn, "attacks_single_lefttoright", 4, 11, blend_in_ready],
],
["release_slashleft_onehanded", acf_left_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
## [0.6, "anim_human", combat+9110, combat+9140, blend_in_release],
## [0.61, "attacks_single_lefttoright", 19, 43, blend_in_release],
## [0.61, "attacks_single_lefttoright", 21, 40, blend_in_release],
[0.61, "attacks_single_lefttoright", 11, 29, blend_in_release],
],
["release_slashleft_onehanded_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
## [0.4, "attacks_single_lefttoright", 43, 56, blend_in_continue],
## [0.4, "attacks_single_lefttoright", 40, 50, blend_in_continue],
[0.4, "attacks_single_lefttoright", 29, 43, blend_in_continue],
],
["blocked_slashleft_onehanded", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play,
## [attack_blocked_duration, "anim_human", combat+9120, combat+9115, blend_in_parry],
[attack_blocked_duration, "parry_single_lefttoright", 0, 75, blend_in_parry],
],
["parried_slashleft_onehanded", 0, amf_priority_parried|amf_use_weapon_speed|amf_play,
## [attack_parried_duration, "anim_human", combat+9120, combat+9115, blend_in_parry],
[attack_parried_duration, "parry_single_lefttoright", 0, 75, blend_in_parry],
],
["ready_overswing_onehanded", acf_overswing|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_overswing,
## [ready_durn, "anim_human", combat+9300, combat+9305, blend_in_ready],
## [ready_durn, "attacks_single_overswing", 2, 16, blend_in_ready],
[ready_durn, "attacks_single_overswing", 5, 16, blend_in_ready],
],
["release_overswing_onehanded", acf_overswing|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_overswing|amf_continue_to_next,
## [0.6, "anim_human", combat+9305, combat+9342, blend_in_release],
## [0.6, "attacks_single_overswing", 16, 35, blend_in_release],
[0.6, "attacks_single_overswing", 16, 37, blend_in_release],
],
["release_overswing_onehanded_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_overswing|amf_client_owner_prediction,
[0.2, "attacks_single_overswing", 37, 40, blend_in_continue],
],
["blocked_overswing_onehanded", acf_enforce_rightside, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_overswing,
[attack_blocked_duration, "anim_human", combat+9315, combat+9310, blend_in_parry],
],
["parried_overswing_onehanded", acf_enforce_rightside, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_overswing,
[attack_parried_duration, "anim_human", combat+9315, combat+9310, blend_in_parry],
],
["ready_slash_horseback_right", acf_right_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_swing_right,
## [ready_durn, "anim_human", combat+10100, combat+10110, blend_in_ready],
## [ready_durn, "single_r_l_horse", 100, 112, blend_in_ready],
## [ready_durn, "attacks_single_righttoleft_horseback", 8, 16, blend_in_ready],
[ready_durn, "attacks_single_righttoleft_horseback", 8, 17, blend_in_ready],
],
["release_slash_horseback_right", acf_right_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right|amf_continue_to_next,
## [0.6, "anim_human", combat+10110, combat+10140, blend_in_release],
# [1.0, "single_r_l_horse", 112, 144, blend_in_release],
## [0.6, "attacks_single_righttoleft_horseback", 16, 38, blend_in_release],
[0.7, "attacks_single_righttoleft_horseback", 17, 39, blend_in_release],
],
["release_slash_horseback_right_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right|amf_client_owner_prediction,
[0.4, "attacks_single_righttoleft_horseback", 39, 54, blend_in_continue],
],
["blocked_slash_horseback_right",acf_rot_vertical_sword|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right,
# [attack_blocked_duration, "anim_human", combat+10120, combat+10115, blend_in_parry],
[attack_blocked_duration, "parry_single_righttoleft", 0, 14, blend_in_parry],
],
["parried_slash_horseback_right",acf_rot_vertical_sword|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right,
# [attack_parried_duration, "anim_human", combat+10120, combat+10115, blend_in_parry],
[attack_parried_duration, "parry_single_righttoleft", 0, 14, blend_in_parry],
],
["ready_slash_horseback_left", acf_left_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_swing_left,
# [ready_durn, "anim_human", combat+10400, combat+10410, blend_in_ready],
# [ready_durn, "anim_human", combat+9100, combat+9110, blend_in_ready],
[ready_durn, "attacks_single_lefttoright_horseback", 7, 21, blend_in_ready],
],
["release_slash_horseback_left", acf_left_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left|amf_continue_to_next,
# [0.6, "anim_human", combat+10410, combat+10440, blend_in_release],
# [0.6, "anim_human", combat+9110, combat+9140, blend_in_release],
[0.7, "attacks_single_lefttoright_horseback", 21, 43, blend_in_release],
],
["release_slash_horseback_left_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left|amf_client_owner_prediction,
[0.3, "attacks_single_lefttoright_horseback", 43, 51, blend_in_continue],
],
["blocked_slash_horseback_left",acf_rot_vertical_sword|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left,
# [attack_blocked_duration, "anim_human", combat+10420, combat+10415, blend_in_parry],
[attack_blocked_duration, "parry_single_lefttoright", 0, 75, blend_in_parry],
],
["parried_slash_horseback_left",acf_rot_vertical_sword|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left,
# [attack_parried_duration, "anim_human", combat+10420, combat+10415, blend_in_parry],
[attack_parried_duration, "parry_single_lefttoright", 0, 75, blend_in_parry],
],
["ready_slash_horseback_polearm_right", acf_right_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_swing_right,
[ready_durn, "attacks_staff_righttoleft", 6, 16, blend_in_ready],
],
["release_slash_horseback_polearm_right", acf_right_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right|amf_continue_to_next,
[0.7, "attacks_staff_righttoleft", 16, 40, blend_in_release],
],
["release_slash_horseback_polearm_right_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right|amf_client_owner_prediction,
[0.4, "attacks_staff_righttoleft", 40, 48, blend_in_continue],
],
["blocked_slash_horseback_polearm_right",acf_rot_vertical_sword|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right,
[attack_blocked_duration, "anim_human", combat+7915, combat+7913, arf_blend_in_2],
],
["parried_slash_horseback_polearm_right",acf_rot_vertical_sword|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_right,
[attack_blocked_duration, "anim_human", combat+7915, combat+7913, arf_blend_in_2],
],
["ready_slash_horseback_polearm_left", acf_left_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_swing_left,
[ready_durn, "attacks_staff_lefttoright", 10, 16, blend_in_ready],
],
["release_slash_horseback_polearm_left", acf_left_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left|amf_continue_to_next,
[0.7, "attacks_staff_lefttoright", 16, 41, blend_in_release],
],
["release_slash_horseback_polearm_left_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left|amf_client_owner_prediction,
[0.3, "attacks_staff_lefttoright", 41, 55, blend_in_continue],
],
["blocked_slash_horseback_polearm_left",acf_rot_vertical_sword|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left,
[attack_blocked_duration, "anim_human", combat+7615, combat+7613, arf_blend_in_2],
],
["parried_slash_horseback_polearm_left",acf_rot_vertical_sword|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_swing_left,
[attack_blocked_duration, "anim_human", combat+7615, combat+7613, arf_blend_in_2],
],
["ready_overswing_staff", acf_overswing, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "anim_human", combat+7100, combat+7110, blend_in_ready],
## [ready_durn, "attacks_staff_uptodown", 9, 34, blend_in_ready],
[ready_durn, "attacks_staff_uptodown", 9, 26, blend_in_ready],
],
["release_overswing_staff", acf_overswing, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
## [0.6, "anim_human", combat+7110, combat+7140, arf_blend_in_0],
## [0.6, "attacks_staff_uptodown", 34, 64, arf_blend_in_0],
[0.6, "attacks_staff_uptodown", 26, 61, blend_in_release],
],
["release_overswing_staff_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
[0.3, "attacks_staff_uptodown", 61, 68, blend_in_continue],
],
["blocked_overswing_staff", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play,
[attack_blocked_duration, "anim_human", combat+7017, combat+7014, arf_blend_in_2],
],
["parried_overswing_staff", 0, amf_priority_parried|amf_use_weapon_speed|amf_play,
[attack_parried_duration, "anim_human", combat+7017, combat+7014, arf_blend_in_2],
],
["ready_thrust_staff", acf_thrust|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "anim_human", combat+7300, combat+7310, blend_in_ready],
# [ready_durn, "thrust_staff", 70, 93, blend_in_ready],
[ready_durn, "attacks_staff_thrust", 14, 21, blend_in_ready],
],
["release_thrust_staff", acf_thrust|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play,
# [0.62, "anim_human", combat+7310, combat+7335, blend_in_release],
## [0.62, "anim_human", combat+7307, combat+7333, blend_in_release],
# [0.6, "thrust_staff", 93, 125, arf_blend_in_2],
[0.6, "attacks_staff_thrust", 21, 40, blend_in_release],
],
["release_thrust_staff_continue", acf_thrust|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
## [0.6, "anim_human", combat+7334, combat+7340, blend_in_release],
[0.6, "attacks_staff_thrust", 40, 58, blend_in_release],
],
["blocked_thrust_staff", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play,
[attack_blocked_duration_thrust, "anim_human", combat+7316, combat+7313, arf_blend_in_2],
# [attack_blocked_duration, "thrust_staff", 102, 97, arf_blend_in_2],
],
["parried_thrust_staff", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play,
[attack_parried_duration_thrust, "anim_human", combat+7316, combat+7313, arf_blend_in_2],
# [attack_parried_duration, "thrust_staff", 102, 97, arf_blend_in_2],
],
##
## ["ready_overswing_staff_overhead", acf_overswing, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "attacks_staff_thrust_overhead", 6, 21, blend_in_ready],
## ],
## ["release_overswing_staff_overhead", acf_overswing, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
## [0.6, "attacks_staff_thrust_overhead", 21, 43, blend_in_release],
## ],
## ["release_overswing_staff_overhead_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
## [0.3, "attacks_staff_thrust_overhead", 43, 50, blend_in_continue],
## ],
## ["blocked_overswing_staff_overhead", 0, amf_priority_blocked|amf_use_weapon_speed|amf_play,
## [attack_blocked_duration, "anim_human", combat+7017, combat+7014, arf_blend_in_2],
## ],
## ["parried_overswing_staff_overhead", 0, amf_priority_parried|amf_use_weapon_speed|amf_play,
## [attack_parried_duration, "anim_human", combat+7017, combat+7014, arf_blend_in_2],
## ],
## ["ready_thrust_staff_overhead", acf_thrust|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "javelin_thrust_overhead", 14, 30, blend_in_ready],
## ],
## ["release_thrust_staff_overhead", acf_thrust|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play,
## [0.6, "javelin_thrust_overhead", 55, 78, blend_in_release],
## ],
## ["release_thrust_staff_overhead_continue", acf_thrust|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
## [0.6, "javelin_thrust_overhead", 78, 95, blend_in_release],
## ],
## ["blocked_thrust_staff_overhead", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play,
## [attack_blocked_duration_thrust, "anim_human", combat+7316, combat+7313, arf_blend_in_2],
## ],
## ["parried_thrust_staff_overhead", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play,
## [attack_parried_duration_thrust, "anim_human", combat+7316, combat+7313, arf_blend_in_2],
## ],
["ready_slashleft_staff",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "anim_human", combat+7600, combat+7610, blend_in_ready],
## [ready_durn, "attacks_staff_lefttoright", 6, 20, blend_in_ready],
[ready_durn, "attacks_staff_lefttoright", 10, 16, blend_in_ready],
],
["release_slashleft_staff",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
## [0.6, "anim_human", combat+7610, combat+7640, arf_blend_in_0],
## [0.6, "attacks_staff_lefttoright", 20, 48, arf_blend_in_0],
[0.6, "attacks_staff_lefttoright", 16, 44, blend_in_release],
],
["release_slashleft_staff_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
[0.3, "attacks_staff_lefttoright", 44, 55, blend_in_continue],
],
["blocked_slashleft_staff",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play,
[attack_blocked_duration, "anim_human", combat+7615, combat+7613, arf_blend_in_2],
],
["parried_slashleft_staff",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play,
[attack_parried_duration, "anim_human", combat+7615, combat+7613, arf_blend_in_2],
],
["ready_slashright_staff",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
## [ready_durn, "anim_human", combat+7900, combat+7910, blend_in_ready],
## [ready_durn, "attacks_staff_righttoleft", 3, 18, blend_in_ready],
[ready_durn, "attacks_staff_righttoleft", 6, 16, blend_in_ready],
],
["release_slashright_staff",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
## [0.6, "anim_human", combat+7910, combat+7940, arf_blend_in_0],
## [0.6, "attacks_staff_righttoleft", 18, 48, arf_blend_in_0],
[0.6, "attacks_staff_righttoleft", 16, 40, blend_in_release],
],
["release_slashright_staff_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_client_owner_prediction,
[0.4, "attacks_staff_righttoleft", 40, 48, blend_in_continue],
],
["blocked_slashright_staff",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_blocked|amf_use_weapon_speed|amf_play,
[attack_blocked_duration, "anim_human", combat+7915, combat+7913, arf_blend_in_2],
],
["parried_slashright_staff",acf_rot_vertical_bow|acf_anim_length(100), amf_priority_parried|amf_use_weapon_speed|amf_play,
[attack_parried_duration, "anim_human", combat+7915, combat+7913, arf_blend_in_2],
],
["defend_fist", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_duration, "anim_human", combat+4950, combat+4960, blend_in_defense],
],
["defend_fist_keep", 0, amf_rider_rot_defend|amf_priority_defend|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_keep_duration, "anim_human", combat+4950, combat+4960, arf_blend_in_2|arf_cyclic],
],
["defend_fist_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", combat+4962, combat+4970, arf_blend_in_0],
],
["defend_fist_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", combat+4962, combat+4970, arf_blend_in_0],
],
["defend_fist_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", combat+4962, combat+4970, arf_blend_in_0],
],
["defend_shield_forward", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_rider_rot_shield|amf_client_owner_prediction,
[defend_duration, "defend_shield_forward", 6, 25, blend_in_defense],
],
["defend_shield_up", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_rider_rot_shield|amf_client_owner_prediction,
[defend_duration, "defend_shield_up", 1, 27, blend_in_defense],
],
["defend_shield_right", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_rider_rot_shield|amf_client_owner_prediction,
[defend_duration, "defend_shield_right", 5, 26, blend_in_defense],
],
["defend_shield_left", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_rider_rot_shield|amf_client_owner_prediction,
[defend_duration, "defend_shield_left", 5, 26, blend_in_defense],
],
["defend_shield", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_rider_rot_shield|amf_client_owner_prediction,
# [defend_duration, "anim_human", defend+105, defend+120, blend_in_defense],
# [defend_duration, "defend_shield_parry_all", 5, 26, blend_in_defense],
[defend_duration, "defend_shield_up", 1, 17, blend_in_defense],
],
["defend_shield_keep", acf_parallels_for_look_slope|acf_anim_length(100), amf_rider_rot_shield|amf_priority_defend|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_keep_duration, "anim_human", defend+118, defend+120, arf_blend_in_4|arf_cyclic],
],
["defend_shield_parry_1", acf_parallels_for_look_slope|acf_anim_length(100), amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_shield,
[defend_parry_duration_1, "anim_human", defend+121, defend+130, arf_blend_in_1],
],
["defend_shield_parry_2", acf_parallels_for_look_slope|acf_anim_length(100), amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_shield,
[defend_parry_duration_2, "anim_human", defend+121, defend+130, arf_blend_in_1],
],
["defend_shield_parry_3", acf_parallels_for_look_slope|acf_anim_length(100), amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_shield,
[defend_parry_duration_3, "anim_human", defend+121, defend+130, arf_blend_in_1],
],
["defend_forward_greatsword", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
# [defend_duration, "anim_human", defend+310, defend+320, blend_in_defense],
[defend_duration, "defend_twohanded", 0, 20, blend_in_defense],
],
["defend_forward_greatsword_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
# [2.0, "anim_human", defend+320, defend+320, arf_blend_in_3|arf_cyclic],
[defend_keep_duration, "defend_twohanded", 170, 170, arf_blend_in_3|arf_cyclic],
],
["defend_forward_greatsword_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
# [0.3, "anim_human", defend+320, defend+330, arf_blend_in_1],
[0.6, "defend_twohanded", 350, 367, arf_blend_in_1],
],
["defend_forward_greatsword_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
# [0.3, "anim_human", defend+320, defend+330, arf_blend_in_1],
[0.6, "defend_twohanded", 350, 367, arf_blend_in_1],
],
["defend_forward_greatsword_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
# [0.3, "anim_human", defend+320, defend+330, arf_blend_in_1],
[0.6, "defend_twohanded", 350, 367, arf_blend_in_1],
],
["defend_up_twohanded", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_duration, "anim_human", defend+403, defend+410, blend_in_defense],
],
["defend_up_twohanded_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_keep_duration, "anim_human", defend+410, defend+410, arf_blend_in_3|arf_cyclic],
],
["defend_up_twohanded_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", defend+411, defend+418, arf_blend_in_1],
],
["defend_up_twohanded_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", defend+411, defend+418, arf_blend_in_1],
],
["defend_up_twohanded_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", defend+411, defend+418, arf_blend_in_1],
],
["defend_right_twohanded", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_duration, "anim_human", defend+510, defend+520, blend_in_defense],
],
["defend_right_twohanded_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_keep_duration, "anim_human", defend+520, defend+520, arf_blend_in_3|arf_cyclic],
],
["defend_right_twohanded_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", defend+521, defend+528, arf_blend_in_1],
],
["defend_right_twohanded_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", defend+521, defend+528, arf_blend_in_1],
],
["defend_right_twohanded_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", defend+521, defend+528, arf_blend_in_1],
],
["defend_left_twohanded", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_duration, "anim_human", defend+610, defend+620, blend_in_defense],
],
["defend_left_twohanded_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_keep_duration, "anim_human", defend+620, defend+620, arf_blend_in_3|arf_cyclic],
],
["defend_left_twohanded_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", defend+620, defend+630, arf_blend_in_1],
],
["defend_left_twohanded_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", defend+620, defend+630, arf_blend_in_1],
],
["defend_left_twohanded_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", defend+620, defend+630, arf_blend_in_1],
],
["defend_forward_onehanded", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
## [defend_duration, "defend_onehanded", 8, 15, blend_in_defense],
[defend_duration, "defend_forward_onehanded", 20, 41, blend_in_defense],
# [defend_duration, "parry_attack_thrust_onehanded", 20, 32, arf_blend_in_1],
],
["defend_forward_onehanded_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
# [2.0, "anim_human", defend+1020, defend+1020, arf_blend_in_3|arf_cyclic],
[5.0, "defend_onehanded", 15, 70, arf_blend_in_3|arf_cyclic],
],
["defend_forward_onehanded_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
# [0.3, "anim_human", defend+1021, defend+1030, arf_blend_in_1],
[defend_parry_duration_1, "defend_onehanded", 75, 85, arf_blend_in_1],
## [defend_parry_duration_1, "defend_forward_onehanded_parry", 11, 18, arf_blend_in_1],
],
["defend_forward_onehanded_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
# [0.3, "anim_human", defend+1021, defend+1030, arf_blend_in_1],
[defend_parry_duration_2, "defend_onehanded", 75, 85, arf_blend_in_1],
## [defend_parry_duration_2, "defend_forward_onehanded_parry", 53, 67, arf_blend_in_1],
],
["defend_forward_onehanded_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
# [0.3, "anim_human", defend+1021, defend+1030, arf_blend_in_1],
[defend_parry_duration_3, "defend_onehanded", 75, 85, arf_blend_in_1],
## [defend_parry_duration_3, "defend_forward_onehanded_parry", 91, 110, arf_blend_in_1],
],
["defend_up_onehanded", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
## [defend_duration, "anim_human", defend+1110, defend+1120, blend_in_defense],
[defend_duration, "defend_up_onehanded", 9, 25, blend_in_defense],
# [defend_duration, "parry_attack_overswing_onehanded", 7, 19, blend_in_release],
],
["defend_up_onehanded_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
## [defend_keep_duration, "anim_human", defend+1120, defend+1120, arf_blend_in_3|arf_cyclic],
[2.8, "defend_up_onehanded_keep", 1, 87, arf_blend_in_3|arf_cyclic],
],
["defend_up_onehanded_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", defend+1121, defend+1130, arf_blend_in_1],
## [defend_parry_duration_1, "defend_up_onehanded_parry", 13, 19, arf_blend_in_1],
],
["defend_up_onehanded_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", defend+1121, defend+1130, arf_blend_in_1],
## [defend_parry_duration_2, "defend_up_onehanded_parry", 46, 52, arf_blend_in_1],
],
["defend_up_onehanded_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", defend+1121, defend+1130, arf_blend_in_1],
## [defend_parry_duration_3, "defend_up_onehanded_parry", 86, 109, arf_blend_in_1],
],
["defend_right_onehanded", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
## [defend_duration, "anim_human", defend+1210, defend+1220, blend_in_defense],
[defend_duration, "defend_right_onehanded", 14, 31, blend_in_defense],
# [defend_duration, "parry_attack_slashright_onehanded", 9, 22, arf_blend_in_1],
],
["defend_right_onehanded_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
## [defend_keep_duration, "anim_human", defend+1220, defend+1220, arf_blend_in_5|arf_cyclic],
[2.5, "defend_right_onehanded_keep", 0, 79, arf_blend_in_5|arf_cyclic],
],
["defend_right_onehanded_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", defend+1221, defend+1230, arf_blend_in_1],
## [defend_parry_duration_1, "defend_right_onehanded_parry", 4, 10, arf_blend_in_1],
],
["defend_right_onehanded_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", defend+1221, defend+1230, arf_blend_in_1],
## [defend_parry_duration_2, "defend_right_onehanded_parry", 38, 47, arf_blend_in_1],
],
["defend_right_onehanded_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", defend+1221, defend+1230, arf_blend_in_1],
## [defend_parry_duration_3, "defend_right_onehanded_parry", 80, 96, arf_blend_in_1],
],
["defend_left_onehanded", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
## [defend_duration, "anim_human", defend+1310, defend+1320, blend_in_defense],
[defend_duration, "defend_left_onehanded", 12, 28, blend_in_defense],
# [defend_duration, "parry_attack_slashleft_onehanded", 11, 24, blend_in_ready],
],
["defend_left_onehanded_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
## [defend_keep_duration, "anim_human", defend+1320, defend+1320, arf_blend_in_3|arf_cyclic],
[2.2, "defend_left_onehanded_keep", 1, 71, arf_blend_in_3|arf_cyclic],
],
["defend_left_onehanded_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", defend+1321, defend+1330, arf_blend_in_1],
## [defend_parry_duration_1, "defend_left_onehanded_parry", 4, 13, arf_blend_in_1],
],
["defend_left_onehanded_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", defend+1321, defend+1330, arf_blend_in_1],
## [defend_parry_duration_2, "defend_left_onehanded_parry", 30, 40, arf_blend_in_1],
],
["defend_left_onehanded_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", defend+1321, defend+1330, arf_blend_in_1],
## [defend_parry_duration_3, "defend_left_onehanded_parry", 58, 90, arf_blend_in_1],
],
["defend_forward_staff", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
# [pole_defend_duration, "anim_human", defend+2010, defend+2020, blend_in_defense],
[defend_duration, "defend_staff", 0, 5, blend_in_defense],
],
["defend_forward_staff_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
# [2.0, "anim_human", defend+2020, defend+2020, arf_blend_in_3|arf_cyclic],
# [4.0, "defend_staff", 0, 45, arf_blend_in_3|arf_cyclic],
[defend_keep_duration, "defend_staff", 5, 5, arf_blend_in_3|arf_cyclic],
],
["defend_forward_staff_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
# [0.3, "anim_human", defend+2021, defend+2030, arf_blend_in_1],
[0.6, "defend_staff", 56, 70, arf_blend_in_1],
],
["defend_forward_staff_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
# [0.3, "anim_human", defend+2021, defend+2030, arf_blend_in_1],
[0.6, "defend_staff", 56, 70, arf_blend_in_1],
],
["defend_forward_staff_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
# [0.3, "anim_human", defend+2021, defend+2030, arf_blend_in_1],
[0.6, "defend_staff", 56, 70, arf_blend_in_1],
],
["defend_up_staff", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_duration, "anim_human", defend+2110, defend+2120, blend_in_defense],
],
["defend_up_staff_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_keep_duration, "anim_human", defend+2120, defend+2120, arf_blend_in_3|arf_cyclic],
],
["defend_up_staff_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", defend+2121, defend+2130, arf_blend_in_1],
],
["defend_up_staff_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", defend+2121, defend+2130, arf_blend_in_1],
],
["defend_up_staff_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", defend+2121, defend+2130, arf_blend_in_1],
],
["defend_right_staff", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_duration, "anim_human", defend+2210, defend+2220, blend_in_defense],
],
["defend_right_staff_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_keep_duration, "anim_human", defend+2220, defend+2220, arf_blend_in_3|arf_cyclic],
],
["defend_right_staff_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", defend+2221, defend+2230, arf_blend_in_1],
],
["defend_right_staff_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", defend+2221, defend+2230, arf_blend_in_1],
],
["defend_right_staff_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", defend+2221, defend+2230, arf_blend_in_1],
],
["defend_left_staff", 0, amf_play|amf_restart|amf_priority_defend|amf_use_defend_speed|amf_use_inertia|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_duration, "anim_human", defend+2310, defend+2320, blend_in_defense],
],
["defend_left_staff_keep", 0, amf_priority_defend|amf_use_defend_speed|amf_keep|amf_rider_rot_defend|amf_client_owner_prediction,
[defend_keep_duration, "anim_human", defend+2320, defend+2320, arf_blend_in_3|arf_cyclic],
],
["defend_left_staff_parry_1", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_1, "anim_human", defend+2321, defend+2330, arf_blend_in_1],
],
["defend_left_staff_parry_2", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_2, "anim_human", defend+2321, defend+2330, arf_blend_in_1],
],
["defend_left_staff_parry_3", 0, amf_priority_defend_parry|amf_play|amf_restart|amf_rider_rot_defend,
[defend_parry_duration_3, "anim_human", defend+2321, defend+2330, arf_blend_in_1],
],
["strike_head_left", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes", 55, 71, arf_blend_in_3],
],
["strike_head_right", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes", 4, 19, arf_blend_in_3],
],
["strike_head_front", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes", 180, 198, arf_blend_in_3],
],
["strike_head_back", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.6, "strikes_back", 4, 25, arf_blend_in_3],
],
["strike_chest_left", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes", 706, 724, arf_blend_in_3],
],
["strike_chest_right", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.6, "strikes", 487, 512, arf_blend_in_3],
],
["strike_chest_front", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.6, "strikes", 881, 905, arf_blend_in_3],
],
["strike_chest_back", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes_back", 401, 418, arf_blend_in_3],
],
["strike_abdomen_left", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.58, "strikes", 1425, 1444, arf_blend_in_3],
],
["strike_abdomen_right", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.6, "strikes", 1168, 1188, arf_blend_in_3],
],
["strike_abdomen_front", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.6, "strikes", 1618, 1640, arf_blend_in_3],
],
["strike_abdomen_back", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.53, "strikes_back", 886, 904, arf_blend_in_3],
],
["strike_legs_left", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.55, "strikes", 2284, 2305, arf_blend_in_3],
],
["strike_legs_right", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.56, "strikes", 1999, 2020, arf_blend_in_3],
],
["strike_legs_front", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.56, "strikes", 2655, 2676, arf_blend_in_3],
],
["strike_legs_back", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes_back", 1120, 1137, arf_blend_in_3],
],
["strike2_head_left", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes", 55, 71, arf_blend_in_3],
],
["strike2_head_right",acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes", 4, 19, arf_blend_in_3],
],
["strike2_head_front",acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes", 180, 198, arf_blend_in_3],
],
["strike2_head_back", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
# [0.6, "strikes_back", 4, 25, arf_blend_in_3],
[0.55, "strikes_back", 4, 25, arf_blend_in_3],
],
["strike2_chest_left", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes", 706, 724, arf_blend_in_3],
],
["strike2_chest_right", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
# [0.6, "strikes", 487, 512, arf_blend_in_3],
[0.55, "strikes", 487, 512, arf_blend_in_3],
],
["strike2_chest_front", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
# [0.6, "strikes", 881, 905, arf_blend_in_3],
[0.55, "strikes", 881, 905, arf_blend_in_3],
],
["strike2_chest_back",acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes_back", 401, 418, arf_blend_in_3],
],
["strike2_abdomen_left", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.55, "strikes", 1425, 1444, arf_blend_in_3],
],
["strike2_abdomen_right", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
# [0.6, "strikes", 1168, 1188, arf_blend_in_3],
[0.55, "strikes", 1168, 1188, arf_blend_in_3],
],
["strike2_abdomen_front", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
# [0.6, "strikes", 1618, 1640, arf_blend_in_3],
[0.55, "strikes", 1618, 1640, arf_blend_in_3],
],
["strike2_abdomen_back", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.53, "strikes_back", 886, 904, arf_blend_in_3],
],
["strike2_legs_left", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.55, "strikes", 2284, 2305, arf_blend_in_3],
],
["strike2_legs_right", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.56, "strikes", 1999, 2020, arf_blend_in_3],
],
["strike2_legs_front", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.56, "strikes", 2655, 2676, arf_blend_in_3],
],
["strike2_legs_back", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.5, "strikes_back", 1120, 1137, arf_blend_in_3],
],
["strike3_head_left", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9 * 1.1, "strikes3_head", 107, 146, arf_blend_in_3],
],
["strike3_head_right",acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9 * 1.0, "strikes3_head", 208, 251, arf_blend_in_3],
],
["strike3_head_front",acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9 * 1.0, "strikes3_head", 14, 48, arf_blend_in_3],
],
["strike3_head_back", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9 * 1.0, "strikes3_head", 309, 346, arf_blend_in_3],
],
["strike3_chest_left", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9 * 1.0, "strikes3_chest", 61, 97, arf_blend_in_3],
],
["strike3_chest_right", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9, "strikes3_chest", 108, 145, arf_blend_in_3],
],
["strike3_chest_front", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.8, "strikes3_chest", 3, 27, arf_blend_in_3],
],
## ["strike3_chest_back",acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
## [1.3, "strikes3_chest", 264, 310, arf_blend_in_3],
## ],
["strike3_abdomen_left", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9 * 1.0, "strikes3_abdomen", 105, 150, arf_blend_in_3, 0, (0, -0.0, 0.0)],
],
["strike3_abdomen_right", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9, "strikes3_abdomen", 63, 98, arf_blend_in_3, 0, (0, 0.0, 0.0)],
],
["strike3_abdomen_front", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9 * 1.0, "strikes3_abdomen", 4, 43, arf_blend_in_3, 0, (0, 0.0, 0.0)],
],
["strike3_abdomen_back", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.9 * 1.2, "strikes3_abdomen_back", 0, 53, arf_blend_in_3],
],
## ["strike3_legs_left", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
## [0.6, "strikes", 2284, 2305, arf_blend_in_3],
## ],
## ["strike3_legs_right", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
## [0.7, "strikes", 1999, 2020, arf_blend_in_3],
## ],
## ["strike3_legs_front", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
## [0.7, "strikes", 2655, 2676, arf_blend_in_3],
## ],
## ["strike3_legs_back", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
## [0.8, "strikes_back", 1120, 1144, arf_blend_in_3],
## ],
## ["strike_head_front_left", 0, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
## [0.55, "anim_human", blow+0, blow+10, arf_blend_in_3],
## ],
["strike_head_front_left_reloc", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.6, "strike_frontal", 0, 37, arf_blend_in_3],
# [0.6, "anim_human", blow+5200, blow+5220, arf_blend_in_3],
],
["fall_face_hold", acf_enforce_all|acf_align_with_ground|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_keep|amf_client_prediction,
[2.2, "death_face", 8, 60, arf_blend_in_16|arf_make_custom_sound, pack2f(0.5, 0.0), (0,0,0), 0.6],
],
["fall_chest_front", acf_enforce_all|acf_align_with_ground|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_keep|amf_client_prediction,
[1.0, "death_chest", 4, 37, arf_blend_in_16|arf_make_custom_sound, pack2f(0.9, 0.0), (0,0,0), 0.5],
],
["fall_abdomen_hold_front", acf_enforce_all|acf_align_with_ground|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_keep|amf_client_prediction,
[2.7, "death_abdomen", 5, 96, arf_blend_in_16|arf_make_custom_sound, pack2f(0.4, 0.0), (0,0,0), 0.5],
],
["fall_head_front", acf_enforce_all|acf_align_with_ground|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_keep|amf_client_prediction,
[1.2, "anim_human", blow+100, blow+138, arf_blend_in_16|arf_make_custom_sound, pack2f(0.8, 0.0), (0,0,0), 0.8],
],
["fall_right_front", acf_enforce_all|acf_align_with_ground|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_keep|amf_client_prediction,
[2.0, "death2", 0, 53, arf_blend_in_16|arf_make_custom_sound, pack2f(0.65, 0.0), (0,0,0), 1.0],
],
["fall_body_back", acf_enforce_all|acf_align_with_ground|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_keep|amf_client_prediction,
[2.7, "death", 0, 83, arf_blend_in_16|arf_make_custom_sound, pack2f(0.47, 0.82), (0,0,0), 1.8],
],
## ["fall_rider_head_front", acf_enforce_all,
## [2.2, "anim_human", blow+200, blow+275, arf_blend_in_3],
## ],
["fall_rider_right_forward", acf_enforce_all|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_keep|amf_client_prediction,
[2.2, "anim_human", blow+200, blow+275, arf_blend_in_3|arf_make_custom_sound, pack2f(0.8, 0.0), (0,0,0), 0.3],
## [2.2, "fall_rider_right_forward", 0, 68, arf_blend_in_3|arf_make_custom_sound, pack2f(0.8, 0.0), (0,0,0), 0.3],
],
["fall_rider_right", acf_enforce_all|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_keep|amf_client_prediction,
[2.2, "anim_human", blow+200, blow+275, arf_blend_in_3|arf_make_custom_sound, pack2f(0.8, 0.0), (0,0,0), 0.3],
## [1.9, "fall_rider_right", 0, 57, arf_blend_in_3|arf_make_custom_sound, pack2f(0.8, 0.0), (0,0,0), 0.3],
],
["fall_rider_left", acf_enforce_all|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_keep|amf_client_prediction,
[2.2, "anim_human", blow+200, blow+275, arf_blend_in_3|arf_make_custom_sound, pack2f(0.8, 0.0), (0,0,0), 0.3],
## [1.9, "fall_rider_left", 0, 56, arf_blend_in_3|arf_make_custom_sound, pack2f(0.8, 0.0), (0,0,0), 0.3],
],
## ["rider_fall_in_place", acf_enforce_lowerbody, amf_priority_fall_from_horse|amf_play|amf_client_prediction,
## [3.8, "anim_human", blow + 1000, blow + 1075, arf_blend_in_16|arf_make_custom_sound, pack2f(0.0, 0.0), (0,0,0), 0.5],
## ],
["rider_fall_right", acf_enforce_all|acf_displace_position, amf_priority_fall_from_horse|amf_play|amf_accurate_body|amf_client_prediction,
[2.5, "anim_human_02", 350, 382, arf_blend_in_8, 0, (0.8,-1.8,0), 0.5],
],
["rider_fall_roll", acf_enforce_all|acf_displace_position, amf_priority_fall_from_horse|amf_play|amf_accurate_body|amf_client_prediction,
[2.5, "anim_human", blow+ 2000, blow+2084, arf_blend_in_8, 0, (0.0,0.0,0), 1.0],
],
["strike_chest_front_stop", acf_enforce_all, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[0.4, "anim_human", blow+5000, blow+5010, arf_blend_in_3],
],
["strike_fall_back_rise", acf_enforce_lowerbody|acf_align_with_ground, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[1.7, "anim_human", blow+5400, blow+5453, arf_blend_in_2|arf_make_custom_sound, pack2f(0.4, 0.0), (0,0,0), 0.5],
],
["strike_fall_back_rise_upper", acf_align_with_ground, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[1.44, "anim_human", blow+5400, blow+5445, arf_blend_in_2],
],
["cheer", 0, amf_play|amf_priority_mount,
## [2.5, "anim_human", 70000, 70045, arf_blend_in_5],
## [3.0, "anim_human", 70100, 70150, arf_blend_in_5],
[6.0, "man_cheer", 0, 185, arf_blend_in_5],
[3.0, "man_cheer", 200, 289, arf_blend_in_5],
[4.5, "man_cheer", 300, 437, arf_blend_in_5],
[5.5, "man_cheer", 450, 617, arf_blend_in_5],
],
["cheer_stand", arf_cyclic, amf_play|amf_priority_mount,
[31.5, "man_cheer", 650, 1597, arf_blend_in_5],
],
["stand_townguard", 0, 0,
[79.0, "stand_guardsman", 0, 2397, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
],
["stand_lady", 0, 0,
[29.0, "lady_stand", 0, 863, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
],
["stand_lord", 0, 0,
[10.0, "lord_stand", 0, 111, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
],
["dance", 0, 0,
[20.0, "anim_human", 0, 387, arf_blend_in_5],
# [10.0, "anim_human_temp", 0, 10, arf_blend_in_5],
],
["pose_1", 0, 0,
[3.0, "poses", 0, 0, arf_cyclic],
],
["pose_2", 0, 0,
[3.0, "poses", 2, 2, arf_cyclic],
],
["pose_3", 0, 0,
[3.0, "poses", 4, 4, arf_cyclic],
],
["pose_4", 0, 0,
[3.0, "poses", 6, 6, arf_cyclic],
],
["pose_5", 0, 0,
[3.0, "poses", 8, 8, arf_cyclic],
],
### Unused human animations start from here.
["wedding_guest", 0, amf_play|amf_priority_die,
[30.0, "wedding_guest", 0, 906, arf_cyclic]],
["wedding_guest_notr", 0, amf_play|amf_priority_die,
[32.0, "wedding_guest_notr", 0, 962, arf_cyclic]],
["wedding_guest_woman", 0, amf_play|amf_priority_die,
[27.5, "wedding_guest_woman", 0, 825, arf_cyclic]],
["wedding_dad_stairs", 0, amf_play|amf_priority_die|amf_start_instantly,
[10.0, "wedding_dad_stairs", 0, 300, arf_blend_in_0]],
["wedding_dad_walk", 0, amf_play|amf_priority_die|amf_start_instantly,
[4.5, "wedding_dad_walk", 0, 134, arf_blend_in_0]],
["wedding_bride_stairs", 0, amf_play|amf_priority_die|amf_start_instantly,
[10.0, "wedding_bride_stairs", 0, 300, arf_blend_in_0]],
["wedding_bride_walk", 0, amf_play|amf_priority_die|amf_start_instantly,
[4.5, "wedding_bride_walk", 0, 134, arf_blend_in_0]],
["wedding_groom_wait", 0, amf_play|amf_priority_die|amf_start_instantly|amf_keep,
[10.0, "wedding_groom_last", 0, 2, arf_blend_in_0]],
["wedding_groom_last", 0, amf_play|amf_priority_die|amf_start_instantly|amf_keep,
[10.0, "wedding_groom_last", 0, 300, arf_blend_in_0]],
["wedding_dad_last", 0, amf_play|amf_priority_die|amf_start_instantly|amf_keep,
[10.0, "wedding_dad_last", 0, 300, arf_blend_in_0]],
["wedding_bride_last", 0, amf_play|amf_priority_die|amf_start_instantly|amf_keep,
[10.0, "wedding_bride_last", 0, 300, arf_blend_in_0]],
["equip_bayonet", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[1.0, "anim_human", 0, 1, 0]],
## [0.8, "equip_arms", 253, 276, arf_blend_in_0]],
["unequip_bayonet", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
[1.0, "anim_human", 0, 1, 0]],
## [0.2, "equip_arms", 254, 250, arf_blend_in_0]],
["unused_human_anim_14", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_15", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_16", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_17", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_18", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_19", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_20", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_21", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_22", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_23", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_24", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_25", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_26", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_27", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_28", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_29", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_30", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_31", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_32", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_33", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_34", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_35", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_36", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_37", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_38", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_39", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_40", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_41", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_42", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_43", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_44", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_45", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_46", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_47", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_48", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_49", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_50", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_51", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_52", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_53", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_54", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_55", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_56", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_57", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_58", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_59", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_60", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_61", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_62", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_63", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_64", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_65", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_66", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_67", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_68", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_69", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_70", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_71", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_72", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_73", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_74", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_75", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_76", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_77", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_78", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_79", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_80", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_81", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_82", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_83", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_84", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_85", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_86", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_87", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_88", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_89", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_90", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_91", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_92", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_93", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_94", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_95", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_96", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_97", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_98", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_99", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["unused_human_anim_100", 0, 0, [1.0, "anim_human", 0, 1, 0]],
["horse_stand", 0, amf_client_prediction,
## [5.0, "anim_horse", 1000, 1044, arf_cyclic],
## [3.0, "anim_horse", 600, 644, arf_cyclic],
[1.5, "anim_horse", 600, 644, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[1.5, "anim_horse", 600, 644, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[1.5, "anim_horse", 600, 644, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[1.5, "anim_horse", 644, 688, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[1.5, "anim_horse", 600, 644, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[1.5, "anim_horse", 688, 732, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[1.5, "anim_horse", 600, 644, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[3.5, "anim_horse", 732, 820, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[1.5, "anim_horse", 600, 644, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[1.5, "anim_horse", 600, 644, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[1.5, "anim_horse", 600, 644, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
[2.5, "anim_horse", 820, 908, arf_cyclic|arf_use_stand_progress, 0, (0, 0, 0), 0.0],
],
["horse_pace_1", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[1.0, "anim_horse", 0, 31, arf_cyclic|arf_use_walk_progress|arf_make_walk_sound,pack4f(0.25,0.42,0.75,0.92), (0, 0, 0), 0.25],
],
["horse_pace_2", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.8, "anim_horse", 50, 69, arf_cyclic|arf_use_walk_progress|arf_make_walk_sound,pack4f(0.15,0.16,0.65,0.66), (0, 0, 0), 0.9],
],
["horse_pace_3", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.6, "anim_horse", 100, 116, arf_cyclic|arf_use_walk_progress|arf_make_walk_sound,pack4f(0.93,0.95,0.35,0.42), (0, 0, 0), 0.6],
],
["horse_pace_4", acf_enforce_lowerbody, amf_use_cycle_period|amf_client_prediction,
[0.5, "anim_horse", 150, 165, arf_cyclic|arf_use_walk_progress|arf_make_walk_sound,pack4f(0.4,0.31,0.79,0.94), (0, 0, 0), 0.2],
],
["horse_walk_backward", acf_enforce_lowerbody, amf_client_prediction,
[1.9, "anim_horse", 31, 0, arf_cyclic|arf_use_inv_walk_progress|arf_make_walk_sound,pack4f(0.07,0.13,0.56,0.63), (0, 0, 0), 0.0],
],
["horse_rear", acf_enforce_lowerbody | acf_ignore_slope, amf_priority_rear|amf_play,
# [1.4, "anim_horse_temp", 1, 10, arf_blend_in_1],
## [2.5, "anim_horse", 505, 580, arf_blend_in_8],
[1.7, "anim_horse", 265, 297, arf_blend_in_8],
],
["horse_jump", acf_enforce_lowerbody, amf_priority_jump|amf_play|amf_client_prediction,
[1.6, "anim_horse", 205, 222, arf_blend_in_4], #|arf_end_pos_0_25],
],
["horse_jump_end", acf_enforce_lowerbody, amf_priority_jump_end|amf_play|amf_client_prediction,
[0.1, "anim_horse", 222, 224, arf_blend_in_8],
],
["horse_turn_right", 0, amf_client_prediction,
[1.0, "anim_horse", 500, 533, arf_blend_in_4|arf_cyclic],
],
["horse_turn_left", 0, amf_client_prediction,
[1.0, "anim_horse", 450, 483, arf_blend_in_4|arf_cyclic],
],
["horse_turn_right_head", 0, amf_client_prediction,
[1.0, "anim_horse", 500, 533, arf_blend_in_4|arf_cyclic],
],
["horse_turn_left_head", 0, amf_client_prediction,
[1.0, "anim_horse", 450, 483, arf_blend_in_4|arf_cyclic],
],
["horse_slow", 0, amf_client_prediction, #not used anymore?
[3.0, "anim_horse", 0, 31,arf_cyclic],
[1.5, "anim_horse", 0, 31, arf_cyclic],
],
["horse_fall_in_place", acf_enforce_all|acf_align_with_ground, amf_priority_striked|amf_keep|amf_client_prediction,
[4.0, "anim_horse", 0, 38, arf_blend_in_16|arf_make_custom_sound, pack2f(0.0, 0.0)],
],
["horse_fall_right", acf_enforce_all|acf_align_with_ground, amf_priority_striked|amf_keep|amf_client_prediction,
[1.75, "anim_horse", 350, 375, arf_blend_in_8|arf_make_custom_sound, pack2f(0.6, 0.0), (0, 0, 0), 0.5],
],
["horse_fall_roll", acf_enforce_all|acf_align_with_ground, amf_priority_striked|amf_keep|amf_client_prediction,
[2.5, "anim_horse", 400, 428, arf_blend_in_8|arf_make_custom_sound, pack2f(0.3, 0.0), (0, 0, 0), 1.8],
],
### Unused horse animations start from here.
["unused_horse_anim_1", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_2", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_3", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_4", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_5", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_6", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_7", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_8", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_9", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_10", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_11", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_12", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_13", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_14", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_15", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_16", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_17", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_18", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_19", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_20", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_21", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_22", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_23", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_24", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_25", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_26", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_27", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_28", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_29", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_30", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_31", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_32", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_33", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_34", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_35", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_36", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_37", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_38", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_39", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_40", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_41", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_42", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_43", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_44", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_45", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_46", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_47", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_48", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_49", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_50", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_51", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_52", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_53", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_54", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_55", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_56", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_57", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_58", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_59", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_60", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_61", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_62", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_63", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_64", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_65", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_66", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_67", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_68", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_69", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_70", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_71", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_72", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_73", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_74", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_75", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_76", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_77", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_78", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_79", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_80", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_81", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_82", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_83", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_84", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_85", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_86", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_87", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_88", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_89", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_90", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_91", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_92", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_93", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_94", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_95", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_96", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_97", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_98", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_99", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
["unused_horse_anim_100", 0, 0, [1.0, "anim_horse", 0, 1, 0]],
]
| Python |
import string
from module_info import *
from module_scene_props import *
from process_common import *
from process_operations import *
def save_scene_props(variable_list,variable_uses,tag_uses,quick_strings):
ofile = open(export_dir + "scene_props.txt","w")
ofile.write("scene_propsfile version 1\n")
ofile.write(" %d\n"%(len(scene_props)))
for scene_prop in scene_props:
ofile.write("spr_%s %d %d %s %s "%(scene_prop[0], scene_prop[1], get_spr_hit_points(scene_prop[1]), scene_prop[2], scene_prop[3]))
save_simple_triggers(ofile,scene_prop[4] , variable_list,variable_uses,tag_uses,quick_strings)
ofile.write("\n")
ofile.close()
def save_python_header():
file = open("./ID_scene_props.py","w")
for i_scene_prop in xrange(len(scene_props)):
file.write("spr_%s = %d\n"%(scene_props[i_scene_prop][0],i_scene_prop))
file.close()
print "Exporting scene props..."
save_python_header()
variable_uses = []
variables = load_variables(export_dir,variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_scene_props(variables,variable_uses,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir,tag_uses)
save_quick_strings(export_dir,quick_strings)
| Python |
anim_stand = 0
anim_stand_man = 1
anim_stand_player_first_person = 2
anim_jump = 3
anim_jump_loop = 4
anim_jump_end = 5
anim_jump_end_hard = 6
anim_stand_unarmed = 7
anim_stand_single = 8
anim_stand_greatsword = 9
anim_stand_staff = 10
anim_stand_crossbow = 11
anim_turn_right = 12
anim_turn_left = 13
anim_turn_right_single = 14
anim_turn_left_single = 15
anim_turn_right_staff = 16
anim_turn_left_staff = 17
anim_turn_right_greatsword = 18
anim_turn_left_greatsword = 19
anim_prepare_kick_0 = 20
anim_prepare_kick_1 = 21
anim_prepare_kick_2 = 22
anim_prepare_kick_3 = 23
anim_kick_right_leg = 24
anim_kick_left_leg = 25
anim_run_forward = 26
anim_run_forward_onehanded = 27
anim_run_forward_staff = 28
anim_run_forward_greatsword = 29
anim_run_forward_hips_right = 30
anim_run_forward_hips_left = 31
anim_run_forward_right = 32
anim_run_forward_right_onehanded = 33
anim_run_forward_right_staff = 34
anim_run_forward_right_greatsword = 35
anim_run_forward_right_hips_right = 36
anim_run_forward_right_hips_left = 37
anim_run_forward_left = 38
anim_run_forward_left_onehanded = 39
anim_run_forward_left_staff = 40
anim_run_forward_left_greatsword = 41
anim_run_forward_left_hips_right = 42
anim_run_forward_left_hips_left = 43
anim_run_backward = 44
anim_run_backward_onehanded = 45
anim_run_backward_staff = 46
anim_run_backward_greatsword = 47
anim_run_backward_hips_right = 48
anim_run_backward_hips_left = 49
anim_run_backward_right = 50
anim_run_backward_right_onehanded = 51
anim_run_backward_right_staff = 52
anim_run_backward_right_greatsword = 53
anim_run_backward_right_hips_right = 54
anim_run_backward_right_hips_left = 55
anim_run_backward_left = 56
anim_run_backward_left_onehanded = 57
anim_run_backward_left_staff = 58
anim_run_backward_left_greatsword = 59
anim_run_backward_left_hips_right = 60
anim_run_backward_left_hips_left = 61
anim_run_right = 62
anim_run_right_onehanded = 63
anim_run_right_twohanded = 64
anim_run_right_polearm = 65
anim_run_right_hips_right = 66
anim_run_right_hips_left = 67
anim_run_left = 68
anim_run_left_onehanded = 69
anim_run_left_twohanded = 70
anim_run_left_polearm = 71
anim_run_left_hips_right = 72
anim_run_left_hips_left = 73
anim_walk_forward = 74
anim_walk_forward_onehanded = 75
anim_walk_forward_staff = 76
anim_walk_forward_greatsword = 77
anim_walk_forward_hips_right = 78
anim_walk_forward_hips_left = 79
anim_walk_backward = 80
anim_walk_backward_onehanded = 81
anim_walk_backward_staff = 82
anim_walk_backward_greatsword = 83
anim_walk_backward_hips_right = 84
anim_walk_backward_hips_left = 85
anim_walk_right = 86
anim_walk_right_onehanded = 87
anim_walk_right_twohanded = 88
anim_walk_right_polearm = 89
anim_walk_right_hips_right = 90
anim_walk_right_hips_left = 91
anim_walk_left = 92
anim_walk_left_onehanded = 93
anim_walk_left_twohanded = 94
anim_walk_left_polearm = 95
anim_walk_left_hips_right = 96
anim_walk_left_hips_left = 97
anim_walk_forward_right = 98
anim_walk_forward_right_onehanded = 99
anim_walk_forward_right_twohanded = 100
anim_walk_forward_right_polearm = 101
anim_walk_forward_right_hips_right = 102
anim_walk_forward_right_hips_left = 103
anim_walk_forward_left = 104
anim_walk_forward_left_onehanded = 105
anim_walk_forward_left_twohanded = 106
anim_walk_forward_left_polearm = 107
anim_walk_forward_left_hips_right = 108
anim_walk_forward_left_hips_left = 109
anim_walk_backward_left = 110
anim_walk_backward_left_onehanded = 111
anim_walk_backward_left_twohanded = 112
anim_walk_backward_left_polearm = 113
anim_walk_backward_left_hips_right = 114
anim_walk_backward_left_hips_left = 115
anim_walk_backward_right = 116
anim_walk_backward_right_onehanded = 117
anim_walk_backward_right_twohanded = 118
anim_walk_backward_right_polearm = 119
anim_walk_backward_right_hips_right = 120
anim_walk_backward_right_hips_left = 121
anim_walk_forward_crouch = 122
anim_stand_to_crouch = 123
anim_crouch_to_stand = 124
anim_ride_0 = 125
anim_ride_1 = 126
anim_lancer_ride_1 = 127
anim_lancer_charge_parried = 128
anim_ride_2 = 129
anim_ride_3 = 130
anim_ride_4 = 131
anim_lancer_ride_4 = 132
anim_lancer_ride_4_no_shield = 133
anim_ride_rear = 134
anim_ride_spur = 135
anim_ride_jump = 136
anim_ride_jump_end = 137
anim_ride_turn_right = 138
anim_ride_turn_left = 139
anim_mount_horse = 140
anim_dismount_horse = 141
anim_lancer_ride_0 = 142
anim_equip_default = 143
anim_unequip_default = 144
anim_equip_sword = 145
anim_unequip_sword = 146
anim_equip_greatsword = 147
anim_unequip_greatsword = 148
anim_equip_axe_left_hip = 149
anim_unequip_axe_left_hip = 150
anim_equip_crossbow = 151
anim_unequip_crossbow = 152
anim_equip_spear = 153
anim_unequip_spear = 154
anim_equip_dagger_front_left = 155
anim_unequip_dagger_front_left = 156
anim_equip_dagger_front_right = 157
anim_unequip_dagger_front_right = 158
anim_equip_axe_back = 159
anim_unequip_axe_back = 160
anim_equip_revolver_right = 161
anim_unequip_revolver_right = 162
anim_equip_pistol_front_left = 163
anim_unequip_pistol_front_left = 164
anim_equip_katana = 165
anim_unequip_katana = 166
anim_equip_wakizashi = 167
anim_unequip_wakizashi = 168
anim_equip_shield = 169
anim_unequip_shield = 170
anim_equip_bow_back = 171
anim_unequip_bow_back = 172
anim_equip_bow_left_hip = 173
anim_unequip_bow_left_hip = 174
anim_cancel_attack_onehanded = 175
anim_cancel_attack_twohanded = 176
anim_cancel_attack_polearm = 177
anim_ready_bow = 178
anim_release_bow = 179
anim_ready_bow_mounted = 180
anim_release_bow_mounted = 181
anim_ready_crossbow = 182
anim_release_crossbow = 183
anim_reload_crossbow = 184
anim_reload_crossbow_horseback = 185
anim_ready_javelin = 186
anim_release_javelin = 187
anim_ready_throwing_knife = 188
anim_release_throwing_knife = 189
anim_ready_throwing_axe = 190
anim_release_throwing_axe = 191
anim_ready_stone = 192
anim_release_stone = 193
anim_ready_pistol = 194
anim_release_pistol = 195
anim_reload_pistol = 196
anim_ready_musket = 197
anim_release_musket = 198
anim_reload_musket = 199
anim_ready_swingright_fist = 200
anim_release_swingright_fist = 201
anim_release_swingright_fist_continue = 202
anim_blocked_swingright_fist = 203
anim_parried_swingright_fist = 204
anim_ready_swingleft_fist = 205
anim_release_swingleft_fist = 206
anim_release_swingleft_fist_continue = 207
anim_blocked_swingleft_fist = 208
anim_parried_swingleft_fist = 209
anim_ready_direct_fist = 210
anim_release_direct_fist = 211
anim_release_direct_fist_continue = 212
anim_blocked_direct_fist = 213
anim_parried_direct_fist = 214
anim_ready_uppercut_fist = 215
anim_release_uppercut_fist = 216
anim_release_uppercut_fist_continue = 217
anim_blocked_uppercut_fist = 218
anim_parried_uppercut_fist = 219
anim_ready_slashright_twohanded = 220
anim_release_slashright_twohanded = 221
anim_release_slashright_twohanded_continue = 222
anim_blocked_slashright_twohanded = 223
anim_parried_slashright_twohanded = 224
anim_ready_slashleft_twohanded = 225
anim_release_slashleft_twohanded = 226
anim_release_slashleft_twohanded_continue = 227
anim_blocked_slashleft_twohanded = 228
anim_parried_slashleft_twohanded = 229
anim_ready_thrust_twohanded = 230
anim_release_thrust_twohanded = 231
anim_release_thrust_twohanded_continue = 232
anim_blocked_thrust_twohanded = 233
anim_parried_thrust_twohanded = 234
anim_ready_overswing_twohanded = 235
anim_release_overswing_twohanded = 236
anim_release_overswing_twohanded_continue = 237
anim_blocked_overswing_twohanded = 238
anim_parried_overswing_twohanded = 239
anim_ready_thrust_onehanded = 240
anim_release_thrust_onehanded = 241
anim_release_thrust_onehanded_continue = 242
anim_blocked_thrust_onehanded = 243
anim_parried_thrust_onehanded = 244
anim_ready_thrust_onehanded_horseback = 245
anim_release_thrust_onehanded_horseback = 246
anim_release_thrust_onehanded_horseback_continue = 247
anim_blocked_thrust_onehanded_horseback = 248
anim_parried_thrust_onehanded_horseback = 249
anim_ready_thrust_onehanded_lance = 250
anim_release_thrust_onehanded_lance = 251
anim_release_thrust_onehanded_lance_continue = 252
anim_blocked_thrust_onehanded_lance = 253
anim_parried_thrust_onehanded_lance = 254
anim_ready_slashright_onehanded = 255
anim_release_slashright_onehanded = 256
anim_release_slashright_onehanded_continue = 257
anim_blocked_slashright_onehanded = 258
anim_parried_slashright_onehanded = 259
anim_ready_slashleft_onehanded = 260
anim_release_slashleft_onehanded = 261
anim_release_slashleft_onehanded_continue = 262
anim_blocked_slashleft_onehanded = 263
anim_parried_slashleft_onehanded = 264
anim_ready_overswing_onehanded = 265
anim_release_overswing_onehanded = 266
anim_release_overswing_onehanded_continue = 267
anim_blocked_overswing_onehanded = 268
anim_parried_overswing_onehanded = 269
anim_ready_slash_horseback_right = 270
anim_release_slash_horseback_right = 271
anim_release_slash_horseback_right_continue = 272
anim_blocked_slash_horseback_right = 273
anim_parried_slash_horseback_right = 274
anim_ready_slash_horseback_left = 275
anim_release_slash_horseback_left = 276
anim_release_slash_horseback_left_continue = 277
anim_blocked_slash_horseback_left = 278
anim_parried_slash_horseback_left = 279
anim_ready_slash_horseback_polearm_right = 280
anim_release_slash_horseback_polearm_right = 281
anim_release_slash_horseback_polearm_right_continue = 282
anim_blocked_slash_horseback_polearm_right = 283
anim_parried_slash_horseback_polearm_right = 284
anim_ready_slash_horseback_polearm_left = 285
anim_release_slash_horseback_polearm_left = 286
anim_release_slash_horseback_polearm_left_continue = 287
anim_blocked_slash_horseback_polearm_left = 288
anim_parried_slash_horseback_polearm_left = 289
anim_ready_overswing_staff = 290
anim_release_overswing_staff = 291
anim_release_overswing_staff_continue = 292
anim_blocked_overswing_staff = 293
anim_parried_overswing_staff = 294
anim_ready_thrust_staff = 295
anim_release_thrust_staff = 296
anim_release_thrust_staff_continue = 297
anim_blocked_thrust_staff = 298
anim_parried_thrust_staff = 299
anim_ready_slashleft_staff = 300
anim_release_slashleft_staff = 301
anim_release_slashleft_staff_continue = 302
anim_blocked_slashleft_staff = 303
anim_parried_slashleft_staff = 304
anim_ready_slashright_staff = 305
anim_release_slashright_staff = 306
anim_release_slashright_staff_continue = 307
anim_blocked_slashright_staff = 308
anim_parried_slashright_staff = 309
anim_defend_fist = 310
anim_defend_fist_keep = 311
anim_defend_fist_parry_1 = 312
anim_defend_fist_parry_2 = 313
anim_defend_fist_parry_3 = 314
anim_defend_shield_forward = 315
anim_defend_shield_up = 316
anim_defend_shield_right = 317
anim_defend_shield_left = 318
anim_defend_shield = 319
anim_defend_shield_keep = 320
anim_defend_shield_parry_1 = 321
anim_defend_shield_parry_2 = 322
anim_defend_shield_parry_3 = 323
anim_defend_forward_greatsword = 324
anim_defend_forward_greatsword_keep = 325
anim_defend_forward_greatsword_parry_1 = 326
anim_defend_forward_greatsword_parry_2 = 327
anim_defend_forward_greatsword_parry_3 = 328
anim_defend_up_twohanded = 329
anim_defend_up_twohanded_keep = 330
anim_defend_up_twohanded_parry_1 = 331
anim_defend_up_twohanded_parry_2 = 332
anim_defend_up_twohanded_parry_3 = 333
anim_defend_right_twohanded = 334
anim_defend_right_twohanded_keep = 335
anim_defend_right_twohanded_parry_1 = 336
anim_defend_right_twohanded_parry_2 = 337
anim_defend_right_twohanded_parry_3 = 338
anim_defend_left_twohanded = 339
anim_defend_left_twohanded_keep = 340
anim_defend_left_twohanded_parry_1 = 341
anim_defend_left_twohanded_parry_2 = 342
anim_defend_left_twohanded_parry_3 = 343
anim_defend_forward_onehanded = 344
anim_defend_forward_onehanded_keep = 345
anim_defend_forward_onehanded_parry_1 = 346
anim_defend_forward_onehanded_parry_2 = 347
anim_defend_forward_onehanded_parry_3 = 348
anim_defend_up_onehanded = 349
anim_defend_up_onehanded_keep = 350
anim_defend_up_onehanded_parry_1 = 351
anim_defend_up_onehanded_parry_2 = 352
anim_defend_up_onehanded_parry_3 = 353
anim_defend_right_onehanded = 354
anim_defend_right_onehanded_keep = 355
anim_defend_right_onehanded_parry_1 = 356
anim_defend_right_onehanded_parry_2 = 357
anim_defend_right_onehanded_parry_3 = 358
anim_defend_left_onehanded = 359
anim_defend_left_onehanded_keep = 360
anim_defend_left_onehanded_parry_1 = 361
anim_defend_left_onehanded_parry_2 = 362
anim_defend_left_onehanded_parry_3 = 363
anim_defend_forward_staff = 364
anim_defend_forward_staff_keep = 365
anim_defend_forward_staff_parry_1 = 366
anim_defend_forward_staff_parry_2 = 367
anim_defend_forward_staff_parry_3 = 368
anim_defend_up_staff = 369
anim_defend_up_staff_keep = 370
anim_defend_up_staff_parry_1 = 371
anim_defend_up_staff_parry_2 = 372
anim_defend_up_staff_parry_3 = 373
anim_defend_right_staff = 374
anim_defend_right_staff_keep = 375
anim_defend_right_staff_parry_1 = 376
anim_defend_right_staff_parry_2 = 377
anim_defend_right_staff_parry_3 = 378
anim_defend_left_staff = 379
anim_defend_left_staff_keep = 380
anim_defend_left_staff_parry_1 = 381
anim_defend_left_staff_parry_2 = 382
anim_defend_left_staff_parry_3 = 383
anim_strike_head_left = 384
anim_strike_head_right = 385
anim_strike_head_front = 386
anim_strike_head_back = 387
anim_strike_chest_left = 388
anim_strike_chest_right = 389
anim_strike_chest_front = 390
anim_strike_chest_back = 391
anim_strike_abdomen_left = 392
anim_strike_abdomen_right = 393
anim_strike_abdomen_front = 394
anim_strike_abdomen_back = 395
anim_strike_legs_left = 396
anim_strike_legs_right = 397
anim_strike_legs_front = 398
anim_strike_legs_back = 399
anim_strike2_head_left = 400
anim_strike2_head_right = 401
anim_strike2_head_front = 402
anim_strike2_head_back = 403
anim_strike2_chest_left = 404
anim_strike2_chest_right = 405
anim_strike2_chest_front = 406
anim_strike2_chest_back = 407
anim_strike2_abdomen_left = 408
anim_strike2_abdomen_right = 409
anim_strike2_abdomen_front = 410
anim_strike2_abdomen_back = 411
anim_strike2_legs_left = 412
anim_strike2_legs_right = 413
anim_strike2_legs_front = 414
anim_strike2_legs_back = 415
anim_strike3_head_left = 416
anim_strike3_head_right = 417
anim_strike3_head_front = 418
anim_strike3_head_back = 419
anim_strike3_chest_left = 420
anim_strike3_chest_right = 421
anim_strike3_chest_front = 422
anim_strike3_abdomen_left = 423
anim_strike3_abdomen_right = 424
anim_strike3_abdomen_front = 425
anim_strike3_abdomen_back = 426
anim_strike_head_front_left_reloc = 427
anim_fall_face_hold = 428
anim_fall_chest_front = 429
anim_fall_abdomen_hold_front = 430
anim_fall_head_front = 431
anim_fall_right_front = 432
anim_fall_body_back = 433
anim_fall_rider_right_forward = 434
anim_fall_rider_right = 435
anim_fall_rider_left = 436
anim_rider_fall_right = 437
anim_rider_fall_roll = 438
anim_strike_chest_front_stop = 439
anim_strike_fall_back_rise = 440
anim_strike_fall_back_rise_upper = 441
anim_cheer = 442
anim_cheer_stand = 443
anim_stand_townguard = 444
anim_stand_lady = 445
anim_stand_lord = 446
anim_dance = 447
anim_pose_1 = 448
anim_pose_2 = 449
anim_pose_3 = 450
anim_pose_4 = 451
anim_pose_5 = 452
anim_wedding_guest = 453
anim_wedding_guest_notr = 454
anim_wedding_guest_woman = 455
anim_wedding_dad_stairs = 456
anim_wedding_dad_walk = 457
anim_wedding_bride_stairs = 458
anim_wedding_bride_walk = 459
anim_wedding_groom_wait = 460
anim_wedding_groom_last = 461
anim_wedding_dad_last = 462
anim_wedding_bride_last = 463
anim_equip_bayonet = 464
anim_unequip_bayonet = 465
anim_unused_human_anim_14 = 466
anim_unused_human_anim_15 = 467
anim_unused_human_anim_16 = 468
anim_unused_human_anim_17 = 469
anim_unused_human_anim_18 = 470
anim_unused_human_anim_19 = 471
anim_unused_human_anim_20 = 472
anim_unused_human_anim_21 = 473
anim_unused_human_anim_22 = 474
anim_unused_human_anim_23 = 475
anim_unused_human_anim_24 = 476
anim_unused_human_anim_25 = 477
anim_unused_human_anim_26 = 478
anim_unused_human_anim_27 = 479
anim_unused_human_anim_28 = 480
anim_unused_human_anim_29 = 481
anim_unused_human_anim_30 = 482
anim_unused_human_anim_31 = 483
anim_unused_human_anim_32 = 484
anim_unused_human_anim_33 = 485
anim_unused_human_anim_34 = 486
anim_unused_human_anim_35 = 487
anim_unused_human_anim_36 = 488
anim_unused_human_anim_37 = 489
anim_unused_human_anim_38 = 490
anim_unused_human_anim_39 = 491
anim_unused_human_anim_40 = 492
anim_unused_human_anim_41 = 493
anim_unused_human_anim_42 = 494
anim_unused_human_anim_43 = 495
anim_unused_human_anim_44 = 496
anim_unused_human_anim_45 = 497
anim_unused_human_anim_46 = 498
anim_unused_human_anim_47 = 499
anim_unused_human_anim_48 = 500
anim_unused_human_anim_49 = 501
anim_unused_human_anim_50 = 502
anim_unused_human_anim_51 = 503
anim_unused_human_anim_52 = 504
anim_unused_human_anim_53 = 505
anim_unused_human_anim_54 = 506
anim_unused_human_anim_55 = 507
anim_unused_human_anim_56 = 508
anim_unused_human_anim_57 = 509
anim_unused_human_anim_58 = 510
anim_unused_human_anim_59 = 511
anim_unused_human_anim_60 = 512
anim_unused_human_anim_61 = 513
anim_unused_human_anim_62 = 514
anim_unused_human_anim_63 = 515
anim_unused_human_anim_64 = 516
anim_unused_human_anim_65 = 517
anim_unused_human_anim_66 = 518
anim_unused_human_anim_67 = 519
anim_unused_human_anim_68 = 520
anim_unused_human_anim_69 = 521
anim_unused_human_anim_70 = 522
anim_unused_human_anim_71 = 523
anim_unused_human_anim_72 = 524
anim_unused_human_anim_73 = 525
anim_unused_human_anim_74 = 526
anim_unused_human_anim_75 = 527
anim_unused_human_anim_76 = 528
anim_unused_human_anim_77 = 529
anim_unused_human_anim_78 = 530
anim_unused_human_anim_79 = 531
anim_unused_human_anim_80 = 532
anim_unused_human_anim_81 = 533
anim_unused_human_anim_82 = 534
anim_unused_human_anim_83 = 535
anim_unused_human_anim_84 = 536
anim_unused_human_anim_85 = 537
anim_unused_human_anim_86 = 538
anim_unused_human_anim_87 = 539
anim_unused_human_anim_88 = 540
anim_unused_human_anim_89 = 541
anim_unused_human_anim_90 = 542
anim_unused_human_anim_91 = 543
anim_unused_human_anim_92 = 544
anim_unused_human_anim_93 = 545
anim_unused_human_anim_94 = 546
anim_unused_human_anim_95 = 547
anim_unused_human_anim_96 = 548
anim_unused_human_anim_97 = 549
anim_unused_human_anim_98 = 550
anim_unused_human_anim_99 = 551
anim_unused_human_anim_100 = 552
anim_horse_stand = 553
anim_horse_pace_1 = 554
anim_horse_pace_2 = 555
anim_horse_pace_3 = 556
anim_horse_pace_4 = 557
anim_horse_walk_backward = 558
anim_horse_rear = 559
anim_horse_jump = 560
anim_horse_jump_end = 561
anim_horse_turn_right = 562
anim_horse_turn_left = 563
anim_horse_turn_right_head = 564
anim_horse_turn_left_head = 565
anim_horse_slow = 566
anim_horse_fall_in_place = 567
anim_horse_fall_right = 568
anim_horse_fall_roll = 569
anim_unused_horse_anim_1 = 570
anim_unused_horse_anim_2 = 571
anim_unused_horse_anim_3 = 572
anim_unused_horse_anim_4 = 573
anim_unused_horse_anim_5 = 574
anim_unused_horse_anim_6 = 575
anim_unused_horse_anim_7 = 576
anim_unused_horse_anim_8 = 577
anim_unused_horse_anim_9 = 578
anim_unused_horse_anim_10 = 579
anim_unused_horse_anim_11 = 580
anim_unused_horse_anim_12 = 581
anim_unused_horse_anim_13 = 582
anim_unused_horse_anim_14 = 583
anim_unused_horse_anim_15 = 584
anim_unused_horse_anim_16 = 585
anim_unused_horse_anim_17 = 586
anim_unused_horse_anim_18 = 587
anim_unused_horse_anim_19 = 588
anim_unused_horse_anim_20 = 589
anim_unused_horse_anim_21 = 590
anim_unused_horse_anim_22 = 591
anim_unused_horse_anim_23 = 592
anim_unused_horse_anim_24 = 593
anim_unused_horse_anim_25 = 594
anim_unused_horse_anim_26 = 595
anim_unused_horse_anim_27 = 596
anim_unused_horse_anim_28 = 597
anim_unused_horse_anim_29 = 598
anim_unused_horse_anim_30 = 599
anim_unused_horse_anim_31 = 600
anim_unused_horse_anim_32 = 601
anim_unused_horse_anim_33 = 602
anim_unused_horse_anim_34 = 603
anim_unused_horse_anim_35 = 604
anim_unused_horse_anim_36 = 605
anim_unused_horse_anim_37 = 606
anim_unused_horse_anim_38 = 607
anim_unused_horse_anim_39 = 608
anim_unused_horse_anim_40 = 609
anim_unused_horse_anim_41 = 610
anim_unused_horse_anim_42 = 611
anim_unused_horse_anim_43 = 612
anim_unused_horse_anim_44 = 613
anim_unused_horse_anim_45 = 614
anim_unused_horse_anim_46 = 615
anim_unused_horse_anim_47 = 616
anim_unused_horse_anim_48 = 617
anim_unused_horse_anim_49 = 618
anim_unused_horse_anim_50 = 619
anim_unused_horse_anim_51 = 620
anim_unused_horse_anim_52 = 621
anim_unused_horse_anim_53 = 622
anim_unused_horse_anim_54 = 623
anim_unused_horse_anim_55 = 624
anim_unused_horse_anim_56 = 625
anim_unused_horse_anim_57 = 626
anim_unused_horse_anim_58 = 627
anim_unused_horse_anim_59 = 628
anim_unused_horse_anim_60 = 629
anim_unused_horse_anim_61 = 630
anim_unused_horse_anim_62 = 631
anim_unused_horse_anim_63 = 632
anim_unused_horse_anim_64 = 633
anim_unused_horse_anim_65 = 634
anim_unused_horse_anim_66 = 635
anim_unused_horse_anim_67 = 636
anim_unused_horse_anim_68 = 637
anim_unused_horse_anim_69 = 638
anim_unused_horse_anim_70 = 639
anim_unused_horse_anim_71 = 640
anim_unused_horse_anim_72 = 641
anim_unused_horse_anim_73 = 642
anim_unused_horse_anim_74 = 643
anim_unused_horse_anim_75 = 644
anim_unused_horse_anim_76 = 645
anim_unused_horse_anim_77 = 646
anim_unused_horse_anim_78 = 647
anim_unused_horse_anim_79 = 648
anim_unused_horse_anim_80 = 649
anim_unused_horse_anim_81 = 650
anim_unused_horse_anim_82 = 651
anim_unused_horse_anim_83 = 652
anim_unused_horse_anim_84 = 653
anim_unused_horse_anim_85 = 654
anim_unused_horse_anim_86 = 655
anim_unused_horse_anim_87 = 656
anim_unused_horse_anim_88 = 657
anim_unused_horse_anim_89 = 658
anim_unused_horse_anim_90 = 659
anim_unused_horse_anim_91 = 660
anim_unused_horse_anim_92 = 661
anim_unused_horse_anim_93 = 662
anim_unused_horse_anim_94 = 663
anim_unused_horse_anim_95 = 664
anim_unused_horse_anim_96 = 665
anim_unused_horse_anim_97 = 666
anim_unused_horse_anim_98 = 667
anim_unused_horse_anim_99 = 668
anim_unused_horse_anim_100 = 669
| Python |
psys_game_rain = 0
psys_game_snow = 1
psys_game_blood = 2
psys_game_blood_2 = 3
psys_game_hoof_dust = 4
psys_game_hoof_dust_snow = 5
psys_game_hoof_dust_mud = 6
psys_game_water_splash_1 = 7
psys_game_water_splash_2 = 8
psys_game_water_splash_3 = 9
psys_torch_fire = 10
psys_fire_glow_1 = 11
psys_fire_glow_fixed = 12
psys_torch_smoke = 13
psys_flue_smoke_short = 14
psys_flue_smoke_tall = 15
psys_war_smoke_tall = 16
psys_ladder_dust_6m = 17
psys_ladder_dust_8m = 18
psys_ladder_dust_10m = 19
psys_ladder_dust_12m = 20
psys_ladder_dust_14m = 21
psys_ladder_straw_6m = 22
psys_ladder_straw_8m = 23
psys_ladder_straw_10m = 24
psys_ladder_straw_12m = 25
psys_ladder_straw_14m = 26
psys_torch_fire_sparks = 27
psys_fire_sparks_1 = 28
psys_pistol_smoke = 29
psys_brazier_fire_1 = 30
psys_cooking_fire_1 = 31
psys_cooking_smoke = 32
psys_food_steam = 33
psys_candle_light = 34
psys_candle_light_small = 35
psys_lamp_fire = 36
psys_dummy_smoke = 37
psys_dummy_straw = 38
psys_dummy_smoke_big = 39
psys_dummy_straw_big = 40
psys_gourd_smoke = 41
psys_gourd_piece_1 = 42
psys_gourd_piece_2 = 43
psys_fire_fly_1 = 44
psys_bug_fly_1 = 45
psys_moon_beam_1 = 46
psys_moon_beam_paricle_1 = 47
psys_night_smoke_1 = 48
psys_fireplace_fire_small = 49
psys_fireplace_fire_big = 50
psys_village_fire_big = 51
psys_village_fire_smoke_big = 52
psys_map_village_fire = 53
psys_map_village_fire_smoke = 54
psys_map_village_looted_smoke = 55
psys_dungeon_water_drops = 56
psys_wedding_rose = 57
psys_sea_foam_a = 58
psys_fall_leafs_a = 59
| Python |
import string
from process_common import *
from module_items import *
def get_item_code(item):
prefix = "it_"
code = prefix + item[0]
return code
def save_python_header():
file = open("./ID_items.py","w")
for i_item in xrange(len(items)):
file.write("itm_%s = %d\n"%(convert_to_identifier(items[i_item][0]),i_item))
file.close()
def write_items(variable_list,variable_uses,tag_uses,quick_strings):
itemkinds_file_name = export_dir + "item_kinds1.txt"
ofile = open(itemkinds_file_name,"w")
ofile.write("itemsfile version 3\n")
ofile.write("%d\n"%len(items))
for item in items:
if (item[3] & itp_merchandise) > 0:
id_no = find_object(items,convert_to_identifier(item[0]))
add_tag_use(tag_uses,tag_item,id_no)
ofile.write(" itm_%s %s %s %d "%(convert_to_identifier(item[0]),replace_spaces(item[1]),replace_spaces(item[1]),len(item[2])))
item_variations = item[2]
for item_variation in item_variations:
ofile.write(" %s %d "%(item_variation[0],item_variation[1]))
ofile.write(" %d %d %d %d %f %d %d %d %d %d %d %d %d %d %d %d %d\n"%(item[3], item[4], item[5], item[7],
get_weight(item[6]),
get_abundance(item[6]),
get_head_armor(item[6]),
get_body_armor(item[6]),
get_leg_armor(item[6]),
get_difficulty(item[6]),
get_hit_points(item[6]),
get_speed_rating(item[6]),
get_missile_speed(item[6]),
get_weapon_length(item[6]),
get_max_ammo(item[6]),
get_thrust_damage(item[6]),
get_swing_damage(item[6]),
))
if (len(item) > 9):
ofile.write(" %d\n"%(len(item[9])))
for item_faction in item[9]:
ofile.write(" %d"%item_faction)
ofile.write("\n")
else:
ofile.write(" 0\n")
trigger_list = []
if (len(item) > 8):
trigger_list = item[8]
save_simple_triggers(ofile,trigger_list, variable_list,variable_uses,tag_uses,quick_strings)
ofile.close()
print "Exporting item data..."
save_python_header()
from module_info import *
from process_common import *
from process_operations import *
variable_uses = []
variables = load_variables(export_dir,variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
write_items(variables,variable_uses,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir,tag_uses)
save_quick_strings(export_dir,quick_strings)
#print "Finished with Items."
| Python |
import string
import types
def convert_to_identifier(s0):
s1 = string.replace(s0," ","_")
s2 = string.replace(s1,"'","_")
s3 = string.replace(s2,"`","_")
s4 = string.replace(s3,"(","_")
s5 = string.replace(s4,")","_")
s6 = string.replace(s5,"-","_")
s7 = string.replace(s6,",","")
s8 = string.replace(s7,"|","")
s9 = string.replace(s8,"\t","_") #Tab
s10 = string.lower(s9)
return s10
def convert_to_identifier_with_no_lowercase(s0):
s1 = string.replace(s0," ","_")
s2 = string.replace(s1,"'","_")
s3 = string.replace(s2,"`","_")
s4 = string.replace(s3,"(","_")
s5 = string.replace(s4,")","_")
s6 = string.replace(s5,"-","_")
s7 = string.replace(s6,",","")
s8 = string.replace(s7,"|","")
s9 = string.replace(s8,"\t","_") #Tab
return s9
def replace_spaces(s0):
return string.replace(string.replace(s0,"\t","_")," ","_")
| Python |
from header_quests import *
####################################################################################################################
# Each quest record contains the following fields:
# 1) Quest id: used for referencing quests in other files. The prefix qst_ is automatically added before each quest-id.
# 2) Quest Name: Name displayed in the quest screen.
# 3) Quest flags. See header_quests.py for a list of available flags
# 4) Quest Description: Description displayed in the quest screen.
#
# Note that you may call the opcode setup_quest_text for setting up the name and description
####################################################################################################################
quests = [
# Note : This is defined as the first governer quest in module_constants.py:
("deliver_message", "Deliver Message to {s13}", qf_random_quest,
"{!}{s9} asked you to take a message to {s13}. {s13} was at {s4} when you were given this quest."
),
("deliver_message_to_enemy_lord", "Deliver Message to {s13}", qf_random_quest,
"{!}{s9} asked you to take a message to {s13} of {s15}. {s13} was at {s4} when you were given this quest."
),
("raise_troops", "Raise {reg1} {s14}", qf_random_quest,
"{!}{s9} asked you to raise {reg1} {s14} and bring them to him."
),
("escort_lady", "Escort {s13} to {s14}", qf_random_quest,
"{!}None"
),
## ("rescue_lady_under_siege", "Rescue {s3} from {s4}", qf_random_quest,
## "{s1} asked you to rescue his {s7} {s3} from {s4} and return her back to him."
## ),
## ("deliver_message_to_lover", "Deliver Message to {s3}", qf_random_quest,
## "{s1} asked you to take a message to his lover {s3} at {s4}."
## ),
## ("bring_prisoners_to_enemy", "Bring Prisoners to {s4}", qf_random_quest,
## "{s1} asked you to bring {reg1} {s3} as prisoners to the guards at {s4}."
## ),
## ("bring_reinforcements_to_siege", "Bring Reinforcements to the Siege of {s5}", qf_random_quest,
## "{s1} asked you to bring {reg1} {s3} to {s4} at the siege of {s5}."
## ),
## ("deliver_supply_to_center_under_siege", "Deliver Supplies to {s5}", qf_random_quest,
## "TODO: Take {reg1} cartloads of supplies from constable {s3} and deliver them to constable {s4} at {s5}."
## ),
("deal_with_bandits_at_lords_village", "Save the Village of {s15} from Marauding Bandits", qf_random_quest,
"{!}{s13} asked you to deal with the bandits who took refuge in his village of {s15} and then report back to him."
),
("collect_taxes", "Collect Taxes from {s3}", qf_random_quest,
"{!}{s9} asked you to collect taxes from {s3}. He offered to leave you one-fifth of all the money you collect there."
),
("hunt_down_fugitive", "Hunt Down {s4}", qf_random_quest,
"{!}{s9} asked you to hunt down the fugitive named {s4}. He is currently believed to be at {s3}."
),
## ("capture_messenger", "Capture {s3}", qf_random_quest,
## "{s1} asked you to capture a {s3} and bring him back."
## ),
## ("bring_back_deserters", "Bring {reg1} {s3}", qf_random_quest,
## "{s1} asked you to bring {reg1} {s3}."
## ),
("kill_local_merchant", "Assassinate Local Merchant at {s3}", qf_random_quest,
"{!}{s9} asked you to assassinate a local merchant at {s3}."
),
("bring_back_runaway_serfs", "Bring Back Runaway Serfs", qf_random_quest,
"{!}{s9} asked you to bring back the three groups of runaway serfs back to {s2}. He said all three groups must be running away in the direction of {s3}."
),
("follow_spy", "Follow the Spy to Meeting", qf_random_quest,
"{!}{s11} asked you to follow the spy that will leave {s12}. You must be careful not to be seen by the spy during his travel, or else he may get suspicious and turn back. Once the spy meets with his accomplice, you are to ambush and capture them and bring them both back to {s11}."
),
("capture_enemy_hero", "Capture a Lord from {s13}", qf_random_quest,
"{!}TODO: {s11} asked you to capture a lord from {s13}."
),
("lend_companion", "Lend Your Companion {s3} to {s9}", qf_random_quest,
"{!}{s9} asked you to lend your companion {s3} to him for a week."
),
("collect_debt", "Collect the Debt {s3} Owes to {s9}", qf_random_quest,
"{!}{s9} asked you to collect the debt of {reg4} denars {s3} owes to him."
),
## ("capture_conspirators", "Capture Conspirators", qf_random_quest,
## "TODO: {s1} asked you to capture all troops in {reg1} conspirator parties that plan to rebel against him and join {s3}."
## ),
## ("defend_nobles_against_peasants", "Defend Nobles Against Peasants", qf_random_quest,
## "TODO: {s1} asked you to defend {reg1} noble parties against peasants."l
## ),
("incriminate_loyal_commander", "Incriminate the Loyal Commander of {s13}, {s16}", qf_random_quest,
"{!}None"
),
# ("raid_caravan_to_start_war", "Raid {reg13} Caravans of {s13}", qf_random_quest, #This is now a dynamic quest, integrated into the provocation system
# "None"
# ),
("meet_spy_in_enemy_town", "Meet Spy in {s13}", qf_random_quest,
"{!}None"
),
("capture_prisoners", "Bring {reg1} {s3} Prisoners", qf_random_quest,
"{!}{s9} wanted you to bring him {reg1} {s3} as prisoners."
),
## ("hunt_down_raiders", "Hunt Down Raiders",qf_random_quest,
## "{s1} asked you to hunt down and punish the raiders that attacked a village near {s3} before they reach the safety of their base at {s4}."
## ),
##################
# Enemy Kingdom Lord quests
##################
# Note : This is defined as the first enemy lord quest in module_constants.py:
("lend_surgeon", "Lend Your Surgeon {s3} to {s1}", qf_random_quest,
"{!}Lend your experienced surgeon {s3} to {s1}."
),
##################
# Kingdom Army quests
##################
# Note : This is defined as lord quests end in module_constants.py:
("follow_army", "Follow {s9}'s Army", qf_random_quest,
"{!}None"
),
("report_to_army", "Report to {s13}, the Marshall", qf_random_quest,
"{!}None"
),
# Note : This is defined as the first army quest in module_constants.py:
# maybe disable these army quests, except as volunteer quests that add to the capacity of the army
("deliver_cattle_to_army", "Deliver {reg3} Heads of Cattle to {s13}", qf_random_quest,
"{!}None"
),
("join_siege_with_army", "Join the Siege of {s14}", qf_random_quest,
"{!}None"
),
("screen_army", "Screen the Advance of {s13}'s Army", qf_random_quest,
"{!}None"
),
("scout_waypoints", "Scout {s13}, {s14} and {s15}", qf_random_quest,
"{!}None"
),
##################
# Kingdom Lady quests
##################
# Note : This is defined as the first kingdom lady quest in module_constants.py:
#Rescue lord by replace will become a
("rescue_lord_by_replace", "Rescue {s13} from {s14}", qf_random_quest,
"{!}None"
),
("deliver_message_to_prisoner_lord", "Deliver Message to {s13} at {s14}", qf_random_quest,
"{!}None"
),
#Courtship quests
("duel_for_lady", "Challenge {s13} to a Trial of Arms", qf_random_quest,
"{!}None"
),
("duel_courtship_rival", "Challenge {s13} to a Trial of Arms (optional)", qf_random_quest,
"{!}None"
),
#Other duel quests
("duel_avenge_insult", "Challenge {s13} to a Trial of Arms", qf_random_quest,
"{!}None"
),
##################
# Mayor quests
##################
# Note : This is defined as the first mayor quest in module_constants.py:
("move_cattle_herd", "Move Cattle Herd to {s13}", qf_random_quest,
"{!}Guildmaster of {s10} asked you to move a cattle herd to {s13}."
),
("escort_merchant_caravan", "Escort Merchant Caravan to {s8}", qf_random_quest, #make this a non-random quest?
"{!}Escort the merchant caravan to the town of {s8}."
),
("deliver_wine", "Deliver {reg5} Units of {s6} to {s4}", qf_random_quest,
"{!}{s9} of {s3} asked you to deliver {reg5} units of {s6} to the tavern in {s4} in 7 days."
),
("troublesome_bandits", "Hunt Down Troublesome Bandits", qf_random_quest,
"{!}{s9} of {s4} asked you to hunt down the troublesome bandits in the vicinity of the town."
),
("kidnapped_girl", "Ransom Girl from Bandits", qf_random_quest,
"{!}Guildmaster of {s4} gave you {reg12} denars to pay the ransom of a girl kidnapped by bandits.\
You are to meet the bandits near {s3} and pay them the ransom fee.\
After that you are to bring the girl back to {s4}."
),
("persuade_lords_to_make_peace", "Make Sure Two Lords Do Not Object to Peace", qf_random_quest, #possibly deprecate., or change effects
"{!}Guildmaster of {s4} promised you {reg12} denars if you can make sure that\
{s12} and {s13} no longer pose a threat to a peace settlement between {s15} and {s14}.\
In order to do that, you must either convince them or make sure they fall captive and remain so until a peace agreement is made."
),
("deal_with_looters", "Deal with Looters", qf_random_quest,
"{!}The Guildmaster of {s4} has asked you to deal with several bands of looters around {s4}, and bring back any goods you recover."
),
("deal_with_night_bandits", "Deal with Night Bandits", qf_random_quest,
"{!}TODO: The Guildmaster of {s14} has asked you to deal with night bandits at {s14}."
),
############
# Village Elder quests
############
# Note : This is defined as the first village elder quest in module_constants.py:
("deliver_grain", "Bring wheat to {s3}", qf_random_quest,
"{!}The elder of the village of {s3} asked you to bring them {reg5} packs of wheat.."
),
("deliver_cattle", "Deliver {reg5} Heads of Cattle to {s3}", qf_random_quest,
"{!}The elder of the village of {s3} asked you to bring {reg5} heads of cattle."
),
("train_peasants_against_bandits", "Train the Peasants of {s13} Against Bandits.", qf_random_quest,
"{!}None"
),
# Deliver horses, Deliver food, Escort_Caravan, Hunt bandits, Ransom Merchant.
## ("capture_nobleman", "Capture Nobleman",qf_random_quest,
## "{s1} wanted you to capture an enemy nobleman on his way from {s3} to {s4}. He said the nobleman would leave {s3} in {reg1} days."
## ),
# Bandit quests: Capture rich merchant, capture banker, kill manhunters?..
# Note : This is defined as the last village elder quest in module_constants.py:
("eliminate_bandits_infesting_village", "Save the Village of {s7} from Marauding Bandits", qf_random_quest,
"{!}A villager from {s7} begged you to save their village from the bandits that took refuge there."
),
# Tutorial quest
## ("destroy_dummies", "Destroy Dummies", qf_show_progression,
## "Trainer ordered you to destroy 10 dummies in the training camp."
## ),
#Courtship and marriage quests begin here
("visit_lady", "Visit Lady", qf_random_quest,
"{!}None"
),
("formal_marriage_proposal", "Formal Marriage Proposal", qf_random_quest,
"{!}None"
), #Make a formal proposal to a bride's father or brother
("obtain_liege_blessing", "Formal Marriage Proposal", qf_random_quest,
"{!}None"
), #The equivalent of the above -- ask permission of a groom's liege. Is currently not used
("wed_betrothed", "Wed Your Betrothed", qf_random_quest,
"{!}None"
), #in this case, the giver troop is the father or guardian of the bride, object troop is the bride
("wed_betrothed_female", "Wed Your Betrothed", qf_random_quest,
"{!}None"
), #in this case, the giver troop is the spouse
# Join Kingdom quest
("join_faction", "Give Oath of Homage to {s1}", qf_random_quest,
"{!}Find {s1} and give him your oath of homage."
),
# Rebel against Kingdom quest
("rebel_against_kingdom", "Help {s13} Claim the Throne of {s14}", qf_random_quest,
"{!}None"
),
#Political quests begin here
("consult_with_minister", "Consult With Minister", qf_random_quest, "{!}Consult your minister, {s11}, currently at {s12}"),
("organize_feast", "Organize Feast", qf_random_quest, "{!}Bring goods for a feast to your spouse {s11}, currently at {s12}"),
("resolve_dispute", "Resolve Dispute", qf_random_quest, "{!}Resolve the dispute between {s11} and {s12}"),
("offer_gift", "Procure Gift", qf_random_quest, "{!}Give {s10} a gift to provide to {reg4?her:his} {s11}, {s12}"),
("denounce_lord", "Denounce Lord", qf_random_quest, "{!}Denounce {s11} in Public"),
("intrigue_against_lord", "Intrigue against Lord", qf_random_quest, "{!}Criticize {s11} in Private"),
#Dynamic quests begin here
#These quests are determined dynamically by external conditions -- bandits who have carried out a raid, an impending war, etc...
("track_down_bandits", "Track Down Bandits", qf_random_quest,
"{!}{s9} of {s4} asked you to track down {s6}, who attacked travellers on the roads near town."
), #this is a fairly simple quest for the early game to make the town guildmaster's description of the economy a little more relevant, and also to give the player a reason to talk to other neutral parties on the map
("track_down_provocateurs", "Track Down Provocateurs", qf_random_quest,
"{!}{s9} of {s4} asked you to track down a group of thugs, hired to create a border incident between {s5} and {s6}."
),
("retaliate_for_border_incident", "Retaliate for a Border Incident", qf_random_quest,
"{!}{s9} of {s4} asked you to defeat {s5} of the {s7} in battle, defusing tension in the {s8} to go to war."
), #perhaps replaces persuade_lords_to_make_peace
("raid_caravan_to_start_war", "Attack a Neutral Caravan to Provoke War", qf_random_quest,
"{!}placeholder",
),
("cause_provocation", "Give a Kingdom Provocation to Attack Another", qf_random_quest,
"{!}placeholder",
), #replaces raid_caravan_to_start_war
("rescue_prisoner", "Rescue or Ransom a Prisoner", qf_random_quest,
"{!}placeholder"
), #possibly replaces rescue lord
("destroy_bandit_lair", "Destroy Bandit Lair", qf_random_quest,
"{!}{s9} of {s4} asked you to discover a {s6} and destroy it."
),
("blank_quest_2", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_3", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_4", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_5", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_6", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_7", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_8", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_9", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_10", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_11", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_12", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_13", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_14", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_15", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_16", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_17", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_18", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_19", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_20", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_21", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_22", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_23", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_24", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_25", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_26", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("blank_quest_27", "{!}blank_quest", qf_random_quest,
"{!}placeholder"
),
("collect_men", "Collect Five Men", 0,
"{!}{s9} asked you to collect at least 5 men before you move against the bandits threatening the townsmen. You can recruit soldiers from villages as well as town taverns. You can find {s9} at the tavern in {s4} when you have think you have enough men."
),
("learn_where_merchant_brother_is", "Learn Where the Hostages are Held.", 0,
"{!}placeholder."
),
("save_relative_of_merchant", "Attack the Bandit Lair", 0,
"{!}placeholder."
),
("save_town_from_bandits", "Save Town from Bandits", 0,
"{!}placeholder."
),
("quests_end", "Quests End", 0, "{!}."),
]
| Python |
imod_plain = 0
imod_cracked = 1
imod_rusty = 2
imod_bent = 3
imod_chipped = 4
imod_battered = 5
imod_poor = 6
imod_crude = 7
imod_old = 8
imod_cheap = 9
imod_fine = 10
imod_well_made = 11
imod_sharp = 12
imod_balanced = 13
imod_tempered = 14
imod_deadly = 15
imod_exquisite = 16
imod_masterwork = 17
imod_heavy = 18
imod_strong = 19
imod_powerful = 20
imod_tattered = 21
imod_ragged = 22
imod_rough = 23
imod_sturdy = 24
imod_thick = 25
imod_hardened = 26
imod_reinforced = 27
imod_superb = 28
imod_lordly = 29
imod_lame = 30
imod_swaybacked = 31
imod_stubborn = 32
imod_timid = 33
imod_meek = 34
imod_spirited = 35
imod_champion = 36
imod_fresh = 37
imod_day_old = 38
imod_two_day_old = 39
imod_smelling = 40
imod_rotten = 41
imod_large_bag = 42
imodbit_plain = 1
imodbit_cracked = 2
imodbit_rusty = 4
imodbit_bent = 8
imodbit_chipped = 16
imodbit_battered = 32
imodbit_poor = 64
imodbit_crude = 128
imodbit_old = 256
imodbit_cheap = 512
imodbit_fine = 1024
imodbit_well_made = 2048
imodbit_sharp = 4096
imodbit_balanced = 8192
imodbit_tempered = 16384
imodbit_deadly = 32768
imodbit_exquisite = 65536
imodbit_masterwork = 131072
imodbit_heavy = 262144
imodbit_strong = 524288
imodbit_powerful = 1048576
imodbit_tattered = 2097152
imodbit_ragged = 4194304
imodbit_rough = 8388608
imodbit_sturdy = 16777216
imodbit_thick = 33554432
imodbit_hardened = 67108864
imodbit_reinforced = 134217728
imodbit_superb = 268435456
imodbit_lordly = 536870912
imodbit_lame = 1073741824
imodbit_swaybacked = 2147483648
imodbit_stubborn = 4294967296
imodbit_timid = 8589934592
imodbit_meek = 17179869184
imodbit_spirited = 34359738368
imodbit_champion = 68719476736
imodbit_fresh = 137438953472
imodbit_day_old = 274877906944
imodbit_two_day_old = 549755813888
imodbit_smelling = 1099511627776
imodbit_rotten = 2199023255552
imodbit_large_bag = 4398046511104
| Python |
menu_start_game_0 = 0
menu_start_phase_2 = 1
menu_start_game_3 = 2
menu_tutorial = 3
menu_reports = 4
menu_custom_battle_scene = 5
menu_custom_battle_end = 6
menu_start_game_1 = 7
menu_start_character_1 = 8
menu_start_character_2 = 9
menu_start_character_3 = 10
menu_start_character_4 = 11
menu_choose_skill = 12
menu_past_life_explanation = 13
menu_auto_return = 14
menu_morale_report = 15
menu_courtship_relations = 16
menu_lord_relations = 17
menu_companion_report = 18
menu_faction_orders = 19
menu_character_report = 20
menu_party_size_report = 21
menu_faction_relations_report = 22
menu_camp = 23
menu_camp_cheat = 24
menu_cheat_find_item = 25
menu_cheat_change_weather = 26
menu_camp_action = 27
menu_camp_recruit_prisoners = 28
menu_camp_no_prisoners = 29
menu_camp_action_read_book = 30
menu_camp_action_read_book_start = 31
menu_retirement_verify = 32
menu_end_game = 33
menu_cattle_herd = 34
menu_cattle_herd_kill = 35
menu_cattle_herd_kill_end = 36
menu_arena_duel_fight = 37
menu_arena_duel_conclusion = 38
menu_simple_encounter = 39
menu_encounter_retreat_confirm = 40
menu_encounter_retreat = 41
menu_order_attack_begin = 42
menu_order_attack_2 = 43
menu_battle_debrief = 44
menu_total_victory = 45
menu_enemy_slipped_away = 46
menu_total_defeat = 47
menu_permanent_damage = 48
menu_pre_join = 49
menu_join_battle = 50
menu_join_order_attack = 51
menu_zendar = 52
menu_salt_mine = 53
menu_four_ways_inn = 54
menu_test_scene = 55
menu_battlefields = 56
menu_dhorak_keep = 57
menu_join_siege_outside = 58
menu_cut_siege_without_fight = 59
menu_besiegers_camp_with_allies = 60
menu_castle_outside = 61
menu_castle_guard = 62
menu_castle_entry_granted = 63
menu_castle_entry_denied = 64
menu_castle_meeting = 65
menu_castle_meeting_selected = 66
menu_castle_besiege = 67
menu_siege_attack_meets_sally = 68
menu_castle_besiege_inner_battle = 69
menu_construct_ladders = 70
menu_construct_siege_tower = 71
menu_castle_attack_walls_simulate = 72
menu_castle_attack_walls_with_allies_simulate = 73
menu_castle_taken_by_friends = 74
menu_castle_taken = 75
menu_castle_taken_2 = 76
menu_requested_castle_granted_to_player = 77
menu_requested_castle_granted_to_player_husband = 78
menu_requested_castle_granted_to_another = 79
menu_requested_castle_granted_to_another_female = 80
menu_leave_faction = 81
menu_give_center_to_player = 82
menu_give_center_to_player_2 = 83
menu_oath_fulfilled = 84
menu_siege_started_defender = 85
menu_siege_join_defense = 86
menu_enter_your_own_castle = 87
menu_village = 88
menu_village_hostile_action = 89
menu_recruit_volunteers = 90
menu_village_hunt_down_fugitive_defeated = 91
menu_village_infest_bandits_result = 92
menu_village_infestation_removed = 93
menu_center_manage = 94
menu_center_improve = 95
menu_town_bandits_failed = 96
menu_town_bandits_succeeded = 97
menu_village_steal_cattle_confirm = 98
menu_village_steal_cattle = 99
menu_village_take_food_confirm = 100
menu_village_take_food = 101
menu_village_start_attack = 102
menu_village_loot_no_resist = 103
menu_village_loot_complete = 104
menu_village_loot_defeat = 105
menu_village_loot_continue = 106
menu_close = 107
menu_town = 108
menu_cannot_enter_court = 109
menu_lady_visit = 110
menu_town_tournament_lost = 111
menu_town_tournament_won = 112
menu_town_tournament_won_by_another = 113
menu_town_tournament = 114
menu_tournament_withdraw_verify = 115
menu_tournament_bet = 116
menu_tournament_bet_confirm = 117
menu_tournament_participants = 118
menu_collect_taxes = 119
menu_collect_taxes_complete = 120
menu_collect_taxes_rebels_killed = 121
menu_collect_taxes_failed = 122
menu_collect_taxes_revolt_warning = 123
menu_collect_taxes_revolt = 124
menu_train_peasants_against_bandits = 125
menu_train_peasants_against_bandits_ready = 126
menu_train_peasants_against_bandits_training_result = 127
menu_train_peasants_against_bandits_attack = 128
menu_train_peasants_against_bandits_attack_result = 129
menu_train_peasants_against_bandits_success = 130
menu_disembark = 131
menu_ship_reembark = 132
menu_center_reports = 133
menu_price_and_production = 134
menu_town_trade = 135
menu_town_trade_assessment_begin = 136
menu_town_trade_assessment = 137
menu_sneak_into_town_suceeded = 138
menu_sneak_into_town_caught = 139
menu_sneak_into_town_caught_dispersed_guards = 140
menu_sneak_into_town_caught_ran_away = 141
menu_enemy_offer_ransom_for_prisoner = 142
menu_training_ground = 143
menu_training_ground_selection_details_melee_1 = 144
menu_training_ground_selection_details_melee_2 = 145
menu_training_ground_selection_details_mounted = 146
menu_training_ground_selection_details_ranged_1 = 147
menu_training_ground_selection_details_ranged_2 = 148
menu_training_ground_description = 149
menu_training_ground_training_result = 150
menu_marshall_selection_candidate_ask = 151
menu_captivity_avoid_wilderness = 152
menu_captivity_start_wilderness = 153
menu_captivity_start_wilderness_surrender = 154
menu_captivity_start_wilderness_defeat = 155
menu_captivity_start_castle_surrender = 156
menu_captivity_start_castle_defeat = 157
menu_captivity_start_under_siege_defeat = 158
menu_captivity_wilderness_taken_prisoner = 159
menu_captivity_wilderness_check = 160
menu_captivity_end_wilderness_escape = 161
menu_captivity_castle_taken_prisoner = 162
menu_captivity_rescue_lord_taken_prisoner = 163
menu_captivity_castle_check = 164
menu_captivity_end_exchanged_with_prisoner = 165
menu_captivity_end_propose_ransom = 166
menu_captivity_castle_remain = 167
menu_kingdom_army_quest_report_to_army = 168
menu_kingdom_army_quest_messenger = 169
menu_kingdom_army_quest_join_siege_order = 170
menu_kingdom_army_follow_failed = 171
menu_invite_player_to_faction_without_center = 172
menu_invite_player_to_faction = 173
menu_invite_player_to_faction_accepted = 174
menu_question_peace_offer = 175
menu_notification_truce_expired = 176
menu_notification_feast_quest_expired = 177
menu_notification_sortie_possible = 178
menu_notification_casus_belli_expired = 179
menu_notification_lord_defects = 180
menu_notification_treason_indictment = 181
menu_notification_border_incident = 182
menu_notification_player_faction_active = 183
menu_minister_confirm = 184
menu_notification_court_lost = 185
menu_notification_player_faction_deactive = 186
menu_notification_player_wedding_day = 187
menu_notification_player_kingdom_holds_feast = 188
menu_notification_center_under_siege = 189
menu_notification_village_raided = 190
menu_notification_village_raid_started = 191
menu_notification_one_faction_left = 192
menu_notification_oath_renounced_faction_defeated = 193
menu_notification_center_lost = 194
menu_notification_troop_left_players_faction = 195
menu_notification_troop_joined_players_faction = 196
menu_notification_war_declared = 197
menu_notification_peace_declared = 198
menu_notification_faction_defeated = 199
menu_notification_rebels_switched_to_faction = 200
menu_notification_player_should_consult = 201
menu_notification_player_feast_in_progress = 202
menu_notification_lady_requests_visit = 203
menu_garden = 204
menu_kill_local_merchant_begin = 205
menu_debug_alert_from_s65 = 206
menu_auto_return_to_map = 207
menu_bandit_lair = 208
menu_notification_player_faction_political_issue_resolved = 209
menu_notification_player_faction_political_issue_resolved_for_player = 210
menu_start_phase_2_5 = 211
menu_start_phase_3 = 212
menu_start_phase_4 = 213
menu_lost_tavern_duel = 214
menu_establish_court = 215
menu_notification_relieved_as_marshal = 216
| Python |
pfx_default = 0
pfx_map_params = 1
pfx_indoors = 2
pfx_sunset = 3
pfx_night = 4
pfx_sunny = 5
pfx_cloudy = 6
pfx_overcast = 7
pfx_high_contrast = 8
| Python |
mst_town_default = 0
mst_conversation_encounter = 1
mst_town_center = 2
mst_village_center = 3
mst_bandits_at_night = 4
mst_village_training = 5
mst_visit_town_castle = 6
mst_back_alley_kill_local_merchant = 7
mst_back_alley_revolt = 8
mst_lead_charge = 9
mst_village_attack_bandits = 10
mst_village_raid = 11
mst_besiege_inner_battle_castle = 12
mst_besiege_inner_battle_town_center = 13
mst_castle_attack_walls_defenders_sally = 14
mst_castle_attack_walls_belfry = 15
mst_castle_attack_walls_ladder = 16
mst_castle_visit = 17
mst_training_ground_trainer_talk = 18
mst_training_ground_trainer_training = 19
mst_training_ground_training = 20
mst_sneak_caught_fight = 21
mst_ai_training = 22
mst_camera_test = 23
mst_arena_melee_fight = 24
mst_arena_challenge_fight = 25
mst_duel_with_lord = 26
mst_wedding = 27
mst_tutorial_training_ground = 28
mst_tutorial_1 = 29
mst_tutorial_2 = 30
mst_tutorial_3 = 31
mst_tutorial_3_2 = 32
mst_tutorial_4 = 33
mst_tutorial_5 = 34
mst_quick_battle_battle = 35
mst_quick_battle_siege = 36
mst_multiplayer_dm = 37
mst_multiplayer_tdm = 38
mst_multiplayer_hq = 39
mst_multiplayer_cf = 40
mst_multiplayer_sg = 41
mst_multiplayer_bt = 42
mst_multiplayer_fd = 43
mst_bandit_lair = 44
mst_alley_fight = 45
mst_meeting_merchant = 46
mst_town_fight = 47
mst_multiplayer_duel = 48
| Python |
fac_no_faction = 0
fac_commoners = 1
fac_outlaws = 2
fac_neutral = 3
fac_innocents = 4
fac_merchants = 5
fac_dark_knights = 6
fac_culture_1 = 7
fac_culture_2 = 8
fac_culture_3 = 9
fac_culture_4 = 10
fac_culture_5 = 11
fac_culture_6 = 12
fac_player_faction = 13
fac_player_supporters_faction = 14
fac_kingdom_1 = 15
fac_kingdom_2 = 16
fac_kingdom_3 = 17
fac_kingdom_4 = 18
fac_kingdom_5 = 19
fac_kingdom_6 = 20
fac_kingdoms_end = 21
fac_robber_knights = 22
fac_khergits = 23
fac_black_khergits = 24
fac_manhunters = 25
fac_deserters = 26
fac_mountain_bandits = 27
fac_forest_bandits = 28
fac_undeads = 29
fac_slavers = 30
fac_peasant_rebels = 31
fac_noble_refugees = 32
| Python |
import string
from module_info import *
from module_troops import *
from process_common import *
#from process_operations import *
num_face_numeric_keys = 4
def save_troops():
file = open(export_dir + "troops.txt","w")
file.write("troopsfile version 2\n")
file.write("%d "%len(troops))
for troop in troops:
troop_len = len(troop)
if troop_len == 11:
troop[11:11] = [0, 0, 0, 0, 0]
elif troop_len == 12:
troop[12:12] = [0, 0, 0, 0]
elif troop_len == 13:
troop[13:13] = [0, 0, 0]
elif troop_len == 14:
troop[14:14] = [0, 0]
elif troop_len == 15:
troop[15:15] = [0]
if (troop[4] > 0):
# add_tag_use(tag_uses,tag_scene,troop[4] & tsf_site_id_mask)
id_no = find_object(troops,convert_to_identifier(troop[0]))
# if (id_no >= 0): add_tag_use(tag_uses,tag_troop,id_no)
# if (troop[6] > 0): add_tag_use(tag_uses,tag_faction,troop[6])
file.write("\ntrp_%s %s %s %s %d %d %d %d %d %d\n "%(convert_to_identifier(troop[0]),replace_spaces(troop[1]),replace_spaces(troop[2]), replace_spaces(str(troop[13])), troop[3],troop[4],troop[5], troop[6], troop[14], troop[15]))
inventory_list = troop[7]
# inventory_list.append(itm_arrows)
# inventory_list.append(itm_bolts)
for inventory_item in inventory_list:
# add_tag_use(tag_uses,tag_item,inventory_item)
file.write("%d 0 "%inventory_item)
for i in xrange(64 - len(inventory_list)):
file.write("-1 0 ")
file.write("\n ")
attrib = troop[8]
strength = (attrib & 0xff)
agility = ((attrib >> 8)& 0xff)
intelligence = ((attrib >> 16)& 0xff)
charisma = ((attrib >> 24)& 0xff)
starting_level = (attrib >> level_bits) & level_mask
# gold = two_to_pow(2 + (attrib >> 12)& 0x0f) * random
file.write(" %d %d %d %d %d\n"%(strength,agility,intelligence,charisma,starting_level))
wp_word = troop[9]
for wp in xrange(num_weapon_proficiencies):
wp_level = wp_word & 0x3FF
file.write(" %d"%wp_level)
wp_word = wp_word >> 10
file.write("\n")
skill_array = troop[10]
for i in xrange(num_skill_words):
file.write("%d "%((skill_array >> (i * 32)) & 0xffffffff))
file.write("\n ")
face_keys = [troop[11],troop[12]]
for fckey in (face_keys):
word_keys = []
for word_no in xrange(num_face_numeric_keys):
word_keys.append((fckey >> (64 * word_no)) & 0xFFFFFFFFFFFFFFFF)
for word_no in xrange(num_face_numeric_keys):
file.write("%d "%(word_keys[(num_face_numeric_keys -1) - word_no]))
file.write("\n")
# word2 = (fckey >> 64) & 0xFFFFFFFFFFFFFFFF
# word3 = (fckey >> 128) & 0xFFFFFFFFFFFFFFFF
# word4 = (fckey >> 192) & 0xFFFFFFFFFFFFFFFF
# file.write("%d %d %d %d "%(word4, word3, word2, word1))
# face_keys = troop[10]
# for fckey in (face_keys):
# file.write("%d "%(fckey))
# for i in xrange(4 - len(face_keys)):
# file.write("0 ")
file.close()
def two_to_pow(x):
result = 1
for i in xrange(x):
result = result * 2
return result
def save_python_header():
file = open("./ID_troops.py","w")
for i_troop in xrange(len(troops)):
file.write("trp_%s = %d\n"%(convert_to_identifier(troops[i_troop][0]),i_troop))
file.close()
print "Exporting troops data"
#tag_uses = load_tag_uses(export_dir)
save_python_header()
save_troops()
#save_tag_uses(export_dir, tag_uses)
#print "Generating C header..."
#save_c_header()
#print "Generating Python header..."
#print "Finished."
| Python |
from module_info import *
from process_common import *
from process_operations import *
print "Checking tag usages..."
tag_uses = load_tag_uses(export_dir)
#Processing strings
length = 0
for i in xrange(len(tag_uses[tag_string])):
if tag_uses[tag_string][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_string][i] == 0:
if i > 3:
print "WARNING: String is never used: " + strings[i][0].lower()
#Processing items
length = 0
for i in xrange(len(tag_uses[tag_item])):
if tag_uses[tag_item][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_item][i] == 0 and i > 1:
print "WARNING: Item is never used: " + items[i][0].lower()
#Processing troops
length = 0
for i in xrange(len(tag_uses[tag_troop])):
if tag_uses[tag_troop][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_troop][i] == 0:
if i > 3:
print "WARNING: Troop is never used: " + troops[i][0].lower()
#Processing factions
length = 0
for i in xrange(len(tag_uses[tag_faction])):
if tag_uses[tag_faction][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_faction][i] == 0:
print "WARNING: Faction is never used: " + factions[i][0].lower()
#Processing quests
length = 0
for i in xrange(len(tag_uses[tag_quest])):
if tag_uses[tag_quest][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_quest][i] == 0:
print "WARNING: Quest is never used: " + quests[i][0].lower()
#Processing party_templates
length = 0
for i in xrange(len(tag_uses[tag_party_tpl])):
if tag_uses[tag_party_tpl][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_party_tpl][i] == 0:
if i > 3:
print "WARNING: Party template is never used: " + party_templates[i][0].lower()
#Processing parties
length = 0
for i in xrange(len(tag_uses[tag_party])):
if tag_uses[tag_party][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_party][i] == 0:
if parties[i][0].lower().find("temp_") == -1:
print "WARNING: Party is never used: " + parties[i][0].lower()
#Processing scenes
#length = 0
#for i in xrange(1024):
# if tag_uses[tag_scene][i] > 0:
# length = i
#
#for i in xrange(length):
# if tag_uses[tag_scene][i] == 0:
# print "WARNING: Scene is never used: " + scenes[i][0].lower()
#Processing mission_templates
length = 0
for i in xrange(len(tag_uses[tag_mission_tpl])):
if tag_uses[tag_mission_tpl][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_mission_tpl][i] == 0:
print "WARNING: Mission template is never used: " + mission_templates[i][0].lower()
#Processing game_menus
length = 0
for i in xrange(len(tag_uses[tag_menu])):
if tag_uses[tag_menu][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_menu][i] == 0 and i > 0:
if i > 1:
print "WARNING: Game menu is never used: " + game_menus[i][0].lower()
#Processing scripts
length = 0
for i in xrange(len(tag_uses[tag_script])):
if tag_uses[tag_script][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_script][i] == 0:
if scripts[i][0].lower().find("game_") == -1:
print "WARNING: Script is never used: " + scripts[i][0].lower()
#Processing particle systems
length = 0
for i in xrange(len(tag_uses[tag_particle_sys])):
if tag_uses[tag_particle_sys][i] > 0:
length = i
for i in xrange(length):
if tag_uses[tag_particle_sys][i] == 0:
if particle_systems[i][0].lower().find("game_") == -1:
print "WARNING: Particle system is never used: " + particle_systems[i][0].lower()
#Processing scene props
#length = 0
#for i in xrange(1024):
# if tag_uses[tag_scene_prop][i] > 0:
# length = i
#
#for i in xrange(length):
# if tag_uses[tag_scene_prop][i] == 0:
# print "WARNING: Scene prop is never used: " + scene_props[i][0].lower()
#Processing sounds
#length = 0
#for i in xrange(1024):
# if tag_uses[tag_sound][i] > 0:
# length = i
#
#for i in xrange(length):
# if tag_uses[tag_sound][i] == 0:
# print "WARNING: Sound is never used: " + sounds[i][0].lower()
#Processing map icons
#length = 0
#for i in xrange(1024):
# if tag_uses[tag_map_icon][i] > 0:
# length = i
#
#for i in xrange(length):
# if tag_uses[tag_map_icon][i] == 0:
# print "WARNING: Map icon is never used: " + map_icons[i][0].lower()
| Python |
from header_common import *
from header_presentations import *
from header_mission_templates import *
from ID_meshes import *
from header_operations import *
from header_triggers import *
from module_constants import *
import string
####################################################################################################################
# Each presentation record contains the following fields:
# 1) Presentation id: used for referencing presentations in other files. The prefix prsnt_ is automatically added before each presentation id.
# 2) Presentation flags. See header_presentations.py for a list of available flags
# 3) Presentation background mesh: See module_meshes.py for a list of available background meshes
# 4) Triggers: Simple triggers that are associated with the presentation
####################################################################################################################
presentations = [
("game_credits",prsntf_read_only,mesh_load_window,[
(ti_on_presentation_load,
[(assign, "$g_presentation_credits_obj_1", -1),
(assign, "$g_presentation_credits_obj_2", -1),
(assign, "$g_presentation_credits_obj_3", -1),
(assign, "$g_presentation_credits_obj_4", -1),
(assign, "$g_presentation_credits_obj_5", -1),
(assign, "$g_presentation_credits_obj_6", -1),
(assign, "$g_presentation_credits_obj_7", -1),
(assign, "$g_presentation_credits_obj_8", -1),
(assign, "$g_presentation_credits_obj_9", -1),
(assign, "$g_presentation_credits_obj_10", -1),
(assign, "$g_presentation_credits_obj_11", -1),
(assign, "$g_presentation_credits_obj_12", -1),
(assign, "$g_presentation_credits_obj_1_alpha", 0),
(assign, "$g_presentation_credits_obj_2_alpha", 0),
(assign, "$g_presentation_credits_obj_3_alpha", 0),
(assign, "$g_presentation_credits_obj_4_alpha", 0),
(assign, "$g_presentation_credits_obj_5_alpha", 0),
(assign, "$g_presentation_credits_obj_6_alpha", 0),
(assign, "$g_presentation_credits_obj_7_alpha", 0),
(assign, "$g_presentation_credits_obj_8_alpha", 0),
(assign, "$g_presentation_credits_obj_9_alpha", 0),
]),
(ti_on_presentation_run,
[
(store_trigger_param_1, ":cur_time"),
(set_fixed_point_multiplier, 1000),
(presentation_set_duration, 1000000),
(try_begin),
(this_or_next|key_clicked, key_space),
(this_or_next|key_clicked, key_enter),
(this_or_next|key_clicked, key_escape),
(this_or_next|key_clicked, key_back_space),
(this_or_next|key_clicked, key_left_mouse_button),
(key_clicked, key_right_mouse_button),
(presentation_set_duration, 0),
(try_end),
(try_begin),
(lt, "$g_presentation_credits_obj_1", 0),
(str_store_string, s1, "str_credits_1"),
(create_text_overlay, "$g_presentation_credits_obj_1", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_1", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_1", 0),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, "$g_presentation_credits_obj_1", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 375),
(overlay_set_position, "$g_presentation_credits_obj_1", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_1", 1000, 0xFF),
(else_try),
(gt, ":cur_time", 2000),
(eq, "$g_presentation_credits_obj_1_alpha", 0),
(assign, "$g_presentation_credits_obj_1_alpha", 1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_1", 1000, 0x00),
(else_try),
(gt, ":cur_time", 3500),
(lt, "$g_presentation_credits_obj_2", 0),
(str_store_string, s1, "str_credits_2"),
(create_text_overlay, "$g_presentation_credits_obj_2", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_2", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_2", 0),
(position_set_x, pos1, 1750),
(position_set_y, pos1, 1750),
(overlay_set_size, "$g_presentation_credits_obj_2", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 375),
(overlay_set_position, "$g_presentation_credits_obj_2", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_2", 1000, 0xFF),
(else_try),
(gt, ":cur_time", 5500),
(eq, "$g_presentation_credits_obj_2_alpha", 0),
(assign, "$g_presentation_credits_obj_2_alpha", 1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_2", 1000, 0x00),
(else_try),
(gt, ":cur_time", 7000),
(lt, "$g_presentation_credits_obj_3", 0),
(str_store_string, s1, "str_credits_3"),
(create_text_overlay, "$g_presentation_credits_obj_3", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_3", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_3", 0),
(position_set_x, pos1, 1750),
(position_set_y, pos1, 1750),
(overlay_set_size, "$g_presentation_credits_obj_3", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 375),
(overlay_set_position, "$g_presentation_credits_obj_3", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_3", 1000, 0xFF),
(else_try),
(gt, ":cur_time", 9000),
(eq, "$g_presentation_credits_obj_3_alpha", 0),
(assign, "$g_presentation_credits_obj_3_alpha", 1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_3", 1000, 0),
(else_try),
(gt, ":cur_time", 10500),
(lt, "$g_presentation_credits_obj_4", 0),
(str_store_string, s1, "str_credits_4"),
(create_text_overlay, "$g_presentation_credits_obj_4", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_4", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_4", 0),
(position_set_x, pos1, 1750),
(position_set_y, pos1, 1750),
(overlay_set_size, "$g_presentation_credits_obj_4", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 375),
(overlay_set_position, "$g_presentation_credits_obj_4", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_4", 1000, 0xFF),
(else_try),
(gt, ":cur_time", 12500),
(eq, "$g_presentation_credits_obj_4_alpha", 0),
(assign, "$g_presentation_credits_obj_4_alpha", 1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_4", 1000, 0),
(else_try),
(gt, ":cur_time", 14000),
(lt, "$g_presentation_credits_obj_5", 0),
(str_store_string, s1, "str_credits_5"),
(create_text_overlay, "$g_presentation_credits_obj_5", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_5", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_5", 0),
(position_set_x, pos1, 1750),
(position_set_y, pos1, 1750),
(overlay_set_size, "$g_presentation_credits_obj_5", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 375),
(overlay_set_position, "$g_presentation_credits_obj_5", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_5", 1000, 0xFF),
(else_try),
(gt, ":cur_time", 16000),
(eq, "$g_presentation_credits_obj_5_alpha", 0),
(assign, "$g_presentation_credits_obj_5_alpha", 1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_5", 1000, 0),
(else_try),
(gt, ":cur_time", 17500),
(lt, "$g_presentation_credits_obj_6", 0),
(str_store_string, s1, "str_credits_6"),
(create_text_overlay, "$g_presentation_credits_obj_6", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_6", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_6", 0),
(position_set_x, pos1, 1750),
(position_set_y, pos1, 1750),
(overlay_set_size, "$g_presentation_credits_obj_6", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 375),
(overlay_set_position, "$g_presentation_credits_obj_6", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_6", 1000, 0xFF),
(else_try),
(gt, ":cur_time", 19500),
(eq, "$g_presentation_credits_obj_6_alpha", 0),
(assign, "$g_presentation_credits_obj_6_alpha", 1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_6", 1000, 0),
(else_try),
(gt, ":cur_time", 21000),
(lt, "$g_presentation_credits_obj_7", 0),
(str_store_string, s1, "str_credits_7"),
(create_text_overlay, "$g_presentation_credits_obj_7", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_7", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_7", 0),
(position_set_x, pos1, 1750),
(position_set_y, pos1, 1750),
(overlay_set_size, "$g_presentation_credits_obj_7", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 375),
(overlay_set_position, "$g_presentation_credits_obj_7", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_7", 1000, 0xFF),
(else_try),
(gt, ":cur_time", 23000),
(eq, "$g_presentation_credits_obj_7_alpha", 0),
(assign, "$g_presentation_credits_obj_7_alpha", 1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_7", 1000, 0),
(else_try),
(gt, ":cur_time", 24500),
(lt, "$g_presentation_credits_obj_8", 0),
(str_store_string, s1, "str_credits_8"),
(create_text_overlay, "$g_presentation_credits_obj_8", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_8", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_8", 0),
(position_set_x, pos1, 1750),
(position_set_y, pos1, 1750),
(overlay_set_size, "$g_presentation_credits_obj_8", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 375),
(overlay_set_position, "$g_presentation_credits_obj_8", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_8", 1000, 0xFF),
(else_try),
(gt, ":cur_time", 26500),
(eq, "$g_presentation_credits_obj_8_alpha", 0),
(assign, "$g_presentation_credits_obj_8_alpha", 1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_8", 1000, 0),
(else_try),
(gt, ":cur_time", 28000),
(lt, "$g_presentation_credits_obj_9", 0),
(str_store_string, s1, "str_credits_10"),
(create_text_overlay, "$g_presentation_credits_obj_9", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_9", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_9", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, "$g_presentation_credits_obj_9", pos1),
(position_set_x, pos1, 250),
(position_set_y, pos1, 485),
(overlay_set_position, "$g_presentation_credits_obj_9", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_9", 1000, 0xFF),
(str_store_string, s1, "str_credits_11"),
(create_text_overlay, "$g_presentation_credits_obj_10", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_10", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_10", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, "$g_presentation_credits_obj_10", pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 470),
(overlay_set_position, "$g_presentation_credits_obj_10", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_10", 1000, 0xFF),
(str_store_string, s1, "str_credits_12"),
(create_text_overlay, "$g_presentation_credits_obj_11", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
(overlay_set_color, "$g_presentation_credits_obj_11", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_11", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, "$g_presentation_credits_obj_11", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 105),
(overlay_set_position, "$g_presentation_credits_obj_11", pos1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_11", 1000, 0xFF),
(else_try),
(gt, ":cur_time", 34000),
(eq, "$g_presentation_credits_obj_9_alpha", 0),
(assign, "$g_presentation_credits_obj_9_alpha", 1),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_9", 1000, 0),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_10", 1000, 0),
(overlay_animate_to_alpha, "$g_presentation_credits_obj_11", 1000, 0),
(else_try),
(gt, ":cur_time", 35500),
(lt, "$g_presentation_credits_obj_12", 0),
(str_store_string, s1, "str_credits_9"),
(create_text_overlay, "$g_presentation_credits_obj_12", s1, tf_center_justify|tf_double_space),
(overlay_set_color, "$g_presentation_credits_obj_12", 0),
(overlay_set_alpha, "$g_presentation_credits_obj_12", 0xFF),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, "$g_presentation_credits_obj_12", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, -4800),
(overlay_set_position, "$g_presentation_credits_obj_12", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 760),
(overlay_animate_to_position, "$g_presentation_credits_obj_12", 70000, pos1),
(else_try),
(gt, ":cur_time", 105500),
(presentation_set_duration, 0),
(try_end),
]),
]),
("game_profile_banner_selection", 0, mesh_load_window, [
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(str_store_string, s1, "str_profile_banner_selection_text"),
(create_text_overlay, reg1, s1, tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 600),
(overlay_set_position, reg1, pos1),
(overlay_set_text, reg1, s1),
(create_button_overlay, "$g_presentation_obj_profile_banner_selection_1", "@Next Page", tf_center_justify),
(position_set_x, pos1, 700),
(position_set_y, pos1, 50),
(overlay_set_position, "$g_presentation_obj_profile_banner_selection_1", pos1),
(create_button_overlay, "$g_presentation_obj_profile_banner_selection_2", "str_use_default_banner", tf_center_justify),
(position_set_x, pos1, 300),
(position_set_y, pos1, 50),
(overlay_set_position, "$g_presentation_obj_profile_banner_selection_2", pos1),
(assign, ":x_pos", 150),
(assign, ":y_pos", 575),
(store_mul, ":starting_banner", 16, "$g_presentation_page_no"),
(store_add, ":ending_banner", ":starting_banner", 16),
(store_add, "$g_presentation_banner_start", "$g_presentation_obj_profile_banner_selection_2", 1),
(assign, ":num_valid_banners", 0),
(try_for_range, ":cur_banner_mesh", banner_meshes_begin, banner_meshes_end_minus_one),
(assign, ":already_used", 0),
(try_for_range, ":cur_faction", npc_kingdoms_begin, npc_kingdoms_end),
(faction_slot_eq, ":cur_faction", slot_faction_banner, ":cur_banner_mesh"),
(assign, ":already_used", 1),
(try_end),
(eq, ":already_used", 0),
(val_add, ":num_valid_banners", 1),
(gt, ":num_valid_banners", ":starting_banner"),
(le, ":num_valid_banners", ":ending_banner"),
(create_image_button_overlay, reg1, ":cur_banner_mesh", ":cur_banner_mesh"),
(position_set_x, pos1, ":x_pos"),
(position_set_y, pos1, ":y_pos"),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 100),
(position_set_y, pos1, 100),
(overlay_set_size, reg1, pos1),
(val_add, ":x_pos", 100),
(ge, ":x_pos", 900),
(assign, ":x_pos", 150),
(val_sub, ":y_pos", 250),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change, [
(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_profile_banner_selection_1"),
(val_add, "$g_presentation_page_no", 1),
(val_mod, "$g_presentation_page_no", 8),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_profile_banner_selection"),
(else_try),
(eq, ":object", "$g_presentation_obj_profile_banner_selection_2"),
(profile_set_banner_id, -1),
(presentation_set_duration, 0),
(else_try),
(store_sub, ":selected_banner", ":object", "$g_presentation_banner_start"),
(store_mul, ":page_adder", 16, "$g_presentation_page_no"),
(val_add, ":selected_banner", ":page_adder"),
(assign, ":num_valid_banners", 0),
(assign, ":end_cond", banner_meshes_end_minus_one),
(try_for_range, ":cur_banner_mesh", banner_meshes_begin, ":end_cond"),
(assign, ":already_used", 0),
(try_for_range, ":cur_faction", npc_kingdoms_begin, npc_kingdoms_end),
(faction_slot_eq, ":cur_faction", slot_faction_banner, ":cur_banner_mesh"),
(assign, ":already_used", 1),
(try_end),
(eq, ":already_used", 0),
(try_begin),
(eq, ":selected_banner", ":num_valid_banners"),
(store_sub, ":selected_banner_index", ":cur_banner_mesh", banner_meshes_begin),
(profile_set_banner_id, ":selected_banner_index"),
(assign, ":end_cond", 0), #break
(try_end),
(val_add, ":num_valid_banners", 1),
(try_end),
(presentation_set_duration, 0),
(try_end),
]),
]),
("game_custom_battle_designer", prsntf_manual_end_only, mesh_cb_ui_main, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_text_overlay, reg0, "str_player", tf_center_justify|tf_single_line|tf_with_outline),
(overlay_set_color, reg0, 0xFFFFFFFF),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 175),
(position_set_y, pos1, 700),
(overlay_set_position, reg0, pos1),
(create_text_overlay, reg0, "str_enemy", tf_center_justify|tf_single_line|tf_with_outline),
(overlay_set_color, reg0, 0xFFFFFFFF),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 820),
(position_set_y, pos1, 700),
(overlay_set_position, reg0, pos1),
(create_text_overlay, reg0, "str_character", tf_center_justify),
(position_set_x, pos1, 175),
(position_set_y, pos1, 670),
(overlay_set_position, reg0, pos1),
(create_combo_label_overlay, "$g_presentation_obj_custom_battle_designer_18"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_18", pos1),
(position_set_x, pos1, 175),
(position_set_y, pos1, 635),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_18", pos1),
(try_for_range, ":cur_troop", quick_battle_troops_begin, quick_battle_troops_end),
(str_store_troop_name, s0, ":cur_troop"),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_18", s0),
(try_end),
(store_sub, ":cur_troop", "$g_quick_battle_troop", quick_battle_troops_begin),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_18", ":cur_troop"),
(store_mul, ":cur_troop", "$g_quick_battle_troop", 2), #with weapons
(create_mesh_overlay_with_tableau_material, reg0, -1, "tableau_game_party_window", ":cur_troop"),
(position_set_x, pos1, 25),
(position_set_y, pos1, 370),
(overlay_set_position, reg0, pos1),
(try_begin),
(eq, "$g_quick_battle_team_2_faction", "fac_kingdom_1"),
(assign, ":cur_troop", "trp_swadian_knight"),
(else_try),
(eq, "$g_quick_battle_team_2_faction", "fac_kingdom_2"),
(assign, ":cur_troop", "trp_vaegir_knight"),
(else_try),
(eq, "$g_quick_battle_team_2_faction", "fac_kingdom_3"),
(assign, ":cur_troop", "trp_khergit_veteran_horse_archer"),
(else_try),
(eq, "$g_quick_battle_team_2_faction", "fac_kingdom_4"),
(assign, ":cur_troop", "trp_nord_champion"),
(else_try),
(eq, "$g_quick_battle_team_2_faction", "fac_kingdom_5"),
(assign, ":cur_troop", "trp_rhodok_sergeant"),
(else_try),
(eq, "$g_quick_battle_team_2_faction", "fac_kingdom_6"),
(assign, ":cur_troop", "trp_sarranid_mamluke"),
(else_try),
(assign, ":cur_troop", "trp_taiga_bandit"),
(try_end),
(val_mul, ":cur_troop", 2), #with weapons
(create_mesh_overlay_with_tableau_material, reg0, -1, "tableau_game_party_window", ":cur_troop"),
(position_set_x, pos1, 670),
(position_set_y, pos1, 370),
(overlay_set_position, reg0, pos1),
(create_text_overlay, reg0, "str_biography", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 700),
(overlay_set_position, reg0, pos1),
(store_sub, ":cur_troop_text", "$g_quick_battle_troop", quick_battle_troops_begin),
(val_add, ":cur_troop_text", quick_battle_troop_texts_begin),
(create_text_overlay, reg0, ":cur_troop_text", tf_scrollable),
(position_set_x, pos1, 850),
(position_set_y, pos1, 850),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 320),
(position_set_y, pos1, 560),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 360),
(position_set_y, pos1, 130),
(overlay_set_area_size, reg0, pos1),
(create_text_overlay, reg0, "str_map_basic", tf_center_justify),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 450),
(overlay_set_position, reg0, pos1),
(create_combo_label_overlay, "$g_presentation_obj_custom_battle_designer_1"),
(position_set_x, pos1, 700),
(position_set_y, pos1, 700),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_1", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 415),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_1", pos1),
(try_begin),
(eq, "$g_quick_battle_game_type", 0), #battle
(try_for_range, ":cur_scene", quick_battle_battle_scenes_begin, quick_battle_battle_scenes_end),
(store_sub, ":cur_scene_name", ":cur_scene", quick_battle_scenes_begin),
(val_add, ":cur_scene_name", quick_battle_scene_names_begin),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_1", ":cur_scene_name"),
(try_end),
(try_begin),
(is_between, "$g_quick_battle_map", quick_battle_battle_scenes_begin, quick_battle_battle_scenes_end),
(store_sub, ":cur_map", "$g_quick_battle_map", quick_battle_battle_scenes_begin),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_1", ":cur_map"),
(else_try),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_1", 0),
(assign, "$g_quick_battle_map", quick_battle_battle_scenes_begin),
(try_end),
(else_try),
(try_for_range, ":cur_scene", quick_battle_siege_scenes_begin, quick_battle_siege_scenes_end),
(store_sub, ":cur_scene_name", ":cur_scene", quick_battle_scenes_begin),
(val_add, ":cur_scene_name", quick_battle_scene_names_begin),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_1", ":cur_scene_name"),
(try_end),
(try_begin),
(is_between, "$g_quick_battle_map", quick_battle_siege_scenes_begin, quick_battle_siege_scenes_end),
(store_sub, ":cur_map", "$g_quick_battle_map", quick_battle_siege_scenes_begin),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_1", ":cur_map"),
(else_try),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_1", 0),
(assign, "$g_quick_battle_map", quick_battle_siege_scenes_begin),
(try_end),
(try_end),
(store_sub, ":cur_mesh", "$g_quick_battle_map", quick_battle_scenes_begin),
(val_add, ":cur_mesh", quick_battle_scene_images_begin),
(create_mesh_overlay, reg0, ":cur_mesh"),
(position_set_x, pos1, 700),
(position_set_y, pos1, 700),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 380),
(position_set_y, pos1, 220),
(overlay_set_position, reg0, pos1),
(create_text_overlay, reg0, "str_game_type_basic", tf_center_justify),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 180),
(overlay_set_position, reg0, pos1),
(create_combo_label_overlay, "$g_presentation_obj_custom_battle_designer_23"),
(position_set_x, pos1, 700),
(position_set_y, pos1, 700),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_23", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 150),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_23", pos1),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_23", "str_battle"),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_23", "str_siege_offense"),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_23", "str_siege_defense"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_23", "$g_quick_battle_game_type"),
(create_game_button_overlay, "$g_presentation_obj_custom_battle_designer_24", "str_randomize"),
(position_set_x, pos1, 500),
(position_set_y, pos1, 60),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_24", pos1),
(assign, ":cur_y", 330),
(assign, ":cur_y", 350),
(assign, ":cur_y_adder", 40),
(create_text_overlay, reg0, "str_faction", tf_center_justify),
(position_set_x, pos1, 175),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_text_overlay, reg0, "str_faction", tf_center_justify),
(position_set_x, pos1, 820),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_combo_label_overlay, "$g_presentation_obj_custom_battle_designer_4"),
## (position_set_x, pos1, 800),
## (position_set_y, pos1, 800),
## (overlay_set_size, "$g_presentation_obj_custom_battle_designer_4", pos1),
(position_set_x, pos1, 175),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_4", pos1),
(try_begin),
(is_trial_version),
(str_store_faction_name, s0, npc_kingdoms_begin),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_4", s0),
(store_add, ":cur_faction", npc_kingdoms_begin, 1),
(str_store_faction_name, s0, ":cur_faction"),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_4", s0),
(else_try),
(try_for_range, ":cur_faction", npc_kingdoms_begin, npc_kingdoms_end),
(str_store_faction_name, s0, ":cur_faction"),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_4", s0),
(try_end),
(str_store_faction_name, s0, "fac_outlaws"),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_4", s0),
(try_end),
(try_begin),
(eq, "$g_quick_battle_team_1_faction", "fac_outlaws"),
(store_sub, ":overlay_value", npc_kingdoms_end, npc_kingdoms_begin),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_4", ":overlay_value"),
(else_try),
(store_sub, ":team_1_faction", "$g_quick_battle_team_1_faction", npc_kingdoms_begin),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_4", ":team_1_faction"),
(try_end),
(create_combo_label_overlay, "$g_presentation_obj_custom_battle_designer_5"),
## (position_set_x, pos1, 800),
## (position_set_y, pos1, 800),
## (overlay_set_size, "$g_presentation_obj_custom_battle_designer_5", pos1),
(position_set_x, pos1, 820),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_5", pos1),
(try_begin),
(is_trial_version),
(str_store_faction_name, s0, npc_kingdoms_begin),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_5", s0),
(store_add, ":cur_faction", npc_kingdoms_begin, 1),
(str_store_faction_name, s0, ":cur_faction"),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_5", s0),
(else_try),
(try_for_range, ":cur_faction", npc_kingdoms_begin, npc_kingdoms_end),
(str_store_faction_name, s0, ":cur_faction"),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_5", s0),
(try_end),
(str_store_faction_name, s0, "fac_outlaws"),
(overlay_add_item, "$g_presentation_obj_custom_battle_designer_5", s0),
(try_end),
(try_begin),
(eq, "$g_quick_battle_team_2_faction", "fac_outlaws"),
(store_sub, ":overlay_value", npc_kingdoms_end, npc_kingdoms_begin),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_5", ":overlay_value"),
(else_try),
(store_sub, ":team_2_faction", "$g_quick_battle_team_2_faction", npc_kingdoms_begin),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_5", ":team_2_faction"),
(try_end),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_army_composition", tf_center_justify),
(position_set_x, pos1, 175),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_text_overlay, reg0, "str_army_composition", tf_center_justify),
(position_set_x, pos1, 820),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", ":cur_y_adder"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_6_last_value", 0),
(eq, "$g_presentation_obj_custom_battle_designer_7_last_value", 0),
(eq, "$g_presentation_obj_custom_battle_designer_8_last_value", 0),
(eq, "$g_presentation_obj_custom_battle_designer_9_last_value", 0),
(eq, "$g_presentation_obj_custom_battle_designer_10_last_value", 0),
(eq, "$g_presentation_obj_custom_battle_designer_11_last_value", 0),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", 34),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", 33),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", 33),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", 34),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", 33),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", 33),
(assign, "$g_presentation_obj_custom_battle_designer_6_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_7_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_8_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_9_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_10_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_11_locked", 0),
(try_end),
(create_mesh_overlay, reg0, "mesh_cb_ui_icon_infantry"),
(position_set_x, pos1, 5),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 400),
(position_set_y, pos1, 400),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_cb_ui_icon_infantry"),
(position_set_x, pos1, 650),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 400),
(position_set_y, pos1, 400),
(overlay_set_size, reg0, pos1),
(create_slider_overlay, "$g_presentation_obj_custom_battle_designer_6", 0, 100),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_6", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 1000),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_6", pos1),
(position_set_x, pos1, 175),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_6", pos1),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_6_last_value"),
(create_text_overlay, "$g_presentation_obj_custom_battle_designer_12", "str_reg0_percent", 0),
(position_set_x, pos1, 295),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_12", pos1),
(create_slider_overlay, "$g_presentation_obj_custom_battle_designer_9", 0, 100),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_9", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 1000),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_9", pos1),
(position_set_x, pos1, 820),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_9", pos1),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_9_last_value"),
(create_text_overlay, "$g_presentation_obj_custom_battle_designer_15", "str_reg0_percent", 0),
(position_set_x, pos1, 940),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_15", pos1),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_mesh_overlay, reg0, "mesh_cb_ui_icon_archer"),
(position_set_x, pos1, 15),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 400),
(position_set_y, pos1, 400),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_cb_ui_icon_archer"),
(position_set_x, pos1, 660),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 400),
(position_set_y, pos1, 400),
(overlay_set_size, reg0, pos1),
(create_slider_overlay, "$g_presentation_obj_custom_battle_designer_7", 0, 100),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_7", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 1000),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_7", pos1),
(position_set_x, pos1, 175),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_7", pos1),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_7_last_value"),
(create_text_overlay, "$g_presentation_obj_custom_battle_designer_13", "str_reg0_percent", 0),
(position_set_x, pos1, 295),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_13", pos1),
(create_slider_overlay, "$g_presentation_obj_custom_battle_designer_10", 0, 100),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_10", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 1000),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_10", pos1),
(position_set_x, pos1, 820),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_10", pos1),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_10_last_value"),
(create_text_overlay, "$g_presentation_obj_custom_battle_designer_16", "str_reg0_percent", 0),
(position_set_x, pos1, 940),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_16", pos1),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_mesh_overlay, reg0, "mesh_cb_ui_icon_horseman"),
(position_set_x, pos1, 10),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 400),
(position_set_y, pos1, 400),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_cb_ui_icon_horseman"),
(position_set_x, pos1, 655),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 400),
(position_set_y, pos1, 400),
(overlay_set_size, reg0, pos1),
(create_slider_overlay, "$g_presentation_obj_custom_battle_designer_8", 0, 100),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_8", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 1000),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_8", pos1),
(position_set_x, pos1, 175),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_8", pos1),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_8_last_value"),
(create_text_overlay, "$g_presentation_obj_custom_battle_designer_14", "str_reg0_percent", 0),
(position_set_x, pos1, 295),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_14", pos1),
(create_slider_overlay, "$g_presentation_obj_custom_battle_designer_11", 0, 100),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_11", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 1000),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_11", pos1),
(position_set_x, pos1, 820),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_11", pos1),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_11_last_value"),
(create_text_overlay, "$g_presentation_obj_custom_battle_designer_17", "str_reg0_percent", 0),
(position_set_x, pos1, 940),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_17", pos1),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_army_size", tf_center_justify),
(position_set_x, pos1, 175),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_text_overlay, reg0, "str_army_size", tf_center_justify),
(position_set_x, pos1, 820),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", ":cur_y_adder"),
(try_begin),
(is_trial_version),
(val_min, "$g_quick_battle_army_1_size", 25),
(val_min, "$g_quick_battle_army_2_size", 25),
(try_end),
(create_slider_overlay, "$g_presentation_obj_custom_battle_designer_2", 0, 100),
(overlay_set_boundaries, "$g_presentation_obj_custom_battle_designer_2", 1000, 75000),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_2", "$g_quick_battle_army_1_size"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 1000),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_2", pos1),
(position_set_x, pos1, 135),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_2", pos1),
(call_script, "script_get_army_size_from_slider_value", "$g_quick_battle_army_1_size"),
(create_text_overlay, "$g_presentation_obj_custom_battle_designer_21", "str_reg0_men", 0),
(position_set_x, pos1, 255),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_21", pos1),
(create_slider_overlay, "$g_presentation_obj_custom_battle_designer_3", 200),
(overlay_set_boundaries, "$g_presentation_obj_custom_battle_designer_3", 1000, 75000),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_3", "$g_quick_battle_army_2_size"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 1000),
(overlay_set_size, "$g_presentation_obj_custom_battle_designer_3", pos1),
(position_set_x, pos1, 780),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_3", pos1),
(call_script, "script_get_army_size_from_slider_value", "$g_quick_battle_army_2_size"),
(create_text_overlay, "$g_presentation_obj_custom_battle_designer_22", "str_reg0_men", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_22", pos1),
(create_game_button_overlay, "$g_presentation_obj_custom_battle_designer_19", "str_start", 0),
(position_set_x, pos1, 415),
(position_set_y, pos1, 10),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_19", pos1),
(create_game_button_overlay, "$g_presentation_obj_custom_battle_designer_20", "str_back", 0),
(position_set_x, pos1, 585),
(position_set_y, pos1, 10),
(overlay_set_position, "$g_presentation_obj_custom_battle_designer_20", pos1),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":value"),
(try_begin),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_1"),
(try_begin),
(eq, "$g_quick_battle_game_type", 0),
(store_add, "$g_quick_battle_map", ":value", quick_battle_battle_scenes_begin),
(else_try),
(store_add, "$g_quick_battle_map", ":value", quick_battle_siege_scenes_begin),
(try_end),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_custom_battle_designer"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_23"),
(assign, "$g_quick_battle_game_type", ":value"),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_custom_battle_designer"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_24"),
(store_random_in_range, "$g_quick_battle_game_type", 0, 3),
(store_random_in_range, "$g_quick_battle_troop", quick_battle_troops_begin, quick_battle_troops_end),
(try_begin),
(is_trial_version),
(store_random_in_range, "$g_quick_battle_team_1_faction", 0, 2),
(try_begin),
(eq, "$g_quick_battle_team_1_faction", 0),
(assign, "$g_quick_battle_team_2_faction", 1),
(else_try),
(assign, "$g_quick_battle_team_2_faction", 0),
(try_end),
(val_add, "$g_quick_battle_team_1_faction", npc_kingdoms_begin),
(val_add, "$g_quick_battle_team_2_faction", npc_kingdoms_begin),
(store_random_in_range, "$g_quick_battle_army_1_size", 10, 16),
(store_random_in_range, ":random_army_size", 0, 6),
(val_add, "$g_quick_battle_army_1_size", ":random_army_size"),
(store_random_in_range, ":random_army_size", 0, 6),
(val_add, "$g_quick_battle_army_1_size", ":random_army_size"),
(else_try),
(store_sub, ":num_factions", npc_kingdoms_end, npc_kingdoms_begin),
(val_add, ":num_factions", 1),
(store_random_in_range, "$g_quick_battle_team_1_faction", 0, ":num_factions"),
(try_begin),
(eq, "$g_quick_battle_team_1_faction", 0),
(assign, "$g_quick_battle_team_1_faction", "fac_outlaws"),
(else_try),
(val_add, "$g_quick_battle_team_1_faction", npc_kingdoms_begin),
(val_sub, "$g_quick_battle_team_1_faction", 1),
(try_end),
(assign, ":end_cond", 1000),
(try_for_range, ":unused", 0, ":end_cond"),
(store_random_in_range, "$g_quick_battle_team_2_faction", 0, ":num_factions"),
(try_begin),
(eq, "$g_quick_battle_team_2_faction", 0),
(assign, "$g_quick_battle_team_2_faction", "fac_outlaws"),
(else_try),
(val_add, "$g_quick_battle_team_2_faction", npc_kingdoms_begin),
(val_sub, "$g_quick_battle_team_2_faction", 1),
(try_end),
(neq, "$g_quick_battle_team_1_faction", "$g_quick_battle_team_2_faction"),
(assign, ":end_cond", 0),
(try_end),
(store_random_in_range, "$g_quick_battle_army_1_size", 10, 21),
(store_random_in_range, ":random_army_size", 0, 11),
(val_add, "$g_quick_battle_army_1_size", ":random_army_size"),
(store_random_in_range, ":random_army_size", 0, 11),
(val_add, "$g_quick_battle_army_1_size", ":random_army_size"),
(try_end),
(assign, "$g_quick_battle_army_2_size", "$g_quick_battle_army_1_size"),
(try_begin),
(eq, "$g_quick_battle_game_type", 0), #battle
(store_random_in_range, "$g_quick_battle_map", quick_battle_battle_scenes_begin, quick_battle_battle_scenes_end),
(store_random_in_range, ":random_type", 0, 3),
(store_random_in_range, ":random_type_2", 0, 2),
(store_random_in_range, ":random_composition", 0, 100),
(store_sub, ":left_max", 100, ":random_composition"),
(store_random_in_range, ":random_composition_2", 0, ":left_max"),
(store_sub, ":random_composition_3", ":left_max", ":random_composition_2"),
(try_begin),
(eq, ":random_type", 0),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", ":random_composition"),
(try_begin),
(eq, ":random_type_2", 0),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", ":random_composition_3"),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", ":random_composition_3"),
(try_end),
(else_try),
(eq, ":random_type", 1),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", ":random_composition"),
(try_begin),
(eq, ":random_type_2", 0),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", ":random_composition_3"),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", ":random_composition_3"),
(try_end),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", ":random_composition"),
(try_begin),
(eq, ":random_type_2", 0),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", ":random_composition_3"),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", ":random_composition_3"),
(try_end),
(try_end),
(store_random_in_range, ":random_type", 0, 3),
(store_random_in_range, ":random_type_2", 0, 2),
(store_random_in_range, ":random_composition", 0, 100),
(store_sub, ":left_max", 100, ":random_composition"),
(store_random_in_range, ":random_composition_2", 0, ":left_max"),
(store_sub, ":random_composition_3", ":left_max", ":random_composition_2"),
(try_begin),
(eq, ":random_type", 0),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", ":random_composition"),
(try_begin),
(eq, ":random_type_2", 0),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", ":random_composition_3"),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", ":random_composition_3"),
(try_end),
(else_try),
(eq, ":random_type", 1),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", ":random_composition"),
(try_begin),
(eq, ":random_type_2", 0),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", ":random_composition_3"),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", ":random_composition_3"),
(try_end),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", ":random_composition"),
(try_begin),
(eq, ":random_type_2", 0),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", ":random_composition_3"),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", ":random_composition_2"),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", ":random_composition_3"),
(try_end),
(try_end),
(else_try),
(eq, "$g_quick_battle_game_type", 1), #siege offense
(store_random_in_range, "$g_quick_battle_map", quick_battle_siege_scenes_begin, quick_battle_siege_scenes_end),
#defender is enemy
(store_random_in_range, "$g_presentation_obj_custom_battle_designer_10_last_value", 30, 100), #min 30% archer
(store_sub, "$g_presentation_obj_custom_battle_designer_9_last_value", 100, "$g_presentation_obj_custom_battle_designer_10_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", 0), #no cavalry
(store_random_in_range, "$g_presentation_obj_custom_battle_designer_6_last_value", 20, 100), #min 20% infantry
(store_sub, "$g_presentation_obj_custom_battle_designer_7_last_value", 100, "$g_presentation_obj_custom_battle_designer_6_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", 0), #no cavalry
(else_try),
#siege defense
(store_random_in_range, "$g_quick_battle_map", quick_battle_siege_scenes_begin, quick_battle_siege_scenes_end),
#defender is player
(store_random_in_range, "$g_presentation_obj_custom_battle_designer_7_last_value", 30, 100), #min 30% archer
(store_sub, "$g_presentation_obj_custom_battle_designer_6_last_value", 100, "$g_presentation_obj_custom_battle_designer_7_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", 0), #no cavalry
(store_random_in_range, "$g_presentation_obj_custom_battle_designer_9_last_value", 20, 100), #min 20% infantry
(store_sub, "$g_presentation_obj_custom_battle_designer_10_last_value", 100, "$g_presentation_obj_custom_battle_designer_9_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", 0), #no cavalry
(try_end),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_custom_battle_designer"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_2"),
(assign, "$g_quick_battle_army_1_size", ":value"),
(try_begin),
(is_trial_version),
(gt, "$g_quick_battle_army_1_size", 25),
(assign, "$g_quick_battle_army_1_size", 25),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_2", 25),
(try_end),
(call_script, "script_get_army_size_from_slider_value", "$g_quick_battle_army_1_size"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_21", "str_reg0_men"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_3"),
(assign, "$g_quick_battle_army_2_size", ":value"),
(try_begin),
(is_trial_version),
(gt, "$g_quick_battle_army_2_size", 25),
(assign, "$g_quick_battle_army_2_size", 25),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_3", 25),
(try_end),
(call_script, "script_get_army_size_from_slider_value", "$g_quick_battle_army_2_size"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_22", "str_reg0_men"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_4"),
(try_begin),
(store_sub, ":outlaw_index", npc_kingdoms_end, npc_kingdoms_begin),
(eq, ":value", ":outlaw_index"),
(assign, "$g_quick_battle_team_1_faction", "fac_outlaws"),
(else_try),
(store_add, "$g_quick_battle_team_1_faction", ":value", npc_kingdoms_begin),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_5"),
(try_begin),
(store_sub, ":outlaw_index", npc_kingdoms_end, npc_kingdoms_begin),
(eq, ":value", ":outlaw_index"),
(assign, "$g_quick_battle_team_2_faction", "fac_outlaws"),
(else_try),
(store_add, "$g_quick_battle_team_2_faction", ":value", npc_kingdoms_begin),
(try_end),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_custom_battle_designer"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_18"),
(store_add, "$g_quick_battle_troop", ":value", quick_battle_troops_begin),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_custom_battle_designer"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_6"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_6_locked", 1),
(neq, ":value", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_6", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(else_try),
(try_begin),
(lt, ":value", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_6_last_value", ":value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_7_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_8_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", ":value"),
(val_add, "$g_presentation_obj_custom_battle_designer_7_last_value", ":first_dif"),
(val_add, "$g_presentation_obj_custom_battle_designer_8_last_value", ":second_dif"),
(try_begin),
(gt, "$g_presentation_obj_custom_battle_designer_7_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_7_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_8_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", 100),
(else_try),
(gt, "$g_presentation_obj_custom_battle_designer_8_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_8_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_7_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", 100),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_7", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_8", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(else_try),
(gt, ":value", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(store_sub, ":dif", ":value", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_7_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_8_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", ":value"),
(val_sub, "$g_presentation_obj_custom_battle_designer_7_last_value", ":first_dif"),
(val_sub, "$g_presentation_obj_custom_battle_designer_8_last_value", ":second_dif"),
(try_begin),
(lt, "$g_presentation_obj_custom_battle_designer_7_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_8_last_value", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", 0),
(else_try),
(lt, "$g_presentation_obj_custom_battle_designer_8_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_7_last_value", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", 0),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_7", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_8", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(try_end),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_6_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_12", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_7_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_13", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_8_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_14", "str_reg0_percent"),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_7"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_7_locked", 1),
(neq, ":value", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_7", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(else_try),
(try_begin),
(lt, ":value", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_7_last_value", ":value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_6_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_8_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", ":value"),
(val_add, "$g_presentation_obj_custom_battle_designer_6_last_value", ":first_dif"),
(val_add, "$g_presentation_obj_custom_battle_designer_8_last_value", ":second_dif"),
(try_begin),
(gt, "$g_presentation_obj_custom_battle_designer_6_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_6_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_8_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", 100),
(else_try),
(gt, "$g_presentation_obj_custom_battle_designer_8_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_8_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_6_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", 100),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_6", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_8", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(else_try),
(gt, ":value", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(store_sub, ":dif", ":value", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_6_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_8_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", ":value"),
(val_sub, "$g_presentation_obj_custom_battle_designer_6_last_value", ":first_dif"),
(val_sub, "$g_presentation_obj_custom_battle_designer_8_last_value", ":second_dif"),
(try_begin),
(lt, "$g_presentation_obj_custom_battle_designer_6_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_8_last_value", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", 0),
(else_try),
(lt, "$g_presentation_obj_custom_battle_designer_8_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_6_last_value", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", 0),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_6", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_8", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(try_end),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_6_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_12", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_7_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_13", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_8_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_14", "str_reg0_percent"),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_8"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_8_locked", 1),
(neq, ":value", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_8", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(else_try),
(try_begin),
(lt, ":value", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_8_last_value", ":value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_7_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_6_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", ":value"),
(val_add, "$g_presentation_obj_custom_battle_designer_7_last_value", ":first_dif"),
(val_add, "$g_presentation_obj_custom_battle_designer_6_last_value", ":second_dif"),
(try_begin),
(gt, "$g_presentation_obj_custom_battle_designer_7_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_7_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_6_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", 100),
(else_try),
(gt, "$g_presentation_obj_custom_battle_designer_6_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_6_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_7_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", 100),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_7", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_6", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(else_try),
(gt, ":value", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(store_sub, ":dif", ":value", "$g_presentation_obj_custom_battle_designer_8_last_value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_7_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_6_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_8_last_value", ":value"),
(val_sub, "$g_presentation_obj_custom_battle_designer_7_last_value", ":first_dif"),
(val_sub, "$g_presentation_obj_custom_battle_designer_6_last_value", ":second_dif"),
(try_begin),
(lt, "$g_presentation_obj_custom_battle_designer_7_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_6_last_value", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_7_last_value", 0),
(else_try),
(lt, "$g_presentation_obj_custom_battle_designer_6_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_7_last_value", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_6_last_value", 0),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_7", "$g_presentation_obj_custom_battle_designer_7_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_6", "$g_presentation_obj_custom_battle_designer_6_last_value"),
(try_end),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_6_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_12", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_7_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_13", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_8_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_14", "str_reg0_percent"),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_9"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_9_locked", 1),
(neq, ":value", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_9", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(else_try),
(try_begin),
(lt, ":value", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_9_last_value", ":value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_10_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_11_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", ":value"),
(val_add, "$g_presentation_obj_custom_battle_designer_10_last_value", ":first_dif"),
(val_add, "$g_presentation_obj_custom_battle_designer_11_last_value", ":second_dif"),
(try_begin),
(gt, "$g_presentation_obj_custom_battle_designer_10_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_10_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_11_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", 100),
(else_try),
(gt, "$g_presentation_obj_custom_battle_designer_11_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_11_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_10_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", 100),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_10", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_11", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(else_try),
(gt, ":value", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(store_sub, ":dif", ":value", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_10_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_11_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", ":value"),
(val_sub, "$g_presentation_obj_custom_battle_designer_10_last_value", ":first_dif"),
(val_sub, "$g_presentation_obj_custom_battle_designer_11_last_value", ":second_dif"),
(try_begin),
(lt, "$g_presentation_obj_custom_battle_designer_10_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_11_last_value", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", 0),
(else_try),
(lt, "$g_presentation_obj_custom_battle_designer_11_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_10_last_value", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", 0),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_10", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_11", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(try_end),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_9_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_15", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_10_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_16", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_11_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_17", "str_reg0_percent"),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_10"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_10_locked", 1),
(neq, ":value", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_10", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(else_try),
(try_begin),
(lt, ":value", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_10_last_value", ":value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_9_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_11_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", ":value"),
(val_add, "$g_presentation_obj_custom_battle_designer_9_last_value", ":first_dif"),
(val_add, "$g_presentation_obj_custom_battle_designer_11_last_value", ":second_dif"),
(try_begin),
(gt, "$g_presentation_obj_custom_battle_designer_9_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_9_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_11_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", 100),
(else_try),
(gt, "$g_presentation_obj_custom_battle_designer_11_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_11_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_9_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", 100),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_9", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_11", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(else_try),
(gt, ":value", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(store_sub, ":dif", ":value", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_9_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_11_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", ":value"),
(val_sub, "$g_presentation_obj_custom_battle_designer_9_last_value", ":first_dif"),
(val_sub, "$g_presentation_obj_custom_battle_designer_11_last_value", ":second_dif"),
(try_begin),
(lt, "$g_presentation_obj_custom_battle_designer_9_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_11_last_value", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", 0),
(else_try),
(lt, "$g_presentation_obj_custom_battle_designer_11_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_9_last_value", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", 0),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_9", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_11", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(try_end),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_9_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_15", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_10_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_16", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_11_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_17", "str_reg0_percent"),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_11"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_11_locked", 1),
(neq, ":value", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_11", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(else_try),
(try_begin),
(lt, ":value", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_11_last_value", ":value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_10_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_9_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", ":value"),
(val_add, "$g_presentation_obj_custom_battle_designer_10_last_value", ":first_dif"),
(val_add, "$g_presentation_obj_custom_battle_designer_9_last_value", ":second_dif"),
(try_begin),
(gt, "$g_presentation_obj_custom_battle_designer_10_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_10_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_9_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", 100),
(else_try),
(gt, "$g_presentation_obj_custom_battle_designer_9_last_value", 100),
(store_sub, ":dif", "$g_presentation_obj_custom_battle_designer_9_last_value", 100),
(val_add, "$g_presentation_obj_custom_battle_designer_10_last_value", ":dif"),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", 100),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_10", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_9", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(else_try),
(gt, ":value", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(store_sub, ":dif", ":value", "$g_presentation_obj_custom_battle_designer_11_last_value"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_10_locked", 1),
(assign, ":first_dif", 0),
(assign, ":second_dif", ":dif"),
(else_try),
(eq, "$g_presentation_obj_custom_battle_designer_9_locked", 1),
(assign, ":first_dif", ":dif"),
(assign, ":second_dif", 0),
(else_try),
(store_div, ":first_dif", ":dif", 2),
(store_sub, ":second_dif", ":dif", ":first_dif"),
(try_begin),
(neq, ":first_dif", ":second_dif"),
(store_random_in_range, ":random_no", 0, 2),
(eq, ":random_no", 0),
(val_sub, ":second_dif", 1),
(val_add, ":first_dif", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_custom_battle_designer_11_last_value", ":value"),
(val_sub, "$g_presentation_obj_custom_battle_designer_10_last_value", ":first_dif"),
(val_sub, "$g_presentation_obj_custom_battle_designer_9_last_value", ":second_dif"),
(try_begin),
(lt, "$g_presentation_obj_custom_battle_designer_10_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_9_last_value", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_10_last_value", 0),
(else_try),
(lt, "$g_presentation_obj_custom_battle_designer_9_last_value", 0),
(val_add, "$g_presentation_obj_custom_battle_designer_10_last_value", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(assign, "$g_presentation_obj_custom_battle_designer_9_last_value", 0),
(try_end),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_10", "$g_presentation_obj_custom_battle_designer_10_last_value"),
(overlay_set_val, "$g_presentation_obj_custom_battle_designer_9", "$g_presentation_obj_custom_battle_designer_9_last_value"),
(try_end),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_9_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_15", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_10_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_16", "str_reg0_percent"),
(assign, reg0, "$g_presentation_obj_custom_battle_designer_11_last_value"),
(overlay_set_text, "$g_presentation_obj_custom_battle_designer_17", "str_reg0_percent"),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_19"),
(assign, "$g_is_quick_battle", 1),
(assign, ":cur_scene", "$g_quick_battle_map"),
(try_begin),
(eq, "$g_quick_battle_game_type", 0), #battle
(assign, ":cur_mission_template", "mt_quick_battle_battle"),
(modify_visitors_at_site, ":cur_scene"),
(call_script, "script_spawn_quick_battle_army", 0, "$g_quick_battle_team_1_faction", "$g_presentation_obj_custom_battle_designer_6_last_value", "$g_presentation_obj_custom_battle_designer_7_last_value", "$g_presentation_obj_custom_battle_designer_8_last_value", 0, 1),
(call_script, "script_spawn_quick_battle_army", 16, "$g_quick_battle_team_2_faction", "$g_presentation_obj_custom_battle_designer_9_last_value", "$g_presentation_obj_custom_battle_designer_10_last_value", "$g_presentation_obj_custom_battle_designer_11_last_value", 0, 0),
(else_try),
(eq, "$g_quick_battle_game_type", 1), #siege offense
(assign, ":cur_mission_template", "mt_quick_battle_siege"),
(modify_visitors_at_site, ":cur_scene"),
(call_script, "script_spawn_quick_battle_army", 16, "$g_quick_battle_team_1_faction", "$g_presentation_obj_custom_battle_designer_6_last_value", "$g_presentation_obj_custom_battle_designer_7_last_value", "$g_presentation_obj_custom_battle_designer_8_last_value", 0, 1),
(call_script, "script_spawn_quick_battle_army", 0, "$g_quick_battle_team_2_faction", "$g_presentation_obj_custom_battle_designer_9_last_value", "$g_presentation_obj_custom_battle_designer_10_last_value", "$g_presentation_obj_custom_battle_designer_11_last_value", 1, 0),
(else_try),
#siege defense
(assign, ":cur_mission_template", "mt_quick_battle_siege"),
(modify_visitors_at_site, ":cur_scene"),
(call_script, "script_spawn_quick_battle_army", 0, "$g_quick_battle_team_1_faction", "$g_presentation_obj_custom_battle_designer_6_last_value", "$g_presentation_obj_custom_battle_designer_7_last_value", "$g_presentation_obj_custom_battle_designer_8_last_value", 1, 1),
(call_script, "script_spawn_quick_battle_army", 16, "$g_quick_battle_team_2_faction", "$g_presentation_obj_custom_battle_designer_9_last_value", "$g_presentation_obj_custom_battle_designer_10_last_value", "$g_presentation_obj_custom_battle_designer_11_last_value", 0, 0),
(try_end),
(set_jump_mission,":cur_mission_template"),
(jump_to_menu, "mnu_custom_battle_end"),
(jump_to_scene, ":cur_scene"),
(change_screen_mission),
(presentation_set_duration, 0),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_20"),
(presentation_set_duration, 0),
(try_end),
]),
(ti_on_presentation_mouse_enter_leave,
[
(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":enter_leave"),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_battle_designer_6"),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_battle_designer_7"),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_battle_designer_8"),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_battle_designer_9"),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_battle_designer_10"),
(eq, ":object", "$g_presentation_obj_custom_battle_designer_11"),
(try_begin),
(eq, ":enter_leave", 1),
(try_begin),
(eq, ":object", "$g_presentation_obj_custom_battle_last_mouse_over_object"),
(assign, "$g_presentation_obj_custom_battle_last_mouse_over_object", -1),
(try_end),
(else_try),
(assign, "$g_presentation_obj_custom_battle_last_mouse_over_object", ":object"),
(try_end),
]),
(ti_on_presentation_run,
[
(try_begin),
(key_clicked, key_escape),
(presentation_set_duration, 0),
(else_try),
(key_clicked, key_right_mouse_button),
(neq, "$g_presentation_obj_custom_battle_last_mouse_over_object", -1),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_last_mouse_over_object", "$g_presentation_obj_custom_battle_designer_6"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_6_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_6_locked", 1),
(assign, "$g_presentation_obj_custom_battle_designer_7_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_8_locked", 0),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_6_locked", 0),
(try_end),
(else_try),
(eq, "$g_presentation_obj_custom_battle_last_mouse_over_object", "$g_presentation_obj_custom_battle_designer_7"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_7_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_6_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_7_locked", 1),
(assign, "$g_presentation_obj_custom_battle_designer_8_locked", 0),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_7_locked", 0),
(try_end),
(else_try),
(eq, "$g_presentation_obj_custom_battle_last_mouse_over_object", "$g_presentation_obj_custom_battle_designer_8"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_8_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_6_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_7_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_8_locked", 1),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_8_locked", 0),
(try_end),
(else_try),
(eq, "$g_presentation_obj_custom_battle_last_mouse_over_object", "$g_presentation_obj_custom_battle_designer_9"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_9_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_9_locked", 1),
(assign, "$g_presentation_obj_custom_battle_designer_10_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_11_locked", 0),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_9_locked", 0),
(try_end),
(else_try),
(eq, "$g_presentation_obj_custom_battle_last_mouse_over_object", "$g_presentation_obj_custom_battle_designer_10"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_10_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_9_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_10_locked", 1),
(assign, "$g_presentation_obj_custom_battle_designer_11_locked", 0),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_10_locked", 0),
(try_end),
(else_try),
(eq, "$g_presentation_obj_custom_battle_last_mouse_over_object", "$g_presentation_obj_custom_battle_designer_11"),
(try_begin),
(eq, "$g_presentation_obj_custom_battle_designer_11_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_9_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_10_locked", 0),
(assign, "$g_presentation_obj_custom_battle_designer_11_locked", 1),
(else_try),
(assign, "$g_presentation_obj_custom_battle_designer_11_locked", 0),
(try_end),
(try_end),
(try_end),
]),
]),
("game_multiplayer_admin_panel", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(try_begin),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_1"),
(assign, ":map_image", "mesh_mp_ui_host_maps_1"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_2"),
(assign, ":map_image", "mesh_mp_ui_host_maps_2"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_3"),
(assign, ":map_image", "mesh_mp_ui_host_maps_3"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_4"),
(assign, ":map_image", "mesh_mp_ui_host_maps_4"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_5"),
(assign, ":map_image", "mesh_mp_ui_host_maps_5"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_6"),
(assign, ":map_image", "mesh_mp_ui_host_maps_6"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_7"),
(assign, ":map_image", "mesh_mp_ui_host_maps_7"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_8"),
(assign, ":map_image", "mesh_mp_ui_host_maps_8"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_9"),
(assign, ":map_image", "mesh_mp_ui_host_maps_9"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_10"),
(assign, ":map_image", "mesh_mp_ui_host_maps_10"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_11"),
(assign, ":map_image", "mesh_mp_ui_host_maps_11"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_12"),
(assign, ":map_image", "mesh_mp_ui_host_maps_12"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_13"),
(assign, ":map_image", "mesh_mp_ui_host_maps_13"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_14"),
(assign, ":map_image", "mesh_mp_ui_host_maps_14"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_15"),
(assign, ":map_image", "mesh_mp_ui_host_maps_15"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_16"),
(assign, ":map_image", "mesh_mp_ui_host_maps_16"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_17"),
(assign, ":map_image", "mesh_mp_ui_host_maps_17"),
(else_try),
(eq, "$g_multiplayer_selected_map", "scn_multi_scene_18"),
(assign, ":map_image", "mesh_mp_ui_host_maps_18"),
(else_try),
(this_or_next|eq, "$g_multiplayer_selected_map", "scn_random_multi_plain_medium"),
(eq, "$g_multiplayer_selected_map", "scn_random_multi_plain_large"),
(assign, ":map_image", "mesh_mp_ui_host_maps_randomp"),
(else_try),
(this_or_next|eq, "$g_multiplayer_selected_map", "scn_random_multi_steppe_medium"),
(eq, "$g_multiplayer_selected_map", "scn_random_multi_steppe_large"),
(assign, ":map_image", "mesh_mp_ui_host_maps_randoms"),
(else_try),
(assign, ":map_image", "mesh_mp_ui_host_maps_randomp"),
(try_end),
(create_mesh_overlay, reg0, ":map_image"),
(position_set_x, pos1, -1),
(position_set_y, pos1, 550),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1002),
(position_set_y, pos1, 1002),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_mp_ui_host_main"),
(position_set_x, pos1, -1),
(position_set_y, pos1, -1),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1002),
(position_set_y, pos1, 1002),
(overlay_set_size, reg0, pos1),
(assign, ":cur_y", 1240),
(assign, ":cur_y_adder", 40),
(try_begin),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_team_deathmatch),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_capture_the_flag),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(val_add, ":cur_y", ":cur_y_adder"), #two more options for these mods (friendly fire options)
(val_add, ":cur_y", ":cur_y_adder"),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_capture_the_flag),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(val_add, ":cur_y", ":cur_y_adder"), #one more option for these mods
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(val_add, ":cur_y", ":cur_y_adder"), #one more option for these mods
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(val_add, ":cur_y", ":cur_y_adder"), #one more option for these mods
(try_end),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_admin_panel_container", s0, tf_scrollable),
(position_set_x, pos1, 59),
(position_set_y, pos1, 50),
(overlay_set_position, "$g_presentation_obj_admin_panel_container", pos1),
(position_set_x, pos1, 640),
(position_set_y, pos1, 520),
(overlay_set_area_size, "$g_presentation_obj_admin_panel_container", pos1),
(set_container_overlay, "$g_presentation_obj_admin_panel_container"),
(create_text_overlay, reg0, "str_add_to_official_game_servers_list", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_14", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_14", pos1),
(server_get_add_to_game_servers_list, ":add_to_servers_list"),
(overlay_set_val, "$g_presentation_obj_admin_panel_14", ":add_to_servers_list"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_enable_valve_anti_cheat", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_41", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_41", pos1),
(server_get_anti_cheat, ":server_anti_cheat"),
(overlay_set_val, "$g_presentation_obj_admin_panel_41", ":server_anti_cheat"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_server_name", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(str_store_server_name, s0),
(try_begin),
(eq, "$g_multiplayer_renaming_server_allowed", 1),
(create_simple_text_box_overlay, "$g_presentation_obj_admin_panel_20"),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_20", pos1),
(overlay_set_text, "$g_presentation_obj_admin_panel_20", s0),
(else_try),
(assign, "$g_presentation_obj_admin_panel_20", -1),
(create_text_overlay, reg0, s0, 0),
(position_set_x, pos1, 385),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(try_end),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_game_password", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_simple_text_box_overlay, "$g_presentation_obj_admin_panel_9"),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_9", pos1),
(str_store_server_password, s0),
(overlay_set_text, "$g_presentation_obj_admin_panel_9", s0),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_welcome_message", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_simple_text_box_overlay, "$g_presentation_obj_admin_panel_32"),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_32", pos1),
(str_store_welcome_message, s0),
(overlay_set_text, "$g_presentation_obj_admin_panel_32", s0),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_map", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(call_script, "script_multiplayer_fill_map_game_types", "$g_multiplayer_game_type"),
(assign, ":num_maps", reg0),
(assign, ":selected_index", 0),
(try_begin),
(gt, ":num_maps", 12),
(create_combo_label_overlay, "$g_presentation_obj_admin_panel_1"),
(else_try),
(create_combo_button_overlay, "$g_presentation_obj_admin_panel_1"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_admin_panel_1", pos1),
(try_begin),
(gt, ":num_maps", 14),
(position_set_x, pos1, 465),
(else_try),
(position_set_x, pos1, 490),
(try_end),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_1", pos1),
(troop_get_slot, ":first_map", "trp_multiplayer_data", multi_data_maps_for_game_type_begin),
(assign, ":selected_map_available", 0),
(try_for_range, ":i_map", 0, ":num_maps"),
(store_add, ":map_slot", ":i_map", multi_data_maps_for_game_type_begin),
(troop_get_slot, ":map_no", "trp_multiplayer_data", ":map_slot"),
(store_sub, ":string_index", ":map_no", multiplayer_scenes_begin),
(val_add, ":string_index", multiplayer_scene_names_begin),
(str_store_string, s0, ":string_index"),
(overlay_add_item, "$g_presentation_obj_admin_panel_1", s0),
(try_begin),
(eq, ":map_no", "$g_multiplayer_selected_map"),
(assign, ":selected_index", ":i_map"),
(assign, ":selected_map_available", 1),
(try_end),
(try_end),
(overlay_set_val, "$g_presentation_obj_admin_panel_1", ":selected_index"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_game_type", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(try_begin),
(eq, "$g_multiplayer_changing_game_type_allowed", 1),
(create_combo_button_overlay, "$g_presentation_obj_admin_panel_10"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_admin_panel_10", pos1),
(position_set_x, pos1, 490),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_10", pos1),
(try_for_range, ":i_game_type", 0, multiplayer_num_game_types),
(store_add, ":string_index", ":i_game_type", multiplayer_game_type_names_begin),
(str_store_string, s0, ":string_index"),
(overlay_add_item, "$g_presentation_obj_admin_panel_10", s0),
(try_end),
(overlay_set_val, "$g_presentation_obj_admin_panel_10", "$g_multiplayer_game_type"),
(else_try),
(assign, "$g_presentation_obj_admin_panel_10", -1),
(store_add, ":string_index", "$g_multiplayer_game_type", multiplayer_game_type_names_begin),
(str_store_string, s0, ":string_index"),
(create_text_overlay, reg0, s0, 0),
(position_set_x, pos1, 385),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(try_end),
(val_sub, ":cur_y", ":cur_y_adder"),
(assign, reg1, 1),
(create_text_overlay, reg0, "str_team_reg1_faction", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_combo_button_overlay, "$g_presentation_obj_admin_panel_11"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_admin_panel_11", pos1),
(position_set_x, pos1, 490),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_11", pos1),
(call_script, "script_multiplayer_fill_available_factions_combo_button", "$g_presentation_obj_admin_panel_11", "$g_multiplayer_next_team_1_faction", "$g_multiplayer_next_team_2_faction"),
(val_sub, ":cur_y", ":cur_y_adder"),
(assign, reg1, 2),
(create_text_overlay, reg0, "str_team_reg1_faction", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_combo_button_overlay, "$g_presentation_obj_admin_panel_12"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_admin_panel_12", pos1),
(position_set_x, pos1, 490),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_12", pos1),
(call_script, "script_multiplayer_fill_available_factions_combo_button", "$g_presentation_obj_admin_panel_12", "$g_multiplayer_next_team_2_faction", "$g_multiplayer_next_team_1_faction"),
(val_sub, ":cur_y", ":cur_y_adder"),
(assign, reg1, 1),
(create_text_overlay, reg0, "str_max_number_of_players", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_21", 2, 65),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_21", pos1),
(server_get_max_num_players, ":max_players"),
(overlay_set_val, "$g_presentation_obj_admin_panel_21", ":max_players"),
(val_sub, ":cur_y", ":cur_y_adder"),
(assign, reg1, 1),
(create_text_overlay, reg0, "str_number_of_bots_in_team_reg1", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_3", 0, "$g_multiplayer_max_num_bots"),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_3", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_3", "$g_multiplayer_num_bots_team_1"),
(val_sub, ":cur_y", ":cur_y_adder"),
(assign, reg1, 2),
(create_text_overlay, reg0, "str_number_of_bots_in_team_reg1", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_4", 0, "$g_multiplayer_max_num_bots"),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_4", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_4", "$g_multiplayer_num_bots_team_2"),
(try_begin),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_duel),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_allow_friendly_fire", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_5", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_5", pos1),
(server_get_friendly_fire, ":server_friendly_fire"),
(overlay_set_val, "$g_presentation_obj_admin_panel_5", ":server_friendly_fire"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_allow_melee_friendly_fire", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_36", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_36", pos1),
(server_get_melee_friendly_fire, ":melee_friendly_fire"),
(overlay_set_val, "$g_presentation_obj_admin_panel_36", ":melee_friendly_fire"),
(try_end),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_friendly_fire_damage_self_ratio", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_37", 0, 101),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_37", pos1),
(server_get_friendly_fire_damage_self_ratio, ":friendly_fire_damage_self_ratio"),
(overlay_set_val, "$g_presentation_obj_admin_panel_37", ":friendly_fire_damage_self_ratio"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_friendly_fire_damage_friend_ratio", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_38", 0, 101),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_38", pos1),
(server_get_friendly_fire_damage_friend_ratio, ":friendly_fire_damage_friend_ratio"),
(overlay_set_val, "$g_presentation_obj_admin_panel_38", ":friendly_fire_damage_friend_ratio"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_spectator_camera", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_combo_button_overlay, "$g_presentation_obj_admin_panel_19"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_admin_panel_19", pos1),
(position_set_x, pos1, 490),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_19", pos1),
(overlay_add_item, "$g_presentation_obj_admin_panel_19", "str_free"),
(overlay_add_item, "$g_presentation_obj_admin_panel_19", "str_stick_to_any_player"),
(overlay_add_item, "$g_presentation_obj_admin_panel_19", "str_stick_to_team_members"),
(overlay_add_item, "$g_presentation_obj_admin_panel_19", "str_stick_to_team_members_view"),
(server_get_ghost_mode, ":server_ghost_mode"),
(overlay_set_val, "$g_presentation_obj_admin_panel_19", ":server_ghost_mode"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_control_block_direction", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_combo_button_overlay, "$g_presentation_obj_admin_panel_15"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_admin_panel_15", pos1),
(position_set_x, pos1, 490),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_15", pos1),
(overlay_add_item, "$g_presentation_obj_admin_panel_15", "str_automatic"),
(overlay_add_item, "$g_presentation_obj_admin_panel_15", "str_by_mouse_movement"),
(server_get_control_block_dir, ":server_control_block_dir"),
(overlay_set_val, "$g_presentation_obj_admin_panel_15", ":server_control_block_dir"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_combat_speed", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_combo_button_overlay, "$g_presentation_obj_admin_panel_26"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_admin_panel_26", pos1),
(position_set_x, pos1, 490),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_26", pos1),
(overlay_add_item, "$g_presentation_obj_admin_panel_26", "str_combat_speed_0"),
(overlay_add_item, "$g_presentation_obj_admin_panel_26", "str_combat_speed_1"),
(overlay_add_item, "$g_presentation_obj_admin_panel_26", "str_combat_speed_2"),
(overlay_add_item, "$g_presentation_obj_admin_panel_26", "str_combat_speed_3"),
(overlay_add_item, "$g_presentation_obj_admin_panel_26", "str_combat_speed_4"),
(server_get_combat_speed, ":server_combat_speed"),
(overlay_set_val, "$g_presentation_obj_admin_panel_26", ":server_combat_speed"),
(try_begin),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_map_time_limit", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_7", 5, 121),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_7", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_7", "$g_multiplayer_game_max_minutes"),
(else_try),
(assign, "$g_presentation_obj_admin_panel_7", -1),
(try_end),
(try_begin),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_round_time_limit", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_16", multiplayer_round_max_seconds_min, multiplayer_round_max_seconds_max),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_16", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_16", "$g_multiplayer_round_max_seconds"),
(else_try),
(assign, "$g_presentation_obj_admin_panel_16", -1),
(try_end),
(try_begin),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_players_take_control_of_a_bot_after_death", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_25", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_25", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_25", "$g_multiplayer_player_respawn_as_bot"),
(else_try),
(assign, "$g_presentation_obj_admin_panel_25", -1),
(try_end),
(try_begin),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_defender_spawn_count_limit", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_combo_button_overlay, "$g_presentation_obj_admin_panel_27"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_admin_panel_27", pos1),
(position_set_x, pos1, 490),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_27", pos1),
(assign, reg0, 5),
(overlay_add_item, "$g_presentation_obj_admin_panel_27", "str_reg0"),
(assign, reg0, 4),
(overlay_add_item, "$g_presentation_obj_admin_panel_27", "str_reg0"),
(assign, reg0, 3),
(overlay_add_item, "$g_presentation_obj_admin_panel_27", "str_reg0"),
(assign, reg0, 2),
(overlay_add_item, "$g_presentation_obj_admin_panel_27", "str_reg0"),
(assign, reg0, 1),
(overlay_add_item, "$g_presentation_obj_admin_panel_27", "str_reg0"),
(overlay_add_item, "$g_presentation_obj_admin_panel_27", "str_unlimited"),
(store_sub, ":value_to_set", 5, "$g_multiplayer_number_of_respawn_count"),
(overlay_set_val, "$g_presentation_obj_admin_panel_27", ":value_to_set"),
#(val_sub, ":cur_y", ":cur_y_adder"),
(else_try),
(assign, "$g_presentation_obj_admin_panel_27", -1),
(try_end),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_team_points_limit", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_8", 3, 1001),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_8", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_8", "$g_multiplayer_game_max_points"),
(try_begin),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_point_gained_from_flags", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_17", 25, 401),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_17", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_17", "$g_multiplayer_point_gained_from_flags"),
(else_try),
(assign, "$g_presentation_obj_admin_panel_17", -1),
(try_end),
(try_begin),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_capture_the_flag),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_point_gained_from_capturing_flag", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_18", 0, 11),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_18", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_18", "$g_multiplayer_point_gained_from_capturing_flag"),
(else_try),
(assign, "$g_presentation_obj_admin_panel_18", -1),
(try_end),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_respawn_period", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_6", multiplayer_respawn_period_min, multiplayer_respawn_period_max),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_6", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_6", "$g_multiplayer_respawn_period"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_initial_gold_multiplier", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_33", 0, 1001),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_33", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_33", "$g_multiplayer_initial_gold_multiplier"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_battle_earnings_multiplier", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_34", 0, 1001),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_34", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_34", "$g_multiplayer_battle_earnings_multiplier"),
(try_begin),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_round_earnings_multiplier", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_35", 0, 1001),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_35", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_35", "$g_multiplayer_round_earnings_multiplier"),
(else_try),
(assign, "$g_presentation_obj_admin_panel_35", -1),
(try_end),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_make_kick_voteable", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_28", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_28", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_28", "$g_multiplayer_kick_voteable"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_make_ban_voteable", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_29", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_29", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_29", "$g_multiplayer_ban_voteable"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_make_maps_voteable", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_24", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_24", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_24", "$g_multiplayer_maps_voteable"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_make_factions_voteable", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_23", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_23", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_23", "$g_multiplayer_factions_voteable"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_bots_upper_limit_for_votes", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(assign, ":upper_limit", 51),
(val_min, ":upper_limit", "$g_multiplayer_max_num_bots"),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_22", 0, ":upper_limit"),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_22", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_22", "$g_multiplayer_num_bots_voteable"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_valid_vote_ratio", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_number_box_overlay, "$g_presentation_obj_admin_panel_30", 50, 101),
(position_set_x, pos1, 390),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_30", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_30", "$g_multiplayer_valid_vote_ratio"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_auto_team_balance_limit", 0),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_combo_button_overlay, "$g_presentation_obj_admin_panel_31"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_admin_panel_31", pos1),
(position_set_x, pos1, 490),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_31", pos1),
(overlay_add_item, "$g_presentation_obj_admin_panel_31", "str_unlimited"),
(assign, reg0, 6),
(overlay_add_item, "$g_presentation_obj_admin_panel_31", "str_reg0"),
(assign, reg0, 5),
(overlay_add_item, "$g_presentation_obj_admin_panel_31", "str_reg0"),
(assign, reg0, 4),
(overlay_add_item, "$g_presentation_obj_admin_panel_31", "str_reg0"),
(assign, reg0, 3),
(overlay_add_item, "$g_presentation_obj_admin_panel_31", "str_reg0"),
(assign, reg0, 2),
(overlay_add_item, "$g_presentation_obj_admin_panel_31", "str_reg0"),
(try_begin),
(ge, "$g_multiplayer_auto_team_balance_limit", 1000),
(overlay_set_val, "$g_presentation_obj_admin_panel_31", 0),
(else_try),
(store_sub, ":set_value", 7, "$g_multiplayer_auto_team_balance_limit"),
(overlay_set_val, "$g_presentation_obj_admin_panel_31", ":set_value"),
(try_end),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_allow_player_banners", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_39", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_39", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_39", "$g_multiplayer_allow_player_banners"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_disallow_ranged_weapons", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_42", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_42", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_42", "$g_multiplayer_disallow_ranged_weapons"),
(val_sub, ":cur_y", ":cur_y_adder"),
(create_text_overlay, reg0, "str_force_default_armor", 0),
(position_set_x, pos1, 30),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(create_check_box_overlay, "$g_presentation_obj_admin_panel_40", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 7),
(store_add, ":special_cur_y", ":cur_y", 7),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, "$g_presentation_obj_admin_panel_40", pos1),
(overlay_set_val, "$g_presentation_obj_admin_panel_40", "$g_multiplayer_force_default_armor"),
(set_container_overlay, -1),
(create_button_overlay, "$g_presentation_obj_admin_panel_13", "str_back", tf_center_justify),
(position_set_x, pos1, 825),
(position_set_y, pos1, 50),
(overlay_set_position, "$g_presentation_obj_admin_panel_13", pos1),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, "$g_presentation_obj_admin_panel_13", pos1),
(create_button_overlay, "$g_presentation_obj_admin_panel_2", "str_start_map", tf_center_justify),
(position_set_x, pos1, 825),
(position_set_y, pos1, 90),
(overlay_set_position, "$g_presentation_obj_admin_panel_2", pos1),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, "$g_presentation_obj_admin_panel_2", pos1),
(presentation_set_duration, 999999),
(try_begin),
(eq, ":selected_map_available", 0),
(assign, "$g_multiplayer_selected_map", ":first_map"),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_multiplayer_admin_panel"),
(try_end),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":value"),
(try_begin),
(eq, ":object", "$g_presentation_obj_admin_panel_1"),
(store_add, ":slot_no", ":value", multi_data_maps_for_game_type_begin),
(troop_get_slot, "$g_multiplayer_selected_map", "trp_multiplayer_data", ":slot_no"),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_multiplayer_admin_panel"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_2"),
(multiplayer_send_2_int_to_server, multiplayer_event_admin_start_map, "$g_multiplayer_selected_map", "$g_multiplayer_game_type"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_3"),
(multiplayer_send_2_int_to_server, multiplayer_event_admin_set_num_bots_in_team, 1, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_4"),
(multiplayer_send_2_int_to_server, multiplayer_event_admin_set_num_bots_in_team, 2, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_5"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_friendly_fire, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_6"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_respawn_period, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_7"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_game_max_minutes, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_8"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_game_max_points, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_9"),
(multiplayer_send_string_to_server, multiplayer_event_admin_set_game_password, s0),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_10"),
(assign, "$g_multiplayer_game_type", ":value"),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_multiplayer_admin_panel"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_11"),
(store_add, "$g_multiplayer_next_team_1_faction", ":value", npc_kingdoms_begin),
## (try_begin),
## (ge, "$g_multiplayer_next_team_1_faction", "$g_multiplayer_next_team_2_faction"),
## (val_add, "$g_multiplayer_next_team_1_faction", 1),
## (try_end),
(multiplayer_send_2_int_to_server, multiplayer_event_admin_set_team_faction, 1, "$g_multiplayer_next_team_1_faction"),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_multiplayer_admin_panel"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_12"),
(store_add, "$g_multiplayer_next_team_2_faction", ":value", npc_kingdoms_begin),
## (try_begin),
## (ge, "$g_multiplayer_next_team_2_faction", "$g_multiplayer_next_team_1_faction"),
## (val_add, "$g_multiplayer_next_team_2_faction", 1),
## (try_end),
(multiplayer_send_2_int_to_server, multiplayer_event_admin_set_team_faction, 2, "$g_multiplayer_next_team_2_faction"),
(presentation_set_duration, 0),
(start_presentation, "prsnt_game_multiplayer_admin_panel"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_13"),
(presentation_set_duration, 0),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_14"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_add_to_servers_list, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_15"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_control_block_dir, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_16"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_round_max_seconds, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_17"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_point_gained_from_flags, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_18"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_point_gained_from_capturing_flag, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_19"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_ghost_mode, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_20"),
(multiplayer_send_string_to_server, multiplayer_event_admin_set_server_name, s0),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_21"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_max_num_players, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_22"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_num_bots_voteable, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_23"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_factions_voteable, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_24"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_maps_voteable, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_25"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_player_respawn_as_bot, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_26"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_combat_speed, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_27"),
(store_sub, ":value_to_send", 5, ":value"), #opposite index of displayed list
(multiplayer_send_int_to_server, multiplayer_event_admin_set_respawn_count, ":value_to_send"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_28"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_kick_voteable, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_29"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_ban_voteable, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_30"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_valid_vote_ratio, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_31"),
(try_begin),
(eq, ":value", 0),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_auto_team_balance_limit, 1000),
(else_try),
(store_sub, ":value_to_send", 7, ":value"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_auto_team_balance_limit, ":value_to_send"),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_32"),
(server_set_welcome_message, s0),
(multiplayer_send_string_to_server, multiplayer_event_admin_set_welcome_message, s0),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_33"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_initial_gold_multiplier, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_34"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_battle_earnings_multiplier, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_35"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_round_earnings_multiplier, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_36"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_melee_friendly_fire, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_37"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_friendly_fire_damage_self_ratio, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_38"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_friendly_fire_damage_friend_ratio, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_39"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_allow_player_banners, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_40"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_force_default_armor, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_41"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_anti_cheat, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_admin_panel_42"),
(multiplayer_send_int_to_server, multiplayer_event_admin_set_disallow_ranged_weapons, ":value"),
(try_end),
]),
(ti_on_presentation_run,
[
(try_begin),
(key_clicked, key_escape),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_welcome_message", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(str_store_welcome_message, s0),
(try_begin),
(neg|str_is_empty, s0),
(eq, "$g_multiplayer_welcome_message_shown", 0),
(create_mesh_overlay, reg0, "mesh_mp_ui_welcome_panel"),
(position_set_x, pos1, 200),
(position_set_y, pos1, 400),
(overlay_set_position, reg0, pos1),
(create_text_overlay, reg0, s0, tf_scrollable),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 230),
(position_set_y, pos1, 425),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 540),
(position_set_y, pos1, 150),
(overlay_set_area_size, reg0, pos1),
(presentation_set_duration, 999999),
(else_try),
(eq, "$g_multiplayer_show_server_rules", 1),
(create_mesh_overlay, reg0, "mesh_mp_ui_welcome_panel"),
(position_set_x, pos1, 200),
(position_set_y, pos1, 400),
(overlay_set_position, reg0, pos1),
(try_begin),
(neg|str_is_empty, s0),
(str_clear, s3),
(str_store_string, s2, s0),
(str_store_string, s2, "str_s2_s3"),
(str_store_string, s2, "str_s2_s3"),
(else_try),
(str_clear, s2),
(try_end),
(str_store_string, s3, "@Game Rules:^"),
(str_store_string, s2, "str_s2_s3"),
(assign, ":end_cond", 1000),
(call_script, "script_game_multiplayer_get_game_type_mission_template", "$g_multiplayer_game_type"),
(assign, ":cur_mt", reg0),
(str_store_server_name, s0),
(str_store_string, s3, "str_server_name_s0"),
(str_store_string, s2, "str_s2_s3"),
(try_begin),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch),
(str_store_string, s0, "str_multi_game_type_1"),
(else_try),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_team_deathmatch),
(str_store_string, s0, "str_multi_game_type_2"),
(else_try),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(str_store_string, s0, "str_multi_game_type_3"),
(else_try),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(str_store_string, s0, "str_multi_game_type_4"),
(else_try),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_capture_the_flag),
(str_store_string, s0, "str_multi_game_type_5"),
(else_try),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(str_store_string, s0, "str_multi_game_type_6"),
(else_try),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(str_store_string, s0, "str_multi_game_type_7"),
(else_try),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_duel),
(str_store_string, s0, "str_multi_game_type_8"),
(try_end),
(str_store_string, s3, "str_game_type_s0"),
(str_store_string, s2, "str_s2_s3"),
(store_current_scene, ":cur_scene"),
(val_sub, ":cur_scene", "scn_multi_scene_1"),
(val_add, ":cur_scene", "str_multi_scene_1"),
(str_store_string, s0, ":cur_scene"),
(str_store_string, s3, "str_map_name_s0"),
(str_store_string, s2, "str_s2_s3"),
(store_mission_timer_a, ":mission_timer"),
(val_add, ":mission_timer", "$server_mission_timer_while_player_joined"),
(assign, reg0, ":mission_timer"),
(store_mul, "$g_multiplayer_game_max_seconds", "$g_multiplayer_game_max_minutes", 60),
(store_sub, ":remaining_seconds", "$g_multiplayer_game_max_seconds", ":mission_timer"),
(store_div, reg0, ":remaining_seconds", 60),
(store_mod, reg1, ":remaining_seconds", 60),
(try_begin),
(ge, reg0, 10),
(ge, reg1, 10),
(str_clear, s0),
(str_clear, s1),
(else_try),
(ge, reg0, 10),
(str_clear, s0),
(str_store_string, s1, "@0"),
(else_try),
(ge, reg1, 10),
(str_store_string, s0, "@0"),
(str_clear, s1),
(else_try),
(str_store_string, s0, "@0"),
(str_store_string, s1, "@0"),
(try_end),
(str_store_string, s3, "str_remaining_time_s0reg0_s1reg1"),
(str_store_string, s2, "str_s2_s3"),
(try_for_range, ":cur_option", 0, ":end_cond"),
(assign, reg0, -12345), #magic number
(call_script, "script_game_get_multiplayer_server_option_for_mission_template", ":cur_mt", ":cur_option"),
(try_begin),
(eq, reg0, -12345),
(assign, ":end_cond", 0),
(else_try),
(call_script, "script_game_multiplayer_server_option_for_mission_template_to_string", ":cur_mt", ":cur_option", reg0),
(str_store_string, s3, s0),
(str_store_string, s2, "str_s2_s3"),
(try_end),
(try_end),
(create_text_overlay, reg0, s2, tf_scrollable),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 230),
(position_set_y, pos1, 425),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 540),
(position_set_y, pos1, 150),
(overlay_set_area_size, reg0, pos1),
(presentation_set_duration, 999999),
(try_end),
]),
(ti_on_presentation_run,
[
(str_store_welcome_message, s0),
(try_begin),
(neq, "$g_multiplayer_show_server_rules", 1),
(this_or_next|str_is_empty, s0),
(eq, "$g_multiplayer_welcome_message_shown", 1),
(presentation_set_duration, 0),
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_team_select"),
(start_presentation, "prsnt_multiplayer_team_select"),
(else_try),
(store_mission_timer_a, ":mission_timer"),
(gt, ":mission_timer", 1),
(this_or_next|key_clicked, key_escape),
(this_or_next|key_clicked, key_space),
(this_or_next|key_clicked, key_enter),
(this_or_next|key_clicked, key_left_mouse_button),
(key_clicked, key_right_mouse_button),
(assign, "$g_multiplayer_welcome_message_shown", 1),
(presentation_set_duration, 0),
(neg|is_presentation_active, "prsnt_multiplayer_escape_menu"),
(neg|is_presentation_active, "prsnt_multiplayer_team_select"),
(try_begin),
(eq, "$g_multiplayer_show_server_rules", 1),
(assign, "$g_multiplayer_show_server_rules", 0),
(start_presentation, "prsnt_multiplayer_escape_menu"),
(else_try),
(start_presentation, "prsnt_multiplayer_team_select"),
(try_end),
(try_end),
]),
]),
("multiplayer_team_select", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_ingame_menu"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 80),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_team_select_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 285),
(position_set_y, pos1, 125),
(overlay_set_position, "$g_presentation_obj_team_select_container", pos1),
(position_set_x, pos1, 405),
(position_set_y, pos1, 500),
(overlay_set_area_size, "$g_presentation_obj_team_select_container", pos1),
(set_container_overlay, "$g_presentation_obj_team_select_container"),
(assign, ":cur_y", 450),
(create_text_overlay, reg0, "str_choose_a_faction", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(position_set_x, pos1, 100),
(multiplayer_get_my_player, ":my_player_no"),
(team_get_faction, ":faction_no", 0),
(str_store_faction_name, s0, ":faction_no"),
(create_button_overlay, "$g_presentation_obj_team_select_1", s0, 0),
(try_begin),
(call_script, "script_cf_multiplayer_team_is_available", ":my_player_no", 0),
(overlay_set_color, "$g_presentation_obj_team_select_1", 0xFFFFFF),
(overlay_set_hilight_color, "$g_presentation_obj_team_select_1", 0x55FF50),
(assign, "$g_multiplayer_team_select_1_available", 1),
(else_try),
(overlay_set_color, "$g_presentation_obj_team_select_1", 0x888888),
(overlay_set_hilight_color, "$g_presentation_obj_team_select_1", 0x888888),
(assign, "$g_multiplayer_team_select_1_available", 0),
(try_end),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_team_select_1", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(team_get_faction, ":faction_no", 1),
(str_store_faction_name, s0, ":faction_no"),
(create_button_overlay, "$g_presentation_obj_team_select_2", s0, 0),
(try_begin),
(call_script, "script_cf_multiplayer_team_is_available", ":my_player_no", 1),
(overlay_set_color, "$g_presentation_obj_team_select_2", 0xFFFFFF),
(overlay_set_hilight_color, "$g_presentation_obj_team_select_2", 0x55FF50),
(assign, "$g_multiplayer_team_select_2_available", 1),
(else_try),
(overlay_set_color, "$g_presentation_obj_team_select_2", 0x888888),
(overlay_set_hilight_color, "$g_presentation_obj_team_select_2", 0x888888),
(assign, "$g_multiplayer_team_select_2_available", 0),
(try_end),
(overlay_set_position, "$g_presentation_obj_team_select_2", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(create_button_overlay, "$g_presentation_obj_team_select_3", "str_spectator", 0),
(overlay_set_color, "$g_presentation_obj_team_select_3", 0xFFFFFF),
(overlay_set_position, "$g_presentation_obj_team_select_3", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(try_begin),
(eq, ":object", "$g_presentation_obj_team_select_1"),
(try_begin),
(call_script, "script_cf_multiplayer_team_is_available", ":my_player_no", 0),
(try_begin),
(player_get_team_no, ":my_team", ":my_player_no"),
(neq, ":my_team", 0),
(assign, "$g_confirmation_result", 0),
(assign, "$g_waiting_for_confirmation_to_terminate", 1),
(player_get_troop_id, "$g_confirmation_troop_backup", ":my_player_no"),
(player_get_team_no, "$g_confirmation_team_backup", ":my_player_no"),
(player_set_troop_id, ":my_player_no", -1),
(multiplayer_send_int_to_server, multiplayer_event_change_team_no, 0),
(player_set_team_no, ":my_player_no", 0),
(else_try),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_troop_select"),
(try_end),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_team_select_2"),
(try_begin),
(call_script, "script_cf_multiplayer_team_is_available", ":my_player_no", 1),
(try_begin),
(player_get_team_no, ":my_team", ":my_player_no"),
(neq, ":my_team", 1),
(assign, "$g_confirmation_result", 0),
(assign, "$g_waiting_for_confirmation_to_terminate", 1),
(player_get_troop_id, "$g_confirmation_troop_backup", ":my_player_no"),
(player_get_team_no, "$g_confirmation_team_backup", ":my_player_no"),
(player_set_troop_id, ":my_player_no", -1),
(multiplayer_send_int_to_server, multiplayer_event_change_team_no, 1),
(player_set_team_no, ":my_player_no", 1),
(else_try),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_troop_select"),
(try_end),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_team_select_3"),
(player_set_troop_id, ":my_player_no", -1),
(multiplayer_send_int_to_server, multiplayer_event_change_team_no, multi_team_spectator),
(player_set_team_no, ":my_player_no", multi_team_spectator),
(presentation_set_duration, 0),
(try_end),
(try_end),
]),
(ti_on_presentation_run,
[
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(key_clicked, key_escape),
(eq, "$g_waiting_for_confirmation_to_terminate", 0),
(multiplayer_get_my_team, ":my_team"),
(try_begin),
(eq, ":my_team", multi_team_unassigned),
(player_set_troop_id, ":my_player_no", -1),
(multiplayer_send_int_to_server, multiplayer_event_change_team_no, multi_team_spectator),
(player_set_team_no, ":my_player_no", multi_team_spectator),
(try_end),
(presentation_set_duration, 0),
(else_try),
(eq, "$g_waiting_for_confirmation_to_terminate", 1),
(eq, "$g_confirmation_result", 1),
(assign, "$g_waiting_for_confirmation_to_terminate", 0),
(assign, "$g_confirmation_result", 0),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_troop_select"),
(else_try),
(eq, "$g_waiting_for_confirmation_to_terminate", 1),
(eq, "$g_confirmation_result", -1),
#return troop and team back to the old state
(player_set_troop_id, ":my_player_no", "$g_confirmation_troop_backup"),
(player_set_team_no, ":my_player_no", "$g_confirmation_team_backup"),
(assign, "$g_waiting_for_confirmation_to_terminate", 0),
(assign, "$g_confirmation_result", 0),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_team_select"),
(else_try),
(assign, ":do_refresh", 0),
(try_begin),
(call_script, "script_cf_multiplayer_team_is_available", ":my_player_no", 0),
(try_begin),
(eq, "$g_multiplayer_team_select_1_available", 0),
(assign, ":do_refresh", 1),
(try_end),
(else_try),
#not available
(try_begin),
(eq, "$g_multiplayer_team_select_1_available", 1),
(assign, ":do_refresh", 1),
(try_end),
(try_end),
(try_begin),
(call_script, "script_cf_multiplayer_team_is_available", ":my_player_no", 1),
(try_begin),
(eq, "$g_multiplayer_team_select_2_available", 0),
(assign, ":do_refresh", 1),
(try_end),
(else_try),
#not available
(try_begin),
(eq, "$g_multiplayer_team_select_2_available", 1),
(assign, ":do_refresh", 1),
(try_end),
(try_end),
(eq, ":do_refresh", 1),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_team_select"),
(try_end),
]),
]),
("multiplayer_troop_select", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_ingame_menu"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 80),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_troop_select_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 285),
(position_set_y, pos1, 125),
(overlay_set_position, "$g_presentation_obj_troop_select_container", pos1),
(position_set_x, pos1, 405),
(position_set_y, pos1, 500),
(overlay_set_area_size, "$g_presentation_obj_troop_select_container", pos1),
(set_container_overlay, "$g_presentation_obj_troop_select_container"),
(assign, ":cur_y", 450),
(create_text_overlay, reg0, "str_choose_a_troop", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(position_set_x, pos1, 100),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_team_no, ":my_team_no", ":my_player_no"),
(team_get_faction, ":my_faction_no", ":my_team_no"),
(try_for_range, ":i_multi", multi_data_troop_button_indices_begin, multi_data_troop_button_indices_end),
(troop_set_slot, "trp_multiplayer_data", ":i_multi", -1),
(try_end),
(assign, ":cur_troop_index", 0),
(try_for_range, ":troop_no", multiplayer_troops_begin, multiplayer_troops_end),
(store_troop_faction, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", ":my_faction_no"),
(str_store_troop_name, s1, ":troop_no"),
(create_button_overlay, reg0, s1, 0),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":button_index_slot", ":cur_troop_index", multi_data_troop_button_indices_begin),
(troop_set_slot, "trp_multiplayer_data", ":button_index_slot", reg0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(val_add, ":cur_troop_index", 1),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_team_no, ":my_team_no", ":my_player_no"),
(team_get_faction, ":my_faction_no", ":my_team_no"),
(assign, ":selected_troop_no", -1),
(assign, ":end_cond", multi_data_troop_button_indices_end),
(try_for_range, ":i_button", multi_data_troop_button_indices_begin, ":end_cond"),
(troop_slot_eq, "trp_multiplayer_data", ":i_button", ":object"),
(store_sub, ":selected_troop_index", ":i_button", multi_data_troop_button_indices_begin),
(assign, ":end_cond_2", multiplayer_troops_end),
(try_for_range, ":troop_no", multiplayer_troops_begin, ":end_cond_2"),
(store_troop_faction, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", ":my_faction_no"),
(val_sub, ":selected_troop_index", 1),
(lt, ":selected_troop_index", 0),
(assign, ":selected_troop_no", ":troop_no"),
(assign, ":end_cond_2", 0), #break
(try_end),
(try_begin),
(multiplayer_get_my_troop, ":troop_no"),
(neq, ":troop_no", ":selected_troop_no"),
(player_set_troop_id, ":my_player_no", ":selected_troop_no"),
(multiplayer_send_int_to_server, multiplayer_event_change_troop_id, ":selected_troop_no"),
(call_script, "script_multiplayer_set_default_item_selections_for_troop", ":selected_troop_no"),
(call_script, "script_multiplayer_send_item_selections"),
(try_end),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(assign, ":end_cond", 0), #break
(try_end),
]),
(ti_on_presentation_run,
[
(try_begin),
(key_clicked, key_escape),
(multiplayer_get_my_player, ":my_player_no"),
(is_between, ":my_player_no", 0, multiplayer_max_possible_player_id),
(multiplayer_get_my_troop, ":my_troop"),
(try_begin),
(neg|is_between, ":my_troop", multiplayer_troops_begin, multiplayer_troops_end),
(player_set_troop_id, ":my_player_no", -1),
(multiplayer_send_int_to_server, multiplayer_event_change_troop_id, -1),
(multiplayer_send_int_to_server, multiplayer_event_change_team_no, multi_team_spectator),
(player_set_team_no, ":my_player_no", multi_team_spectator),
(try_end),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_item_select", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(multiplayer_get_my_player, ":my_player_no"),
(assign, "$g_presentation_obj_item_select_1", -1),
(assign, "$g_presentation_obj_item_select_2", -1),
(assign, "$g_presentation_obj_item_select_3", -1),
(assign, "$g_presentation_obj_item_select_4", -1),
(assign, "$g_presentation_obj_item_select_5", -1),
(assign, "$g_presentation_obj_item_select_6", -1),
(assign, "$g_presentation_obj_item_select_7", -1),
(assign, "$g_presentation_obj_item_select_8", -1),
(assign, "$g_presentation_obj_item_select_9", -1),
(assign, "$g_presentation_obj_item_select_10", -1),
(assign, "$g_presentation_obj_item_select_11", -1),
(assign, "$g_presentation_obj_item_select_12", -1),
(assign, "$g_presentation_obj_item_select_13", -1),
(assign, "$g_presentation_obj_item_select_14", -1),
(assign, "$g_presentation_obj_item_select_15", -1),
(assign, "$g_presentation_obj_item_select_16", -1),
(try_begin),
(neq, "$g_current_opened_item_details", -1),
(close_item_details),
(assign, "$g_current_opened_item_details", -1),
(try_end),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 0),
(player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
(try_begin),
(ge, ":selected_item_id", 0),
(create_image_button_overlay, "$g_presentation_obj_item_select_1", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),
(create_mesh_overlay_with_item_id, reg0, ":selected_item_id"),
(position_set_x, pos1, 950),
(position_set_y, pos1, 526),
(overlay_set_position, reg0, pos1),
(assign, "$g_inside_obj_1", reg0),
(else_try),
(create_image_button_overlay, "$g_presentation_obj_item_select_1", "mesh_mp_inventory_slot_equip", "mesh_mp_inventory_slot_equip"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_item_select_1", pos1),
(position_set_x, pos1, 899),
(position_set_y, pos1, 475),
(overlay_set_position, "$g_presentation_obj_item_select_1", pos1),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 1),
(player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
(try_begin),
(ge, ":selected_item_id", 0),
(create_image_button_overlay, "$g_presentation_obj_item_select_2", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),
(create_mesh_overlay_with_item_id, reg0, ":selected_item_id"),
(position_set_x, pos1, 950),
(position_set_y, pos1, 426),
(overlay_set_position, reg0, pos1),
(assign, "$g_inside_obj_2", reg0),
(else_try),
(create_image_button_overlay, "$g_presentation_obj_item_select_2", "mesh_mp_inventory_slot_equip", "mesh_mp_inventory_slot_equip"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_item_select_2", pos1),
(position_set_x, pos1, 899),
(position_set_y, pos1, 375),
(overlay_set_position, "$g_presentation_obj_item_select_2", pos1),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 2),
(player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
(try_begin),
(ge, ":selected_item_id", 0),
(create_image_button_overlay, "$g_presentation_obj_item_select_3", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),
(create_mesh_overlay_with_item_id, reg0, ":selected_item_id"),
(position_set_x, pos1, 950),
(position_set_y, pos1, 326),
(overlay_set_position, reg0, pos1),
(assign, "$g_inside_obj_3", reg0),
(else_try),
(create_image_button_overlay, "$g_presentation_obj_item_select_3", "mesh_mp_inventory_slot_equip", "mesh_mp_inventory_slot_equip"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_item_select_3", pos1),
(position_set_x, pos1, 899),
(position_set_y, pos1, 275),
(overlay_set_position, "$g_presentation_obj_item_select_3", pos1),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 3),
(player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
(try_begin),
(ge, ":selected_item_id", 0),
(create_image_button_overlay, "$g_presentation_obj_item_select_4", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),
(create_mesh_overlay_with_item_id, reg0, ":selected_item_id"),
(position_set_x, pos1, 950),
(position_set_y, pos1, 226),
(overlay_set_position, reg0, pos1),
(assign, "$g_inside_obj_4", reg0),
(else_try),
(create_image_button_overlay, "$g_presentation_obj_item_select_4", "mesh_mp_inventory_slot_equip", "mesh_mp_inventory_slot_equip"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_item_select_4", pos1),
(position_set_x, pos1, 899),
(position_set_y, pos1, 175),
(overlay_set_position, "$g_presentation_obj_item_select_4", pos1),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 4),
(player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
(try_begin),
(ge, ":selected_item_id", 0),
(create_image_button_overlay, "$g_presentation_obj_item_select_5", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),
(create_mesh_overlay_with_item_id, reg0, ":selected_item_id"),
(position_set_x, pos1, 53),
(position_set_y, pos1, 576),
(overlay_set_position, reg0, pos1),
(assign, "$g_inside_obj_5", reg0),
(else_try),
(create_image_button_overlay, "$g_presentation_obj_item_select_5", "mesh_mp_inventory_slot_helmet", "mesh_mp_inventory_slot_helmet"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_item_select_5", pos1),
(position_set_x, pos1, 2),
(position_set_y, pos1, 525),
(overlay_set_position, "$g_presentation_obj_item_select_5", pos1),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 5),
(player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
(try_begin),
(ge, ":selected_item_id", 0),
(create_image_button_overlay, "$g_presentation_obj_item_select_6", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),
(create_mesh_overlay_with_item_id, reg0, ":selected_item_id"),
(position_set_x, pos1, 53),
(position_set_y, pos1, 476),
(overlay_set_position, reg0, pos1),
(assign, "$g_inside_obj_6", reg0),
(else_try),
(create_image_button_overlay, "$g_presentation_obj_item_select_6", "mesh_mp_inventory_slot_armor", "mesh_mp_inventory_slot_armor"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_item_select_6", pos1),
(position_set_x, pos1, 2),
(position_set_y, pos1, 425),
(overlay_set_position, "$g_presentation_obj_item_select_6", pos1),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 6),
(player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
(try_begin),
(ge, ":selected_item_id", 0),
(create_image_button_overlay, "$g_presentation_obj_item_select_7", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),
(create_mesh_overlay_with_item_id, reg0, ":selected_item_id"),
(position_set_x, pos1, 53),
(position_set_y, pos1, 376),
(overlay_set_position, reg0, pos1),
(assign, "$g_inside_obj_7", reg0),
(else_try),
(create_image_button_overlay, "$g_presentation_obj_item_select_7", "mesh_mp_inventory_slot_boot", "mesh_mp_inventory_slot_boot"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_item_select_7", pos1),
(position_set_x, pos1, 2),
(position_set_y, pos1, 325),
(overlay_set_position, "$g_presentation_obj_item_select_7", pos1),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 7),
(player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
(try_begin),
(ge, ":selected_item_id", 0),
(create_image_button_overlay, "$g_presentation_obj_item_select_8", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),
(create_mesh_overlay_with_item_id, reg0, ":selected_item_id"),
(position_set_x, pos1, 53),
(position_set_y, pos1, 276),
(overlay_set_position, reg0, pos1),
(assign, "$g_inside_obj_8", reg0),
(else_try),
(create_image_button_overlay, "$g_presentation_obj_item_select_8", "mesh_mp_inventory_slot_glove", "mesh_mp_inventory_slot_glove"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_item_select_8", pos1),
(position_set_x, pos1, 2),
(position_set_y, pos1, 225),
(overlay_set_position, "$g_presentation_obj_item_select_8", pos1),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 8),
(player_get_slot, ":selected_item_id", ":my_player_no", ":selected_item_index"),
(try_begin),
(ge, ":selected_item_id", 0),
(eq, "$g_horses_are_avaliable", 1),
(create_image_button_overlay, "$g_presentation_obj_item_select_9", "mesh_mp_inventory_slot_empty", "mesh_mp_inventory_slot_empty"),
(create_mesh_overlay_with_item_id, reg0, ":selected_item_id"),
(position_set_x, pos1, 53),
(position_set_y, pos1, 176),
(overlay_set_position, reg0, pos1),
(assign, "$g_inside_obj_9", reg0),
(else_try),
(create_image_button_overlay, "$g_presentation_obj_item_select_9", "mesh_mp_inventory_slot_horse", "mesh_mp_inventory_slot_horse"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, "$g_presentation_obj_item_select_9", pos1),
(position_set_x, pos1, 2),
(position_set_y, pos1, 125),
(overlay_set_position, "$g_presentation_obj_item_select_9", pos1),
(create_mesh_overlay, reg0, "mesh_mp_inventory_left"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 0),
(position_set_y, pos1, 14),
(overlay_set_position, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_mp_inventory_right"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 894),
(position_set_y, pos1, 65),
(overlay_set_position, reg0, pos1),
(create_in_game_button_overlay, "$g_presentation_obj_item_select_10", "str_reset_to_default", 0),
(overlay_set_color, "$g_presentation_obj_item_select_10", 0xFFFFFF),
(position_set_x, pos1, 605),
(position_set_y, pos1, 25),
(overlay_set_position, "$g_presentation_obj_item_select_10", pos1),
(create_in_game_button_overlay, "$g_presentation_obj_item_select_11", "str_done", 0),
(overlay_set_color, "$g_presentation_obj_item_select_11", 0xFFFFFF),
(position_set_x, pos1, 395),
(position_set_y, pos1, 25),
(overlay_set_position, "$g_presentation_obj_item_select_11", pos1),
(assign, ":cur_y", 725),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_team_no, ":my_team_no", ":my_player_no"),
(assign, ":has_bots", 0),
(try_begin),
(eq, ":my_team_no", 0),
(try_begin),
(gt, "$g_multiplayer_num_bots_team_1", 0),
(assign, ":has_bots", 1),
(try_end),
(else_try),
(try_begin),
(gt, "$g_multiplayer_num_bots_team_2", 0),
(assign, ":has_bots", 1),
(try_end),
(try_end),
(team_get_faction, ":my_faction_no", ":my_team_no"),
(try_begin),
(eq, ":has_bots", 1),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_duel),
(assign, ":num_lines", 0),
(try_begin),
(eq, ":has_bots", 1),
(try_for_range, ":ai_troop_no", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
(store_troop_faction, ":ai_troop_faction", ":ai_troop_no"),
(eq, ":ai_troop_faction", ":my_faction_no"),
(val_add, ":num_lines", 1),
(try_end),
(try_end),
(store_mul, ":board_height", ":num_lines", 20),
(val_add, ":board_height", 40),
(create_mesh_overlay, reg0, "mesh_mp_ui_command_border_r"),
(position_set_x, pos1, 280),
(position_set_y, pos1, 680),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 2500),
(position_set_y, pos1, 2500),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_mp_ui_command_border_l"),
(position_set_x, pos1, 650),
(position_set_y, pos1, 680),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 2500),
(position_set_y, pos1, 2500),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_mp_ui_command_panel"),
(position_set_x, pos1, 350),
(store_sub, ":board_pos_y", 750, ":board_height"),
(position_set_y, pos1, ":board_pos_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 3000),
(position_set_y, pos1, 3000),
(overlay_set_size, reg0, pos1),
(create_text_overlay, reg0, "str_command", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 370),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", 20),
(assign, ":cur_ai_troop_index", 0),
(try_for_range, ":ai_troop_no", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
(store_troop_faction, ":ai_troop_faction", ":ai_troop_no"),
(eq, ":ai_troop_faction", ":my_faction_no"),
(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 377),
(store_add, ":special_cur_y", ":cur_y", 2),
(position_set_y, pos1, ":special_cur_y"),
(overlay_set_position, reg0, pos1),
(try_begin),
(eq, ":cur_ai_troop_index", 0),
(overlay_set_val, reg0, "$g_multiplayer_bot_type_1_wanted"),
(assign, "$g_presentation_obj_item_select_13", reg0),
(else_try),
(eq, ":cur_ai_troop_index", 1),
(overlay_set_val, reg0, "$g_multiplayer_bot_type_2_wanted"),
(assign, "$g_presentation_obj_item_select_14", reg0),
(else_try),
(eq, ":cur_ai_troop_index", 2),
(overlay_set_val, reg0, "$g_multiplayer_bot_type_3_wanted"),
(assign, "$g_presentation_obj_item_select_15", reg0),
(else_try),
(overlay_set_val, reg0, "$g_multiplayer_bot_type_4_wanted"),
(assign, "$g_presentation_obj_item_select_16", reg0),
(try_end),
(str_store_troop_name, s0, ":ai_troop_no"),
(create_text_overlay, reg0, "str_s0", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 397),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", 20),
(val_add, ":cur_ai_troop_index", 1),
(try_end),
(val_sub, ":cur_y", 20),
(try_end),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_gold, ":player_gold", ":my_player_no"),
(call_script, "script_multiplayer_calculate_cur_selected_items_cost", ":my_player_no", 1),
(create_text_overlay, "$g_presentation_obj_item_select_12", "str_total_item_cost_reg0", tf_left_align|tf_single_line|tf_with_outline),
(try_begin),
(ge, ":player_gold", reg0),
(overlay_set_color, "$g_presentation_obj_item_select_12", 0xFFFFFF),
(else_try),
(overlay_set_color, "$g_presentation_obj_item_select_12", 0xFF0000),
(try_end),
(position_set_x, pos1, 680),
(position_set_y, pos1, 652),
(overlay_set_position, "$g_presentation_obj_item_select_12", pos1),
(store_add, "$g_presentation_obj_item_select_next", "$g_presentation_obj_item_select_12", 1),
(player_get_troop_id, ":my_troop_no", ":my_player_no"),
(try_begin),
(eq, "$g_presentation_state", 1),
(call_script, "script_multiplayer_display_available_items_for_troop_and_item_classes", ":my_troop_no", multi_item_class_type_weapons_begin, multi_item_class_type_weapons_end, 781, 474),
(create_mesh_overlay, reg0, "mesh_mp_inventory_right_arrow"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 881),
(position_set_y, pos1, 515),
(overlay_set_position, reg0, pos1),
(else_try),
(eq, "$g_presentation_state", 2),
(call_script, "script_multiplayer_display_available_items_for_troop_and_item_classes", ":my_troop_no", multi_item_class_type_weapons_begin, multi_item_class_type_weapons_end, 781, 374),
(create_mesh_overlay, reg0, "mesh_mp_inventory_right_arrow"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 881),
(position_set_y, pos1, 415),
(overlay_set_position, reg0, pos1),
(else_try),
(eq, "$g_presentation_state", 3),
(call_script, "script_multiplayer_display_available_items_for_troop_and_item_classes", ":my_troop_no", multi_item_class_type_weapons_begin, multi_item_class_type_weapons_end, 781, 274),
(create_mesh_overlay, reg0, "mesh_mp_inventory_right_arrow"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 881),
(position_set_y, pos1, 315),
(overlay_set_position, reg0, pos1),
(else_try),
(eq, "$g_presentation_state", 4),
(call_script, "script_multiplayer_display_available_items_for_troop_and_item_classes", ":my_troop_no", multi_item_class_type_weapons_begin, multi_item_class_type_weapons_end, 781, 174),
(create_mesh_overlay, reg0, "mesh_mp_inventory_right_arrow"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 881),
(position_set_y, pos1, 215),
(overlay_set_position, reg0, pos1),
(else_try),
(eq, "$g_presentation_state", 5),
(call_script, "script_multiplayer_display_available_items_for_troop_and_item_classes", ":my_troop_no", multi_item_class_type_heads_begin, multi_item_class_type_heads_end, 117, 524),
(create_mesh_overlay, reg0, "mesh_mp_inventory_left_arrow"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 106),
(position_set_y, pos1, 565),
(overlay_set_position, reg0, pos1),
(else_try),
(eq, "$g_presentation_state", 6),
(call_script, "script_multiplayer_display_available_items_for_troop_and_item_classes", ":my_troop_no", multi_item_class_type_bodies_begin, multi_item_class_type_bodies_end, 117, 424),
(create_mesh_overlay, reg0, "mesh_mp_inventory_left_arrow"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 106),
(position_set_y, pos1, 465),
(overlay_set_position, reg0, pos1),
(else_try),
(eq, "$g_presentation_state", 7),
(call_script, "script_multiplayer_display_available_items_for_troop_and_item_classes", ":my_troop_no", multi_item_class_type_feet_begin, multi_item_class_type_feet_end, 117, 324),
(create_mesh_overlay, reg0, "mesh_mp_inventory_left_arrow"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 106),
(position_set_y, pos1, 365),
(overlay_set_position, reg0, pos1),
(else_try),
(eq, "$g_presentation_state", 8),
(call_script, "script_multiplayer_display_available_items_for_troop_and_item_classes", ":my_troop_no", multi_item_class_type_gloves_begin, multi_item_class_type_gloves_end, 117, 224),
(create_mesh_overlay, reg0, "mesh_mp_inventory_left_arrow"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 106),
(position_set_y, pos1, 265),
(overlay_set_position, reg0, pos1),
(else_try),
(eq, "$g_presentation_state", 9),
(eq, "$g_horses_are_avaliable", 1),
(call_script, "script_multiplayer_display_available_items_for_troop_and_item_classes", ":my_troop_no", multi_item_class_type_horses_begin, multi_item_class_type_horses_end, 117, 124),
(create_mesh_overlay, reg0, "mesh_mp_inventory_left_arrow"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 106),
(position_set_y, pos1, 165),
(overlay_set_position, reg0, pos1),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_mouse_enter_leave,
[(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":enter_leave"),
(try_begin),
(eq, "$g_close_equipment_selection", 0),
(try_begin),
(eq, ":enter_leave", 0),
(assign, ":item_no", -1),
(try_begin),
(ge, ":object", "$g_presentation_obj_item_select_next"),
(store_sub, ":tested_object", ":object", "$g_presentation_obj_item_select_next"),
(store_mod, ":mod_value", ":tested_object", 2),
(store_sub, ":mod_value", 1, ":mod_value"),
(val_div, ":tested_object", 2),
(store_add, ":cur_slot", multi_data_item_button_indices_begin, ":tested_object"),
(troop_get_slot, ":item_no", "trp_multiplayer_data", ":cur_slot"),
(assign, ":target_obj", ":object"),
(val_add, ":target_obj", ":mod_value"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_1"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 1),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_1"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_2"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 2),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_2"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_3"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 3),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_3"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_4"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 4),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_4"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_5"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 5),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_5"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_6"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 6),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_6"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_7"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 7),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_7"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_8"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 8),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_8"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_9"),
(eq, "$g_horses_are_avaliable", 1),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 9),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_9"),
(try_end),
(try_begin),
(ge, ":item_no", 0),
(overlay_get_position, pos0, ":target_obj"),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_troop_id, ":my_player_troop_no", ":my_player_no"),
(try_begin),
(call_script, "script_cf_multiplayer_is_item_default_for_troop", ":item_no", ":my_player_troop_no"),
(show_item_details, ":item_no", pos0, 0),
(else_try),
(store_troop_faction, ":my_player_faction_no", ":my_player_troop_no"),
(store_sub, ":faction_slot", ":my_player_faction_no", npc_kingdoms_begin),
(val_add, ":faction_slot", slot_item_multiplayer_faction_price_multipliers_begin),
(item_get_slot, ":price_multiplier", ":item_no", ":faction_slot"),
(show_item_details, ":item_no", pos0, ":price_multiplier"),
(try_end),
(assign, "$g_current_opened_item_details", ":item_no"),
(try_end),
(else_try),
(assign, ":item_no", -1),
(try_begin),
(ge, ":object", "$g_presentation_obj_item_select_next"),
(store_sub, ":tested_object", ":object", "$g_presentation_obj_item_select_next"),
(val_div, ":tested_object", 2),
(store_add, ":cur_slot", multi_data_item_button_indices_begin, ":tested_object"),
(troop_get_slot, ":item_no", "trp_multiplayer_data", ":cur_slot"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_1"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 1),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_1"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_2"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 2),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_2"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_3"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 3),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_3"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_4"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 4),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_4"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_5"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 5),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_5"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_6"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 6),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_6"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_7"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 7),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_7"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_8"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 8),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_8"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_9"),
(eq, "$g_horses_are_avaliable", 1),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, 9),
(val_sub, ":player_slot_index", 1),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_slot, ":item_no", ":my_player_no", ":player_slot_index"),
(assign, ":target_obj", "$g_inside_obj_9"),
(try_end),
(try_begin),
(eq, "$g_current_opened_item_details", ":item_no"),
(close_item_details),
(assign, "$g_current_opened_item_details", -1),
(try_end),
(try_end),
(else_try),
(assign, "$g_close_equipment_selection", 0),
(presentation_set_duration, 0),
(try_end),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":value"),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_troop_id, ":my_troop_no", ":my_player_no"),
(try_begin),
(eq, "$g_close_equipment_selection", 0),
(try_begin),
(eq, "$g_presentation_state", 0),
(try_begin),
(eq, ":object", "$g_presentation_obj_item_select_1"),
(assign, "$g_presentation_state", 1),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_2"),
(assign, "$g_presentation_state", 2),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_3"),
(assign, "$g_presentation_state", 3),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_4"),
(assign, "$g_presentation_state", 4),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_5"),
(assign, "$g_presentation_state", 5),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_6"),
(assign, "$g_presentation_state", 6),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_7"),
(assign, "$g_presentation_state", 7),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_8"),
(assign, "$g_presentation_state", 8),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_9"),
(eq, "$g_horses_are_avaliable", 1),
(assign, "$g_presentation_state", 9),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(try_end),
(else_try),
(gt, "$g_presentation_state", 0),
(store_sub, ":tested_object", ":object", "$g_presentation_obj_item_select_next"),
(val_div, ":tested_object", 2),
(assign, ":end_cond", multi_data_item_button_indices_end),
(try_for_range, ":cur_slot", multi_data_item_button_indices_begin, ":end_cond"),
(neg|troop_slot_eq, "trp_multiplayer_data", ":cur_slot", -1),
(store_sub, ":button_id", ":cur_slot", multi_data_item_button_indices_begin),
(eq, ":tested_object", ":button_id"),
(troop_get_slot, ":item_no", "trp_multiplayer_data", ":cur_slot"),
(store_add, ":player_slot_index", slot_player_selected_item_indices_begin, "$g_presentation_state"),
(val_sub, ":player_slot_index", 1),
(player_set_slot, ":my_player_no", ":player_slot_index", ":item_no"),
(player_get_gold, ":player_gold", ":my_player_no"),
(call_script, "script_multiplayer_calculate_cur_selected_items_cost", ":my_player_no", 1),
(overlay_set_text, "$g_presentation_obj_item_select_12", "str_total_item_cost_reg0"),
(try_begin),
(ge, ":player_gold", reg0),
(overlay_set_color, "$g_presentation_obj_item_select_12", 0xFFFFFF),
(else_try),
(overlay_set_color, "$g_presentation_obj_item_select_12", 0xFF0000),
(try_end),
(assign, ":end_cond", 0), #break
(try_end),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(try_end),
(try_begin),
(eq, ":object", "$g_presentation_obj_item_select_10"),
(call_script, "script_multiplayer_set_default_item_selections_for_troop", ":my_troop_no"),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_11"),
(call_script, "script_multiplayer_send_item_selections"),
(presentation_set_duration, 0),
(try_begin),
(try_begin),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(gt, "$g_multiplayer_number_of_respawn_count", 0),
(ge, "$g_my_spawn_count", "$g_multiplayer_number_of_respawn_count"),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_team_no, ":my_player_team", ":my_player_no"),
(this_or_next|eq, ":my_player_team", 0),
(ge, "$g_my_spawn_count", 999),
(assign, "$g_show_no_more_respawns_remained", 1),
(else_try),
(assign, "$g_show_no_more_respawns_remained", 0),
(try_end),
(eq, "$g_show_no_more_respawns_remained", 1),
(store_mission_timer_a, "$g_multiplayer_respawn_start_time"),
(start_presentation, "prsnt_multiplayer_respawn_time_counter"),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_13"),
(assign, "$g_multiplayer_bot_type_1_wanted", ":value"),
(multiplayer_send_2_int_to_server, multiplayer_event_set_bot_selection, slot_player_bot_type_1_wanted, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_14"),
(assign, "$g_multiplayer_bot_type_2_wanted", ":value"),
(multiplayer_send_2_int_to_server, multiplayer_event_set_bot_selection, slot_player_bot_type_2_wanted, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_15"),
(assign, "$g_multiplayer_bot_type_3_wanted", ":value"),
(multiplayer_send_2_int_to_server, multiplayer_event_set_bot_selection, slot_player_bot_type_3_wanted, ":value"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_16"),
(assign, "$g_multiplayer_bot_type_4_wanted", ":value"),
(multiplayer_send_2_int_to_server, multiplayer_event_set_bot_selection, slot_player_bot_type_4_wanted, ":value"),
(try_end),
(else_try),
(assign, "$g_close_equipment_selection", 0),
(presentation_set_duration, 0),
(try_end),
]),
(ti_on_presentation_mouse_press,
[(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":mouse_state"),
(try_begin),
(eq, "$g_close_equipment_selection", 0),
(try_begin),
(eq, ":mouse_state", 1), #right click (clears the item slot)
(try_begin),
(eq, "$g_presentation_state", 0),
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(eq, ":object", "$g_presentation_obj_item_select_1"),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 0),
(player_set_slot, ":my_player_no", ":selected_item_index", -1),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_2"),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 1),
(player_set_slot, ":my_player_no", ":selected_item_index", -1),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_3"),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 2),
(player_set_slot, ":my_player_no", ":selected_item_index", -1),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_4"),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 3),
(player_set_slot, ":my_player_no", ":selected_item_index", -1),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_5"),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 4),
(player_set_slot, ":my_player_no", ":selected_item_index", -1),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_6"),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 5),
(player_set_slot, ":my_player_no", ":selected_item_index", -1),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_7"),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 6),
(player_set_slot, ":my_player_no", ":selected_item_index", -1),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_8"),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 7),
(player_set_slot, ":my_player_no", ":selected_item_index", -1),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_item_select_9"),
(eq, "$g_horses_are_avaliable", 1),
(store_add, ":selected_item_index", slot_player_selected_item_indices_begin, 8),
(player_set_slot, ":my_player_no", ":selected_item_index", -1),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(try_end),
(else_try),
(gt, "$g_presentation_state", 0),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(try_end),
(try_end),
(else_try),
(assign, "$g_close_equipment_selection", 0),
(presentation_set_duration, 0),
(try_end),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
## this causes an error sometimes
## (multiplayer_get_my_player, ":my_player_no"),
## (player_get_gold, ":player_gold", ":my_player_no"),
## (call_script, "script_multiplayer_calculate_cur_selected_items_cost", ":my_player_no", 1),
## (try_begin),
## (ge, ":player_gold", reg0),
## (overlay_set_color, "$g_presentation_obj_item_select_12", 0xFFFFFF),
## (else_try),
## (overlay_set_color, "$g_presentation_obj_item_select_12", 0xFF0000),
## (try_end),
(try_begin),
(eq, "$g_close_equipment_selection", 0),
(try_begin),
(key_clicked, key_escape),
(try_begin),
(neq, "$g_current_opened_item_details", -1),
(close_item_details),
(assign, "$g_current_opened_item_details", -1),
(try_end),
(gt, ":cur_time", 200),
(presentation_set_duration, 0),
(try_end),
(else_try),
(assign, "$g_close_equipment_selection", 0),
#daha sonra buraya siege modundaysa ve takimini yeni degistirdigi icin spawn olamiyorsa start_presentation, spawn_counter satirini ekle sdsd.
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_message_1", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(try_begin),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_round_result_in_battle_mode),
(assign, ":winner_agent_team", "$g_multiplayer_message_value_1"),
(try_begin),
(eq, ":winner_agent_team", -1),
(assign, ":text_font_color", 0xFFFFFFFF),
(str_store_string, s0, "str_round_draw_no_one_remained"),
(else_try),
(try_begin), #for spectators initializing, we assume spectators are fan of team0 so coloring is applied as they are at team0.
(eq, ":winner_agent_team", 0),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end), #initializing ends
(try_begin),
(lt, "$my_team_at_start_of_round", 2),
(try_begin),
(eq, "$my_team_at_start_of_round", ":winner_agent_team"),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end),
(try_end),
(team_get_faction, ":faction_of_winner_team", ":winner_agent_team"),
(str_store_faction_name, s1, ":faction_of_winner_team"),
(str_store_string, s0, "str_s1_won_round"),
(try_end),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(try_begin),
(neq, ":winner_agent_team", -1),
(position_set_x, pos1, 375), #375
(else_try),
(position_set_x, pos1, 400), #400
(try_end),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 300),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_capture_the_flag_score),
(agent_get_team, ":winner_agent_team", "$g_multiplayer_message_value_1"), #assign given agent's team to winner agent team.
(team_get_faction, ":winner_agent_faction", ":winner_agent_team"),
(str_store_faction_name, s1, ":winner_agent_faction"),
(try_begin), #for spectators initializing, we assume spectators are fan of team0 so coloring is applied as they are at team0.
(eq, ":winner_agent_team", 0),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end), #initializing ends
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(agent_get_team, ":my_player_team", ":my_player_agent"),
(try_begin),
(eq, ":my_player_team", ":winner_agent_team"),
(assign, ":text_font_color", 0xFF33DD11),
(play_sound, "snd_team_scored_a_point"),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(play_sound, "snd_enemy_scored_a_point"),
(try_end),
(try_end),
(try_end),
(str_store_string, s0, "str_s1_captured_flag"),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 350),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_flag_returned_home),
(try_begin),
(ge, "$g_multiplayer_message_value_1", 0),
(agent_get_team, ":returned_flag_agent_team", "$g_multiplayer_message_value_1"),
(team_get_faction, ":returned_flag_agent_faction", ":returned_flag_agent_team"),
(str_store_faction_name, s1, ":returned_flag_agent_faction"),
(str_store_string, s0, "str_s1_returned_flag"),
(else_try),
(val_add, "$g_multiplayer_message_value_1", 1),
(val_mul, "$g_multiplayer_message_value_1", -1),
(assign, ":returned_flag_agent_team", "$g_multiplayer_message_value_1"),
(team_get_faction, ":returned_flag_agent_faction", ":returned_flag_agent_team"),
(str_store_faction_name, s1, ":returned_flag_agent_faction"),
(str_store_string, s0, "str_s1_auto_returned_flag"),
(try_end),
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(play_sound, "snd_flag_returned"),
(try_end),
(try_end),
(assign, ":text_font_color", 0xFFFFFFFF),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 325),
(position_set_y, pos1, 400),
(position_set_x, pos1, 500), #new
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_capture_the_flag_stole),
(agent_get_team, ":stolen_flag_agent_team", "$g_multiplayer_message_value_1"),
(team_get_faction, ":stolen_flag_agent_faction", ":stolen_flag_agent_team"),
(str_store_faction_name, s1, ":stolen_flag_agent_faction"),
(assign, ":text_font_color", 0xFFFFFFFF),
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(agent_get_team, ":my_player_team", ":my_player_agent"),
(try_begin),
(eq, ":my_player_team", ":stolen_flag_agent_team"),
(play_sound, "snd_enemy_flag_taken"),
(else_try),
(play_sound, "snd_your_flag_taken"),
(try_end),
(try_end),
(try_end),
(str_store_string, s0, "str_s1_taken_flag"),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 365),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_flag_captured),
(store_div, ":winner_agent_team", "$g_multiplayer_message_value_1", 100),
(store_mod, reg0, "$g_multiplayer_message_value_1", 100),
(val_sub, ":winner_agent_team", 1),
(try_begin), #for spectators initializing, we assume spectators are fan of team0 so coloring is applied as they are at team0.
(eq, ":winner_agent_team", 0),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end), #initializing ends
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(agent_get_team, ":my_player_team", ":my_player_agent"),
(try_begin),
(eq, ":my_player_team", ":winner_agent_team"),
(assign, ":text_font_color", 0xFF33DD11),
(play_sound, "snd_team_scored_a_point"),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(play_sound, "snd_enemy_scored_a_point"),
(try_end),
(try_end),
(try_end),
(team_get_faction, ":winner_agent_faction", ":winner_agent_team"),
(str_store_faction_name, s1, ":winner_agent_faction"),
(str_store_string, s0, "str_s1_captured_flag_reg0"),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 345),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_flag_is_pulling),
(store_div, ":winner_agent_team", "$g_multiplayer_message_value_1", 100),
(store_mod, reg0, "$g_multiplayer_message_value_1", 100),
(val_sub, ":winner_agent_team", 1),
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(agent_get_team, ":my_player_team", ":my_player_agent"),
(try_begin),
(eq, ":my_player_team", ":winner_agent_team"),
(play_sound, "snd_enemy_flag_taken"),
(else_try),
(play_sound, "snd_your_flag_taken"),
(try_end),
(try_end),
(try_end),
(assign, ":text_font_color", 0xFFFFFFFF),
(team_get_faction, ":winner_agent_faction", ":winner_agent_team"),
(str_store_faction_name, s1, ":winner_agent_faction"),
(str_store_string, s0, "str_s1_pulling_flag_reg0"),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 345),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_flag_neutralized),
(store_div, ":winner_agent_team", "$g_multiplayer_message_value_1", 100),
(store_mod, reg0, "$g_multiplayer_message_value_1", 100),
(val_sub, ":winner_agent_team", 1),
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(play_sound, "snd_flag_returned"),
(try_end),
(try_end),
(try_begin), #for spectators initializing, we assume spectators are fan of team0 so coloring is applied as they are at team0.
(eq, ":winner_agent_team", 0),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end), #initializing ends
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(agent_get_team, ":my_player_team", ":my_player_agent"),
(try_begin),
(eq, ":my_player_team", ":winner_agent_team"),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end),
(try_end),
(try_end),
(team_get_faction, ":winner_agent_faction", ":winner_agent_team"),
(str_store_faction_name, s1, ":winner_agent_faction"),
(str_store_string, s0, "str_s1_neutralized_flag_reg0"),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 345),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_round_result_in_siege_mode),
(assign, ":winner_agent_team", "$g_multiplayer_message_value_1"),
(try_begin), #for spectators initializing, we assume spectators are fan of team0 so coloring is applied as they are at team0.
(eq, ":winner_agent_team", 0),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end), #initializing ends
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(agent_get_team, ":my_player_team", ":my_player_agent"),
(try_begin),
(eq, ":my_player_team", ":winner_agent_team"),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end),
(try_end),
(try_end),
(try_begin),
(eq, "$g_multiplayer_message_value_1", 0),
(str_store_string, s0, "str_s1_defended_castle"),
(else_try),
(eq, "$g_multiplayer_message_value_1", 1),
(str_store_string, s0, "str_s1_captured_castle"),
(else_try),
(str_store_string, s0, "str_round_draw"),
(assign, ":text_font_color", 0xFFFFFFFF),
(try_end),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(try_begin),
(neq, "$g_multiplayer_message_value_1", -1),
(position_set_x, pos1, 325),
(else_try),
(position_set_x, pos1, 400),
(try_end),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_round_draw),
(assign, ":text_font_color", 0xFFFFFFFF),
(str_store_string, s0, "str_round_draw"),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 375),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_start_death_mode),
(assign, ":text_font_color", 0xFFFFFFFF),
(str_store_string, s0, "str_death_mode_started"),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 350),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_target_destroyed),
(try_begin),
(lt, "$g_multiplayer_message_value_1", 0),
(val_mul, "$g_multiplayer_message_value_1", -1),
(assign, ":scene_prop_team", 0),
(team_get_faction, ":faction_of_winner_team", 1),
(str_store_faction_name, s1, ":faction_of_winner_team"),
(else_try),
(assign, ":scene_prop_team", 1),
(team_get_faction, ":faction_of_winner_team", 0),
(str_store_faction_name, s1, ":faction_of_winner_team"),
(try_end),
(try_begin), #for spectators initializing, we assume spectators are fan of team0 so coloring is applied as they are at team0.
(eq, "$g_multiplayer_message_value_1", 1),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end), #initializing ends
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(try_begin),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_team_no, ":my_team_no", ":my_player_no"),
(neq, ":scene_prop_team", ":my_team_no"), #if scene prop and I have different teams this means we won
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end),
(try_end),
(try_begin),
(eq, "$g_multiplayer_message_value_1", 9),
(str_store_string, s0, "str_s1_destroyed_all_targets"),
(else_try),
(eq, "$g_multiplayer_message_value_1", 1),
(str_store_string, s0, "str_s1_destroyed_catapult"),
(else_try),
(eq, "$g_multiplayer_message_value_1", 2),
(str_store_string, s0, "str_s1_destroyed_trebuchet"),
(try_end),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 350),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_defenders_saved_n_targets),
(try_begin), #for spectators initializing, we assume spectators are fan of team0 so coloring is applied as they are at team0.
(eq, "$g_defender_team", 0),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end), #initializing ends
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(agent_get_team, ":my_player_team", ":my_player_agent"),
(try_begin),
(eq, ":my_player_team", "$g_defender_team"),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end),
(try_end),
(try_end),
(assign, ":num_targets_saved", "$g_multiplayer_message_value_1"),
(team_get_faction, ":faction_of_winner_team", "$g_defender_team"),
(str_store_faction_name, s1, ":faction_of_winner_team"),
(try_begin),
(eq, ":num_targets_saved", 1),
(str_store_string, s0, "str_s1_saved_1_target"),
(else_try),
(eq, ":num_targets_saved", 2),
(str_store_string, s0, "str_s1_saved_2_targets"),
(try_end),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 350),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_attackers_won_the_round),
(assign, ":winner_agent_team", "$g_multiplayer_message_value_1"),
(try_begin), #for spectators initializing, we assume spectators are fan of team0 so coloring is applied as they are at team0.
(eq, ":winner_agent_team", 0),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end), #initializing ends
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_agent_id, ":my_player_agent", ":my_player_no"),
(try_begin),
(ge, ":my_player_agent", 0),
(agent_get_team, ":my_player_team", ":my_player_agent"),
(try_begin),
(eq, ":my_player_team", ":winner_agent_team"),
(assign, ":text_font_color", 0xFF33DD11),
(else_try),
(assign, ":text_font_color", 0xFFFF4422),
(try_end),
(try_end),
(try_end),
(try_begin),
(eq, "$g_defender_team", 0),
(team_get_faction, ":faction_of_winner_team", 1),
(else_try),
(team_get_faction, ":faction_of_winner_team", 0),
(try_end),
(str_store_faction_name, s1, ":faction_of_winner_team"),
(str_store_string, s0, "str_s1_won_round"),
(create_text_overlay, "$g_multiplayer_message_1", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_1", ":text_font_color"),
(position_set_x, pos1, 350),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 400),
(overlay_set_position, "$g_multiplayer_message_1", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_1", pos1),
(presentation_set_duration, 400),
(try_end),
]),
(ti_on_presentation_run,
[
]),
]),
("multiplayer_message_2", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(try_begin),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_auto_team_balance_done),
(assign, ":text_font_color", 0xFFFFFFFF),
(str_store_string, s0, "str_auto_team_balance_done"),
(create_text_overlay, "$g_multiplayer_message_2", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_2", ":text_font_color"),
(position_set_x, pos1, 375),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 550),
(overlay_set_position, "$g_multiplayer_message_2", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_2", pos1),
(presentation_set_duration, 300),
(else_try),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_auto_team_balance_next),
(assign, ":text_font_color", 0xFFFFFFFF),
(try_begin),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_destroy),
(neq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(str_store_string, s0, "str_auto_team_balance_in_20_seconds"),
(position_set_x, pos1, 375),
(else_try),
(str_store_string, s0, "str_auto_team_balance_next_round"),
(position_set_x, pos1, 375),
(try_end),
(create_text_overlay, "$g_multiplayer_message_2", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_2", ":text_font_color"),
(position_set_y, pos1, 550),
(position_set_x, pos1, 500), #new
(overlay_set_position, "$g_multiplayer_message_2", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_2", pos1),
(presentation_set_duration, 300),
(try_end),
]),
(ti_on_presentation_run,
[
]),
]),
("multiplayer_message_3", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(try_begin),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_poll_result),
(assign, ":text_font_color", 0xFFFFFFFF),
(try_begin),
(eq, "$g_multiplayer_message_value_3", 1),
(str_store_string, s0, "str_poll_result_yes"),
(else_try),
(str_store_string, s0, "str_poll_result_no"),
(try_end),
(create_text_overlay, "$g_multiplayer_message_3", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_message_3", ":text_font_color"),
(position_set_x, pos1, 380),
(position_set_x, pos1, 500), #new
(position_set_y, pos1, 475),
(overlay_set_position, "$g_multiplayer_message_3", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_message_3", pos1),
(presentation_set_duration, 400),
(try_end),
]),
(ti_on_presentation_run,
[
]),
]),
("multiplayer_round_time_counter", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(assign, "$g_multiplayer_last_round_time_counter_value", -1),
(str_clear, s0),
(create_text_overlay, "$g_multiplayer_round_time_counter_overlay", s0, tf_left_align|tf_single_line|tf_with_outline),
(overlay_set_color, "$g_multiplayer_round_time_counter_overlay", 0xFFFFFF),
(position_set_x, pos1, 900),
(position_set_y, pos1, 690),
(overlay_set_position, "$g_multiplayer_round_time_counter_overlay", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_round_time_counter_overlay", pos1),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run,
[(store_mission_timer_a, ":current_time"),
(store_sub, ":seconds_past_in_round", ":current_time", "$g_round_start_time"),
(store_sub, ":seconds_left_in_round", "$g_multiplayer_round_max_seconds", ":seconds_past_in_round"),
(val_max, ":seconds_left_in_round", 0),
(try_begin),
(neq, "$g_multiplayer_last_round_time_counter_value", ":seconds_left_in_round"),
(assign, "$g_multiplayer_last_round_time_counter_value", ":seconds_left_in_round"),
(store_div, reg0, ":seconds_left_in_round", 60),
(store_div, reg1, ":seconds_left_in_round", 10),
(val_mod, reg1, 6),
(assign, reg2, ":seconds_left_in_round"),
(val_mod, reg2, 10),
(str_store_string, s0, "str_reg0_dd_reg1reg2"),
(overlay_set_text, "$g_multiplayer_round_time_counter_overlay", s0),
(try_end),
]),
]),
("multiplayer_team_score_display", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(assign, "$g_multiplayer_team_1_last_displayed_score", -1),
(assign, "$g_multiplayer_team_2_last_displayed_score", -1),
(str_clear, s0),
(create_text_overlay, "$g_multiplayer_team_1_score_display_overlay", s0, tf_left_align|tf_single_line|tf_with_outline),
(overlay_set_color, "$g_multiplayer_team_1_score_display_overlay", 0xFFFFFF),
(position_set_x, pos1, 40),
(position_set_y, pos1, 700),
(overlay_set_position, "$g_multiplayer_team_1_score_display_overlay", pos1),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, "$g_multiplayer_team_1_score_display_overlay", pos1),
(create_text_overlay, "$g_multiplayer_team_2_score_display_overlay", s0, tf_left_align|tf_single_line|tf_with_outline),
(overlay_set_color, "$g_multiplayer_team_2_score_display_overlay", 0xFFFFFF),
(position_set_x, pos1, 40),
(position_set_y, pos1, 645),
(overlay_set_position, "$g_multiplayer_team_2_score_display_overlay", pos1),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, "$g_multiplayer_team_2_score_display_overlay", pos1),
(try_begin),
(eq, "$g_multiplayer_team_1_faction", "fac_kingdom_4"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_1"),
(else_try),
(eq, "$g_multiplayer_team_1_faction", "fac_kingdom_2"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_2"),
(else_try),
(eq, "$g_multiplayer_team_1_faction", "fac_kingdom_3"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_3"),
(else_try),
(eq, "$g_multiplayer_team_1_faction", "fac_kingdom_5"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_4"),
(else_try),
(eq, "$g_multiplayer_team_1_faction", "fac_kingdom_6"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_5"),
(else_try),
(eq, "$g_multiplayer_team_1_faction", "fac_kingdom_1"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_6"),
(try_end),
(position_set_x, pos3, 25),
(position_set_y, pos3, 715),
(overlay_set_position, reg0, pos3),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_size, reg0, pos1),
(try_begin),
(eq, "$g_multiplayer_team_1_faction", "$g_multiplayer_team_2_faction"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_7"),
(else_try),
(eq, "$g_multiplayer_team_2_faction", "fac_kingdom_4"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_1"),
(else_try),
(eq, "$g_multiplayer_team_2_faction", "fac_kingdom_2"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_2"),
(else_try),
(eq, "$g_multiplayer_team_2_faction", "fac_kingdom_3"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_3"),
(else_try),
(eq, "$g_multiplayer_team_2_faction", "fac_kingdom_5"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_4"),
(else_try),
(eq, "$g_multiplayer_team_2_faction", "fac_kingdom_6"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_5"),
(else_try),
(eq, "$g_multiplayer_team_2_faction", "fac_kingdom_1"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_6"),
(try_end),
(position_set_x, pos3, 25),
(position_set_y, pos3, 660),
(overlay_set_position, reg0, pos3),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_size, reg0, pos1),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run, [
(team_get_score, ":team_1_score", 0),
(team_get_score, ":team_2_score", 1),
(try_begin),
(this_or_next|neq, ":team_1_score", "$g_multiplayer_team_1_last_displayed_score"),
(neq, ":team_2_score", "$g_multiplayer_team_2_last_displayed_score"),
(assign, "$g_multiplayer_team_1_last_displayed_score", ":team_1_score"),
(assign, "$g_multiplayer_team_2_last_displayed_score", ":team_2_score"),
(str_store_faction_name, s0, "$g_multiplayer_team_1_faction"),
(assign, reg0, ":team_1_score"),
(overlay_set_text, "$g_multiplayer_team_1_score_display_overlay", "str_reg0"),
(str_store_faction_name, s0, "$g_multiplayer_team_2_faction"),
(assign, reg0, ":team_2_score"),
(overlay_set_text, "$g_multiplayer_team_2_score_display_overlay", "str_reg0"),
## (str_store_faction_name, s0, "$g_multiplayer_team_1_faction"),
## (assign, reg0, ":team_1_score"),
## (overlay_set_text, "$g_multiplayer_team_1_score_display_overlay", "str_s0_dd_reg0"),
## (str_store_faction_name, s0, "$g_multiplayer_team_2_faction"),
## (assign, reg0, ":team_2_score"),
## (overlay_set_text, "$g_multiplayer_team_2_score_display_overlay", "str_s0_dd_reg0"),
(try_end),
]),
]),
("multiplayer_flag_projection_display", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[
(set_fixed_point_multiplier, 1000),
(store_sub, ":flag_mesh", "$g_multiplayer_team_1_faction", npc_kingdoms_begin),
(val_add, ":flag_mesh", multiplayer_flag_projections_begin),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_1", ":flag_mesh"),
(val_sub, ":flag_mesh", multiplayer_flag_projections_begin),
(val_add, ":flag_mesh", multiplayer_flag_taken_projections_begin),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_2", ":flag_mesh"),
(try_begin),
(neq, "$g_multiplayer_team_1_faction", "$g_multiplayer_team_2_faction"),
(store_sub, ":flag_mesh", "$g_multiplayer_team_2_faction", npc_kingdoms_begin),
(val_add, ":flag_mesh", multiplayer_flag_projections_begin),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_3", ":flag_mesh"),
(val_sub, ":flag_mesh", multiplayer_flag_projections_begin),
(val_add, ":flag_mesh", multiplayer_flag_taken_projections_begin),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_4", ":flag_mesh"),
(else_try),
(assign, ":flag_mesh", "mesh_flag_project_rb"),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_3", ":flag_mesh"),
(assign, ":flag_mesh", "mesh_flag_project_rb_miss"),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_4", ":flag_mesh"),
(try_end),
(position_set_x, pos1, 250),
(position_set_y, pos1, 250),
(overlay_set_size, "$g_presentation_obj_flag_projection_display_1", pos1),
(overlay_set_size, "$g_presentation_obj_flag_projection_display_2", pos1),
(overlay_set_size, "$g_presentation_obj_flag_projection_display_3", pos1),
(overlay_set_size, "$g_presentation_obj_flag_projection_display_4", pos1),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 0),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_2", 0),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_3", 0),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_4", 0),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run,
[
(set_fixed_point_multiplier, 1000),
(scene_prop_get_instance, ":flag_red_id", "$team_1_flag_scene_prop", 0),
(team_get_slot, ":team_0_flag_situation", 0, slot_team_flag_situation),
(try_begin),
(neq, ":team_0_flag_situation", 1),
(prop_instance_get_position, pos1, ":flag_red_id"), #hold position of flag of team 1 (red flag) at pos1
(else_try),
(entry_point_get_position, pos1, multi_base_point_team_1), #moved from above to here after auto-set position
(try_end),
(position_move_z, pos1, 200, 1),
(scene_prop_get_instance, ":flag_blue_id", "$team_2_flag_scene_prop", 0),
(team_get_slot, ":team_1_flag_situation", 1, slot_team_flag_situation),
(try_begin),
(neq, ":team_1_flag_situation", 1),
(prop_instance_get_position, pos2, ":flag_blue_id"), #hold position of flag of team 1 (red flag) at pos1
(else_try),
(entry_point_get_position, pos2, multi_base_point_team_2), #moved from above to here after auto-set position
(try_end),
(position_move_z, pos2, 200, 1),
(position_get_screen_projection, pos3, pos1),
(position_get_x, ":x_pos", pos3),
(position_get_y, ":y_pos", pos3),
(position_set_y, pos3, ":y_pos"),
(try_begin),
(is_between, ":x_pos", -100, 1100),
(is_between, ":y_pos", -100, 850),
(multiplayer_get_my_player, ":my_player_number"),
(try_begin),
(ge, ":my_player_number", 0),
(player_get_team_no, ":my_player_team", ":my_player_number"),
(else_try),
(assign, ":my_player_team", multi_team_spectator),
(try_end),
(try_begin),
(neq, ":my_player_team", 1), #if I am at team 0 or spectator
(try_begin),
(neq, ":team_0_flag_situation", 1), #if our flag is not stolen
(overlay_set_position, "$g_presentation_obj_flag_projection_display_1", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 1),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_2", 0),
(else_try), #if our flag is stolen
(try_begin),
(eq, ":my_player_team", 0),
(assign, ":our_base_entry_id", multi_base_point_team_1),
(else_try),
(assign, ":our_base_entry_id", multi_base_point_team_2),
(try_end),
(entry_point_get_position, pos5, ":our_base_entry_id"), #moved from above to here after auto-set position
(position_get_screen_projection, pos3, pos5),
(overlay_set_position, "$g_presentation_obj_flag_projection_display_2", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_2", 1),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 0),
(try_end),
(else_try),
(try_begin),
(neq, ":team_0_flag_situation", 1),
(overlay_set_position, "$g_presentation_obj_flag_projection_display_1", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 1),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_2", 0),
(try_end),
(try_end),
(else_try),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 0),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_2", 0),
(try_end),
(position_get_screen_projection, pos3, pos2),
(position_get_x, ":x_pos", pos3),
(position_get_y, ":y_pos", pos3),
(position_set_y, pos3, ":y_pos"),
(try_begin),
(is_between, ":x_pos", -100, 1100),
(is_between, ":y_pos", -100, 850),
(team_get_slot, ":team_1_flag_situation", 1, slot_team_flag_situation),
(multiplayer_get_my_player, ":my_player_number"),
(try_begin),
(ge, ":my_player_number", 0),
(player_get_team_no, ":my_player_team", ":my_player_number"),
(else_try),
(assign, ":my_player_team", multi_team_spectator),
(try_end),
(try_begin),
(neq, ":my_player_team", 0), #if I am at team 0 or spectator
(try_begin),
(neq, ":team_1_flag_situation", 1), #if our flag is not stolen
(overlay_set_position, "$g_presentation_obj_flag_projection_display_3", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_3", 1),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_4", 0),
(else_try), #if our flag is stolen
(try_begin),
(eq, ":my_player_team", 0),
(assign, ":our_base_entry_id", multi_base_point_team_1),
(else_try),
(assign, ":our_base_entry_id", multi_base_point_team_2),
(try_end),
(entry_point_get_position, pos5, ":our_base_entry_id"), #moved from above to here after auto-set position
(position_get_screen_projection, pos3, pos5),
(overlay_set_position, "$g_presentation_obj_flag_projection_display_4", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_4", 1),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_3", 0),
(try_end),
(else_try),
(try_begin),
(neq, ":team_1_flag_situation", 1),
(overlay_set_position, "$g_presentation_obj_flag_projection_display_3", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_3", 1),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_4", 0),
(try_end),
(try_end),
(else_try),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_3", 0),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_4", 0),
(try_end),
]),
]),
("multiplayer_flag_projection_display_bt", prsntf_read_only|prsntf_manual_end_only, 0, [ #this is for search and destroy death mode flags.
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(store_sub, ":flag_mesh", "$g_multiplayer_team_1_faction", npc_kingdoms_begin),
(val_add, ":flag_mesh", multiplayer_flag_projections_begin),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_1", ":flag_mesh"),
(try_begin),
(neq, "$g_multiplayer_team_1_faction", "$g_multiplayer_team_2_faction"),
(store_sub, ":flag_mesh", "$g_multiplayer_team_2_faction", npc_kingdoms_begin),
(val_add, ":flag_mesh", multiplayer_flag_projections_begin),
(else_try),
(assign, ":flag_mesh", "mesh_flag_project_rb"),
(try_end),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_3", ":flag_mesh"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 250),
(overlay_set_size, "$g_presentation_obj_flag_projection_display_1", pos1),
(overlay_set_size, "$g_presentation_obj_flag_projection_display_3", pos1),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 0),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_3", 0),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run, [
(try_begin),
(eq, "$g_round_ended", 0),
(set_fixed_point_multiplier, 1000),
(scene_prop_get_instance, ":flag_1_id", "$team_1_flag_scene_prop", 0),
(prop_instance_get_position, pos1, ":flag_1_id"), #hold position of flag of team 1 at pos1
(position_move_z, pos1, 250, 1),
(scene_prop_get_instance, ":flag_2_id", "$team_2_flag_scene_prop", 0),
(prop_instance_get_position, pos2, ":flag_2_id"), #hold position of flag of team 2 at pos2
(position_move_z, pos2, 250, 1),
(position_get_screen_projection, pos3, pos1),
(position_get_x, ":x_pos", pos3),
(position_get_y, ":y_pos", pos3),
(position_set_y, pos3, ":y_pos"),
(try_begin),
(is_between, ":x_pos", -100, 1100),
(is_between, ":y_pos", -100, 850),
(overlay_set_position, "$g_presentation_obj_flag_projection_display_1", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 1),
(else_try),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 0),
(try_end),
(position_get_screen_projection, pos3, pos2),
(position_get_x, ":x_pos", pos3),
(position_get_y, ":y_pos", pos3),
(position_set_y, pos3, ":y_pos"),
(try_begin),
(is_between, ":x_pos", -100, 1100),
(is_between, ":y_pos", -100, 850),
(overlay_set_position, "$g_presentation_obj_flag_projection_display_3", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_3", 1),
(else_try),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_3", 0),
(try_end),
(else_try),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_destructible_targets_display", prsntf_read_only|prsntf_manual_end_only, 0, [ #this is for search and destroy death mode flags.
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(try_begin),
(eq, "$g_defender_team", 0),
(store_sub, ":flag_mesh", "$g_multiplayer_team_1_faction", npc_kingdoms_begin),
(else_try),
(store_sub, ":flag_mesh", "$g_multiplayer_team_2_faction", npc_kingdoms_begin),
(try_end),
(val_add, ":flag_mesh", multiplayer_flag_projections_begin),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_1", ":flag_mesh"),
(create_mesh_overlay, "$g_presentation_obj_flag_projection_display_2", ":flag_mesh"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 250),
(overlay_set_size, "$g_presentation_obj_flag_projection_display_1", pos1),
(overlay_set_size, "$g_presentation_obj_flag_projection_display_2", pos1),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 0),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_2", 0),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run, [
(try_begin),
(eq, "$g_round_ended", 0),
(set_fixed_point_multiplier, 1000),
(scene_prop_get_instance, ":target_1_id", "$g_destructible_target_1", 0),
(prop_instance_get_position, pos1, ":target_1_id"),
(prop_instance_get_position, pos1, ":target_1_id"),
(position_move_z, pos1, 250, 1),
(scene_prop_get_instance, ":target_2_id", "$g_destructible_target_2", 0),
(prop_instance_get_position, pos2, ":target_2_id"),
(prop_instance_get_position, pos2, ":target_2_id"),
(position_move_z, pos2, 250, 1),
(position_get_screen_projection, pos3, pos1),
(position_get_x, ":x_pos", pos3),
(position_get_y, ":y_pos", pos3),
(position_set_y, pos3, ":y_pos"),
(try_begin),
(is_between, ":x_pos", -100, 1100),
(is_between, ":y_pos", -100, 850),
(prop_instance_get_starting_position, pos0, ":target_1_id"),
(prop_instance_get_position, pos1, ":target_1_id"),
(get_sq_distance_between_positions_in_meters, ":dist", pos0, pos1),
(le, ":dist", 2), #this can be 0 or 1 too.
(overlay_set_position, "$g_presentation_obj_flag_projection_display_1", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 1),
(else_try),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_1", 0),
(try_end),
(position_get_screen_projection, pos3, pos2),
(position_get_x, ":x_pos", pos3),
(position_get_y, ":y_pos", pos3),
(position_set_y, pos3, ":y_pos"),
(try_begin),
(is_between, ":x_pos", -100, 1100),
(is_between, ":y_pos", -100, 850),
(prop_instance_get_starting_position, pos0, ":target_2_id"),
(prop_instance_get_position, pos1, ":target_2_id"),
(get_sq_distance_between_positions_in_meters, ":dist", pos0, pos1),
(le, ":dist", 2), #this can be 0 or 1 too.
(overlay_set_position, "$g_presentation_obj_flag_projection_display_2", pos3),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_2", 1),
(else_try),
(overlay_set_display, "$g_presentation_obj_flag_projection_display_2", 0),
(try_end),
(else_try),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_respawn_time_counter", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(assign, "$g_multiplayer_respawn_counter_overlay", -1),
(assign, "$g_multiplayer_respawn_remained_overlay", -1),
(assign, ":do_not_show_respawn_counter", 0),
(try_begin),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_round_result_in_siege_mode),
(this_or_next|eq, "$g_round_ended", 1),
(eq, "$g_flag_is_not_ready", 1),
(assign, ":do_not_show_respawn_counter", 1),
(try_end),
(eq, ":do_not_show_respawn_counter", 0),
(assign, "$g_multiplayer_last_respawn_counter_value", -1),
(str_clear, s0),
(create_text_overlay, "$g_multiplayer_respawn_counter_overlay", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_respawn_counter_overlay", 0xFFFFFF),
(position_set_x, pos1, 500),
(position_set_y, pos1, 600),
(overlay_set_position, "$g_multiplayer_respawn_counter_overlay", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_respawn_counter_overlay", pos1),
(str_clear, s0),
(create_text_overlay, "$g_multiplayer_respawn_remained_overlay", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_respawn_remained_overlay", 0xFFFFFF),
(position_set_x, pos1, 500),
(position_set_y, pos1, 570),
(overlay_set_position, "$g_multiplayer_respawn_remained_overlay", pos1),
(position_set_x, pos1, 1400),
(position_set_y, pos1, 1400),
(overlay_set_size, "$g_multiplayer_respawn_remained_overlay", pos1),
#(store_mission_timer_a, "$g_multiplayer_respawn_start_time"),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run, [
(ge, "$g_multiplayer_respawn_counter_overlay", 0),
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_team_no, ":player_team", ":my_player_no"),
(try_begin),
(eq, ":player_team", multi_team_spectator),
(presentation_set_duration, 0),
(else_try),
(store_mission_timer_a, ":current_time"),
(store_sub, ":seconds_past_in_respawn", ":current_time", "$g_multiplayer_respawn_start_time"),
(try_begin),
(eq, "$g_show_no_more_respawns_remained", 0),
(assign, ":total_respawn_time", "$g_multiplayer_respawn_period"),
(try_begin),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
(player_get_team_no, ":player_team", ":my_player_no"),
(eq, ":player_team", 0),
(val_add, ":total_respawn_time", multiplayer_siege_mod_defender_team_extra_respawn_time),
(try_end),
(else_try),
(assign, ":total_respawn_time", 6),
(try_end),
(store_sub, ":seconds_left_in_respawn", ":total_respawn_time", ":seconds_past_in_respawn"),
(try_begin),
(le, ":seconds_left_in_respawn", 0),
(presentation_set_duration, 0),
(else_try),
(neq, "$g_multiplayer_last_respawn_counter_value", ":seconds_left_in_respawn"),
(assign, "$g_multiplayer_last_respawn_counter_value", ":seconds_left_in_respawn"),
(try_begin),
(eq, "$g_show_no_more_respawns_remained", 0),
(assign, reg0, ":seconds_left_in_respawn"),
(str_store_string, s0, "str_respawning_in_reg0_seconds"),
(try_begin),
(gt, "$g_multiplayer_number_of_respawn_count", 0),
(store_sub, reg0, "$g_multiplayer_number_of_respawn_count", "$g_my_spawn_count"),
(multiplayer_get_my_player, ":my_player_no"),
(player_get_team_no, ":my_player_team", ":my_player_no"),
(eq, ":my_player_team", 0),
(try_begin),
(gt, reg0, 1),
(str_store_string, s1, "str_reg0_respawns_remained"),
(else_try),
(str_store_string, s1, "str_this_is_your_last_respawn"),
(try_end),
(else_try),
(str_clear, s1),
(try_end),
(else_try),
(eq, "$g_show_no_more_respawns_remained", 1),
##(assign, "$g_informed_about_no_more_respawns_remained", 1),
(str_store_string, s0, "str_no_more_respawns_remained_this_round"),
(str_clear, s1),
(str_store_string, s1, "str_wait_next_round"),
(try_end),
(overlay_set_text, "$g_multiplayer_respawn_counter_overlay", s0),
(overlay_set_text, "$g_multiplayer_respawn_remained_overlay", s1),
(try_end),
(try_end),
(else_try),
(presentation_set_duration, 0),
(try_end),
(try_begin),
(eq, "$g_multiplayer_message_type", multiplayer_message_type_round_result_in_siege_mode),
(this_or_next|eq, "$g_round_ended", 1),
(eq, "$g_flag_is_not_ready", 1),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_stats_chart", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_score_b"),
(position_set_x, pos1, 100),
(position_set_y, pos1, 100),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(assign, ":team_1_rows", 0),
(assign, ":team_2_rows", 0),
(assign, ":spectator_rows", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(try_begin),
(player_is_active, ":player_no"),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 1),
(player_get_team_no, ":player_team", ":player_no"),
(try_begin),
(eq, ":player_team", 0),
(val_add, ":team_1_rows", 1),
(else_try),
(eq, ":player_team", 1),
(val_add, ":team_2_rows", 1),
(else_try),
(eq, ":player_team", multi_team_spectator),
(val_add, ":spectator_rows", 1),
(try_end),
(else_try),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 0),
(try_end),
(try_end),
(try_begin),
(gt, "$g_multiplayer_num_bots_team_1", 0),
(val_add, ":team_1_rows", 1),
(try_end),
(try_begin),
(gt, "$g_multiplayer_num_bots_team_2", 0),
(val_add, ":team_2_rows", 1),
(try_end),
(assign, ":total_rows", ":team_1_rows"),
(val_max, ":total_rows", ":team_2_rows"),
(val_add, ":total_rows", ":spectator_rows"),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_stats_chart_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 100),
(position_set_y, pos1, 120),#120
(overlay_set_position, "$g_presentation_obj_stats_chart_container", pos1),
(position_set_x, pos1, 746),
(position_set_y, pos1, 530),#530
(overlay_set_area_size, "$g_presentation_obj_stats_chart_container", pos1),
(set_container_overlay, "$g_presentation_obj_stats_chart_container"),
(store_mul, ":y_needed", ":total_rows", 20),
(val_add, ":y_needed", 100),
(try_begin),
(gt, ":spectator_rows", 0),
(val_add, ":y_needed", 70),
(try_end),
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(gt, ":y_needed", 490),
(assign, "$g_stats_chart_update_period", 8),
(else_try),
(assign, "$g_stats_chart_update_period", 1),
(try_end),
(try_begin), #counting number of flags each team has.
(eq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(call_script, "script_get_headquarters_scores"),
(assign, ":team_1_num_flags", reg0),
(assign, ":team_2_num_flags", reg1),
(try_end),
#assuming only 2 teams in scene
(try_for_range, ":i_team", 0, multi_team_spectator),
(assign, ":number_of_players", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_team_no, ":team_no", ":player_no"),
(eq, ":team_no", ":i_team"),
(val_add, ":number_of_players", 1),
(try_end),
(assign, reg0, ":number_of_players"),
(try_begin),
(neq, ":number_of_players", 1),
(create_text_overlay, reg1, "str_reg0_players", 0),
(else_try),
(create_text_overlay, reg1, "str_reg0_player", 0),
(try_end),
(assign, ":cur_y", ":y_needed"),
(team_get_faction, ":cur_faction", ":i_team"),
(str_store_faction_name, s1, ":cur_faction"),
(create_text_overlay, reg0, s1, 0),
(try_begin),
(eq, ":i_team", 0),
(overlay_set_color, reg0, 0xFF0000),
(overlay_set_color, reg1, 0xFF0000),
(else_try),
(overlay_set_color, reg0, 0x0099FF),
(overlay_set_color, reg1, 0x0099FF),
(try_end),
(assign, ":distance_between_teams", 373),
(store_mul, ":cur_x", ":distance_between_teams", ":i_team"),
(val_add, ":cur_x", 42),
(store_add, ":cur_x_add_15", ":cur_x", 15),
(position_set_x, pos3, ":cur_x_add_15"),
(position_set_y, pos3, ":cur_y"),
(store_add, ":cur_x_add_35", ":cur_x", 35),
(position_set_x, pos1, ":cur_x_add_35"),
(position_set_y, pos1, ":cur_y"),
(copy_position, pos2, pos1),
(store_sub, ":cur_y_sub_10", ":cur_y", 10),
(position_set_x, pos2, ":cur_x_add_35"),
(position_set_y, pos2, ":cur_y_sub_10"),
(overlay_set_position, reg0, pos1),
(overlay_set_position, reg1, pos2),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(position_set_x, pos2, 600),
(position_set_y, pos2, 600),
(overlay_set_size, reg0, pos1),
(overlay_set_size, reg1, pos2),
(team_get_faction, ":faction_of_team_1", 0),
(team_get_faction, ":faction_of_team_2", 1),
(try_begin),
(eq, ":faction_of_team_1", ":faction_of_team_2"),
(eq, ":i_team", 1),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_7"),
(else_try),
(eq, ":cur_faction", "fac_kingdom_4"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_1"),
(else_try),
(eq, ":cur_faction", "fac_kingdom_2"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_2"),
(else_try),
(eq, ":cur_faction", "fac_kingdom_3"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_3"),
(else_try),
(eq, ":cur_faction", "fac_kingdom_5"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_4"),
(else_try),
(eq, ":cur_faction", "fac_kingdom_6"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_5"),
(else_try),
(eq, ":cur_faction", "fac_kingdom_1"),
(create_mesh_overlay, reg0, "mesh_ui_kingdom_shield_6"),
(try_end),
(position_set_x, pos1, 100),
(position_set_y, pos1, 100),
(overlay_set_position, reg0, pos3),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_size, reg0, pos1),
(team_get_score, reg0, ":i_team"),
(create_text_overlay, reg0, "str_score_reg0", tf_right_align),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 325), #325
(store_add, ":sub_cur_y", ":cur_y", 0),
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1200),
(position_set_y, pos1, 1200),
(overlay_set_size, reg0, pos1),
(try_begin), #counting number of flags each team has only at hq mod.
(eq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(try_begin),
(eq, ":i_team", 0),
(assign, reg0, ":team_1_num_flags"),
(else_try),
(eq, ":i_team", 1),
(assign, reg0, ":team_2_num_flags"),
(try_end),
(create_text_overlay, reg0, "str_flags_reg0", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 258),
(store_add, ":sub_cur_y", ":cur_y", -10),
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 600),
(overlay_set_size, reg0, pos1),
(try_end),
(val_sub, ":cur_y", 60),
(create_text_overlay, reg0, "str_player_name", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(try_begin), #at headquarters and capture the flag write score instead before kill count
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_capture_the_flag),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(create_text_overlay, reg0, "str_score", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 138),
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(try_end),
(create_text_overlay, reg0, "str_kills", tf_center_justify),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 206), #191
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(create_text_overlay, reg0, "str_deaths", tf_center_justify),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 260), #232
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(create_text_overlay, reg0, "str_ping", tf_center_justify),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 308), #291
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0xD0),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", -10),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 16500),
(position_set_y, pos1, 50),
(overlay_set_size, reg0, pos1),
(val_sub, ":cur_y", 35),
(store_add, ":end_cond", ":num_players", 1),
(try_for_range, ":unused", 0, ":end_cond"),
(assign, ":max_score_plus_death", -30030),
(assign, ":max_score_plus_death_player_no", -1),
(try_for_range, ":player_no", 0, ":num_players"),
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(troop_slot_eq, "trp_multiplayer_data", ":slot_index", 1),
(player_get_team_no, ":player_team", ":player_no"),
(eq, ":player_team", ":i_team"),
(try_begin),
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_capture_the_flag),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(player_get_score, ":kill_count", ":player_no"), #get score in "capture the flag" or "headquarters"
(else_try),
(player_get_kill_count, ":kill_count", ":player_no"), #get kill count in "siege" or "battle" or "team deathmatch" or "deathmatch"
(try_end),
(player_get_death_count, ":death_count", ":player_no"), #get_death_count
(store_mul, ":player_score_plus_death", ":kill_count", 1000),
(val_sub, ":player_score_plus_death", ":death_count"),
(this_or_next|gt, ":player_score_plus_death", ":max_score_plus_death"),
(eq, ":player_score_plus_death", -30030),
(assign, ":max_score_plus_death", ":player_score_plus_death"),
(assign, ":max_score_plus_death_player_no", ":player_no"),
(try_end),
(try_begin),
(ge, ":max_score_plus_death_player_no", 0),
(store_add, ":slot_index", ":max_score_plus_death_player_no", multi_data_player_index_list_begin),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 0),
(try_begin),
(eq, ":my_player_no", ":max_score_plus_death_player_no"),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0x35),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", 0),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 16500),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(try_end),
(try_begin), #at headquarters and capture the flag write score instead dead label before kill count
(this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_capture_the_flag),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_headquarters),
(assign, ":font_color", 0xFFFFFF),
(player_get_agent_id, ":max_score_plus_death_agent_id", ":max_score_plus_death_player_no"),
(try_begin),
(this_or_next|lt, ":max_score_plus_death_agent_id", 0),
(neg|agent_is_alive, ":max_score_plus_death_agent_id"),
(assign, ":font_color", 0xFF0000),
(try_end),
(player_get_score, reg0, ":max_score_plus_death_player_no"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 165), #150
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(else_try),
(assign, ":font_color", 0xFFFFFF),
(player_get_agent_id, ":max_score_plus_death_agent_id", ":max_score_plus_death_player_no"),
(try_begin),
(this_or_next|lt, ":max_score_plus_death_agent_id", 0),
(neg|agent_is_alive, ":max_score_plus_death_agent_id"),
(assign, ":font_color", 0xFF0000),
(create_text_overlay, reg0, "str_dead", 0),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 130),
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(try_end),
(try_end),
(str_store_player_username, s1, ":max_score_plus_death_player_no"),
(create_text_overlay, reg0, s1, 0),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(player_get_kill_count, reg0, ":max_score_plus_death_player_no"), #get_kill_count
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 215), #200
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(player_get_death_count, reg0, ":max_score_plus_death_player_no"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 265), #250
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(player_get_ping, reg0, ":max_score_plus_death_player_no"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 315), #300
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", 20),
(else_try),
(try_begin),
(try_begin),
(eq, ":i_team", 0),
(assign, ":number_of_bots_in_cur_team", "$g_multiplayer_num_bots_team_1"),
(else_try),
(assign, ":number_of_bots_in_cur_team", "$g_multiplayer_num_bots_team_2"),
(try_end),
(team_get_bot_kill_count, reg0, ":i_team"),
(team_get_bot_death_count, reg1, ":i_team"),
(try_begin),
(this_or_next|neq, reg0, 0),
(this_or_next|neq, reg1, 0),
(neq, ":number_of_bots_in_cur_team", 0),
(assign, ":write_bot_informations_of_team", 1),
(else_try),
(assign, ":write_bot_informations_of_team", 0),
(try_end),
(eq, ":write_bot_informations_of_team", 1),
(assign, ":number_of_alive_bots", 0),
(try_for_agents, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_team, ":cur_agent_team", ":cur_agent"),
(eq, ":cur_agent_team", ":i_team"),
(val_add, ":number_of_alive_bots", 1),
(try_end),
(store_sub, ":number_of_dead_bots", ":number_of_bots_in_cur_team", ":number_of_alive_bots"),
(try_begin),
(eq, ":number_of_alive_bots", 0),
(assign, ":font_color", 0xFF0000),
(else_try),
(assign, ":font_color", 0xD0D0D0),
(try_end),
(try_begin),
(gt, ":number_of_dead_bots", 0),
(try_begin),
(eq, ":number_of_bots_in_cur_team", 1),
(create_text_overlay, reg0, "str_dead", 0),
(store_add, ":sub_cur_x", ":cur_x", 130),
(else_try),
(assign, reg0, ":number_of_dead_bots"),
(create_text_overlay, reg0, "str_reg0_dead", 0),
(store_add, ":sub_cur_x", ":cur_x", 123),
(try_end),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(try_end),
(try_begin),
(gt, ":number_of_bots_in_cur_team", 1),
(assign, reg0, ":number_of_bots_in_cur_team"),
(create_text_overlay, reg0, "str_bots_reg0_agents", 0),
(else_try),
(create_text_overlay, reg0, "str_bot_1_agent", 0),
(try_end),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(team_get_bot_kill_count, reg0, ":i_team"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 215), #200
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(team_get_bot_death_count, reg0, ":i_team"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 265), #250
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", 20),
(try_end),
(assign, ":end_cond", 0), #all players are written for this team, break
(try_end),
(try_end),
(try_begin),
(eq, ":i_team", 0),
(assign, ":old_cur_y", ":cur_y"),
(try_end),
(try_end),
(try_begin),
(le, ":old_cur_y", ":cur_y"),
(assign, ":cur_y", ":old_cur_y"),
(try_end),
(assign, ":cur_x", 42),
#white line between playing players and spectators
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0xD0),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", 10),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 36000),
(position_set_y, pos1, 50),
(overlay_set_size, reg0, pos1),
(try_begin),
(gt, ":spectator_rows", 0),
(assign, ":cur_x", 280),
(val_sub, ":cur_y", 50),
#"spectators" text
(create_text_overlay, reg0, "str_spectators", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(create_text_overlay, reg0, "str_ping", tf_right_align),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 215), #200
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
#white line for spectators list
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0xD0),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", -10),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 12000),
(position_set_y, pos1, 50),
(overlay_set_size, reg0, pos1),
(val_sub, ":cur_y", 30),
(assign, ":font_color", 0xC0C0C0),
(store_add, ":end_cond", ":num_players", 1),
(try_for_range, ":player_no", 0, ":end_cond"),
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(troop_slot_eq, "trp_multiplayer_data", ":slot_index", 1),
(player_get_team_no, ":player_team", ":player_no"),
(eq, ":player_team", multi_team_spectator), #to not to allow dedicated server to pass below, dedicated servers have -1 for team_no not 2(multi_team_spectator).
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 1),
(try_begin),
(eq, ":my_player_no", ":player_no"),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0x35),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", 0),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 12000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(try_end),
(str_store_player_username, s1, ":player_no"),
(create_text_overlay, reg0, s1, 0),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(player_get_ping, reg0, ":player_no"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 215), #200
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", 20),
(try_end),
(try_end),
(omit_key_once, key_mouse_scroll_up),
(omit_key_once, key_mouse_scroll_down),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(this_or_next|key_clicked, key_mouse_scroll_up),
(key_clicked, key_mouse_scroll_down),
(omit_key_once, key_mouse_scroll_up),
(omit_key_once, key_mouse_scroll_down),
(try_end),
(try_begin),
(eq, "$g_multiplayer_stats_chart_opened_manually", 1),
(neg|game_key_is_down, gk_leave),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(clear_omitted_keys),
(presentation_set_duration, 0),
(try_end),
(try_begin),
(store_mul, ":update_period_time_limit", "$g_stats_chart_update_period", 1000),
(gt, ":cur_time", ":update_period_time_limit"),
(clear_omitted_keys),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_stats_chart"),
(try_end),
]),
]),
#this score table is used in only deathmatch
("multiplayer_stats_chart_deathmatch", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_score_a"),
(position_set_x, pos1, 295),
(position_set_y, pos1, 115),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(assign, ":team_rows", 0),
(assign, ":spectator_rows", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(try_begin),
(player_is_active, ":player_no"),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 1),
(player_get_team_no, ":player_team", ":player_no"),
(try_begin),
(this_or_next|eq, ":player_team", 0),
(eq, ":player_team", 1),
(val_add, ":team_rows", 1),
(else_try),
(eq, ":player_team", multi_team_spectator),
(val_add, ":spectator_rows", 1),
(try_end),
(else_try),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 0),
(try_end),
(try_end),
(try_begin),
(this_or_next|gt, "$g_multiplayer_num_bots_team_1", 0),
(gt, "$g_multiplayer_num_bots_team_2", 0),
(val_add, ":team_rows", 1),
(try_end),
(store_add, ":total_rows", ":team_rows", ":spectator_rows"),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_stats_chart_deathmatch_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 300),
(position_set_y, pos1, 140),
(overlay_set_position, "$g_presentation_obj_stats_chart_deathmatch_container", pos1),
(position_set_x, pos1, 346),
(position_set_y, pos1, 530),
(overlay_set_area_size, "$g_presentation_obj_stats_chart_deathmatch_container", pos1),
(set_container_overlay, "$g_presentation_obj_stats_chart_deathmatch_container"),
(store_mul, ":y_needed", ":total_rows", 20),
(val_add, ":y_needed", 80),
(try_begin),
(gt, ":spectator_rows", 0),
(val_add, ":y_needed", 70),
(try_end),
(try_begin),
(ge, ":total_rows", 17),
(assign, "$g_stats_chart_update_period", 10),
(else_try),
(assign, "$g_stats_chart_update_period", 1),
(try_end),
(multiplayer_get_my_player, ":my_player_no"),
#assuming only 2 teams in scene
(assign, ":cur_y", ":y_needed"),
(assign, ":cur_x", 42),
(create_text_overlay, reg0, "str_player_name", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(create_text_overlay, reg0, "str_kills", tf_center_justify),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 179), #164
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(create_text_overlay, reg0, "str_deaths", tf_center_justify),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 233), #205
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(create_text_overlay, reg0, "str_ping", tf_center_justify),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 282), #264
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0xD0),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", -10),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 15250),
(position_set_y, pos1, 50),
(overlay_set_size, reg0, pos1),
(val_sub, ":cur_y", 35),
(store_add, ":end_cond", ":num_players", 1),
(try_for_range, ":unused", 0, ":end_cond"),
(assign, ":max_score_plus_death", -30030),
(assign, ":max_kills_player_no", -1),
(try_for_range, ":player_no", 0, ":num_players"),
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(troop_slot_eq, "trp_multiplayer_data", ":slot_index", 1),
(player_get_team_no, ":player_team", ":player_no"),
(this_or_next|eq, ":player_team", 0),
(eq, ":player_team", 1),
(player_get_kill_count, ":kill_count", ":player_no"),
(player_get_death_count, ":death_count", ":player_no"), #get_death_count
(store_mul, ":player_score_plus_death", ":kill_count", 1000),
(val_sub, ":player_score_plus_death", ":death_count"),
(this_or_next|gt, ":player_score_plus_death", ":max_score_plus_death"),
(eq, ":player_score_plus_death", -30030),
(assign, ":max_score_plus_death", ":player_score_plus_death"),
(assign, ":max_kills_player_no", ":player_no"),
(try_end),
(try_begin),
(ge, ":max_kills_player_no", 0),
(store_add, ":slot_index", ":max_kills_player_no", multi_data_player_index_list_begin),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 0),
(str_store_player_username, s1, ":max_kills_player_no"),
(try_begin),
(eq, ":my_player_no", ":max_kills_player_no"),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0x35),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", 0),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 16000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(try_end),
(create_text_overlay, reg0, s1, 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(player_get_kill_count, reg0, ":max_kills_player_no"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 188), #173
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(player_get_death_count, reg0, ":max_kills_player_no"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 238), #223
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(player_get_ping, reg0, ":max_kills_player_no"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 288), #273
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", 20),
(else_try),
(store_add, ":number_of_bots", "$g_multiplayer_num_bots_team_1", "$g_multiplayer_num_bots_team_2"),
(ge, ":number_of_bots", 1),
(try_begin),
(gt, ":number_of_bots", 1),
(assign, reg0, ":number_of_bots"),
(create_text_overlay, reg0, "str_bots_reg0_agents", 0),
(else_try),
(create_text_overlay, reg0, "str_bot_1_agent", 0),
(try_end),
(overlay_set_color, reg0, 0xD0D0D0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(team_get_bot_kill_count, reg0, 0),
(assign, ":bot_kill_count", reg0),
(team_get_bot_kill_count, reg0, 1),
(val_add, ":bot_kill_count", reg0),
(assign, reg0, ":bot_kill_count"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, 0xD0D0D0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 188), #173
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(team_get_bot_death_count, reg0, 0),
(assign, ":bot_death_count", reg0),
(team_get_bot_death_count, reg0, 1),
(val_add, ":bot_death_count", reg0),
(assign, reg0, ":bot_death_count"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, 0xD0D0D0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 238), #223
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", 20),
(assign, ":end_cond", 0), #all players are written, break
(else_try),
(assign, ":end_cond", 0), #all players are written, break
(try_end),
(try_end),
(assign, ":cur_x", 42),
#white line between playing players and spectators
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0xD0),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", 10),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 15250),
(position_set_y, pos1, 50),
(overlay_set_size, reg0, pos1),
(try_begin),
(gt, ":spectator_rows", 0),
(assign, ":cur_x", 75),
(val_sub, ":cur_y", 50),
#"spectators" text
(create_text_overlay, reg0, "str_spectators", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(create_text_overlay, reg0, "str_ping", tf_center_justify),
(overlay_set_color, reg0, 0xFFFFFF),
(store_add, ":sub_cur_x", ":cur_x", 218), #200
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
#white line for spectators list
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0xD0),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", -10),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 12000),
(position_set_y, pos1, 50),
(overlay_set_size, reg0, pos1),
(val_sub, ":cur_y", 30),
(assign, ":font_color", 0xC0C0C0),
(store_add, ":end_cond", ":num_players", 1),
(try_for_range, ":player_no", 0, ":end_cond"),
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(troop_slot_eq, "trp_multiplayer_data", ":slot_index", 1),
(player_get_team_no, ":player_team", ":player_no"),
(eq, ":player_team", multi_team_spectator), #to not to allow dedicated server to pass below, dedicated servers have -1 for team_no not 2(multi_team_spectator).
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 1),
(try_begin),
(eq, ":my_player_no", ":player_no"),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0xFFFFFF),
(overlay_set_alpha, reg0, 0x35),
(store_add, ":sub_cur_x", ":cur_x", 0),
(position_set_x, pos1, ":sub_cur_x"),
(store_add, ":sub_cur_y", ":cur_y", 0),
(position_set_y, pos1, ":sub_cur_y"),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 12000), #16500
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(try_end),
(str_store_player_username, s1, ":player_no"),
(create_text_overlay, reg0, s1, 0),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, ":cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(player_get_ping, reg0, ":player_no"),
(create_text_overlay, reg0, "str_reg0", tf_right_align),
(overlay_set_color, reg0, ":font_color"),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg0, pos1),
(store_add, ":sub_cur_x", ":cur_x", 215), #200
(position_set_x, pos1, ":sub_cur_x"),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", 20),
(try_end),
(try_end),
(omit_key_once, key_mouse_scroll_up),
(omit_key_once, key_mouse_scroll_down),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(this_or_next|key_clicked, key_mouse_scroll_up),
(key_clicked, key_mouse_scroll_down),
(omit_key_once, key_mouse_scroll_up),
(omit_key_once, key_mouse_scroll_down),
(try_end),
(try_begin),
(eq, "$g_multiplayer_stats_chart_opened_manually", 1),
(neg|game_key_is_down, gk_leave),
(assign, "$g_multiplayer_stats_chart_opened_manually", 0),
(clear_omitted_keys),
(presentation_set_duration, 0),
(try_end),
(try_begin),
(store_mul, ":update_period_time_limit", "$g_stats_chart_update_period", 1000),
(gt, ":cur_time", ":update_period_time_limit"),
(clear_omitted_keys),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_stats_chart_deathmatch"),
(try_end),
]),
]),
("multiplayer_escape_menu", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_ingame_menu"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 80),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_escape_menu_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 285),
(position_set_y, pos1, 75),
(overlay_set_position, "$g_presentation_obj_escape_menu_container", pos1),
(position_set_x, pos1, 405),
(position_set_y, pos1, 550),
(overlay_set_area_size, "$g_presentation_obj_escape_menu_container", pos1),
(set_container_overlay, "$g_presentation_obj_escape_menu_container"),
(assign, ":cur_y", 500),
(create_text_overlay, reg0, "str_choose_an_option", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(create_button_overlay, "$g_presentation_obj_escape_menu_1", "str_choose_faction", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_1", 0xFFFFFF),
(multiplayer_get_my_team, ":my_team"),
(assign, "$g_presentation_obj_escape_menu_2", -1),
(assign, "$g_presentation_obj_escape_menu_3", -1),
(assign, "$g_presentation_obj_escape_menu_6", -1),
(assign, "$g_presentation_obj_escape_menu_7", -1),
(assign, "$g_presentation_obj_escape_menu_8", -1),
(assign, "$g_presentation_obj_escape_menu_9", -1),
(assign, "$g_presentation_obj_escape_menu_10", -1),
(assign, "$g_presentation_obj_escape_menu_11", -1),
(assign, "$g_presentation_obj_escape_menu_12", -1),
(assign, "$g_presentation_obj_escape_menu_13", -1),
(try_begin),
(lt, ":my_team", multi_team_spectator),
(create_button_overlay, "$g_presentation_obj_escape_menu_2", "str_choose_troop", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_2", 0xFFFFFF),
(multiplayer_get_my_troop, ":my_troop"),
(try_begin),
(ge, ":my_troop", 0),
(create_button_overlay, "$g_presentation_obj_escape_menu_3", "str_choose_items", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_3", 0xFFFFFF),
(try_end),
(try_end),
(create_button_overlay, "$g_presentation_obj_escape_menu_4", "str_options", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_4", 0xFFFFFF),
(create_button_overlay, "$g_presentation_obj_escape_menu_5", "str_redefine_keys", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_5", 0xFFFFFF),
(create_button_overlay, "$g_presentation_obj_escape_menu_13", "@Show game rules", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_13", 0xFFFFFF),
(multiplayer_get_my_player, ":my_player_no"),
(try_begin),
(this_or_next|eq, "$g_multiplayer_maps_voteable", 1),
(this_or_next|eq, "$g_multiplayer_factions_voteable", 1),
(this_or_next|gt, "$g_multiplayer_num_bots_voteable", 0),
(this_or_next|eq, "$g_multiplayer_kick_voteable", 1),
(eq, "$g_multiplayer_ban_voteable", 1),
(create_button_overlay, "$g_presentation_obj_escape_menu_6", "str_submit_a_poll", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_6", 0xFFFFFF),
(assign, "$g_presentation_obj_escape_menu_6_available", 1),
(try_begin),
(ge, ":my_player_no", 0),
(player_get_slot, ":last_poll_time", ":my_player_no", slot_player_poll_disabled_until_time),
(store_mission_timer_a, ":mission_timer"),
(lt, ":mission_timer", ":last_poll_time"),
(overlay_set_color, "$g_presentation_obj_escape_menu_6", 0x888888),
(overlay_set_hilight_color, "$g_presentation_obj_escape_menu_6", 0x888888),
(assign, "$g_presentation_obj_escape_menu_6_available", 0),
(try_end),
(try_end),
(try_begin),
(ge, ":my_player_no", 0),
(player_is_admin, ":my_player_no"),
(create_button_overlay, "$g_presentation_obj_escape_menu_7", "str_administrator_panel", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_7", 0xFFFFFF),
(create_button_overlay, "$g_presentation_obj_escape_menu_8", "str_kick_player", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_8", 0xFFFFFF),
(create_button_overlay, "$g_presentation_obj_escape_menu_9", "str_ban_player", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_9", 0xFFFFFF),
(try_end),
(create_button_overlay, "$g_presentation_obj_escape_menu_11", "str_mute_player", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_11", 0xFFFFFF),
(try_begin),
(assign, "$g_presentation_obj_escape_menu_12", -1),
(assign, ":any_muted", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(player_get_is_muted, ":is_muted", ":player_no"),
(eq, ":is_muted", 1),
(assign, ":any_muted", 1),
(try_end),
(eq, ":any_muted", 1),
(create_button_overlay, "$g_presentation_obj_escape_menu_12", "str_unmute_player", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_12", 0xFFFFFF),
(try_end),
(create_button_overlay, "$g_presentation_obj_escape_menu_10", "str_quit", 0),
(overlay_set_color, "$g_presentation_obj_escape_menu_10", 0xFFFFFF),
(position_set_x, pos1, 130),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_1", pos1),
(try_begin),
(ge, "$g_presentation_obj_escape_menu_2", 0),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_2", pos1),
(try_end),
(try_begin),
(ge, "$g_presentation_obj_escape_menu_3", 0),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_3", pos1),
(try_end),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_4", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_5", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_13", pos1),
(try_begin),
(ge, "$g_presentation_obj_escape_menu_6", 0),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_6", pos1),
(try_end),
(try_begin),
(ge, "$g_presentation_obj_escape_menu_7", 0),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_7", pos1),
(try_end),
(try_begin),
(ge, "$g_presentation_obj_escape_menu_8", 0),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_8", pos1),
(try_end),
(try_begin),
(ge, "$g_presentation_obj_escape_menu_9", 0),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_9", pos1),
(try_end),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_11", pos1),
(try_begin),
(ge, "$g_presentation_obj_escape_menu_12", 0),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_12", pos1),
(try_end),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_escape_menu_10", pos1),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_escape_menu_1"),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_team_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_2"),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_troop_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_3"),
(presentation_set_duration, 0),
(assign, "$g_presentation_state", 0),
(start_presentation, "prsnt_multiplayer_item_select"),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_4"),
(presentation_set_duration, 0),
(change_screen_options),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_5"),
(presentation_set_duration, 0),
(change_screen_controls),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_6"),
(eq, "$g_presentation_obj_escape_menu_6_available", 1),
(presentation_set_duration, 0),
(start_presentation, "prsnt_multiplayer_poll_menu"),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_7"),
(presentation_set_duration, 0),
(multiplayer_send_message_to_server, multiplayer_event_open_admin_panel),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_8"),
(presentation_set_duration, 0),
(assign, "$g_multiplayer_players_list_action_type", 3), #admin kick
(start_presentation, "prsnt_multiplayer_show_players_list"),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_9"),
(presentation_set_duration, 0),
(assign, "$g_multiplayer_players_list_action_type", 4), #admin ban
(start_presentation, "prsnt_multiplayer_show_players_list"),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_10"),
(presentation_set_duration, 0),
(finish_mission, 0),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_11"),
(presentation_set_duration, 0),
(assign, "$g_multiplayer_players_list_action_type", 5), #mute player
(start_presentation, "prsnt_multiplayer_show_players_list"),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_12"),
(presentation_set_duration, 0),
(assign, "$g_multiplayer_players_list_action_type", 6), #unmute player
(start_presentation, "prsnt_multiplayer_show_players_list"),
(else_try),
(eq, ":object", "$g_presentation_obj_escape_menu_13"),
(presentation_set_duration, 0),
(multiplayer_send_message_to_server, multiplayer_event_open_game_rules),
(try_end),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(key_clicked, key_escape),
(gt, ":cur_time", 200),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_poll_menu", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_ingame_menu"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 80),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_poll_menu_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 285),
(position_set_y, pos1, 125),
(overlay_set_position, "$g_presentation_obj_poll_menu_container", pos1),
(position_set_x, pos1, 405),
(position_set_y, pos1, 500),
(overlay_set_area_size, "$g_presentation_obj_poll_menu_container", pos1),
(set_container_overlay, "$g_presentation_obj_poll_menu_container"),
(assign, "$g_presentation_obj_poll_menu_1", -1),
(assign, "$g_presentation_obj_poll_menu_4", -1),
(assign, "$g_presentation_obj_poll_menu_5", -1),
(assign, ":cur_y", 450),
(create_text_overlay, reg0, "str_choose_a_poll_type", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(position_set_x, pos1, 60),
(try_begin),
(eq, "$g_multiplayer_maps_voteable", 1),
(create_button_overlay, "$g_presentation_obj_poll_menu_1", "str_poll_for_changing_the_map", 0),
(overlay_set_color, "$g_presentation_obj_poll_menu_1", 0xFFFFFF),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_poll_menu_1", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(try_end),
(try_begin),
(eq, "$g_multiplayer_factions_voteable", 1),
(create_button_overlay, "$g_presentation_obj_poll_menu_4", "str_poll_for_changing_the_map_and_factions", 0),
(overlay_set_color, "$g_presentation_obj_poll_menu_4", 0xFFFFFF),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_poll_menu_4", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(try_end),
(try_begin),
(gt, "$g_multiplayer_num_bots_voteable", 0),
(create_button_overlay, "$g_presentation_obj_poll_menu_5", "str_poll_for_changing_number_of_bots", 0),
(overlay_set_color, "$g_presentation_obj_poll_menu_5", 0xFFFFFF),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_poll_menu_5", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(try_end),
(try_begin),
(eq, "$g_multiplayer_kick_voteable", 1),
(create_button_overlay, "$g_presentation_obj_poll_menu_2", "str_poll_for_kicking_a_player", 0),
(overlay_set_color, "$g_presentation_obj_poll_menu_2", 0xFFFFFF),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_poll_menu_2", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(try_end),
(try_begin),
(eq, "$g_multiplayer_ban_voteable", 1),
(create_button_overlay, "$g_presentation_obj_poll_menu_3", "str_poll_for_banning_a_player", 0),
(overlay_set_color, "$g_presentation_obj_poll_menu_3", 0xFFFFFF),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, "$g_presentation_obj_poll_menu_3", pos1),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_poll_menu_1"),
(presentation_set_duration, 0),
(assign, "$g_multiplayer_maps_list_action_type", 1), #poll map
(start_presentation, "prsnt_multiplayer_show_maps_list"),
(else_try),
(eq, ":object", "$g_presentation_obj_poll_menu_2"),
(presentation_set_duration, 0),
(assign, "$g_multiplayer_players_list_action_type", 1), #poll kick
(start_presentation, "prsnt_multiplayer_show_players_list"),
(else_try),
(eq, ":object", "$g_presentation_obj_poll_menu_3"),
(presentation_set_duration, 0),
(assign, "$g_multiplayer_players_list_action_type", 2), #poll ban
(start_presentation, "prsnt_multiplayer_show_players_list"),
(else_try),
(eq, ":object", "$g_presentation_obj_poll_menu_4"),
(presentation_set_duration, 0),
(assign, "$g_multiplayer_maps_list_action_type", 2), #poll map and factions
(start_presentation, "prsnt_multiplayer_show_maps_list"),
(else_try),
(eq, ":object", "$g_presentation_obj_poll_menu_5"),
(presentation_set_duration, 0),
(assign, "$g_multiplayer_number_of_bots_list_action_type", 1), #for team 1
(start_presentation, "prsnt_multiplayer_show_number_of_bots_list"),
(try_end),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(key_clicked, key_escape),
(gt, ":cur_time", 200),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_show_players_list", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_ingame_menu"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 80),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_show_players_1", s0, tf_scrollable_style_2),
(position_set_x, pos1, 285),
(position_set_y, pos1, 125),
(overlay_set_position, "$g_presentation_obj_show_players_1", pos1),
(position_set_x, pos1, 405),
(position_set_y, pos1, 500),
(overlay_set_area_size, "$g_presentation_obj_show_players_1", pos1),
(set_container_overlay, "$g_presentation_obj_show_players_1"),
#(assign, ":cur_y", 450),
(multiplayer_get_my_player, ":my_player_no"),
(assign, ":cur_y", 10),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server no need to write it
(player_is_active, ":player_no"),
(assign, ":continue", 0),
(try_begin),
(neq, "$g_multiplayer_players_list_action_type", 5),
(neq, "$g_multiplayer_players_list_action_type", 6),
(assign, ":continue", 1),
(else_try),
(eq, "$g_multiplayer_players_list_action_type", 5),
(neq, ":player_no", ":my_player_no"),
(player_get_is_muted, ":is_muted", ":player_no"),
(eq, ":is_muted", 0),
(assign, ":continue", 1),
(else_try),
(eq, "$g_multiplayer_players_list_action_type", 6),
(neq, ":player_no", ":my_player_no"),
(player_get_is_muted, ":is_muted", ":player_no"),
(eq, ":is_muted", 1),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(val_add, ":cur_y", escape_menu_item_height),
(try_end),
(create_text_overlay, reg0, "str_choose_a_player", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server no need to write it
(player_is_active, ":player_no"),
(player_set_slot, ":player_no", slot_player_button_index, -1),
(assign, ":continue", 0),
(try_begin),
(neq, "$g_multiplayer_players_list_action_type", 5),
(neq, "$g_multiplayer_players_list_action_type", 6),
(assign, ":continue", 1),
(else_try),
(eq, "$g_multiplayer_players_list_action_type", 5),
(neq, ":player_no", ":my_player_no"),
(player_get_is_muted, ":is_muted", ":player_no"),
(eq, ":is_muted", 0),
(assign, ":continue", 1),
(else_try),
(eq, "$g_multiplayer_players_list_action_type", 6),
(neq, ":player_no", ":my_player_no"),
(player_get_is_muted, ":is_muted", ":player_no"),
(eq, ":is_muted", 1),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(str_store_player_username, s0, ":player_no"),
(create_button_overlay, ":overlay_id", s0, 0),
(overlay_set_color, ":overlay_id", 0xFFFFFF),
(position_set_x, pos1, 130),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, ":overlay_id", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(player_set_slot, ":player_no", slot_player_button_index, ":overlay_id"),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server no need to write it
(player_is_active, ":player_no"),
(player_slot_eq, ":player_no", slot_player_button_index, ":object"),
(try_begin),
(is_between, "$g_multiplayer_players_list_action_type", 1, 3), #poll kick or poll ban
(try_begin),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(multiplayer_send_2_int_to_server, multiplayer_event_start_new_poll, "$g_multiplayer_players_list_action_type", ":player_no"),
(store_mission_timer_a, ":mission_timer"),
(val_add, ":mission_timer", multiplayer_poll_disable_period),
(player_set_slot, ":my_player_no", slot_player_poll_disabled_until_time, ":mission_timer"),
(try_end),
(else_try),
(eq, "$g_multiplayer_players_list_action_type", 3), #admin kick
(multiplayer_send_int_to_server, multiplayer_event_admin_kick_player, ":player_no"),
(else_try),
(eq, "$g_multiplayer_players_list_action_type", 4), #admin ban
(multiplayer_send_int_to_server, multiplayer_event_admin_ban_player, ":player_no"),
(else_try),
(eq, "$g_multiplayer_players_list_action_type", 5), #mute player
(player_set_is_muted, ":player_no", 1),
(else_try),
(eq, "$g_multiplayer_players_list_action_type", 6), #unmute player
(player_set_is_muted, ":player_no", 0),
(try_end),
(assign, ":num_players", 0), #break
(presentation_set_duration, 0),
(try_end),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(key_clicked, key_escape),
(gt, ":cur_time", 200),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_show_maps_list", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_ingame_menu"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 80),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_show_maps_list_menu_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 285),
(position_set_y, pos1, 125),
(overlay_set_position, "$g_presentation_obj_show_maps_list_menu_container", pos1),
(position_set_x, pos1, 405),
(position_set_y, pos1, 500),
(overlay_set_area_size, "$g_presentation_obj_show_maps_list_menu_container", pos1),
(set_container_overlay, "$g_presentation_obj_show_maps_list_menu_container"),
(call_script, "script_multiplayer_fill_map_game_types", "$g_multiplayer_game_type"),
(assign, ":num_maps", reg0),
(store_mul, ":cur_y", ":num_maps", escape_menu_item_height),
(val_add, ":cur_y", 10),
(create_text_overlay, reg0, "str_choose_a_map", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(assign, ":overlay_id", -1),
(try_for_range, ":i_map", 0, ":num_maps"),
(store_add, ":map_slot", ":i_map", multi_data_maps_for_game_type_begin),
(troop_get_slot, ":map_no", "trp_multiplayer_data", ":map_slot"),
(store_sub, ":string_index", ":map_no", multiplayer_scenes_begin),
(val_add, ":string_index", multiplayer_scene_names_begin),
(str_store_string, s0, ":string_index"),
(create_button_overlay, ":overlay_id", s0, 0),
(overlay_set_color, ":overlay_id", 0xFFFFFF),
(position_set_x, pos1, 100),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, ":overlay_id", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(try_end),
(store_add, "$g_show_maps_list_button_list_end_index", ":overlay_id", 1),
(store_sub, "$g_show_maps_list_button_list_first_index", "$g_show_maps_list_button_list_end_index", ":num_maps"),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(try_for_range, ":i_button", "$g_show_maps_list_button_list_first_index", "$g_show_maps_list_button_list_end_index"),
(eq, ":object", ":i_button"),
(call_script, "script_multiplayer_fill_map_game_types", "$g_multiplayer_game_type"),
(store_sub, ":map_slot", ":object", "$g_show_maps_list_button_list_first_index"),
(val_add, ":map_slot", multi_data_maps_for_game_type_begin),
(troop_get_slot, ":scene_id", "trp_multiplayer_data", ":map_slot"),
(presentation_set_duration, 0),
(try_begin),
(eq, "$g_multiplayer_maps_list_action_type", 1), #vote for map
(try_begin),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(multiplayer_send_2_int_to_server, multiplayer_event_start_new_poll, 0, ":scene_id"),
(store_mission_timer_a, ":mission_timer"),
(val_add, ":mission_timer", multiplayer_poll_disable_period),
(player_set_slot, ":my_player_no", slot_player_poll_disabled_until_time, ":mission_timer"),
(try_end),
(else_try), #vote for map and factions
(assign, "$g_multiplayer_factions_list_action_type", 1), #for team 1
(assign, "$g_multiplayer_poll_for_map_and_faction_data_map", ":scene_id"),
(start_presentation, "prsnt_multiplayer_show_factions_list"),
(try_end),
(assign, "$g_show_maps_list_button_list_end_index", 0), #break;
(try_end),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(key_clicked, key_escape),
(gt, ":cur_time", 200),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_show_factions_list", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_ingame_menu"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 80),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_show_factions_list_menu_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 285),
(position_set_y, pos1, 125),
(overlay_set_position, "$g_presentation_obj_show_factions_list_menu_container", pos1),
(position_set_x, pos1, 405),
(position_set_y, pos1, 500),
(overlay_set_area_size, "$g_presentation_obj_show_factions_list_menu_container", pos1),
(set_container_overlay, "$g_presentation_obj_show_factions_list_menu_container"),
(store_sub, ":num_factions", npc_kingdoms_end, npc_kingdoms_begin),
(try_begin),
(eq, "$g_multiplayer_factions_list_action_type", 2),
(val_sub, ":num_factions", 1),
(try_end),
(store_mul, ":cur_y", ":num_factions", escape_menu_item_height),
(val_add, ":cur_y", 10),
(assign, reg0, "$g_multiplayer_factions_list_action_type"),
(create_text_overlay, reg0, "str_choose_a_faction_for_team_reg0", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(assign, ":overlay_id", -1),
(try_for_range, ":i_faction", npc_kingdoms_begin, npc_kingdoms_end),
(this_or_next|eq, "$g_multiplayer_factions_list_action_type", 1),
(neq, "$g_multiplayer_poll_for_map_and_faction_data_faction_1", ":i_faction"),
(str_store_faction_name, s0, ":i_faction"),
(create_button_overlay, ":overlay_id", s0, 0),
(overlay_set_color, ":overlay_id", 0xFFFFFF),
(position_set_x, pos1, 100),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, ":overlay_id", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(try_end),
(store_add, "$g_show_factions_list_button_list_end_index", ":overlay_id", 1),
(store_sub, "$g_show_factions_list_button_list_first_index", "$g_show_factions_list_button_list_end_index", ":num_factions"),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(try_for_range, ":i_button", "$g_show_factions_list_button_list_first_index", "$g_show_factions_list_button_list_end_index"),
(eq, ":object", ":i_button"),
(store_sub, ":faction_no", ":object", "$g_show_factions_list_button_list_first_index"),
(val_add, ":faction_no", npc_kingdoms_begin),
(presentation_set_duration, 0),
(try_begin),
(eq, "$g_multiplayer_factions_list_action_type", 2), #vote for second team
(try_begin),
(ge, ":faction_no", "$g_multiplayer_poll_for_map_and_faction_data_faction_1"),
(val_add, ":faction_no", 1),
(try_end),
(try_begin),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(multiplayer_send_4_int_to_server, multiplayer_event_start_new_poll, 3, "$g_multiplayer_poll_for_map_and_faction_data_map", "$g_multiplayer_poll_for_map_and_faction_data_faction_1", ":faction_no"),
(store_mission_timer_a, ":mission_timer"),
(val_add, ":mission_timer", multiplayer_poll_disable_period),
(player_set_slot, ":my_player_no", slot_player_poll_disabled_until_time, ":mission_timer"),
(try_end),
(else_try), #vote for first team
(assign, "$g_multiplayer_factions_list_action_type", 2), #for team 2
(assign, "$g_multiplayer_poll_for_map_and_faction_data_faction_1", ":faction_no"),
(start_presentation, "prsnt_multiplayer_show_factions_list"),
(try_end),
(assign, "$g_show_factions_list_button_list_end_index", 0), #break;
(try_end),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(key_clicked, key_escape),
(gt, ":cur_time", 200),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_show_number_of_bots_list", prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_mp_ingame_menu"),
(position_set_x, pos1, 250),
(position_set_y, pos1, 80),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1000),
(position_set_y, pos1, 1000),
(overlay_set_size, reg0, pos1),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_show_number_of_bots_list_menu_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 285),
(position_set_y, pos1, 125),
(overlay_set_position, "$g_presentation_obj_show_number_of_bots_list_menu_container", pos1),
(position_set_x, pos1, 405),
(position_set_y, pos1, 500),
(overlay_set_area_size, "$g_presentation_obj_show_number_of_bots_list_menu_container", pos1),
(set_container_overlay, "$g_presentation_obj_show_number_of_bots_list_menu_container"),
(assign, ":num_options", 0),
(store_add, ":end_cond", "$g_multiplayer_num_bots_voteable", 1),
(try_for_range, ":i_number", 0, ":end_cond"),
(assign, ":i_number_mod_5", ":i_number"),
(val_mod, ":i_number_mod_5", 5),
(this_or_next|lt, ":i_number", 10),
(eq, ":i_number_mod_5", 0),
(val_add, ":num_options", 1),
(try_end),
(store_mul, ":cur_y", ":num_options", escape_menu_item_height),
(val_add, ":cur_y", 10),
(assign, reg0, "$g_multiplayer_number_of_bots_list_action_type"),
(create_text_overlay, reg0, "str_choose_number_of_bots_for_team_reg0", 0),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 0),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg0, pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(assign, ":overlay_id", -1),
(try_for_range, ":i_number", 0, ":end_cond"),
(assign, ":i_number_mod_5", ":i_number"),
(val_mod, ":i_number_mod_5", 5),
(this_or_next|lt, ":i_number", 10),
(eq, ":i_number_mod_5", 0),
(assign, reg0, ":i_number"),
(str_store_string, s0, "str_reg0"),
(create_button_overlay, ":overlay_id", s0, 0),
(overlay_set_color, ":overlay_id", 0xFFFFFF),
(position_set_x, pos1, 100),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, ":overlay_id", pos1),
(val_sub, ":cur_y", escape_menu_item_height),
(try_end),
(store_add, "$g_show_number_of_bots_list_button_list_end_index", ":overlay_id", 1),
(store_sub, "$g_show_number_of_bots_list_button_list_first_index", "$g_show_number_of_bots_list_button_list_end_index", ":num_options"),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(try_for_range, ":i_button", "$g_show_number_of_bots_list_button_list_first_index", "$g_show_number_of_bots_list_button_list_end_index"),
(eq, ":object", ":i_button"),
(store_sub, ":value_index", ":object", "$g_show_number_of_bots_list_button_list_first_index"),
(try_begin),
(lt, ":value_index", 10),
(assign, ":used_value", ":value_index"),
(else_try),
(store_sub, ":used_value", ":value_index", 8),
(val_mul, ":used_value", 5),
(try_end),
(presentation_set_duration, 0),
(try_begin),
(eq, "$g_multiplayer_number_of_bots_list_action_type", 2), #vote for second team
(try_begin),
(multiplayer_get_my_player, ":my_player_no"),
(ge, ":my_player_no", 0),
(multiplayer_send_3_int_to_server, multiplayer_event_start_new_poll, 4, "$g_multiplayer_poll_number_of_bots_team_1", ":used_value"),
(store_mission_timer_a, ":mission_timer"),
(val_add, ":mission_timer", multiplayer_poll_disable_period),
(player_set_slot, ":my_player_no", slot_player_poll_disabled_until_time, ":mission_timer"),
(try_end),
(else_try), #vote for first team
(assign, "$g_multiplayer_number_of_bots_list_action_type", 2), #for team 2
(assign, "$g_multiplayer_poll_number_of_bots_team_1", ":used_value"),
(start_presentation, "prsnt_multiplayer_show_number_of_bots_list"),
(try_end),
(assign, "$g_show_number_of_bots_list_button_list_end_index", 0), #break;
(try_end),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(key_clicked, key_escape),
(gt, ":cur_time", 200),
(presentation_set_duration, 0),
(try_end),
]),
]),
("multiplayer_poll", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0x000000),
(overlay_set_alpha, reg0, 0x44),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 37500),
(position_set_y, pos1, 4500),
(overlay_set_size, reg0, pos1),
(try_begin),
(eq, "$g_multiplayer_poll_to_show", 0),
(store_sub, ":string_index", "$g_multiplayer_poll_value_to_show", multiplayer_scenes_begin),
(val_add, ":string_index", multiplayer_scene_names_begin),
(str_store_string, s0, ":string_index"),
(create_text_overlay, reg0, "str_poll_change_map", tf_center_justify),
(else_try),
(eq, "$g_multiplayer_poll_to_show", 1),
(str_store_player_username, s0, "$g_multiplayer_poll_value_to_show"),
(create_text_overlay, reg0, "str_poll_kick_player", tf_center_justify),
(else_try),
(eq, "$g_multiplayer_poll_to_show", 2),
(str_store_player_username, s0, "$g_multiplayer_poll_value_to_show"),
(create_text_overlay, reg0, "str_poll_ban_player", tf_center_justify),
(else_try),
(eq, "$g_multiplayer_poll_to_show", 3),
(store_sub, ":string_index", "$g_multiplayer_poll_value_to_show", multiplayer_scenes_begin),
(val_add, ":string_index", multiplayer_scene_names_begin),
(str_store_string, s0, ":string_index"),
(str_store_faction_name, s1, "$g_multiplayer_poll_value_2_to_show"),
(str_store_faction_name, s2, "$g_multiplayer_poll_value_3_to_show"),
(create_text_overlay, reg0, "str_poll_change_map_with_faction", tf_center_justify|tf_scrollable_style_2),
(else_try),
(assign, reg0, "$g_multiplayer_poll_value_to_show"),
(assign, reg1, "$g_multiplayer_poll_value_2_to_show"),
(str_store_faction_name, s0, "$g_multiplayer_team_1_faction"),
(str_store_faction_name, s1, "$g_multiplayer_team_2_faction"),
(create_text_overlay, reg0, "str_poll_change_number_of_bots", tf_center_justify|tf_scrollable_style_2),
(try_end),
(overlay_set_color, reg0, 0xFFFFFF),
(try_begin),
(neq, "$g_multiplayer_poll_to_show", 3),
(neq, "$g_multiplayer_poll_to_show", 4),
(position_set_x, pos1, 400),
(position_set_y, pos1, 100),
(overlay_set_position, reg0, pos1),
(else_try),
(position_set_x, pos1, 50),
(position_set_y, pos1, 70),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 750),
(position_set_y, pos1, 60),
(overlay_set_area_size, reg0, pos1),
(try_end),
(store_mission_timer_a, ":mission_timer"),
(store_sub, "$g_multiplayer_poll_last_written_seconds_left", "$g_multiplayer_poll_client_end_time", ":mission_timer"),
(assign, reg0, "$g_multiplayer_poll_last_written_seconds_left"),
(create_text_overlay, "$g_presentation_obj_poll_1", "str_poll_time_left", tf_right_align|tf_single_line),
(overlay_set_color, "$g_presentation_obj_poll_1", 0xFFFFFF),
(position_set_x, pos1, 790),
(position_set_y, pos1, 60),
(overlay_set_position, "$g_presentation_obj_poll_1", pos1),
(omit_key_once, key_1),
(omit_key_once, key_2),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(this_or_next|key_clicked, key_escape),
(key_clicked, key_2),
(gt, ":cur_time", 500),
(multiplayer_send_int_to_server, multiplayer_event_answer_to_poll, 0),
(clear_omitted_keys),
(presentation_set_duration, 0),
(else_try),
(key_clicked, key_1),
(gt, ":cur_time", 500),
(multiplayer_send_int_to_server, multiplayer_event_answer_to_poll, 1),
(clear_omitted_keys),
(presentation_set_duration, 0),
(try_end),
(store_mission_timer_a, ":mission_timer"),
(store_sub, ":time_left", "$g_multiplayer_poll_client_end_time", ":mission_timer"),
(try_begin),
(neq, ":time_left", "$g_multiplayer_poll_last_written_seconds_left"),
(try_begin),
(lt, ":time_left", 0),
(clear_omitted_keys),
(presentation_set_duration, 0),
(else_try),
(assign, "$g_multiplayer_poll_last_written_seconds_left", ":time_left"),
(assign, reg0, "$g_multiplayer_poll_last_written_seconds_left"),
(overlay_set_text, "$g_presentation_obj_poll_1", "str_poll_time_left"),
(try_end),
(try_end),
]),
]),
("tutorial_show_mouse_movement",prsntf_read_only|prsntf_manual_end_only,0,[
(ti_on_presentation_load,
[
(try_begin),
(this_or_next|eq, "$g_tutorial_mouse_dir", -1),
(eq, "$g_tutorial_mouse_click", -1),
(presentation_set_duration, 0),
(else_try),
(set_fixed_point_multiplier, 1000),
(assign, "$g_tutorial_displayed_mouse_dir", "$g_tutorial_mouse_dir"),
(assign, "$g_tutorial_displayed_mouse_click", "$g_tutorial_mouse_click"),
(store_add, ":arrow_mesh", "$g_tutorial_mouse_dir", "mesh_mouse_arrow_down"),
(create_mesh_overlay, reg0, ":arrow_mesh"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 380),
(position_set_y, pos1, 500),
(overlay_set_position, reg0, pos1),
(try_begin),
(eq, "$g_tutorial_mouse_click", 0),
(create_mesh_overlay, reg0, "mesh_mouse_left_click"),
(else_try),
(create_mesh_overlay, reg0, "mesh_mouse_right_click"),
(try_end),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 540),
(position_set_y, pos1, 500),
(overlay_set_position, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_mouse_arrow_plus"),
(overlay_set_color, reg0, 0xFFFFFF),
(position_set_x, pos1, 600),
(position_set_y, pos1, 600),
(overlay_set_size, reg0, pos1),
(position_set_x, pos1, 470),
(position_set_y, pos1, 510),
(overlay_set_position, reg0, pos1),
(presentation_set_duration, 999999),
(try_end),
]),
(ti_on_presentation_run,
[(try_begin),
(this_or_next|neq, "$g_tutorial_displayed_mouse_dir", "$g_tutorial_mouse_dir"),
(neq, "$g_tutorial_displayed_mouse_click", "$g_tutorial_mouse_click"),
(presentation_set_duration, 0),
(try_begin),
(ge, "$g_tutorial_mouse_dir", 0),
(ge, "$g_tutorial_mouse_click", 0),
(start_presentation, "prsnt_tutorial_show_mouse_movement"),
(try_end),
(try_end),
]),
]),
("name_kingdom",0,mesh_load_window,[
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(str_store_string, s1, "str_name_kingdom_text"),
(create_text_overlay, reg1, s1, tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 500),
(overlay_set_position, reg1, pos1),
(overlay_set_text, reg1, s1),
(create_simple_text_box_overlay, "$g_presentation_obj_name_kingdom_1"),
(position_set_x, pos1, 400),
(position_set_y, pos1, 400),
(overlay_set_position, "$g_presentation_obj_name_kingdom_1", pos1),
(try_begin),
(eq, "$players_kingdom_name_set", 1),
(str_store_faction_name, s7, "fac_player_supporters_faction"),
(overlay_set_text, "$g_presentation_obj_name_kingdom_1", s7),
(else_try),
(str_store_troop_name, s0, "trp_player"),
(overlay_set_text, "$g_presentation_obj_name_kingdom_1", "str_default_kingdom_name"),
(str_store_string, s7, "str_default_kingdom_name"),
(try_end),
(create_button_overlay, "$g_presentation_obj_name_kingdom_2", "@Continue...", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 300),
(overlay_set_position, "$g_presentation_obj_name_kingdom_2", pos1),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_name_kingdom_1"),
(str_store_string, s7, s0),
(else_try),
(eq, ":object", "$g_presentation_obj_name_kingdom_2"),
(faction_set_name, "fac_player_supporters_faction", s7),
(faction_set_color, "fac_player_supporters_faction", 0xFF0000),
(assign, "$players_kingdom_name_set", 1),
(presentation_set_duration, 0),
(try_end),
]),
]),
("banner_selection",0,mesh_load_window,[
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(str_store_string, s1, "str_banner_selection_text"),
(create_text_overlay, reg1, s1, tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 600),
(overlay_set_position, reg1, pos1),
(overlay_set_text, reg1, s1),
(create_button_overlay, "$g_presentation_obj_banner_selection_1", "@Next Page", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 50),
(overlay_set_position, "$g_presentation_obj_banner_selection_1", pos1),
(assign, ":x_pos", 150),
(assign, ":y_pos", 575),
(assign, ":try_end", banner_meshes_end_minus_one),
(store_sub, ":num_npc_kingdoms", npc_kingdoms_end, npc_kingdoms_begin),
(val_sub, ":try_end", ":num_npc_kingdoms"), #do not allow kingdom banners to be selected
(store_mul, ":begin_mesh", 16, "$g_presentation_page_no"),
(val_add, ":begin_mesh", banner_meshes_begin),
(store_add, ":try_end_2", ":begin_mesh", 16),
(val_min, ":try_end", ":try_end_2"),
(store_add, "$g_presentation_banner_start", "$g_presentation_obj_banner_selection_1", 1),
(try_for_range, ":cur_banner_mesh", ":begin_mesh", ":try_end"),
(create_image_button_overlay, reg1, ":cur_banner_mesh", ":cur_banner_mesh"),
(position_set_x, pos1, ":x_pos"),
(position_set_y, pos1, ":y_pos"),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 100),
(position_set_y, pos1, 100),
(overlay_set_size, reg1, pos1),
(val_add, ":x_pos", 100),
(ge, ":x_pos", 900),
(assign, ":x_pos", 150),
(val_sub, ":y_pos", 250),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_banner_selection_1"),
(val_add, "$g_presentation_page_no", 1),
(val_mod, "$g_presentation_page_no", 8),
(start_presentation, "prsnt_banner_selection"),
(else_try),
(store_sub, ":selected_banner", ":object", "$g_presentation_banner_start"),
(store_mul, ":page_adder", 16, "$g_presentation_page_no"),
(val_add, ":selected_banner", ":page_adder"),
(store_add, ":selected_banner_map_icon", ":selected_banner", banner_map_icons_begin),
(party_set_banner_icon, "p_main_party", ":selected_banner_map_icon"),
(store_add, ":selected_banner_spr", ":selected_banner", banner_scene_props_begin),
(troop_set_slot, "trp_player", slot_troop_banner_scene_prop, ":selected_banner_spr"),
#Correcting banners according to the player banner
#(assign, ":end_cond", active_npcs_end),
#(try_for_range, ":cur_troop", original_kingdom_heroes_begin, ":end_cond"),
# (troop_slot_eq, ":cur_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"),
# (str_store_troop_name, s7, ":cur_troop"),
# (display_message, "@DEBUGS : {s7}'s banner is changed"),
# (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
# (assign, ":end_cond", 0),
#(try_end),
(presentation_set_duration, 0),
(assign, ":troop_to_change", 0),
(assign, ":end_cond", active_npcs_end),
(try_for_range, ":cur_troop", active_npcs_begin, ":end_cond"),
(troop_slot_eq, ":cur_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"),
(assign, ":troop_to_change", ":cur_troop"),
(assign, ":end_cond", 0),
(troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(gt, ":cur_party", 0),
(party_set_banner_icon, ":cur_party", banner_map_icons_end_minus_one),
(try_end),
(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
(try_begin),
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(party_set_banner_icon, ":cur_center", ":selected_banner_map_icon"),
(else_try),
(party_slot_eq, ":cur_center", slot_town_lord, ":troop_to_change"),
(party_set_banner_icon, ":cur_center", banner_map_icons_end_minus_one),
(try_end),
(try_end),
(try_end),
]),
(ti_on_presentation_run,
[(try_begin),
(this_or_next|key_clicked, key_space),
(this_or_next|key_clicked, key_enter),
(this_or_next|key_clicked, key_escape),
(key_clicked, key_back_space),
(presentation_set_duration, 0),
(try_end),
]),
]),
("custom_banner", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(set_fixed_point_multiplier, 1000),
(troop_get_slot, ":flag_type", "trp_player", slot_troop_custom_banner_flag_type),
(val_max, ":flag_type", 0),
(val_add, ":flag_type", custom_banner_flag_types_begin),
(troop_get_slot, ":map_flag_type", "trp_player", slot_troop_custom_banner_map_flag_type),
(val_max, ":map_flag_type", 0),
(val_add, ":map_flag_type", custom_banner_flag_map_types_begin),
## (create_mesh_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_1", ":flag_type", "tableau_custom_banner_square", "trp_player"),
(troop_get_slot, ":bg_color_1", "trp_player", slot_troop_custom_banner_bg_color_1),
(troop_get_slot, ":bg_color_2", "trp_player", slot_troop_custom_banner_bg_color_2),
(create_text_overlay, reg1, "str_color_no_1", 0),
(position_set_x, pos1, 40),
(position_set_y, pos1, 550),
(overlay_set_position, reg1, pos1),
(create_text_overlay, reg1, "str_color_no_2", 0),
(position_set_x, pos1, 40),
(position_set_y, pos1, 500),
(overlay_set_position, reg1, pos1),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_22", "mesh_color_picker", "tableau_color_picker", ":bg_color_1"),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_23", "mesh_color_picker", "tableau_color_picker", ":bg_color_2"),
(position_set_x, pos1, 200),
(position_set_y, pos1, 565),
(overlay_set_position, "$g_presentation_obj_custom_banner_22", pos1),
(position_set_y, pos1, 515),
(overlay_set_position, "$g_presentation_obj_custom_banner_23", pos1),
(position_set_x, pos1, 250),
(position_set_y, pos1, 250),
(overlay_set_size, "$g_presentation_obj_custom_banner_22", pos1),
(overlay_set_size, "$g_presentation_obj_custom_banner_23", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_2", "str_change", tf_center_justify),
(create_button_overlay, "$g_presentation_obj_custom_banner_3", "str_change", tf_center_justify),
(create_button_overlay, "$g_presentation_obj_custom_banner_4", "str_change_background", tf_center_justify),
(create_button_overlay, "$g_presentation_obj_custom_banner_5", "str_change", tf_center_justify),
(create_button_overlay, "$g_presentation_obj_custom_banner_19", "str_change", tf_center_justify),
(create_button_overlay, "$g_presentation_obj_custom_banner_20", "str_accept", tf_center_justify),
(troop_get_slot, ":num_charges", "trp_player", slot_troop_custom_banner_num_charges),
(create_button_overlay, "$g_presentation_obj_custom_banner_16", "str_randomize", tf_center_justify),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_17", ":flag_type", "tableau_custom_banner_default", "trp_player"),
(try_begin),
(eq, ":map_flag_type", "mesh_custom_map_banner_01"),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_18", ":map_flag_type", "tableau_custom_banner_square", "trp_player"),
(else_try),
(eq, ":map_flag_type", "mesh_custom_map_banner_02"),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_18", ":map_flag_type", "tableau_custom_banner_short", "trp_player"),
(else_try),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_18", ":map_flag_type", "tableau_custom_banner_tall", "trp_player"),
(try_end),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_1", -1, "tableau_custom_banner_square_no_mesh", "trp_player"),
(create_text_overlay, reg1, "str_sample_banner", tf_center_justify),
(position_set_x, pos1, 825),
(position_set_y, pos1, 650),
(overlay_set_position, reg1, pos1),
(create_text_overlay, reg1, "str_sample_map_banner", tf_center_justify),
(position_set_y, pos1, 500),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 800),
(position_set_y, pos1, 640),
(overlay_set_position, "$g_presentation_obj_custom_banner_17", pos1),
(position_set_x, pos1, 780),
(position_set_y, pos1, 315),
(overlay_set_position, "$g_presentation_obj_custom_banner_18", pos1),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_size, "$g_presentation_obj_custom_banner_17", pos1),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_size, "$g_presentation_obj_custom_banner_18", pos1),
(create_text_overlay, reg1, "str_number_of_charges", 0),
(position_set_x, pos1, 40),
(position_set_y, pos1, 350),
(overlay_set_position, reg1, pos1),
(assign, reg1, ":num_charges"),
(create_text_overlay, reg2, "str_reg1", tf_center_justify),
(position_set_x, pos1, 350),
(position_set_y, pos1, 350),
(overlay_set_position, reg2, pos1),
(try_begin),
(lt, ":num_charges", 4),
(create_button_overlay, "$g_presentation_obj_custom_banner_15", "str_plus", tf_center_justify),
(position_set_x, pos1, 385),
(position_set_y, pos1, 350),
(overlay_set_position, "$g_presentation_obj_custom_banner_15", pos1),
(else_try),
(assign, "$g_presentation_obj_custom_banner_15", -1),
(try_end),
(try_begin),
(gt, ":num_charges", 0),
(create_button_overlay, "$g_presentation_obj_custom_banner_21", "str_minus", tf_center_justify),
(position_set_x, pos1, 370),
(position_set_y, pos1, 350),
(overlay_set_position, "$g_presentation_obj_custom_banner_21", pos1),
(else_try),
(assign, "$g_presentation_obj_custom_banner_21", -1),
(try_end),
(try_begin),
(ge, ":num_charges", 1),
(create_text_overlay, reg1, "str_charge", tf_center_justify),
(position_set_x, pos1, 300),
(position_set_y, pos1, 300),
(overlay_set_position, reg1, pos1),
(create_text_overlay, reg1, "str_color", tf_center_justify),
(position_set_x, pos1, 550),
(position_set_y, pos1, 300),
(overlay_set_position, reg1, pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_14", "str_change_charge_position", tf_center_justify),
(position_set_y, pos1, 350),
(position_set_x, pos1, 550),
(overlay_set_position, "$g_presentation_obj_custom_banner_14", pos1),
(create_text_overlay, reg1, "str_charge_no_1", 0),
(position_set_x, pos1, 40),
(position_set_y, pos1, 240),
(overlay_set_position, reg1, pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_6", "str_change", 0),
(position_set_x, pos1, 310),
(overlay_set_position, "$g_presentation_obj_custom_banner_6", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_7", "str_change", 0),
(position_set_x, pos1, 560),
(overlay_set_position, "$g_presentation_obj_custom_banner_7", pos1),
(troop_get_slot, ":cur_charge", "trp_player", slot_troop_custom_banner_charge_type_1),
(val_mod, ":cur_charge", 256),
(val_add, ":cur_charge", custom_banner_charges_begin),
(create_image_button_overlay, "$g_presentation_obj_custom_banner_24", ":cur_charge", ":cur_charge"),
(position_set_x, pos1, 260),
(position_set_y, pos1, 255),
(overlay_set_position, "$g_presentation_obj_custom_banner_24", pos1),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_size, "$g_presentation_obj_custom_banner_24", pos1),
(troop_get_slot, ":cur_charge_color", "trp_player", slot_troop_custom_banner_charge_color_1),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_28", "mesh_color_picker", "tableau_color_picker", ":cur_charge_color"),
(position_set_x, pos1, 530),
(position_set_y, pos1, 255),
(overlay_set_position, "$g_presentation_obj_custom_banner_28", pos1),
(position_set_x, pos1, 250),
(position_set_y, pos1, 250),
(overlay_set_size, "$g_presentation_obj_custom_banner_28", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_32", "str_flip_horizontal", 0),
(position_set_x, pos1, 700),
(position_set_y, pos1, 240),
(overlay_set_position, "$g_presentation_obj_custom_banner_32", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_33", "str_flip_vertical", 0),
(position_set_x, pos1, 800),
(overlay_set_position, "$g_presentation_obj_custom_banner_33", pos1),
(try_end),
(try_begin),
(ge, ":num_charges", 2),
(create_text_overlay, reg1, "str_charge_no_2", 0),
(position_set_x, pos1, 40),
(position_set_y, pos1, 180),
(overlay_set_position, reg1, pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_8", "str_change", 0),
(position_set_x, pos1, 310),
(overlay_set_position, "$g_presentation_obj_custom_banner_8", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_9", "str_change", 0),
(position_set_x, pos1, 560),
(overlay_set_position, "$g_presentation_obj_custom_banner_9", pos1),
(troop_get_slot, ":cur_charge", "trp_player", slot_troop_custom_banner_charge_type_2),
(val_mod, ":cur_charge", 256),
(val_add, ":cur_charge", custom_banner_charges_begin),
(create_image_button_overlay, "$g_presentation_obj_custom_banner_25", ":cur_charge", ":cur_charge"),
(position_set_x, pos1, 260),
(position_set_y, pos1, 195),
(overlay_set_position, "$g_presentation_obj_custom_banner_25", pos1),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_size, "$g_presentation_obj_custom_banner_25", pos1),
(troop_get_slot, ":cur_charge_color", "trp_player", slot_troop_custom_banner_charge_color_2),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_29", "mesh_color_picker", "tableau_color_picker", ":cur_charge_color"),
(position_set_x, pos1, 530),
(position_set_y, pos1, 195),
(overlay_set_position, "$g_presentation_obj_custom_banner_29", pos1),
(position_set_x, pos1, 250),
(position_set_y, pos1, 250),
(overlay_set_size, "$g_presentation_obj_custom_banner_29", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_34", "str_flip_horizontal", 0),
(position_set_x, pos1, 700),
(position_set_y, pos1, 180),
(overlay_set_position, "$g_presentation_obj_custom_banner_34", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_35", "str_flip_vertical", 0),
(position_set_x, pos1, 800),
(overlay_set_position, "$g_presentation_obj_custom_banner_35", pos1),
(try_end),
(try_begin),
(ge, ":num_charges", 3),
(create_text_overlay, reg1, "str_charge_no_3", 0),
(position_set_x, pos1, 40),
(position_set_y, pos1, 120),
(overlay_set_position, reg1, pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_10", "str_change", 0),
(position_set_x, pos1, 310),
(overlay_set_position, "$g_presentation_obj_custom_banner_10", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_11", "str_change", 0),
(position_set_x, pos1, 560),
(overlay_set_position, "$g_presentation_obj_custom_banner_11", pos1),
(troop_get_slot, ":cur_charge", "trp_player", slot_troop_custom_banner_charge_type_3),
(val_mod, ":cur_charge", 256),
(val_add, ":cur_charge", custom_banner_charges_begin),
(create_image_button_overlay, "$g_presentation_obj_custom_banner_26", ":cur_charge", ":cur_charge"),
(position_set_x, pos1, 260),
(position_set_y, pos1, 135),
(overlay_set_position, "$g_presentation_obj_custom_banner_26", pos1),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_size, "$g_presentation_obj_custom_banner_26", pos1),
(troop_get_slot, ":cur_charge_color", "trp_player", slot_troop_custom_banner_charge_color_3),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_30", "mesh_color_picker", "tableau_color_picker", ":cur_charge_color"),
(position_set_x, pos1, 530),
(position_set_y, pos1, 135),
(overlay_set_position, "$g_presentation_obj_custom_banner_30", pos1),
(position_set_x, pos1, 250),
(position_set_y, pos1, 250),
(overlay_set_size, "$g_presentation_obj_custom_banner_30", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_36", "str_flip_horizontal", 0),
(position_set_x, pos1, 700),
(position_set_y, pos1, 120),
(overlay_set_position, "$g_presentation_obj_custom_banner_36", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_37", "str_flip_vertical", 0),
(position_set_x, pos1, 800),
(overlay_set_position, "$g_presentation_obj_custom_banner_37", pos1),
(try_end),
(try_begin),
(ge, ":num_charges", 4),
(create_text_overlay, reg1, "str_charge_no_4", 0),
(position_set_x, pos1, 40),
(position_set_y, pos1, 60),
(overlay_set_position, reg1, pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_12", "str_change", 0),
(position_set_x, pos1, 310),
(overlay_set_position, "$g_presentation_obj_custom_banner_12", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_13", "str_change", 0),
(position_set_x, pos1, 560),
(overlay_set_position, "$g_presentation_obj_custom_banner_13", pos1),
(troop_get_slot, ":cur_charge", "trp_player", slot_troop_custom_banner_charge_type_4),
(val_mod, ":cur_charge", 256),
(val_add, ":cur_charge", custom_banner_charges_begin),
(create_image_button_overlay, "$g_presentation_obj_custom_banner_27", ":cur_charge", ":cur_charge"),
(position_set_x, pos1, 260),
(position_set_y, pos1, 75),
(overlay_set_position, "$g_presentation_obj_custom_banner_27", pos1),
(position_set_x, pos1, 50),
(position_set_y, pos1, 50),
(overlay_set_size, "$g_presentation_obj_custom_banner_27", pos1),
(troop_get_slot, ":cur_charge_color", "trp_player", slot_troop_custom_banner_charge_color_4),
(create_image_button_overlay_with_tableau_material, "$g_presentation_obj_custom_banner_31", "mesh_color_picker", "tableau_color_picker", ":cur_charge_color"),
(position_set_x, pos1, 530),
(position_set_y, pos1, 75),
(overlay_set_position, "$g_presentation_obj_custom_banner_31", pos1),
(position_set_x, pos1, 250),
(position_set_y, pos1, 250),
(overlay_set_size, "$g_presentation_obj_custom_banner_31", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_38", "str_flip_horizontal", 0),
(position_set_x, pos1, 700),
(position_set_y, pos1, 60),
(overlay_set_position, "$g_presentation_obj_custom_banner_38", pos1),
(create_button_overlay, "$g_presentation_obj_custom_banner_39", "str_flip_vertical", 0),
(position_set_x, pos1, 800),
(overlay_set_position, "$g_presentation_obj_custom_banner_39", pos1),
(try_end),
(position_set_x, pos1, 350),
(position_set_y, pos1, 400),
(overlay_set_position, "$g_presentation_obj_custom_banner_1", pos1),
(position_set_x, pos1, 275),
(position_set_y, pos1, 550),
(overlay_set_position, "$g_presentation_obj_custom_banner_2", pos1),
(position_set_y, pos1, 500),
(overlay_set_position, "$g_presentation_obj_custom_banner_3", pos1),
(position_set_x, pos1, 175),
(position_set_y, pos1, 600),
(overlay_set_position, "$g_presentation_obj_custom_banner_4", pos1),
(position_set_x, pos1, 880),
(position_set_y, pos1, 575),
(overlay_set_position, "$g_presentation_obj_custom_banner_5", pos1),
(position_set_y, pos1, 400),
(overlay_set_position, "$g_presentation_obj_custom_banner_19", pos1),
(position_set_y, pos1, 650),
(position_set_x, pos1, 175),
(overlay_set_position, "$g_presentation_obj_custom_banner_16", pos1),
(position_set_y, pos1, 150),
(position_set_x, pos1, 850),
(overlay_set_position, "$g_presentation_obj_custom_banner_20", pos1),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(troop_get_slot, ":num_charges", "trp_player", slot_troop_custom_banner_num_charges),
(try_begin),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_2"),
(eq, ":object", "$g_presentation_obj_custom_banner_22"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_bg_color_1),
(start_presentation, "prsnt_color_selection"),
(else_try),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_3"),
(eq, ":object", "$g_presentation_obj_custom_banner_23"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_bg_color_2),
(start_presentation, "prsnt_color_selection"),
(else_try),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_4"),
(eq, ":object", "$g_presentation_obj_custom_banner_1"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(start_presentation, "prsnt_banner_background_selection"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_5"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(start_presentation, "prsnt_banner_flag_type_selection"),
(else_try),
(ge, ":num_charges", 1),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_6"),
(eq, ":object", "$g_presentation_obj_custom_banner_24"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_charge_type_1),
(start_presentation, "prsnt_banner_charge_selection"),
(else_try),
(ge, ":num_charges", 1),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_7"),
(eq, ":object", "$g_presentation_obj_custom_banner_28"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_charge_color_1),
(start_presentation, "prsnt_color_selection"),
(else_try),
(ge, ":num_charges", 2),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_8"),
(eq, ":object", "$g_presentation_obj_custom_banner_25"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_charge_type_2),
(start_presentation, "prsnt_banner_charge_selection"),
(else_try),
(ge, ":num_charges", 2),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_9"),
(eq, ":object", "$g_presentation_obj_custom_banner_29"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_charge_color_2),
(start_presentation, "prsnt_color_selection"),
(else_try),
(ge, ":num_charges", 3),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_10"),
(eq, ":object", "$g_presentation_obj_custom_banner_26"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_charge_type_3),
(start_presentation, "prsnt_banner_charge_selection"),
(else_try),
(ge, ":num_charges", 3),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_11"),
(eq, ":object", "$g_presentation_obj_custom_banner_30"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_charge_color_3),
(start_presentation, "prsnt_color_selection"),
(else_try),
(ge, ":num_charges", 4),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_12"),
(eq, ":object", "$g_presentation_obj_custom_banner_27"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_charge_type_4),
(start_presentation, "prsnt_banner_charge_selection"),
(else_try),
(ge, ":num_charges", 4),
(this_or_next|eq, ":object", "$g_presentation_obj_custom_banner_13"),
(eq, ":object", "$g_presentation_obj_custom_banner_31"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(assign, "$g_presentation_output_slot", slot_troop_custom_banner_charge_color_4),
(start_presentation, "prsnt_color_selection"),
(else_try),
(ge, ":num_charges", 1),
(eq, ":object", "$g_presentation_obj_custom_banner_14"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(start_presentation, "prsnt_banner_charge_positioning"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_15"),
(troop_get_slot, ":num_charges", "trp_player", slot_troop_custom_banner_num_charges),
(val_add, ":num_charges", 1),
(val_clamp, ":num_charges", 0, 5),
(troop_set_slot, "trp_player", slot_troop_custom_banner_num_charges, ":num_charges"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_21"),
(troop_get_slot, ":num_charges", "trp_player", slot_troop_custom_banner_num_charges),
(val_sub, ":num_charges", 1),
(val_clamp, ":num_charges", 0, 5),
(troop_set_slot, "trp_player", slot_troop_custom_banner_num_charges, ":num_charges"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_16"),
(call_script, "script_get_random_custom_banner", "trp_player"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_17"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(start_presentation, "prsnt_banner_flag_type_selection"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_18"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(start_presentation, "prsnt_banner_flag_map_type_selection"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_19"),
(assign, "$g_presentation_next_presentation", "prsnt_custom_banner"),
(start_presentation, "prsnt_banner_flag_map_type_selection"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_32"),
(troop_get_slot, ":charge_type", "trp_player", slot_troop_custom_banner_charge_type_1),
(store_mod, ":charge_type_base", ":charge_type", 256),
(val_div, ":charge_type", 256),
(store_mod, ":flag", ":charge_type", 2),
(val_div, ":charge_type", 2), #remove flag
(val_add, ":flag", 1),
(val_mod, ":flag", 2), #switch flag
(val_mul, ":charge_type", 2),
(val_add, ":charge_type", ":flag"),
(val_mul, ":charge_type", 256),
(val_add, ":charge_type", ":charge_type_base"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_type_1, ":charge_type"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_34"),
(troop_get_slot, ":charge_type", "trp_player", slot_troop_custom_banner_charge_type_2),
(store_mod, ":charge_type_base", ":charge_type", 256),
(val_div, ":charge_type", 256),
(store_mod, ":flag", ":charge_type", 2),
(val_div, ":charge_type", 2), #remove flag
(val_add, ":flag", 1),
(val_mod, ":flag", 2), #switch flag
(val_mul, ":charge_type", 2),
(val_add, ":charge_type", ":flag"),
(val_mul, ":charge_type", 256),
(val_add, ":charge_type", ":charge_type_base"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_type_2, ":charge_type"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_36"),
(troop_get_slot, ":charge_type", "trp_player", slot_troop_custom_banner_charge_type_3),
(store_mod, ":charge_type_base", ":charge_type", 256),
(val_div, ":charge_type", 256),
(store_mod, ":flag", ":charge_type", 2),
(val_div, ":charge_type", 2), #remove flag
(val_add, ":flag", 1),
(val_mod, ":flag", 2), #switch flag
(val_mul, ":charge_type", 2),
(val_add, ":charge_type", ":flag"),
(val_mul, ":charge_type", 256),
(val_add, ":charge_type", ":charge_type_base"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_type_3, ":charge_type"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_38"),
(troop_get_slot, ":charge_type", "trp_player", slot_troop_custom_banner_charge_type_4),
(store_mod, ":charge_type_base", ":charge_type", 256),
(val_div, ":charge_type", 256),
(store_mod, ":flag", ":charge_type", 2),
(val_div, ":charge_type", 2), #remove flag
(val_add, ":flag", 1),
(val_mod, ":flag", 2), #switch flag
(val_mul, ":charge_type", 2),
(val_add, ":charge_type", ":flag"),
(val_mul, ":charge_type", 256),
(val_add, ":charge_type", ":charge_type_base"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_type_4, ":charge_type"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_33"),
(troop_get_slot, ":charge_type", "trp_player", slot_troop_custom_banner_charge_type_1),
(store_div, ":flag", ":charge_type", 512),
(val_add, ":flag", 1),
(val_mod, ":flag", 2), #switch flag
(val_mul, ":flag", 512),
(val_mod, ":charge_type", 512), #remove flag
(val_add, ":charge_type", ":flag"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_type_1, ":charge_type"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_35"),
(troop_get_slot, ":charge_type", "trp_player", slot_troop_custom_banner_charge_type_2),
(store_div, ":flag", ":charge_type", 512),
(val_add, ":flag", 1),
(val_mod, ":flag", 2), #switch flag
(val_mul, ":flag", 512),
(val_mod, ":charge_type", 512), #remove flag
(val_add, ":charge_type", ":flag"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_type_2, ":charge_type"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_37"),
(troop_get_slot, ":charge_type", "trp_player", slot_troop_custom_banner_charge_type_3),
(store_div, ":flag", ":charge_type", 512),
(val_add, ":flag", 1),
(val_mod, ":flag", 2), #switch flag
(val_mul, ":flag", 512),
(val_mod, ":charge_type", 512), #remove flag
(val_add, ":charge_type", ":flag"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_type_3, ":charge_type"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_39"),
(troop_get_slot, ":charge_type", "trp_player", slot_troop_custom_banner_charge_type_4),
(store_div, ":flag", ":charge_type", 512),
(val_add, ":flag", 1),
(val_mod, ":flag", 2), #switch flag
(val_mul, ":flag", 512),
(val_mod, ":charge_type", 512), #remove flag
(val_add, ":charge_type", ":flag"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_charge_type_4, ":charge_type"),
(start_presentation, "prsnt_custom_banner"),
(else_try),
(eq, ":object", "$g_presentation_obj_custom_banner_20"),
(troop_get_slot, ":flag_icon", "trp_player", slot_troop_custom_banner_map_flag_type),
(try_begin),
(ge, ":flag_icon", 0),
(val_add, ":flag_icon", custom_banner_map_icons_begin),
(party_set_banner_icon, "p_main_party", ":flag_icon"),
(try_end),
(presentation_set_duration, 0),
(try_end),
]),
## (ti_on_presentation_run,
## [(try_begin),
## (this_or_next|key_clicked, key_space),
## (this_or_next|key_clicked, key_enter),
## (this_or_next|key_clicked, key_escape),
## (key_clicked, key_back_space),
## (presentation_set_duration, 0),
## (try_end),
## ]),
]),
("banner_charge_positioning", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(set_fixed_point_multiplier, 1000),
(create_text_overlay, reg1, "str_choose_position", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 600),
(overlay_set_position, reg1, pos1),
(assign, ":pos_x", 125),
(assign, ":pos_y", 400),
(call_script, "script_get_troop_custom_banner_num_positionings", "trp_player"),
(assign, ":num_positionings", reg0),
(store_mul, ":x_needed", ":num_positionings", 125),
(val_sub, ":x_needed", 25),
(store_div, ":pos_x", ":x_needed", 2),
(store_sub, ":pos_x", 500, ":pos_x"),
(try_for_range, ":cur_positioning", 0, ":num_positionings"),
(create_image_button_overlay_with_tableau_material, reg1, -1, "tableau_positioning_selection", ":cur_positioning"),
(position_set_x, pos1, ":pos_x"),
(position_set_y, pos1, ":pos_y"),
(val_add, ":pos_x", 125),
(overlay_set_position, reg1, pos1),
(troop_set_slot, "trp_temp_array_a", ":cur_positioning", reg1),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(call_script, "script_get_troop_custom_banner_num_positionings", "trp_player"),
(assign, ":num_positionings", reg0),
(try_for_range, ":trp_slot_index", 0, ":num_positionings"),
(troop_slot_eq, "trp_temp_array_a", ":trp_slot_index", ":object"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_positioning, ":trp_slot_index"),
(assign, ":num_positionings", 0),
(try_end),
(try_begin),
(gt, "$g_presentation_next_presentation", 0),
(start_presentation, "$g_presentation_next_presentation"),
(else_try),
(presentation_set_duration, 0),
(try_end),
]),
]),
("banner_charge_selection", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(set_fixed_point_multiplier, 1000),
(create_text_overlay, reg1, "str_choose_charge", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 650),
(overlay_set_position, reg1, pos1),
(assign, ":pos_x", 100),
(assign, ":pos_y", 600),
(try_for_range, ":cur_charge", custom_banner_charges_begin, custom_banner_charges_end),
(create_image_button_overlay, reg1, ":cur_charge", ":cur_charge"),
(position_set_x, pos1, ":pos_x"),
(position_set_y, pos1, ":pos_y"),
(val_add, ":pos_x", 100),
(try_begin),
(gt, ":pos_x", 900),
(assign, ":pos_x", 100),
(val_sub, ":pos_y", 100),
(try_end),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 80),
(position_set_y, pos1, 80),
(overlay_set_size, reg1, pos1),
(store_sub, ":slot_index", ":cur_charge", custom_banner_charges_begin),
(troop_set_slot, "trp_temp_array_a", ":slot_index", reg1),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(assign, ":end_cond", custom_banner_charges_end),
(val_sub, ":end_cond", custom_banner_charges_begin),
(try_for_range, ":trp_slot_index", 0, ":end_cond"),
(troop_slot_eq, "trp_temp_array_a", ":trp_slot_index", ":object"),
(troop_set_slot, "trp_player", "$g_presentation_output_slot", ":trp_slot_index"),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(gt, "$g_presentation_next_presentation", 0),
(start_presentation, "$g_presentation_next_presentation"),
(else_try),
(presentation_set_duration, 0),
(try_end),
]),
]),
("banner_background_selection", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(set_fixed_point_multiplier, 1000),
(create_text_overlay, reg1, "str_choose_background", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 600),
(overlay_set_position, reg1, pos1),
(assign, ":pos_x", 75),
(assign, ":pos_y", 450),
(try_for_range, ":cur_banner", custom_banner_backgrounds_begin, custom_banner_backgrounds_end),
(store_sub, ":slot_index", ":cur_banner", custom_banner_backgrounds_begin),
(create_image_button_overlay_with_tableau_material, reg1, -1, "tableau_background_selection", ":slot_index"),
(position_set_x, pos1, ":pos_x"),
(position_set_y, pos1, ":pos_y"),
(val_add, ":pos_x", 125),
(try_begin),
(gt, ":pos_x", 900),
(assign, ":pos_x", 75),
(val_sub, ":pos_y", 125),
(try_end),
(overlay_set_position, reg1, pos1),
(troop_set_slot, "trp_temp_array_a", ":slot_index", reg1),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(assign, ":end_cond", custom_banner_backgrounds_end),
(val_sub, ":end_cond", custom_banner_backgrounds_begin),
(try_for_range, ":trp_slot_index", 0, ":end_cond"),
(troop_slot_eq, "trp_temp_array_a", ":trp_slot_index", ":object"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_bg_type, ":trp_slot_index"),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(gt, "$g_presentation_next_presentation", 0),
(start_presentation, "$g_presentation_next_presentation"),
(else_try),
(presentation_set_duration, 0),
(try_end),
]),
]),
("banner_flag_type_selection", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(set_fixed_point_multiplier, 1000),
(create_text_overlay, reg1, "str_choose_flag_type", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 600),
(overlay_set_position, reg1, pos1),
(assign, ":pos_x", 435),
(assign, ":pos_y", 450),
(try_for_range, ":cur_flag", custom_banner_flag_types_begin, custom_banner_flag_types_end),
(store_sub, ":slot_index", ":cur_flag", custom_banner_flag_types_begin),
(troop_set_slot, "trp_player", slot_troop_custom_banner_flag_type, ":slot_index"),
(create_image_button_overlay_with_tableau_material, reg1, ":cur_flag", "tableau_custom_banner_default", "trp_player"),
(position_set_x, pos1, ":pos_x"),
(position_set_y, pos1, ":pos_y"),
(val_add, ":pos_x", 130),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 100),
(position_set_y, pos1, 100),
(overlay_set_size, reg1, pos1),
(troop_set_slot, "trp_temp_array_a", ":slot_index", reg1),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(assign, ":end_cond", custom_banner_flag_types_end),
(val_sub, ":end_cond", custom_banner_flag_types_begin),
(try_for_range, ":trp_slot_index", 0, ":end_cond"),
(troop_slot_eq, "trp_temp_array_a", ":trp_slot_index", ":object"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_flag_type, ":trp_slot_index"),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(gt, "$g_presentation_next_presentation", 0),
(start_presentation, "$g_presentation_next_presentation"),
(else_try),
(presentation_set_duration, 0),
(try_end),
]),
]),
("banner_flag_map_type_selection", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(set_fixed_point_multiplier, 1000),
(create_text_overlay, reg1, "str_choose_map_flag_type", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 600),
(overlay_set_position, reg1, pos1),
(troop_get_slot, ":bg_type", "trp_player", slot_troop_custom_banner_bg_type),
(val_add, ":bg_type", custom_banner_backgrounds_begin),
(assign, ":pos_x", 250),
(assign, ":pos_y", 150),
(try_for_range, ":cur_flag", custom_banner_flag_map_types_begin, custom_banner_flag_map_types_end),
(store_sub, ":slot_index", ":cur_flag", custom_banner_flag_map_types_begin),
(troop_set_slot, "trp_player", slot_troop_custom_banner_map_flag_type, ":slot_index"),
(try_begin),
(eq, ":cur_flag", "mesh_custom_map_banner_01"),
(create_image_button_overlay_with_tableau_material, reg1, ":cur_flag", "tableau_custom_banner_square", "trp_player"),
(else_try),
(eq, ":cur_flag", "mesh_custom_map_banner_02"),
(create_image_button_overlay_with_tableau_material, reg1, ":cur_flag", "tableau_custom_banner_short", "trp_player"),
(else_try),
(create_image_button_overlay_with_tableau_material, reg1, ":cur_flag", "tableau_custom_banner_tall", "trp_player"),
(try_end),
(position_set_x, pos1, ":pos_x"),
(position_set_y, pos1, ":pos_y"),
(val_add, ":pos_x", 200),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 100),
(position_set_y, pos1, 100),
(overlay_set_size, reg1, pos1),
(troop_set_slot, "trp_temp_array_a", ":slot_index", reg1),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(assign, ":end_cond", custom_banner_flag_map_types_end),
(val_sub, ":end_cond", custom_banner_flag_map_types_begin),
(try_for_range, ":trp_slot_index", 0, ":end_cond"),
(troop_slot_eq, "trp_temp_array_a", ":trp_slot_index", ":object"),
(troop_set_slot, "trp_player", slot_troop_custom_banner_map_flag_type, ":trp_slot_index"),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(gt, "$g_presentation_next_presentation", 0),
(start_presentation, "$g_presentation_next_presentation"),
(else_try),
(presentation_set_duration, 0),
(try_end),
]),
]),
("color_selection", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(set_fixed_point_multiplier, 1000),
(create_text_overlay, reg1, "str_choose_color", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 600),
(overlay_set_position, reg1, pos1),
(assign, ":pos_x", 125),
(assign, ":pos_y", 450),
(try_for_range, ":i_color", 0, 42),
(call_script, "script_get_custom_banner_color_from_index", ":i_color"),
(assign, ":cur_color", reg0),
(create_image_button_overlay_with_tableau_material, reg1, "mesh_color_picker", "tableau_color_picker", ":cur_color"),
(position_set_x, pos1, ":pos_x"),
(position_set_y, pos1, ":pos_y"),
(val_add, ":pos_x", 50),
(try_begin),
(store_mod, ":mod_i_color", ":i_color", 7),
(eq, ":mod_i_color", 6),
(assign, ":pos_x", 125),
(val_sub, ":pos_y", 50),
(try_end),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 500),
(overlay_set_size, reg1, pos1),
(store_mul, ":trp_slot_index", ":i_color", 2),
(store_add, ":trp_slot_color", ":trp_slot_index", 1),
(troop_set_slot, "trp_temp_array_a", ":trp_slot_index", reg1),
(troop_set_slot, "trp_temp_array_a", ":trp_slot_color", ":cur_color"),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(assign, ":end_cond", 64),
(try_for_range, ":i_color", 0, ":end_cond"),
(store_mul, ":trp_slot_index", ":i_color", 2),
(troop_slot_eq, "trp_temp_array_a", ":trp_slot_index", ":object"),
(store_add, ":trp_slot_color", ":trp_slot_index", 1),
(troop_get_slot, ":output_color", "trp_temp_array_a", ":trp_slot_color"),
(troop_set_slot, "trp_player", "$g_presentation_output_slot", ":output_color"),
(assign, ":end_cond", 0),
(try_end),
(try_begin),
(gt, "$g_presentation_next_presentation", 0),
(start_presentation, "$g_presentation_next_presentation"),
(else_try),
(presentation_set_duration, 0),
(try_end),
]),
]),
("marshall_selection", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(assign, "$g_presentation_obj_marshall_selection_1", -1),
(assign, "$g_presentation_obj_marshall_selection_2", -1),
(assign, "$g_presentation_obj_marshall_selection_3", -1),
(set_fixed_point_multiplier, 1000),
(assign, "$g_presentation_next_presentation", -1),
(store_add, ":total_renown", "$g_presentation_marshall_selection_max_renown_1", "$g_presentation_marshall_selection_max_renown_2"),
(faction_get_slot, ":king", "$players_kingdom", slot_faction_leader),
(str_store_troop_name, s1, "$g_presentation_marshall_selection_max_renown_1_troop"),
(create_text_overlay, reg1, "@Candidate #1: {s1}", tf_center_justify),
(position_set_x, pos1, 200),
(position_set_y, pos1, 600),
(overlay_set_position, reg1, pos1),
(str_store_troop_name, s1, "$g_presentation_marshall_selection_max_renown_2_troop"),
(create_text_overlay, reg1, "@Candidate #2: {s1}", tf_center_justify),
(position_set_x, pos1, 800),
(position_set_y, pos1, 600),
(overlay_set_position, reg1, pos1),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_troop_note_mesh", "$g_presentation_marshall_selection_max_renown_1_troop"),
(position_set_x, pos1, 500),
(position_set_y, pos1, 500),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 100),
(position_set_y, pos1, 300),
(overlay_set_position, reg1, pos1),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_troop_note_mesh", "$g_presentation_marshall_selection_max_renown_2_troop"),
(position_set_x, pos1, 500),
(position_set_y, pos1, 500),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 700),
(position_set_y, pos1, 300),
(overlay_set_position, reg1, pos1),
(assign, ":lord_index", "$g_presentation_input"),
(val_add, "$g_presentation_input", 1),
(try_begin),
(lt, ":lord_index", 0),
(str_store_troop_name, s1, "$g_presentation_marshall_selection_max_renown_1_troop"),
(str_store_troop_name, s2, "$g_presentation_marshall_selection_max_renown_2_troop"),
(str_store_troop_name, s3, ":king"),
(str_store_faction_name, s4, "$players_kingdom"),
(create_text_overlay, reg1, "@{s3} of {s4} wishes to select a new marshall and invites his vassals for a counsel. {s1} and {s2} are the likely candidates.", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 200),
(overlay_set_position, reg1, pos1),
(create_button_overlay, "$g_presentation_obj_marshall_selection_1", "@Continue...", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 100),
(overlay_set_position, "$g_presentation_obj_marshall_selection_1", pos1),
(assign, "$g_presentation_next_presentation", "prsnt_marshall_selection"),
(else_try),
(assign, ":cur_index", ":lord_index"),
(try_for_range_backwards, ":loop_var", "trp_kingdom_heroes_including_player_begin", active_npcs_end),
(ge, ":cur_index", 0),
(assign, ":cur_troop", ":loop_var"),
(assign, ":continue", 0),
(try_begin),
(eq, ":loop_var", "trp_kingdom_heroes_including_player_begin"),
(assign, ":cur_troop", "trp_player"),
(try_begin),
(eq, "$g_player_is_captive", 0),
(assign, ":continue", 1),
(try_end),
(else_try),
(store_troop_faction, ":cur_troop_faction", ":cur_troop"),
(eq, "$players_kingdom", ":cur_troop_faction"),
#(troop_slot_eq, ":cur_troop", slot_troop_is_prisoner, 0),
(neg|troop_slot_ge, ":cur_troop", slot_troop_prisoner_of_party, 0),
(troop_slot_ge, ":cur_troop", slot_troop_leaded_party, 1),
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(neg|faction_slot_eq, ":cur_troop_faction", slot_faction_leader, ":cur_troop"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(neq, "$g_presentation_marshall_selection_max_renown_1_troop", ":cur_troop"),
(neq, "$g_presentation_marshall_selection_max_renown_2_troop", ":cur_troop"),
(val_sub, ":cur_index", 1),
(lt, ":cur_index", 0),
(assign, "$g_presentation_next_presentation", "prsnt_marshall_selection"),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_troop_note_mesh", ":cur_troop"),
(position_set_x, pos1, 300),
(position_set_y, pos1, 300),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 440),
(position_set_y, pos1, 400),
(overlay_set_position, reg1, pos1),
(try_begin),
(eq, ":cur_troop", "trp_player"),
(create_text_overlay, reg1, "@Who do you wish to support?", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 200),
(overlay_set_position, reg1, pos1),
(str_store_troop_name, s1, "$g_presentation_marshall_selection_max_renown_1_troop"),
(create_button_overlay, "$g_presentation_obj_marshall_selection_2", "@{!}{s1}", tf_center_justify),
(position_set_x, pos1, 300),
(position_set_y, pos1, 100),
(overlay_set_position, "$g_presentation_obj_marshall_selection_2", pos1),
(str_store_troop_name, s1, "$g_presentation_marshall_selection_max_renown_2_troop"),
(create_button_overlay, "$g_presentation_obj_marshall_selection_3", "@{!}{s1}", tf_center_justify),
(position_set_x, pos1, 700),
(position_set_y, pos1, 100),
(overlay_set_position, "$g_presentation_obj_marshall_selection_3", pos1),
(else_try),
(str_store_troop_name, s1, ":cur_troop"),
(store_random_in_range, ":random_renown", 0, ":total_renown"),
(val_sub, ":random_renown", "$g_presentation_marshall_selection_max_renown_1"),
(try_begin),
(lt, ":random_renown", 0),
(val_add, "$g_presentation_marshall_selection_1_vote", 1),
(str_store_troop_name, s2, "$g_presentation_marshall_selection_max_renown_1_troop"),
(else_try),
(val_add, "$g_presentation_marshall_selection_2_vote", 1),
(str_store_troop_name, s2, "$g_presentation_marshall_selection_max_renown_2_troop"),
(try_end),
(create_text_overlay, reg1, "@{s1} gives his support to {s2}.", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 200),
(overlay_set_position, reg1, pos1),
(create_button_overlay, "$g_presentation_obj_marshall_selection_1", "@Continue...", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 100),
(overlay_set_position, "$g_presentation_obj_marshall_selection_1", pos1),
(try_end),
(try_end),
(try_end),
(assign, reg0, "$g_presentation_marshall_selection_1_vote"),
(create_text_overlay, reg1, "@Number of Supporters: {reg0}", tf_center_justify),
(position_set_x, pos1, 200),
(position_set_y, pos1, 550),
(overlay_set_position, reg1, pos1),
(assign, reg0, "$g_presentation_marshall_selection_2_vote"),
(create_text_overlay, reg1, "@Number of Supporters: {reg0}", tf_center_justify),
(position_set_x, pos1, 800),
(position_set_y, pos1, 550),
(overlay_set_position, reg1, pos1),
(try_begin),
(lt, "$g_presentation_next_presentation", 0),
(try_begin),
(gt, "$g_presentation_marshall_selection_2_vote", "$g_presentation_marshall_selection_1_vote"),
(assign, ":local_temp", "$g_presentation_marshall_selection_max_renown_1_troop"),
(assign, "$g_presentation_marshall_selection_max_renown_1_troop", "$g_presentation_marshall_selection_max_renown_2_troop"),
(assign, "$g_presentation_marshall_selection_max_renown_2_troop", ":local_temp"),
(try_end),
#Winner is set to g_presentation_marshall_selection_max_renown_1_troop
(str_store_troop_name, s1, "$g_presentation_marshall_selection_max_renown_1_troop"),
(str_store_troop_name, s2, ":king"),
(str_store_faction_name, s3, "$players_kingdom"),
(create_text_overlay, reg1, "@{s2} has heard his vassals' counsel. He selects {s1} as the marshall of {s3}.", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 200),
(overlay_set_position, reg1, pos1),
(create_button_overlay, "$g_presentation_obj_marshall_selection_1", "@Continue...", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 100),
(overlay_set_position, "$g_presentation_obj_marshall_selection_1", pos1),
(try_end),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_marshall_selection_2"),
(val_add, "$g_presentation_marshall_selection_1_vote", 1),
(call_script, "script_change_player_relation_with_troop", "$g_presentation_marshall_selection_max_renown_1_troop", 2),
(call_script, "script_change_player_relation_with_troop", "$g_presentation_marshall_selection_max_renown_2_troop", -2),
(else_try),
(eq, ":object", "$g_presentation_obj_marshall_selection_3"),
(val_add, "$g_presentation_marshall_selection_2_vote", 1),
(call_script, "script_change_player_relation_with_troop", "$g_presentation_marshall_selection_max_renown_1_troop", -2),
(call_script, "script_change_player_relation_with_troop", "$g_presentation_marshall_selection_max_renown_2_troop", 2),
(try_end),
(try_begin),
(this_or_next|eq, ":object", "$g_presentation_obj_marshall_selection_1"),
(this_or_next|eq, ":object", "$g_presentation_obj_marshall_selection_2"),
(eq, ":object", "$g_presentation_obj_marshall_selection_3"),
(try_begin),
(ge, "$g_presentation_next_presentation", 0),
(start_presentation, "$g_presentation_next_presentation"),
(else_try),
(try_begin),
(neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "$g_presentation_marshall_selection_max_renown_1_troop"),
(call_script, "script_check_and_finish_active_army_quests_for_faction", "$players_kingdom"),
(try_end),
(faction_get_slot, ":old_marshall", "$players_kingdom", slot_faction_marshall),
(try_begin),
(ge, ":old_marshall", 0),
(party_is_active, ":old_marshall"),
(party_set_marshall, ":old_marshall", 0),
(try_end),
(faction_set_slot, "$players_kingdom", slot_faction_marshall, "$g_presentation_marshall_selection_max_renown_1_troop"),
(try_begin),
(eq, "$g_presentation_marshall_selection_max_renown_1_troop", "trp_player"),
(call_script, "script_change_player_relation_with_troop", "$g_presentation_marshall_selection_max_renown_2_troop", -3),
(try_end),
(assign, "$g_recalculate_ais", 1),
(assign, "$g_presentation_marshall_selection_ended", 1),
(presentation_set_duration, 0),
(try_end),
(try_end),
]),
]),
("battle",0,0,[
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(assign, "$g_formation_group0_selected", 0),
(assign, "$g_formation_group1_selected", 0),
(assign, "$g_formation_group2_selected", 0),
(assign, "$g_formation_group3_selected", 0),
(assign, "$g_formation_group4_selected", 0),
(assign, "$g_formation_group5_selected", 0),
(assign, "$g_formation_group6_selected", 0),
(assign, "$g_formation_group7_selected", 0),
(assign, "$g_formation_group8_selected", 0),
(assign, "$g_presentation_obj_battle_but0", -1),
(assign, "$g_presentation_obj_battle_but1", -1),
(assign, "$g_presentation_obj_battle_but2", -1),
(assign, "$g_presentation_obj_battle_but3", -1),
(assign, "$g_presentation_obj_battle_but4", -1),
(assign, "$g_presentation_obj_battle_but5", -1),
(assign, "$g_presentation_obj_battle_but6", -1),
(assign, "$g_presentation_obj_battle_but7", -1),
(assign, "$g_presentation_obj_battle_but8", -1),
(str_clear, s7),
(try_for_agents, ":agent_no"),
(agent_set_slot, ":agent_no", slot_agent_map_overlay_id, 0),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_troop_id, ":player_troop_id", ":player_agent"),
(position_set_y, pos1, 700),
(create_text_overlay, reg1, "@Action", tf_center_justify|tf_single_line|tf_with_outline),
(overlay_set_color, reg1, 0xFFAAAAAA),
(position_set_x, pos1, 270),
(overlay_set_position, reg1, pos1),
(create_text_overlay, reg1, "@Mount", tf_center_justify|tf_single_line|tf_with_outline),
(overlay_set_color, reg1, 0xFFAAAAAA),
(position_set_x, pos1, 410),
(overlay_set_position, reg1, pos1),
(create_text_overlay, reg1, "@Attack Type", tf_center_justify|tf_single_line|tf_with_outline),
(overlay_set_color, reg1, 0xFFAAAAAA),
(position_set_x, pos1, 550),
(overlay_set_position, reg1, pos1),
(assign, "$group0_has_troops", 0),
(assign, "$group1_has_troops", 0),
(assign, "$group2_has_troops", 0),
(assign, "$group3_has_troops", 0),
(assign, "$group4_has_troops", 0),
(assign, "$group5_has_troops", 0),
(assign, "$group6_has_troops", 0),
(assign, "$group7_has_troops", 0),
(assign, "$group8_has_troops", 0),
(party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
(assign, "$num_classes", 0),
(try_for_range, ":troop_iterator", 0, ":num_stacks"),
(party_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":troop_iterator"),
(troop_get_class, ":troop_class", ":cur_troop_id"),
(neq, ":player_troop_id", ":cur_troop_id"),
(try_begin),
(eq, ":troop_class", 0),
(try_begin),
(neq, "$group0_has_troops", 1),
(val_add, "$num_classes", 1),
(try_end),
(assign, "$group0_has_troops", 1),
(else_try),
(eq, ":troop_class", 1),
(try_begin),
(neq, "$group1_has_troops", 1),
(val_add, "$num_classes", 1),
(try_end),
(assign, "$group1_has_troops", 1),
(else_try),
(eq, ":troop_class", 2),
(try_begin),
(neq, "$group2_has_troops", 1),
(val_add, "$num_classes", 1),
(try_end),
(assign, "$group2_has_troops", 1),
(else_try),
(eq, ":troop_class", 3),
(try_begin),
(neq, "$group3_has_troops", 1),
(val_add, "$num_classes", 1),
(try_end),
(assign, "$group3_has_troops", 1),
(else_try),
(eq, ":troop_class", 4),
(try_begin),
(neq, "$group4_has_troops", 1),
(val_add, "$num_classes", 1),
(try_end),
(assign, "$group4_has_troops", 1),
(else_try),
(eq, ":troop_class", 5),
(try_begin),
(neq, "$group5_has_troops", 1),
(val_add, "$num_classes", 1),
(try_end),
(assign, "$group5_has_troops", 1),
(else_try),
(eq, ":troop_class", 6),
(try_begin),
(neq, "$group6_has_troops", 1),
(val_add, "$num_classes", 1),
(try_end),
(assign, "$group6_has_troops", 1),
(else_try),
(eq, ":troop_class", 7),
(try_begin),
(neq, "$group7_has_troops", 1),
(val_add, "$num_classes", 1),
(try_end),
(assign, "$group7_has_troops", 1),
(else_try),
(eq, ":troop_class", 8),
(try_begin),
(neq, "$group8_has_troops", 1),
(val_add, "$num_classes", 1),
(try_end),
(assign, "$group8_has_troops", 1),
(try_end),
(try_end),
(assign, ":stat_position_x", 0),
(assign, ":stat_position_y", 653),
(assign, ":stat_position_check_x", 20),
(assign, ":stat_position_check_y", 662),
(assign, ":stat_position_name_x", 50),
(assign, ":stat_position_name_y", 660),
(try_begin),
(eq, "$group0_has_troops", 1),
(create_image_button_overlay, "$g_presentation_obj_battle_but0", "mesh_white_plane", "mesh_white_plane"),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_but0", pos1),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, 32500),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_presentation_obj_battle_but0", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_but0", 0),
(overlay_set_color, "$g_presentation_obj_battle_but0", 0xFFFF00),
(create_check_box_overlay, "$g_presentation_obj_battle_check0", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos2, ":stat_position_check_x"),
(position_set_y, pos2, ":stat_position_check_y"),
(overlay_set_position, "$g_presentation_obj_battle_check0", pos2),
(val_add, ":stat_position_check_y", -40),
(create_text_overlay, "$g_presentation_obj_battle_name0", s7, 0),
(position_set_x, pos3, ":stat_position_name_x"),
(position_set_y, pos3, ":stat_position_name_y"),
(overlay_set_position, "$g_presentation_obj_battle_name0", pos3),
(val_add, ":stat_position_name_y", -40),
(create_text_overlay, "$g_presentation_but0_movement", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but0_riding", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but0_weapon_usage", s7, tf_center_justify),
(try_end),
(try_begin),
(eq, "$group1_has_troops", 1),
(create_image_button_overlay, "$g_presentation_obj_battle_but1", "mesh_white_plane", "mesh_white_plane"),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_but1", pos1),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, 32500),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_presentation_obj_battle_but1", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_but1", 0),
(overlay_set_color, "$g_presentation_obj_battle_but1", 0xFFFF00),
(create_check_box_overlay, "$g_presentation_obj_battle_check1", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos2, ":stat_position_check_x"),
(position_set_y, pos2, ":stat_position_check_y"),
(overlay_set_position, "$g_presentation_obj_battle_check1", pos2),
(val_add, ":stat_position_check_y", -40),
(create_text_overlay, "$g_presentation_obj_battle_name1", s7, 0),
(position_set_x, pos3, ":stat_position_name_x"),
(position_set_y, pos3, ":stat_position_name_y"),
(overlay_set_position, "$g_presentation_obj_battle_name1", pos3),
(val_add, ":stat_position_name_y", -40),
(create_text_overlay, "$g_presentation_but1_movement", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but1_riding", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but1_weapon_usage", s7, tf_center_justify),
(try_end),
(try_begin),
(eq, "$group2_has_troops", 1),
(create_image_button_overlay, "$g_presentation_obj_battle_but2", "mesh_white_plane", "mesh_white_plane"),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_but2", pos1),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, 32500),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_presentation_obj_battle_but2", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_but2", 0),
(overlay_set_color, "$g_presentation_obj_battle_but2", 0xFFFF00),
(create_check_box_overlay, "$g_presentation_obj_battle_check2", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos2, ":stat_position_check_x"),
(position_set_y, pos2, ":stat_position_check_y"),
(overlay_set_position, "$g_presentation_obj_battle_check2", pos2),
(val_add, ":stat_position_check_y", -40),
(create_text_overlay, "$g_presentation_obj_battle_name2", s7, 0),
(position_set_x, pos3, ":stat_position_name_x"),
(position_set_y, pos3, ":stat_position_name_y"),
(overlay_set_position, "$g_presentation_obj_battle_name2", pos3),
(val_add, ":stat_position_name_y", -40),
(create_text_overlay, "$g_presentation_but2_movement", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but2_riding", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but2_weapon_usage", s7, tf_center_justify),
(try_end),
(try_begin),
(eq, "$group3_has_troops", 1),
(create_image_button_overlay, "$g_presentation_obj_battle_but3", "mesh_white_plane", "mesh_white_plane"),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_but3", pos1),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, 32500),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_presentation_obj_battle_but3", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_but3", 0),
(overlay_set_color, "$g_presentation_obj_battle_but3", 0xFFFF00),
(create_check_box_overlay, "$g_presentation_obj_battle_check3", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos2, ":stat_position_check_x"),
(position_set_y, pos2, ":stat_position_check_y"),
(overlay_set_position, "$g_presentation_obj_battle_check3", pos2),
(val_add, ":stat_position_check_y", -40),
(create_text_overlay, "$g_presentation_obj_battle_name3", s7, 0),
(position_set_x, pos3, ":stat_position_name_x"),
(position_set_y, pos3, ":stat_position_name_y"),
(overlay_set_position, "$g_presentation_obj_battle_name3", pos3),
(val_add, ":stat_position_name_y", -40),
(create_text_overlay, "$g_presentation_but3_movement", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but3_riding", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but3_weapon_usage", s7, tf_center_justify),
(try_end),
(try_begin),
(eq, "$group4_has_troops", 1),
(create_image_button_overlay, "$g_presentation_obj_battle_but4", "mesh_white_plane", "mesh_white_plane"),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_but4", pos1),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, 32500),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_presentation_obj_battle_but4", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_but4", 0),
(overlay_set_color, "$g_presentation_obj_battle_but4", 0xFFFF00),
(create_check_box_overlay, "$g_presentation_obj_battle_check4", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos2, ":stat_position_check_x"),
(position_set_y, pos2, ":stat_position_check_y"),
(overlay_set_position, "$g_presentation_obj_battle_check4", pos2),
(val_add, ":stat_position_check_y", -40),
(create_text_overlay, "$g_presentation_obj_battle_name4", s7, 0),
(position_set_x, pos3, ":stat_position_name_x"),
(position_set_y, pos3, ":stat_position_name_y"),
(overlay_set_position, "$g_presentation_obj_battle_name4", pos3),
(val_add, ":stat_position_name_y", -40),
(create_text_overlay, "$g_presentation_but4_movement", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but4_riding", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but4_weapon_usage", s7, tf_center_justify),
(try_end),
(try_begin),
(eq, "$group5_has_troops", 1),
(create_image_button_overlay, "$g_presentation_obj_battle_but5", "mesh_white_plane", "mesh_white_plane"),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_but5", pos1),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, 32500),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_presentation_obj_battle_but5", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_but5", 0),
(overlay_set_color, "$g_presentation_obj_battle_but5", 0xFFFF00),
(create_check_box_overlay, "$g_presentation_obj_battle_check5", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos2, ":stat_position_check_x"),
(position_set_y, pos2, ":stat_position_check_y"),
(overlay_set_position, "$g_presentation_obj_battle_check5", pos2),
(val_add, ":stat_position_check_y", -40),
(create_text_overlay, "$g_presentation_obj_battle_name5", s7, 0),
(position_set_x, pos3, ":stat_position_name_x"),
(position_set_y, pos3, ":stat_position_name_y"),
(overlay_set_position, "$g_presentation_obj_battle_name5", pos3),
(val_add, ":stat_position_name_y", -40),
(create_text_overlay, "$g_presentation_but5_movement", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but5_riding", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but5_weapon_usage", s7, tf_center_justify),
(try_end),
(try_begin),
(eq, "$group6_has_troops", 1),
(create_image_button_overlay, "$g_presentation_obj_battle_but6", "mesh_white_plane", "mesh_white_plane"),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_but6", pos1),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, 32500),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_presentation_obj_battle_but6", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_but6", 0),
(overlay_set_color, "$g_presentation_obj_battle_but6", 0xFFFF00),
(create_check_box_overlay, "$g_presentation_obj_battle_check6", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos2, ":stat_position_check_x"),
(position_set_y, pos2, ":stat_position_check_y"),
(overlay_set_position, "$g_presentation_obj_battle_check6", pos2),
(val_add, ":stat_position_check_y", -40),
(create_text_overlay, "$g_presentation_obj_battle_name6", s7, 0),
(position_set_x, pos3, ":stat_position_name_x"),
(position_set_y, pos3, ":stat_position_name_y"),
(overlay_set_position, "$g_presentation_obj_battle_name6", pos3),
(val_add, ":stat_position_name_y", -40),
(create_text_overlay, "$g_presentation_but6_movement", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but6_riding", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but6_weapon_usage", s7, tf_center_justify),
(try_end),
(try_begin),
(eq, "$group7_has_troops", 1),
(create_image_button_overlay, "$g_presentation_obj_battle_but7", "mesh_white_plane", "mesh_white_plane"),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_but7", pos1),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, 32500),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_presentation_obj_battle_but7", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_but7", 0),
(overlay_set_color, "$g_presentation_obj_battle_but7", 0xFFFF00),
(create_check_box_overlay, "$g_presentation_obj_battle_check7", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos2, ":stat_position_check_x"),
(position_set_y, pos2, ":stat_position_check_y"),
(overlay_set_position, "$g_presentation_obj_battle_check7", pos2),
(val_add, ":stat_position_check_y", -40),
(create_text_overlay, "$g_presentation_obj_battle_name7", s7, 0),
(position_set_x, pos3, ":stat_position_name_x"),
(position_set_y, pos3, ":stat_position_name_y"),
(overlay_set_position, "$g_presentation_obj_battle_name7", pos3),
(val_add, ":stat_position_name_y", -40),
(create_text_overlay, "$g_presentation_but7_movement", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but7_riding", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but7_weapon_usage", s7, tf_center_justify),
(try_end),
(try_begin),
(eq, "$group8_has_troops", 1),
(create_image_button_overlay, "$g_presentation_obj_battle_but8", "mesh_white_plane", "mesh_white_plane"),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_but8", pos1),
(val_add, ":stat_position_y", -40),
(position_set_x, pos1, 32500),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_presentation_obj_battle_but8", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_but8", 0),
(overlay_set_color, "$g_presentation_obj_battle_but8", 0xFFFF00),
(create_check_box_overlay, "$g_presentation_obj_battle_check8", "mesh_checkbox_off", "mesh_checkbox_on"),
(position_set_x, pos2, ":stat_position_check_x"),
(position_set_y, pos2, ":stat_position_check_y"),
(overlay_set_position, "$g_presentation_obj_battle_check8", pos2),
(val_add, ":stat_position_check_y", -40),
(create_text_overlay, "$g_presentation_obj_battle_name8", s7, 0),
(position_set_x, pos3, ":stat_position_name_x"),
(position_set_y, pos3, ":stat_position_name_y"),
(overlay_set_position, "$g_presentation_obj_battle_name8", pos3),
(val_add, ":stat_position_name_y", -40),
(create_text_overlay, "$g_presentation_but8_movement", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but8_riding", s7, tf_center_justify),
(create_text_overlay, "$g_presentation_but8_weapon_usage", s7, tf_center_justify),
(try_end),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(call_script, "script_update_order_panel", ":player_team"),
#(create_button_overlay, "$g_presentation_obj_battle_10", "@Hold This Position", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_11", "@Follow Me", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_12", "@Charge", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_13", "@Advance", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_14", "@Fall Back", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_15", "@Stand Closer", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_16", "@Spread Out", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_17", "@Stand Ground", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_18", "@Mount", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_19", "@Dismount", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_20", "@Use Any Weapon", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_21", "@Use Blunt Weapons", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_28", "@Hold Your Fire", tf_center_justify),
#(create_button_overlay, "$g_presentation_obj_battle_29", "@Fire At Will", tf_center_justify),
(assign, ":y_position_for_order_buttons", 640),
(assign, ":addition_y_position", "$num_classes"),
(val_mul, ":addition_y_position", -40),
(val_add, ":y_position_for_order_buttons", ":addition_y_position"),
(create_listbox_overlay, "$g_presentation_obj_battle_10", "str_space", 0),
(create_listbox_overlay, "$g_presentation_obj_battle_11", "str_space", 0),
(create_listbox_overlay, "$g_presentation_obj_battle_12", "str_space", 0),
(create_listbox_overlay, "$g_presentation_obj_battle_13", "str_space", 0),
(overlay_add_item, "$g_presentation_obj_battle_10", "@Stand Ground"),
##(overlay_add_item, "$g_presentation_obj_battle_10", "@Spread Out"),
##(overlay_add_item, "$g_presentation_obj_battle_10", "@Stand Closer"),
##(overlay_add_item, "$g_presentation_obj_battle_10", "@Fall Back"),
##(overlay_add_item, "$g_presentation_obj_battle_10", "@Advance"),
(overlay_add_item, "$g_presentation_obj_battle_10", "@Charge"),
(overlay_add_item, "$g_presentation_obj_battle_10", "@Follow Me"),
(overlay_add_item, "$g_presentation_obj_battle_10", "@Hold This Position"),
(create_button_overlay, "$g_presentation_obj_battle_14", "@Spread Out", tf_center_justify|tf_single_line|tf_with_outline),
(overlay_set_color, "$g_presentation_obj_battle_14", 0xFFFFFFFF),
(create_button_overlay, "$g_presentation_obj_battle_15", "@Stand Closer", tf_center_justify|tf_single_line|tf_with_outline),
(overlay_set_color, "$g_presentation_obj_battle_15", 0xFFFFFFFF),
(create_button_overlay, "$g_presentation_obj_battle_16", "@Fall Back", tf_center_justify|tf_single_line|tf_with_outline),
(overlay_set_color, "$g_presentation_obj_battle_16", 0xFFFFFFFF),
(create_button_overlay, "$g_presentation_obj_battle_17", "@Advance", tf_center_justify|tf_single_line|tf_with_outline),
(overlay_set_color, "$g_presentation_obj_battle_17", 0xFFFFFFFF),
(position_set_x, pos1, 600),
(position_set_y, pos1, 600),
(overlay_set_size, "$g_presentation_obj_battle_10", pos1),
(val_add, ":y_position_for_order_buttons", -35),
(position_set_x, pos1, 205),
(position_set_y, pos1, ":y_position_for_order_buttons"),
(val_add, ":y_position_for_order_buttons", 35),
(overlay_set_position, "$g_presentation_obj_battle_10", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_10", 0x60),
(overlay_set_val, "$g_presentation_obj_battle_10", "$g_latest_order_1"),
(val_add, ":y_position_for_order_buttons", -40), #new
(position_set_x, pos1, 130), #new
(position_set_y, pos1, ":y_position_for_order_buttons"), #new
(val_add, ":y_position_for_order_buttons", 40), #new
(overlay_set_position, "$g_presentation_obj_battle_14", pos1), #new
#(overlay_set_alpha, "$g_presentation_obj_battle_14", 0x60), #new
(val_add, ":y_position_for_order_buttons", -20), #new
(position_set_x, pos1, 130), #new
(position_set_y, pos1, ":y_position_for_order_buttons"), #new
(val_add, ":y_position_for_order_buttons", 20), #new
(overlay_set_position, "$g_presentation_obj_battle_15", pos1), #new
#(overlay_set_alpha, "$g_presentation_obj_battle_15", 0x60), #new
(val_add, ":y_position_for_order_buttons", -0), #new
(position_set_x, pos1, 130), #new
(position_set_y, pos1, ":y_position_for_order_buttons"), #new
(val_add, ":y_position_for_order_buttons", 0), #new
(overlay_set_position, "$g_presentation_obj_battle_16", pos1), #new
#(overlay_set_alpha, "$g_presentation_obj_battle_16", 0x60), #new
(val_add, ":y_position_for_order_buttons", 20), #new
(position_set_x, pos1, 130), #new
(position_set_y, pos1, ":y_position_for_order_buttons"), #new
(val_add, ":y_position_for_order_buttons", -20), #new
(overlay_set_position, "$g_presentation_obj_battle_17", pos1), #new
#(overlay_set_alpha, "$g_presentation_obj_battle_17", 0x60), #new
(overlay_add_item, "$g_presentation_obj_battle_11", "@Dismount"),
(overlay_add_item, "$g_presentation_obj_battle_11", "@Mount"),
(position_set_x, pos1, 600),
(position_set_y, pos1, 600),
(overlay_set_size, "$g_presentation_obj_battle_11", pos1),
(position_set_x, pos1, 350),
(position_set_y, pos1, ":y_position_for_order_buttons"),
(overlay_set_position, "$g_presentation_obj_battle_11", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_11", 0x60),
(overlay_set_val, "$g_presentation_obj_battle_11", "$g_latest_order_2"),
(overlay_add_item, "$g_presentation_obj_battle_12", "@Fire At Will"),
(overlay_add_item, "$g_presentation_obj_battle_12", "@Hold Your Fire"),
(position_set_x, pos1, 600),
(position_set_y, pos1, 600),
(overlay_set_size, "$g_presentation_obj_battle_12", pos1),
(position_set_x, pos1, 495),
(position_set_y, pos1, ":y_position_for_order_buttons"),
(overlay_set_position, "$g_presentation_obj_battle_12", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_12", 0x60),
(overlay_set_val, "$g_presentation_obj_battle_12", "$g_latest_order_3"),
(overlay_add_item, "$g_presentation_obj_battle_13", "@Use Blunt Weapons"),
(overlay_add_item, "$g_presentation_obj_battle_13", "@Use Any Weapon"),
(position_set_x, pos1, 600),
(position_set_y, pos1, 600),
(overlay_set_size, "$g_presentation_obj_battle_13", pos1),
(val_add, ":y_position_for_order_buttons", -35),
(position_set_x, pos1, 495),
(position_set_y, pos1, ":y_position_for_order_buttons"),
(val_add, ":y_position_for_order_buttons", 35),
(overlay_set_position, "$g_presentation_obj_battle_13", pos1),
(overlay_set_alpha, "$g_presentation_obj_battle_13", 0x60),
(overlay_set_val, "$g_presentation_obj_battle_13", "$g_latest_order_4"),
(create_text_overlay, "$g_presentation_obj_battle_22", "str_us_", 0),
(create_text_overlay, "$g_presentation_obj_battle_23", "str_allies_", 0),
(create_text_overlay, "$g_presentation_obj_battle_24", "str_enemies_", 0),
(create_text_overlay, "$g_presentation_obj_battle_25", "@Ready", tf_center_justify),
(create_text_overlay, "$g_presentation_obj_battle_26", "@Wounded", tf_center_justify),
(create_text_overlay, "$g_presentation_obj_battle_28", "str_routed", tf_center_justify),
(create_text_overlay, "$g_presentation_obj_battle_27", "@Dead", tf_center_justify),
(create_text_overlay, "$g_battle_us_ready", s7, tf_center_justify),
(create_text_overlay, "$g_battle_us_wounded", s7, tf_center_justify),
(create_text_overlay, "$g_battle_us_routed", s7, tf_center_justify),
(create_text_overlay, "$g_battle_us_dead", s7, tf_center_justify),
(create_text_overlay, "$g_battle_enemies_ready", s7, tf_center_justify),
(create_text_overlay, "$g_battle_enemies_wounded", s7, tf_center_justify),
(create_text_overlay, "$g_battle_enemies_routed", s7, tf_center_justify),
(create_text_overlay, "$g_battle_enemies_dead", s7, tf_center_justify),
(create_text_overlay, "$g_battle_allies_ready", s7, tf_center_justify),
(create_text_overlay, "$g_battle_allies_wounded", s7, tf_center_justify),
(create_text_overlay, "$g_battle_allies_routed", s7, tf_center_justify),
(create_text_overlay, "$g_battle_allies_dead", s7, tf_center_justify),
(create_image_button_overlay, "$g_battle_report_plane", "mesh_white_plane", "mesh_white_plane"),
(overlay_set_color, "$g_battle_report_plane", 0),
(position_set_x, pos1, 15500),
(position_set_y, pos1, 6000),
(overlay_set_size, "$g_battle_report_plane", pos1),
(position_set_x, pos1, 672),
(position_set_y, pos1, 275),
(overlay_set_position, "$g_battle_report_plane", pos1),
(overlay_set_alpha, "$g_battle_report_plane", 0x44),
(overlay_set_color, "$g_battle_report_plane", 0x1166BB),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, "$g_presentation_obj_battle_14", pos1), #new
(overlay_set_size, "$g_presentation_obj_battle_15", pos1), #new
(overlay_set_size, "$g_presentation_obj_battle_16", pos1), #new
(overlay_set_size, "$g_presentation_obj_battle_17", pos1), #new
(overlay_set_size, "$g_presentation_obj_battle_22", pos1),
(overlay_set_size, "$g_presentation_obj_battle_23", pos1),
(overlay_set_size, "$g_presentation_obj_battle_24", pos1),
(overlay_set_size, "$g_presentation_obj_battle_25", pos1),
(overlay_set_size, "$g_presentation_obj_battle_26", pos1),
(overlay_set_size, "$g_presentation_obj_battle_27", pos1),
(overlay_set_size, "$g_presentation_obj_battle_28", pos1),
(overlay_set_size, "$g_battle_us_ready", pos1),
(overlay_set_size, "$g_battle_us_wounded", pos1),
(overlay_set_size, "$g_battle_us_routed", pos1),
(overlay_set_size, "$g_battle_us_dead", pos1),
(overlay_set_size, "$g_battle_enemies_ready", pos1),
(overlay_set_size, "$g_battle_enemies_wounded", pos1),
(overlay_set_size, "$g_battle_enemies_routed", pos1),
(overlay_set_size, "$g_battle_enemies_dead", pos1),
(overlay_set_size, "$g_battle_allies_ready", pos1),
(overlay_set_size, "$g_battle_allies_wounded", pos1),
(overlay_set_size, "$g_battle_allies_routed", pos1),
(overlay_set_size, "$g_battle_allies_dead", pos1),
(assign, ":stat_position_x", 675),
(assign, ":stat_position_y", 280),
(val_add, ":stat_position_x", 70),
(val_add, ":stat_position_y", 90),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_25", pos1),
(val_add, ":stat_position_x", 70),
(position_set_x, pos1, ":stat_position_x"),
(overlay_set_position, "$g_presentation_obj_battle_26", pos1),
(val_add, ":stat_position_x", 70),
(position_set_x, pos1, ":stat_position_x"),
(overlay_set_position, "$g_presentation_obj_battle_28", pos1),
(val_add, ":stat_position_x", 70),
(position_set_x, pos1, ":stat_position_x"),
(overlay_set_position, "$g_presentation_obj_battle_27", pos1),
(val_add, ":stat_position_x", -280),
(val_add, ":stat_position_y", -30),
(position_set_x, pos1, ":stat_position_x"),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_22", pos1),
(val_add, ":stat_position_y", -30),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_23", pos1),
(val_add, ":stat_position_y", -30),
(position_set_y, pos1, ":stat_position_y"),
(overlay_set_position, "$g_presentation_obj_battle_24", pos1),
(get_scene_boundaries, pos2, pos3),
(position_transform_position_to_local, pos4, pos2, pos3),
(set_fixed_point_multiplier, 1000),
(position_get_x, ":map_width", pos4),
(position_get_y, ":map_height", pos4),
(set_fixed_point_multiplier, 1000),
(store_div, ":map_ratio", ":map_height", 100),
(store_div, ":map_ratio", ":map_width", ":map_ratio"),
(try_begin),
(gt, ":map_ratio", 100),
(assign, "$g_battle_map_width", 300),
(store_div, "$g_battle_map_scale", ":map_width", "$g_battle_map_width"),
(store_div, "$g_battle_map_height", ":map_height", "$g_battle_map_scale"),
(else_try),
(assign, "$g_battle_map_height", 300),
(store_div, "$g_battle_map_scale", ":map_height", "$g_battle_map_height"),
(store_div, "$g_battle_map_width", ":map_width", "$g_battle_map_scale"),
(try_end),
(create_image_button_overlay, "$g_battle_map_plane", "mesh_white_plane", "mesh_white_plane"),
(overlay_set_color, "$g_battle_map_plane", 0),
(store_add, ":map_bordered_width", "$g_battle_map_width", 20),
(store_add, ":map_bordered_height", "$g_battle_map_height", 20),
(store_mul, ":map_scale_x", ":map_bordered_width", 50),
(store_mul, ":map_scale_y", ":map_bordered_height", 50),
(position_set_x, pos1, ":map_scale_x"),
(position_set_y, pos1, ":map_scale_y"),
(overlay_set_size, "$g_battle_map_plane", pos1),
(store_sub, ":map_pos_x", 990, ":map_bordered_width"),
(store_sub, ":map_pos_y", 740, ":map_bordered_height"),
(position_set_x, pos1, ":map_pos_x"),
(position_set_y, pos1, ":map_pos_y"),
(overlay_set_position, "$g_battle_map_plane", pos1),
(overlay_set_alpha, "$g_battle_map_plane", 0x44),
(create_mesh_overlay, "$g_battle_map_infantry_order_flag", "mesh_flag_infantry"),
(create_mesh_overlay, "$g_battle_map_archers_order_flag", "mesh_flag_archers"),
(create_mesh_overlay, "$g_battle_map_cavalry_order_flag", "mesh_flag_cavalry"),
(overlay_set_alpha, "$g_battle_map_infantry_order_flag", 0),
(overlay_set_alpha, "$g_battle_map_archers_order_flag", 0),
(overlay_set_alpha, "$g_battle_map_cavalry_order_flag", 0),
(call_script, "script_update_order_panel_checked_classes"),
(call_script, "script_update_order_panel_statistics_and_map"),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":value"),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(assign, ":update_listeners", 0),
(try_begin),
(eq, "$group0_has_troops", 1),
(eq, ":object", "$g_presentation_obj_battle_check0"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group0_selected", ":value"),
(try_begin),
(eq, ":value", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0x44),
(else_try),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0),
(try_end),
(else_try),
(eq, "$group1_has_troops", 1),
(eq, ":object", "$g_presentation_obj_battle_check1"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group1_selected", ":value"),
(try_begin),
(eq, ":value", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0x44),
(else_try),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0),
(try_end),
(else_try),
(eq, "$group2_has_troops", 1),
(eq, ":object", "$g_presentation_obj_battle_check2"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group2_selected", ":value"),
(try_begin),
(eq, ":value", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0x44),
(else_try),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0),
(try_end),
(else_try),
(eq, "$group3_has_troops", 1),
(eq, ":object", "$g_presentation_obj_battle_check3"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group3_selected", ":value"),
(try_begin),
(eq, ":value", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0x44),
(else_try),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0),
(try_end),
(else_try),
(eq, "$group4_has_troops", 1),
(eq, ":object", "$g_presentation_obj_battle_check4"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group4_selected", ":value"),
(try_begin),
(eq, ":value", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0x44),
(else_try),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0),
(try_end),
(else_try),
(eq, "$group5_has_troops", 1),
(eq, ":object", "$g_presentation_obj_battle_check5"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group5_selected", ":value"),
(try_begin),
(eq, ":value", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0x44),
(else_try),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0),
(try_end),
(else_try),
(eq, "$group6_has_troops", 1),
(eq, ":object", "$g_presentation_obj_battle_check6"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group6_selected", ":value"),
(try_begin),
(eq, ":value", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0x44),
(else_try),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0),
(try_end),
(else_try),
(eq, "$group7_has_troops", 1),
(eq, ":object", "$g_presentation_obj_battle_check7"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group7_selected", ":value"),
(try_begin),
(eq, ":value", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0x44),
(else_try),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0),
(try_end),
(else_try),
(eq, "$group8_has_troops", 1),
(eq, ":object", "$g_presentation_obj_battle_check8"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group8_selected", ":value"),
(try_begin),
(eq, ":value", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0x44),
(else_try),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but0"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group0_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0x44),
(overlay_set_val, "$g_presentation_obj_battle_check0", 1),
(try_begin),
(eq, "$group1_has_troops", 1),
(assign, "$g_formation_group1_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check1", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0),
(try_end),
(try_begin),
(eq, "$group2_has_troops", 1),
(assign, "$g_formation_group2_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check2", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0),
(try_end),
(try_begin),
(eq, "$group3_has_troops", 1),
(assign, "$g_formation_group3_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check3", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0),
(try_end),
(try_begin),
(eq, "$group4_has_troops", 1),
(assign, "$g_formation_group4_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check4", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0),
(try_end),
(try_begin),
(eq, "$group5_has_troops", 1),
(assign, "$g_formation_group5_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check5", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0),
(try_end),
(try_begin),
(eq, "$group6_has_troops", 1),
(assign, "$g_formation_group6_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check6", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0),
(try_end),
(try_begin),
(eq, "$group7_has_troops", 1),
(assign, "$g_formation_group7_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check7", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0),
(try_end),
(try_begin),
(eq, "$group8_has_troops", 1),
(assign, "$g_formation_group8_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check8", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but1"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group1_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0x44),
(overlay_set_val, "$g_presentation_obj_battle_check1", 1),
(try_begin),
(eq, "$group0_has_troops", 1),
(assign, "$g_formation_group0_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check0", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0),
(try_end),
(try_begin),
(eq, "$group2_has_troops", 1),
(assign, "$g_formation_group2_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check2", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0),
(try_end),
(try_begin),
(eq, "$group3_has_troops", 1),
(assign, "$g_formation_group3_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check3", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0),
(try_end),
(try_begin),
(eq, "$group4_has_troops", 1),
(assign, "$g_formation_group4_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check4", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0),
(try_end),
(try_begin),
(eq, "$group5_has_troops", 1),
(assign, "$g_formation_group5_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check5", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0),
(try_end),
(try_begin),
(eq, "$group6_has_troops", 1),
(assign, "$g_formation_group6_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check6", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0),
(try_end),
(try_begin),
(eq, "$group7_has_troops", 1),
(assign, "$g_formation_group7_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check7", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0),
(try_end),
(try_begin),
(eq, "$group8_has_troops", 1),
(assign, "$g_formation_group8_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check8", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but2"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group2_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0x44),
(overlay_set_val, "$g_presentation_obj_battle_check2", 1),
(try_begin),
(eq, "$group0_has_troops", 1),
(assign, "$g_formation_group0_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check0", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0),
(try_end),
(try_begin),
(eq, "$group1_has_troops", 1),
(assign, "$g_formation_group1_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check1", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0),
(try_end),
(try_begin),
(eq, "$group3_has_troops", 1),
(assign, "$g_formation_group3_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check3", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0),
(try_end),
(try_begin),
(eq, "$group4_has_troops", 1),
(assign, "$g_formation_group4_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check4", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0),
(try_end),
(try_begin),
(eq, "$group5_has_troops", 1),
(assign, "$g_formation_group5_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check5", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0),
(try_end),
(try_begin),
(eq, "$group6_has_troops", 1),
(assign, "$g_formation_group6_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check6", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0),
(try_end),
(try_begin),
(eq, "$group7_has_troops", 1),
(assign, "$g_formation_group7_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check7", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0),
(try_end),
(try_begin),
(eq, "$group8_has_troops", 1),
(assign, "$g_formation_group8_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check8", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but3"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group3_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0x44),
(overlay_set_val, "$g_presentation_obj_battle_check3", 1),
(try_begin),
(eq, "$group0_has_troops", 1),
(assign, "$g_formation_group0_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check0", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0),
(try_end),
(try_begin),
(eq, "$group1_has_troops", 1),
(assign, "$g_formation_group1_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check1", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0),
(try_end),
(try_begin),
(eq, "$group2_has_troops", 1),
(assign, "$g_formation_group2_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check2", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0),
(try_end),
(try_begin),
(eq, "$group4_has_troops", 1),
(assign, "$g_formation_group4_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check4", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0),
(try_end),
(try_begin),
(eq, "$group5_has_troops", 1),
(assign, "$g_formation_group5_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check5", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0),
(try_end),
(try_begin),
(eq, "$group6_has_troops", 1),
(assign, "$g_formation_group6_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check6", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0),
(try_end),
(try_begin),
(eq, "$group7_has_troops", 1),
(assign, "$g_formation_group7_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check7", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0),
(try_end),
(try_begin),
(eq, "$group8_has_troops", 1),
(assign, "$g_formation_group8_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check8", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but4"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group4_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0x44),
(overlay_set_val, "$g_presentation_obj_battle_check4", 1),
(try_begin),
(eq, "$group0_has_troops", 1),
(assign, "$g_formation_group0_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check0", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0),
(try_end),
(try_begin),
(eq, "$group1_has_troops", 1),
(assign, "$g_formation_group1_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check1", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0),
(try_end),
(try_begin),
(eq, "$group2_has_troops", 1),
(assign, "$g_formation_group2_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check2", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0),
(try_end),
(try_begin),
(eq, "$group3_has_troops", 1),
(assign, "$g_formation_group3_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check3", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0),
(try_end),
(try_begin),
(eq, "$group5_has_troops", 1),
(assign, "$g_formation_group5_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check5", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0),
(try_end),
(try_begin),
(eq, "$group6_has_troops", 1),
(assign, "$g_formation_group6_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check6", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0),
(try_end),
(try_begin),
(eq, "$group7_has_troops", 1),
(assign, "$g_formation_group7_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check7", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0),
(try_end),
(try_begin),
(eq, "$group8_has_troops", 1),
(assign, "$g_formation_group8_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check8", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but5"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group5_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0x44),
(overlay_set_val, "$g_presentation_obj_battle_check5", 1),
(try_begin),
(eq, "$group0_has_troops", 1),
(assign, "$g_formation_group0_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check0", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0),
(try_end),
(try_begin),
(eq, "$group1_has_troops", 1),
(assign, "$g_formation_group1_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check1", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0),
(try_end),
(try_begin),
(eq, "$group2_has_troops", 1),
(assign, "$g_formation_group2_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check2", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0),
(try_end),
(try_begin),
(eq, "$group3_has_troops", 1),
(assign, "$g_formation_group3_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check3", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0),
(try_end),
(try_begin),
(eq, "$group4_has_troops", 1),
(assign, "$g_formation_group4_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check4", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0),
(try_end),
(try_begin),
(eq, "$group6_has_troops", 1),
(assign, "$g_formation_group6_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check6", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0),
(try_end),
(try_begin),
(eq, "$group7_has_troops", 1),
(assign, "$g_formation_group7_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check7", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0),
(try_end),
(try_begin),
(eq, "$group8_has_troops", 1),
(assign, "$g_formation_group8_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check8", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but6"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group6_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0x44),
(overlay_set_val, "$g_presentation_obj_battle_check6", 1),
(try_begin),
(eq, "$group0_has_troops", 1),
(assign, "$g_formation_group0_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check0", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0),
(try_end),
(try_begin),
(eq, "$group1_has_troops", 1),
(assign, "$g_formation_group1_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check1", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0),
(try_end),
(try_begin),
(eq, "$group2_has_troops", 1),
(assign, "$g_formation_group2_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check2", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0),
(try_end),
(try_begin),
(eq, "$group3_has_troops", 1),
(assign, "$g_formation_group3_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check3", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0),
(try_end),
(try_begin),
(eq, "$group4_has_troops", 1),
(assign, "$g_formation_group4_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check4", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0),
(try_end),
(try_begin),
(eq, "$group5_has_troops", 1),
(assign, "$g_formation_group5_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check5", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0),
(try_end),
(try_begin),
(eq, "$group7_has_troops", 1),
(assign, "$g_formation_group7_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check7", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0),
(try_end),
(try_begin),
(eq, "$group8_has_troops", 1),
(assign, "$g_formation_group8_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check8", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but7"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group7_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0x44),
(overlay_set_val, "$g_presentation_obj_battle_check7", 1),
(try_begin),
(eq, "$group0_has_troops", 1),
(assign, "$g_formation_group0_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check0", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0),
(try_end),
(try_begin),
(eq, "$group1_has_troops", 1),
(assign, "$g_formation_group1_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check1", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0),
(try_end),
(try_begin),
(eq, "$group2_has_troops", 1),
(assign, "$g_formation_group2_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check2", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0),
(try_end),
(try_begin),
(eq, "$group3_has_troops", 1),
(assign, "$g_formation_group3_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check3", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0),
(try_end),
(try_begin),
(eq, "$group4_has_troops", 1),
(assign, "$g_formation_group4_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check4", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0),
(try_end),
(try_begin),
(eq, "$group5_has_troops", 1),
(assign, "$g_formation_group5_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check5", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0),
(try_end),
(try_begin),
(eq, "$group6_has_troops", 1),
(assign, "$g_formation_group6_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check6", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0),
(try_end),
(try_begin),
(eq, "$group8_has_troops", 1),
(assign, "$g_formation_group8_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check8", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but8"),
(assign, ":update_listeners", 1),
(assign, "$g_formation_group8_selected", 1),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but8", 250, 0x44),
(overlay_set_val, "$g_presentation_obj_battle_check8", 1),
(try_begin),
(eq, "$group0_has_troops", 1),
(assign, "$g_formation_group0_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check0", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but0", 250, 0),
(try_end),
(try_begin),
(eq, "$group1_has_troops", 1),
(assign, "$g_formation_group1_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check1", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but1", 250, 0),
(try_end),
(try_begin),
(eq, "$group2_has_troops", 1),
(assign, "$g_formation_group2_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check2", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but2", 250, 0),
(try_end),
(try_begin),
(eq, "$group3_has_troops", 1),
(assign, "$g_formation_group3_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check3", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but3", 250, 0),
(try_end),
(try_begin),
(eq, "$group4_has_troops", 1),
(assign, "$g_formation_group4_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check4", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but4", 250, 0),
(try_end),
(try_begin),
(eq, "$group5_has_troops", 1),
(assign, "$g_formation_group5_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check5", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but5", 250, 0),
(try_end),
(try_begin),
(eq, "$group6_has_troops", 1),
(assign, "$g_formation_group6_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check6", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but6", 250, 0),
(try_end),
(try_begin),
(eq, "$group7_has_troops", 1),
(assign, "$g_formation_group7_selected", 0),
(overlay_set_val, "$g_presentation_obj_battle_check7", 0),
(overlay_animate_to_alpha, "$g_presentation_obj_battle_but7", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_14"),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_spread_out),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_15"),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_stand_closer),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_16"),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_fall_back),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_17"),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_advance),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_10"),
(try_begin),
(eq, ":value", 3),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_hold),
(call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_1", 3),
(else_try),
(eq, ":value", 2),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_follow),
(call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_1", 2),
(else_try),
(eq, ":value", 1),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_charge),
(call_script, "script_update_order_panel", ":player_team"),
## (else_try),
## (eq, ":value", 4),
## (call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_advance),
## (call_script, "script_update_order_panel", ":player_team"),
## (else_try),
## (eq, ":value", 3),
## (call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_fall_back),
## (call_script, "script_update_order_panel", ":player_team"),
## (else_try),
## (eq, ":value", 2),
## (call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_stand_closer),
## (call_script, "script_update_order_panel", ":player_team"),
## (else_try),
## (eq, ":value", 1),
## (call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_spread_out),
## (call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_1", 1),
(else_try),
(eq, ":value", 0),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_stand_ground),
(call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_1", 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_11"),
(try_begin),
(eq, ":value", 1),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_mount),
(call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_2", 1),
(else_try),
(eq, ":value", 0),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_dismount),
(call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_2", 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_12"),
(try_begin),
(eq, ":value", 1),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_hold_fire),
(call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_3", 1),
(else_try),
(eq, ":value", 0),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_fire_at_will),
(call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_3", 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_13"),
(try_begin),
(eq, ":value", 1),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_use_any_weapon),
(call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_4", 1),
(else_try),
(eq, ":value", 0),
(call_script, "script_team_give_order_from_order_panel", ":player_agent", mordr_use_blunt_weapons),
(call_script, "script_update_order_panel", ":player_team"),
(assign, "$g_latest_order_4", 0),
(try_end),
(else_try),
(eq, ":object", "$g_battle_map_plane"),
(get_scene_boundaries, pos2, pos3),
(mouse_get_position, pos1),
(set_fixed_point_multiplier, 1000),
(position_get_x, ":mouse_x", pos1),
(position_get_y, ":mouse_y", pos1),
(store_sub, ":map_x", 980, "$g_battle_map_width"),
(store_sub, ":map_y", 730, "$g_battle_map_height"),
(val_sub, ":mouse_x", ":map_x"),
(val_sub, ":mouse_y", ":map_y"),
(val_clamp, ":mouse_x", 0, "$g_battle_map_width"),
(val_clamp, ":mouse_y", 0, "$g_battle_map_height"),
(val_mul, ":mouse_x", "$g_battle_map_scale"),
(val_mul, ":mouse_y", "$g_battle_map_scale"),
(set_fixed_point_multiplier, 1000),
(position_set_x, pos1, ":mouse_x"),
(position_set_y, pos1, ":mouse_y"),
(position_transform_position_to_parent, pos3, pos2, pos1),
(try_begin),
(eq, "$g_formation_group0_selected", 1),
(team_give_order, ":player_team", 0, mordr_hold),
(team_set_order_position, ":player_team", 0, pos3),
(try_end),
(try_begin),
(eq, "$g_formation_group1_selected", 1),
(team_give_order, ":player_team", 1, mordr_hold),
(team_set_order_position, ":player_team", 1, pos3),
(try_end),
(try_begin),
(eq, "$g_formation_group2_selected", 1),
(team_give_order, ":player_team", 2, mordr_hold),
(team_set_order_position, ":player_team", 2, pos3),
(try_end),
(try_begin),
(eq, "$g_formation_group3_selected", 1),
(team_give_order, ":player_team", 3, mordr_hold),
(team_set_order_position, ":player_team", 3, pos3),
(try_end),
(try_begin),
(eq, "$g_formation_group4_selected", 1),
(team_give_order, ":player_team", 4, mordr_hold),
(team_set_order_position, ":player_team", 4, pos3),
(try_end),
(try_begin),
(eq, "$g_formation_group5_selected", 1),
(team_give_order, ":player_team", 5, mordr_hold),
(team_set_order_position, ":player_team", 5, pos3),
(try_end),
(try_begin),
(eq, "$g_formation_group6_selected", 1),
(team_give_order, ":player_team", 6, mordr_hold),
(team_set_order_position, ":player_team", 6, pos3),
(try_end),
(try_begin),
(eq, "$g_formation_group7_selected", 1),
(team_give_order, ":player_team", 7, mordr_hold),
(team_set_order_position, ":player_team", 7, pos3),
(try_end),
(try_begin),
(eq, "$g_formation_group8_selected", 1),
(team_give_order, ":player_team", 8, mordr_hold),
(team_set_order_position, ":player_team", 8, pos3),
(try_end),
(call_script, "script_update_order_flags_on_map"),
(call_script, "script_update_order_panel", ":player_team"),
(try_end),
(try_begin),
(eq, ":update_listeners", 1),
(team_set_order_listener, ":player_team", -1),
(try_begin),
(this_or_next|eq, "$g_formation_group0_selected", 1),
(eq, "$group0_has_troops", 0),
(this_or_next|eq, "$g_formation_group1_selected", 1),
(eq, "$group1_has_troops", 0),
(this_or_next|eq, "$g_formation_group2_selected", 1),
(eq, "$group2_has_troops", 0),
(this_or_next|eq, "$g_formation_group3_selected", 1),
(eq, "$group3_has_troops", 0),
(this_or_next|eq, "$g_formation_group4_selected", 1),
(eq, "$group4_has_troops", 0),
(this_or_next|eq, "$g_formation_group5_selected", 1),
(eq, "$group5_has_troops", 0),
(this_or_next|eq, "$g_formation_group6_selected", 1),
(eq, "$group6_has_troops", 0),
(this_or_next|eq, "$g_formation_group7_selected", 1),
(eq, "$group7_has_troops", 0),
(this_or_next|eq, "$g_formation_group8_selected", 1),
(eq, "$group8_has_troops", 0),
(team_set_order_listener, ":player_team", grc_everyone),
(else_try),
(eq, "$g_formation_group0_selected", 1),
(team_set_order_listener, ":player_team", 0, 1),
(else_try),
(eq, "$g_formation_group1_selected", 1),
(team_set_order_listener, ":player_team", 1, 1),
(else_try),
(eq, "$g_formation_group2_selected", 1),
(team_set_order_listener, ":player_team", 2, 1),
(else_try),
(eq, "$g_formation_group3_selected", 1),
(team_set_order_listener, ":player_team", 3, 1),
(else_try),
(eq, "$g_formation_group4_selected", 1),
(team_set_order_listener, ":player_team", 4, 1),
(else_try),
(eq, "$g_formation_group5_selected", 1),
(team_set_order_listener, ":player_team", 5, 1),
(else_try),
(eq, "$g_formation_group6_selected", 1),
(team_set_order_listener, ":player_team", 6, 1),
(else_try),
(eq, "$g_formation_group7_selected", 1),
(team_set_order_listener, ":player_team", 7, 1),
(else_try),
(eq, "$g_formation_group8_selected", 1),
(team_set_order_listener, ":player_team", 8, 1),
(try_end),
(try_end),
]),
(ti_on_presentation_mouse_enter_leave,
[(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":enter_leave"),
(try_begin),
(eq, ":object", "$g_presentation_obj_battle_but0"),
(try_begin),
(eq, ":enter_leave", 0),
(overlay_animate_to_color, "$g_presentation_but0_movement", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but0_riding", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but0_weapon_usage", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_obj_battle_name0", 250, 0xFFFFFF),
(else_try),
(overlay_animate_to_color, "$g_presentation_but0_movement", 250, 0),
(overlay_animate_to_color, "$g_presentation_but0_riding", 250, 0),
(overlay_animate_to_color, "$g_presentation_but0_weapon_usage", 250, 0),
(overlay_animate_to_color, "$g_presentation_obj_battle_name0", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but1"),
(try_begin),
(eq, ":enter_leave", 0),
(overlay_animate_to_color, "$g_presentation_but1_movement", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but1_riding", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but1_weapon_usage", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_obj_battle_name1", 250, 0xFFFFFF),
(else_try),
(overlay_animate_to_color, "$g_presentation_but1_movement", 250, 0),
(overlay_animate_to_color, "$g_presentation_but1_riding", 250, 0),
(overlay_animate_to_color, "$g_presentation_but1_weapon_usage", 250, 0),
(overlay_animate_to_color, "$g_presentation_obj_battle_name1", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but2"),
(try_begin),
(eq, ":enter_leave", 0),
(overlay_animate_to_color, "$g_presentation_but2_movement", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but2_riding", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but2_weapon_usage", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_obj_battle_name2", 250, 0xFFFFFF),
(else_try),
(overlay_animate_to_color, "$g_presentation_but2_movement", 250, 0),
(overlay_animate_to_color, "$g_presentation_but2_riding", 250, 0),
(overlay_animate_to_color, "$g_presentation_but2_weapon_usage", 250, 0),
(overlay_animate_to_color, "$g_presentation_obj_battle_name2", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but3"),
(try_begin),
(eq, ":enter_leave", 0),
(overlay_animate_to_color, "$g_presentation_but3_movement", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but3_riding", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but3_weapon_usage", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_obj_battle_name3", 250, 0xFFFFFF),
(else_try),
(overlay_animate_to_color, "$g_presentation_but3_movement", 250, 0),
(overlay_animate_to_color, "$g_presentation_but3_riding", 250, 0),
(overlay_animate_to_color, "$g_presentation_but3_weapon_usage", 250, 0),
(overlay_animate_to_color, "$g_presentation_obj_battle_name3", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but4"),
(try_begin),
(eq, ":enter_leave", 0),
(overlay_animate_to_color, "$g_presentation_but4_movement", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but4_riding", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but4_weapon_usage", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_obj_battle_name4", 250, 0xFFFFFF),
(else_try),
(overlay_animate_to_color, "$g_presentation_but4_movement", 250, 0),
(overlay_animate_to_color, "$g_presentation_but4_riding", 250, 0),
(overlay_animate_to_color, "$g_presentation_but4_weapon_usage", 250, 0),
(overlay_animate_to_color, "$g_presentation_obj_battle_name4", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but5"),
(try_begin),
(eq, ":enter_leave", 0),
(overlay_animate_to_color, "$g_presentation_but5_movement", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but5_riding", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but5_weapon_usage", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_obj_battle_name5", 250, 0xFFFFFF),
(else_try),
(overlay_animate_to_color, "$g_presentation_but5_movement", 250, 0),
(overlay_animate_to_color, "$g_presentation_but5_riding", 250, 0),
(overlay_animate_to_color, "$g_presentation_but5_weapon_usage", 250, 0),
(overlay_animate_to_color, "$g_presentation_obj_battle_name5", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but6"),
(try_begin),
(eq, ":enter_leave", 0),
(overlay_animate_to_color, "$g_presentation_but6_movement", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but6_riding", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but6_weapon_usage", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_obj_battle_name6", 250, 0xFFFFFF),
(else_try),
(overlay_animate_to_color, "$g_presentation_but6_movement", 250, 0),
(overlay_animate_to_color, "$g_presentation_but6_riding", 250, 0),
(overlay_animate_to_color, "$g_presentation_but6_weapon_usage", 250, 0),
(overlay_animate_to_color, "$g_presentation_obj_battle_name6", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but7"),
(try_begin),
(eq, ":enter_leave", 0),
(overlay_animate_to_color, "$g_presentation_but7_movement", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but7_riding", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but7_weapon_usage", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_obj_battle_name7", 250, 0xFFFFFF),
(else_try),
(overlay_animate_to_color, "$g_presentation_but7_movement", 250, 0),
(overlay_animate_to_color, "$g_presentation_but7_riding", 250, 0),
(overlay_animate_to_color, "$g_presentation_but7_weapon_usage", 250, 0),
(overlay_animate_to_color, "$g_presentation_obj_battle_name7", 250, 0),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_battle_but8"),
(try_begin),
(eq, ":enter_leave", 0),
(overlay_animate_to_color, "$g_presentation_but8_movement", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but8_riding", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_but8_weapon_usage", 250, 0xFFFFFF),
(overlay_animate_to_color, "$g_presentation_obj_battle_name8", 250, 0xFFFFFF),
(else_try),
(overlay_animate_to_color, "$g_presentation_but8_movement", 250, 0),
(overlay_animate_to_color, "$g_presentation_but8_riding", 250, 0),
(overlay_animate_to_color, "$g_presentation_but8_weapon_usage", 250, 0),
(overlay_animate_to_color, "$g_presentation_obj_battle_name8", 250, 0),
(try_end),
(try_end),
]),
(ti_on_presentation_run,
[(store_trigger_param_1, ":cur_time"),
(try_begin),
(this_or_next|game_key_clicked, gk_group0_hear),
(this_or_next|game_key_clicked, gk_group1_hear),
(this_or_next|game_key_clicked, gk_group2_hear),
(this_or_next|game_key_clicked, gk_group3_hear),
(this_or_next|game_key_clicked, gk_group4_hear),
(this_or_next|game_key_clicked, gk_group5_hear),
(this_or_next|game_key_clicked, gk_group6_hear),
(this_or_next|game_key_clicked, gk_group7_hear),
(this_or_next|game_key_clicked, gk_group8_hear),
(this_or_next|game_key_clicked, gk_everyone_hear),
(game_key_clicked, gk_reverse_order_group),
(call_script, "script_update_order_panel_checked_classes"),
(try_end),
(try_begin),
(this_or_next|game_key_clicked, gk_order_1),
(this_or_next|game_key_clicked, gk_order_2),
(this_or_next|game_key_clicked, gk_order_3),
(this_or_next|game_key_clicked, gk_order_4),
(this_or_next|game_key_clicked, gk_order_5),
(game_key_clicked, gk_order_6),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":player_team", ":player_agent"),
(call_script, "script_update_order_panel", ":player_team"),
(try_end),
(try_begin),
(gt, ":cur_time", 200),
(game_key_clicked, gk_view_orders),
(try_for_agents, ":cur_agent"),
(agent_set_slot, ":cur_agent", slot_agent_map_overlay_id, 0),
(try_end),
(presentation_set_duration, 0),
(try_end),
]),
]),
("sliders",0,0,[
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(create_slider_overlay, "$g_presentation_obj_sliders_1", 0, 100),
(create_slider_overlay, "$g_presentation_obj_sliders_2", 0, 100),
(create_slider_overlay, "$g_presentation_obj_sliders_3", 0, 100),
(create_slider_overlay, "$g_presentation_obj_sliders_4", 0, 100),
(assign, reg1, 25),
(str_store_string, s1, "str_reg1"),
(create_text_overlay, "$g_presentation_obj_sliders_5", s1),
(create_text_overlay, "$g_presentation_obj_sliders_6", s1),
(create_text_overlay, "$g_presentation_obj_sliders_7", s1),
(create_text_overlay, "$g_presentation_obj_sliders_8", s1),
(assign, "$g_presentation_obj_sliders_1_val", 25),
(overlay_set_val, "$g_presentation_obj_sliders_1", 25),
(assign, "$g_presentation_obj_sliders_2_val", 25),
(overlay_set_val, "$g_presentation_obj_sliders_2", 25),
(assign, "$g_presentation_obj_sliders_3_val", 25),
(overlay_set_val, "$g_presentation_obj_sliders_3", 25),
(assign, "$g_presentation_obj_sliders_4_val", 25),
(overlay_set_val, "$g_presentation_obj_sliders_4", 25),
(position_set_x, pos1, 600),
(position_set_y, pos1, 200),
(overlay_set_position, "$g_presentation_obj_sliders_1", pos1),
(position_set_y, pos1, 300),
(overlay_set_position, "$g_presentation_obj_sliders_2", pos1),
(position_set_y, pos1, 400),
(overlay_set_position, "$g_presentation_obj_sliders_3", pos1),
(position_set_y, pos1, 500),
(overlay_set_position, "$g_presentation_obj_sliders_4", pos1),
(position_set_x, pos1, 800),
(position_set_y, pos1, 200),
(overlay_set_position, "$g_presentation_obj_sliders_5", pos1),
(position_set_y, pos1, 300),
(overlay_set_position, "$g_presentation_obj_sliders_6", pos1),
(position_set_y, pos1, 400),
(overlay_set_position, "$g_presentation_obj_sliders_7", pos1),
(position_set_y, pos1, 500),
(overlay_set_position, "$g_presentation_obj_sliders_8", pos1),
(position_set_x, pos1, 500),
(overlay_set_size, "$g_presentation_obj_sliders_3", pos1),
]),
(ti_on_presentation_run,
[
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":value"),
(assign, ":val_changed", 0),
(try_begin),
(eq, ":object", "$g_presentation_obj_sliders_1"),
(try_begin),
(neq, "$g_presentation_obj_sliders_1_val", ":value"),
(assign, "$g_presentation_obj_sliders_1_val", ":value"),
(assign, ":val_changed", 1),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_sliders_2"),
(try_begin),
(neq, "$g_presentation_obj_sliders_2_val", ":value"),
(assign, "$g_presentation_obj_sliders_2_val", ":value"),
(assign, ":val_changed", 1),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_sliders_3"),
(try_begin),
(neq, "$g_presentation_obj_sliders_3_val", ":value"),
(assign, "$g_presentation_obj_sliders_3_val", ":value"),
(assign, ":val_changed", 1),
(try_end),
(else_try),
(eq, ":object", "$g_presentation_obj_sliders_4"),
(try_begin),
(neq, "$g_presentation_obj_sliders_4_val", ":value"),
(assign, "$g_presentation_obj_sliders_4_val", ":value"),
(assign, ":val_changed", 1),
(try_end),
(try_end),
(try_begin),
(eq, ":val_changed", 1),
(assign, ":sum_values", 0),
(val_add, ":sum_values", "$g_presentation_obj_sliders_1_val"),
(val_add, ":sum_values", "$g_presentation_obj_sliders_2_val"),
(val_add, ":sum_values", "$g_presentation_obj_sliders_3_val"),
(val_add, ":sum_values", "$g_presentation_obj_sliders_4_val"),
(store_sub, ":difference", 100, ":sum_values"),
(assign, ":obj_1_new_val", "$g_presentation_obj_sliders_1_val"),
(assign, ":obj_2_new_val", "$g_presentation_obj_sliders_2_val"),
(assign, ":obj_3_new_val", "$g_presentation_obj_sliders_3_val"),
(assign, ":obj_4_new_val", "$g_presentation_obj_sliders_4_val"),
(assign, ":adder", 1),
(assign, ":between_1", 0),
(assign, ":between_2", 100),
(try_begin),
(lt, ":difference", 0),
(val_mul, ":difference", -1),
(assign, ":adder", -1),
(assign, ":between_1", 1),
(assign, ":between_2", 101),
(try_end),
(store_sub, ":sum_non_changed_values", ":sum_values", ":value"),
(val_add, ":sum_non_changed_values", 30),
(try_for_range, ":unused", 0, ":difference"),
(store_random_in_range, ":random_no", 0, ":sum_non_changed_values"),
(try_begin),
(neq, ":object", "$g_presentation_obj_sliders_1"),
(val_sub, ":random_no", "$g_presentation_obj_sliders_1_val"),
(val_sub, ":random_no", 10),
(lt, ":random_no", 0),
(is_between, ":obj_1_new_val", ":between_1", ":between_2"),
(val_add, ":obj_1_new_val", ":adder"),
(else_try),
(neq, ":object", "$g_presentation_obj_sliders_2"),
(val_sub, ":random_no", "$g_presentation_obj_sliders_2_val"),
(val_sub, ":random_no", 10),
(lt, ":random_no", 0),
(is_between, ":obj_2_new_val", ":between_1", ":between_2"),
(val_add, ":obj_2_new_val", ":adder"),
(else_try),
(neq, ":object", "$g_presentation_obj_sliders_3"),
(val_sub, ":random_no", "$g_presentation_obj_sliders_3_val"),
(val_sub, ":random_no", 10),
(lt, ":random_no", 0),
(is_between, ":obj_3_new_val", ":between_1", ":between_2"),
(val_add, ":obj_3_new_val", ":adder"),
(else_try),
(is_between, ":obj_4_new_val", ":between_1", ":between_2"),
(val_add, ":obj_4_new_val", ":adder"),
(else_try),
(val_add, ":difference", 1),
(try_end),
(try_end),
(assign, "$g_presentation_obj_sliders_1_val", ":obj_1_new_val"),
(assign, "$g_presentation_obj_sliders_2_val", ":obj_2_new_val"),
(assign, "$g_presentation_obj_sliders_3_val", ":obj_3_new_val"),
(assign, "$g_presentation_obj_sliders_4_val", ":obj_4_new_val"),
(try_end),
(overlay_set_val, "$g_presentation_obj_sliders_1", "$g_presentation_obj_sliders_1_val"),
(overlay_set_val, "$g_presentation_obj_sliders_2", "$g_presentation_obj_sliders_2_val"),
(overlay_set_val, "$g_presentation_obj_sliders_3", "$g_presentation_obj_sliders_3_val"),
(overlay_set_val, "$g_presentation_obj_sliders_4", "$g_presentation_obj_sliders_4_val"),
(assign, reg1, "$g_presentation_obj_sliders_1_val"),
(str_store_string, s1, "str_reg1"),
(overlay_set_text, "$g_presentation_obj_sliders_5", s1),
(assign, reg1, "$g_presentation_obj_sliders_2_val"),
(str_store_string, s1, "str_reg1"),
(overlay_set_text, "$g_presentation_obj_sliders_6", s1),
(assign, reg1, "$g_presentation_obj_sliders_3_val"),
(str_store_string, s1, "str_reg1"),
(overlay_set_text, "$g_presentation_obj_sliders_7", s1),
(assign, reg1, "$g_presentation_obj_sliders_4_val"),
(str_store_string, s1, "str_reg1"),
(overlay_set_text, "$g_presentation_obj_sliders_8", s1),
]),
]),
("arena_training", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load,
[(presentation_set_duration, 999999),
(set_fixed_point_multiplier, 1000),
(get_player_agent_no, ":player_agent"),
(agent_get_kill_count, reg1, ":player_agent", 1),
(str_store_string, s1, "@Number of men knocked down: {reg1}"),
(create_text_overlay, "$g_presentation_obj_arena_training_1", s1),
(overlay_set_color, "$g_presentation_obj_arena_training_1", 0xFFFFFF),
(position_set_x, pos1, 10),
(position_set_y, pos1, 700),
(overlay_set_position, "$g_presentation_obj_arena_training_1", pos1),
(assign, reg1, 0),
(str_store_string, s1, "@Number of men left: {reg1}"),
(create_text_overlay, "$g_presentation_obj_arena_training_2", s1),
(overlay_set_color, "$g_presentation_obj_arena_training_2", 0xFFFFFF),
(position_set_x, pos1, 10),
(position_set_y, pos1, 670),
(overlay_set_position, "$g_presentation_obj_arena_training_2", pos1),
]),
(ti_on_presentation_run,
[(get_player_agent_no, ":player_agent"),
(agent_get_kill_count, reg1, ":player_agent", 1),
(str_store_string, s1, "@Opponents Beaten: {reg1}"),
(overlay_set_text, "$g_presentation_obj_arena_training_1", s1),
(assign, ":num_left", "$g_arena_training_max_opponents"),
(try_for_agents, ":agent_no"),
(agent_is_human, ":agent_no"),
(neg|agent_is_alive, ":agent_no"),
(neq, ":agent_no", ":player_agent"),
(val_sub, ":num_left", 1),
(try_end),
(assign, reg1, ":num_left"),
(str_store_string, s1, "@Opponents Remaining: {reg1}"),
(overlay_set_text, "$g_presentation_obj_arena_training_2", s1),
]),
]),
("retirement", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(presentation_set_duration, 999999),
(set_fixed_point_multiplier, 1000),
(create_button_overlay, "$g_presentation_obj_retirement_1", "@Remain in retirement.", tf_center_justify),
(create_button_overlay, "$g_presentation_obj_retirement_2", "@Go back to the adventuring.", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 80),
(overlay_set_position, "$g_presentation_obj_retirement_1", pos1),
(position_set_y, pos1, 40),
(overlay_set_position, "$g_presentation_obj_retirement_2", pos1),
(assign, ":total_effect", 0),
#wealth
(store_troop_gold, ":wealth", "trp_player"),
(store_div, ":wealth_effect", ":wealth", 200),
(val_add, ":total_effect", ":wealth_effect"),
#ruled centers and friendly/enemy centers
(assign, ":num_towns", 0),
(assign, ":num_castles", 0),
(assign, ":num_villages", 0),
(assign, ":num_friendly_towns", 0),
(assign, ":num_friendly_villages", 0),
(assign, ":num_enemy_towns", 0),
(assign, ":num_enemy_villages", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(party_get_slot, ":type", ":center_no", slot_party_type),
(try_begin),
(party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(try_begin),
(eq, ":type", spt_town),
(val_add, ":num_towns", 1),
(else_try),
(eq, ":type", spt_castle),
(val_add, ":num_castles", 1),
(else_try),
(val_add, ":num_villages", 1),
(try_end),
(try_end),
(party_get_slot, ":relation", ":center_no", slot_center_player_relation),
(try_begin),
(ge, ":relation", 40),
(try_begin),
(eq, ":type", spt_town),
(val_add, ":num_friendly_towns", 1),
(else_try),
(eq, ":type", spt_village),
(val_add, ":num_friendly_villages", 1),
(try_end),
(else_try),
(le, ":relation", -40),
(try_begin),
(eq, ":type", spt_town),
(val_add, ":num_enemy_towns", 1),
(else_try),
(eq, ":type", spt_village),
(val_add, ":num_enemy_villages", 1),
(try_end),
(try_end),
(try_end),
(store_mul, ":num_towns_effect", ":num_towns", 100),
(store_mul, ":num_castles_effect", ":num_castles", 50),
(store_mul, ":num_villages_effect", ":num_villages", 20),
(store_add, ":num_centers", ":num_towns", ":num_castles"),
(val_add, ":num_centers", ":num_villages"),
(store_add, ":ruled_centers_effect", ":num_towns_effect", ":num_castles_effect"),
(val_add, ":ruled_centers_effect", ":num_villages_effect"),
(val_add, ":total_effect", ":ruled_centers_effect"),
(store_mul, ":num_friendly_towns_effect", ":num_friendly_towns", 20),
(store_mul, ":num_friendly_villages_effect", ":num_friendly_villages", 4),
(store_add, ":num_friendly_centers", ":num_friendly_towns", ":num_friendly_villages"),
(store_add, ":friendly_centers_effect", ":num_friendly_towns_effect", ":num_friendly_villages_effect"),
(val_add, ":total_effect", ":friendly_centers_effect"),
(store_mul, ":num_enemy_towns_effect", ":num_enemy_towns", -40),
(store_mul, ":num_enemy_villages_effect", ":num_enemy_villages", -8),
(store_add, ":num_enemy_centers", ":num_enemy_towns", ":num_enemy_villages"),
(store_add, ":enemy_centers_effect", ":num_enemy_towns_effect", ":num_enemy_villages_effect"),
(val_add, ":total_effect", ":enemy_centers_effect"),
#inventory
(assign, ":total_item_value", 0),
(troop_get_inventory_capacity, ":capacity", "trp_player"),
(try_for_range, ":i_inv", 0, ":capacity"),
(troop_get_inventory_slot, ":item", "trp_player", ":i_inv"),
(ge, ":item", 0),
(store_item_value, ":item_value", ":item"),
(val_add, ":total_item_value", ":item_value"),
(try_end),
(store_div, ":total_item_value_effect", ":total_item_value", 200),
(val_add, ":total_effect", ":total_item_value_effect"),
#renown
(troop_get_slot, ":renown", "trp_player", slot_troop_renown),
(store_div, ":renown_effect", ":renown", 1),
(val_add, ":total_effect", ":renown_effect"),
#enemies and friends
(assign, ":num_enemies", 0),
(assign, ":num_friends", 0),
(try_for_range, ":troop_no", heroes_begin, heroes_end),
(this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_lady),
(call_script, "script_troop_get_player_relation", ":troop_no"),
(assign, ":relation", reg0),
#(troop_get_slot, ":relation", ":troop_no", slot_troop_player_relation),
(try_begin),
(ge, ":relation", 40),
(val_add, ":num_friends", 1),
(else_try),
(le, ":relation", -40),
(val_add, ":num_enemies", 1),
(try_end),
(try_end),
(store_mul, ":num_friends_effect", ":num_friends", 10),
(val_add, ":total_effect", ":num_friends_effect"),
(store_mul, ":num_enemies_effect", ":num_enemies", -10),
(val_add, ":total_effect", ":num_enemies_effect"),
#current day
(store_current_day, ":cur_day"),
(store_div, ":cur_day_effect", ":cur_day", -1),
(val_add, ":total_effect", ":cur_day_effect"),
#g_total_victories
(store_mul, ":total_victories_effect", "$g_total_victories", 2),
(val_add, ":total_effect", ":total_victories_effect"),
#g_total_defeats
(store_mul, ":total_defeats_effect", "$g_total_defeats", -3),
(val_add, ":total_effect", ":total_defeats_effect"),
#g_total_quests_completed
(store_mul, ":total_quests_completed_effect", "$g_total_quests_completed", 4),
(val_add, ":total_effect", ":total_quests_completed_effect"),
#xp
(troop_get_xp, ":xp", "trp_player"),
(store_div, ":xp_effect", ":xp", 5000),
(val_add, ":total_effect", ":xp_effect"),
#companions joined / departed
(assign, ":num_companions_joined", 0),
(assign, ":num_companions_departed", 0),
(try_for_range, ":troop_no", companions_begin, companions_end),
(try_begin),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_player_companion),
(val_add, ":num_companions_joined", 1),
(else_try),
(troop_slot_ge, ":troop_no", slot_troop_playerparty_history, 1),
(val_add, ":num_companions_departed", 1),
(try_end),
(try_end),
(store_div, ":num_companions_joined_effect", ":num_companions_joined", 2),
(val_add, ":total_effect", ":num_companions_joined_effect"),
(store_div, ":num_companions_departed_effect", ":num_companions_departed", -4),
(val_add, ":total_effect", ":num_companions_departed_effect"),
#difficulty
(get_average_game_difficulty, ":difficulty"),
(assign, ":difficulty_effect", ":total_effect"),
(val_mul, ":total_effect", ":difficulty"),
(val_div, ":total_effect", 75),
(val_mul, ":total_effect", ":difficulty"),
(val_div, ":total_effect", 75),
(store_sub, ":difficulty_effect", ":total_effect", ":difficulty_effect"),
(assign, reg5, ":cur_day"),
(store_character_level, reg4, "trp_player"),
(create_text_overlay, reg1, "@You have retired at level {reg4} after {reg5} days of adventuring.", tf_center_justify),
(position_set_x, pos1, 700),
(position_set_y, pos1, 700),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 950),
(position_set_y, pos1, 950),
(overlay_set_size, reg1, pos1),
## (overlay_set_color, reg1, 0),
(create_text_overlay, reg2, "@Effect on Score", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg2, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 670),
(overlay_set_position, reg2, pos1),
(assign, reg0, ":num_centers"),
(create_text_overlay, reg1, "@Settlements owned by you: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 650),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":ruled_centers_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 650),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, ":num_friendly_centers"),
(create_text_overlay, reg1, "@Friendly Settlements: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 630),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":friendly_centers_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 630),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, ":num_enemy_centers"),
(create_text_overlay, reg1, "@Hostile Settlements: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 610),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":enemy_centers_effect"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 610),
(overlay_set_position, reg1, pos1),
(try_begin),
(lt, reg0, 0),
(overlay_set_color, reg1, 0xFF0000),
(try_end),
(assign, reg0, ":num_friends"),
(create_text_overlay, reg1, "@Friendly Lords: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 590),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":num_friends_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 590),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, ":num_enemies"),
(create_text_overlay, reg1, "@Enemy Lords: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 570),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":num_enemies_effect"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 570),
(overlay_set_position, reg1, pos1),
(try_begin),
(lt, reg0, 0),
(overlay_set_color, reg1, 0xFF0000),
(try_end),
(assign, reg0, "$g_total_victories"),
(create_text_overlay, reg1, "@Victories: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 550),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":total_victories_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 550),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, "$g_total_defeats"),
(create_text_overlay, reg1, "@Defeats: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 530),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":total_defeats_effect"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 530),
(overlay_set_position, reg1, pos1),
(try_begin),
(lt, reg0, 0),
(overlay_set_color, reg1, 0xFF0000),
(try_end),
(assign, reg0, "$g_total_quests_completed"),
(create_text_overlay, reg1, "@Quests Completed: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 510),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":total_quests_completed_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 510),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, ":num_companions_joined"),
(create_text_overlay, reg1, "@Companions Found: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 490),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":num_companions_joined_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 490),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, ":num_companions_departed"),
(create_text_overlay, reg1, "@Companions Lost/Departed: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 470),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":num_companions_departed_effect"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 470),
(overlay_set_position, reg1, pos1),
(try_begin),
(lt, reg0, 0),
(overlay_set_color, reg1, 0xFF0000),
(try_end),
(assign, reg0, ":wealth"),
(create_text_overlay, reg1, "@Wealth: {reg0} denars", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 450),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":wealth_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 450),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, ":total_item_value"),
(create_text_overlay, reg1, "@Inventory: {reg0} denars", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 430),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":total_item_value_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 430),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, ":renown"),
(create_text_overlay, reg1, "@Renown: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 410),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":renown_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 410),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, ":xp"),
(create_text_overlay, reg1, "@Experience: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 390),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":xp_effect"),
(create_text_overlay, reg1, "@{!}{reg0?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 390),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(try_end),
(assign, reg0, ":cur_day"),
(create_text_overlay, reg1, "@Days Passed: {reg0}", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 370),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":cur_day_effect"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 370),
(overlay_set_position, reg1, pos1),
(try_begin),
(lt, reg0, 0),
(overlay_set_color, reg1, 0xFF0000),
(try_end),
(assign, reg0, ":difficulty"),
(create_text_overlay, reg1, "@Difficulty: {reg0}%", 0),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 600),
(position_set_y, pos1, 350),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":difficulty_effect"),
(assign, reg3, reg0),
(val_max, reg3, 0),
(create_text_overlay, reg1, "@{!}{reg3?+:}{reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 750),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 850),
(position_set_y, pos1, 350),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(else_try),
(lt, reg0, 0),
(overlay_set_color, reg1, 0xFF0000),
(try_end),
(assign, reg0, ":total_effect"),
(create_text_overlay, reg1, "@TOTAL SCORE: {reg0}", tf_center_justify),
(position_set_x, pos1, 750),
(position_set_y, pos1, 320),
(overlay_set_position, reg1, pos1),
(assign, ":total_villages", 0),
(assign, ":total_castles", 0),
(assign, ":total_towns", 0),
(assign, ":total_village_rels", 0),
(assign, ":total_castle_rels", 0),
(assign, ":total_town_rels", 0),
(try_for_range, ":cur_center_no", centers_begin, centers_end),
(try_begin),
(party_slot_eq, ":cur_center_no", slot_town_lord, "trp_player"),
(try_begin),
(party_slot_eq, ":cur_center_no", slot_party_type, spt_town),
(val_add, ":total_towns", 1),
(else_try),
(party_slot_eq, ":cur_center_no", slot_party_type, spt_castle),
(val_add, ":total_castles", 1),
(else_try),
(val_add, ":total_villages", 1),
(try_end),
(else_try),
(party_get_slot, ":center_relation", ":cur_center_no", slot_center_player_relation),
(gt, ":center_relation", 0),
(try_begin),
(party_slot_eq, ":cur_center_no", slot_party_type, spt_town),
(val_add, ":total_town_rels", ":center_relation"),
(else_try),
(party_slot_eq, ":cur_center_no", slot_party_type, spt_castle),
(val_add, ":total_castle_rels", ":center_relation"),
(else_try),
(val_add, ":total_village_rels", ":center_relation"),
(try_end),
(try_end),
(try_end),
(try_begin),
(gt, ":total_towns", 0),
(store_random_in_range, ":random_town", 0, ":total_towns"),
(try_for_range, ":cur_center_no", towns_begin, towns_end),
(party_slot_eq, ":cur_center_no", slot_town_lord, "trp_player"),
(val_sub, ":random_town", 1),
(lt, ":random_town", 0),
(str_store_party_name, s9, ":cur_center_no"),
(try_end),
(else_try),
(gt, ":total_town_rels", 0),
(store_random_in_range, ":random_town_rel", 0, ":total_town_rels"),
(try_for_range, ":cur_center_no", towns_begin, towns_end),
(party_get_slot, ":center_relation", ":cur_center_no", slot_center_player_relation),
(gt, ":center_relation", 0),
(val_sub, ":random_town_rel", ":center_relation"),
(lt, ":random_town_rel", 0),
(str_store_party_name, s9, ":cur_center_no"),
(try_end),
(else_try),
(store_random_in_range, ":random_town", towns_begin, towns_end),
(str_store_party_name, s9, ":random_town"),
(try_end),
(try_begin),
(gt, ":total_castles", 0),
(store_random_in_range, ":random_castle", 0, ":total_castles"),
(try_for_range, ":cur_center_no", castles_begin, castles_end),
(party_slot_eq, ":cur_center_no", slot_town_lord, "trp_player"),
(val_sub, ":random_castle", 1),
(lt, ":random_castle", 0),
(str_store_party_name, s8, ":cur_center_no"),
(try_end),
(else_try),
(gt, ":total_castle_rels", 0),
(store_random_in_range, ":random_castle_rel", 0, ":total_castle_rels"),
(try_for_range, ":cur_center_no", castles_begin, castles_end),
(party_get_slot, ":center_relation", ":cur_center_no", slot_center_player_relation),
(gt, ":center_relation", 0),
(val_sub, ":random_castle_rel", ":center_relation"),
(lt, ":random_castle_rel", 0),
(str_store_party_name, s8, ":cur_center_no"),
(try_end),
(else_try),
(store_random_in_range, ":random_castle", castles_begin, castles_end),
(str_store_party_name, s8, ":random_castle"),
(try_end),
(try_begin),
(gt, ":total_villages", 0),
(store_random_in_range, ":random_village", 0, ":total_villages"),
(try_for_range, ":cur_center_no", villages_begin, villages_end),
(party_slot_eq, ":cur_center_no", slot_town_lord, "trp_player"),
(val_sub, ":random_village", 1),
(lt, ":random_village", 0),
(str_store_party_name, s7, ":cur_center_no"),
(try_end),
(else_try),
(gt, ":total_village_rels", 0),
(store_random_in_range, ":random_village_rel", 0, ":total_village_rels"),
(try_for_range, ":cur_center_no", villages_begin, villages_end),
(party_get_slot, ":center_relation", ":cur_center_no", slot_center_player_relation),
(gt, ":center_relation", 0),
(val_sub, ":random_village_rel", ":center_relation"),
(lt, ":random_village_rel", 0),
(str_store_party_name, s7, ":cur_center_no"),
(try_end),
(else_try),
(store_random_in_range, ":random_village", villages_begin, villages_end),
(str_store_party_name, s7, ":random_village"),
(try_end),
(try_begin),
(lt, ":total_effect", 100),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 0),
(str_store_string, s0, "str_retirement_text_1"),
(else_try),
(lt, ":total_effect", 200),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 1),
(str_store_string, s0, "str_retirement_text_2"),
(else_try),
(lt, ":total_effect", 400),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 2),
(str_store_string, s0, "str_retirement_text_3"),
(else_try),
(lt, ":total_effect", 700),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 3),
(str_store_string, s0, "str_retirement_text_4"),
(else_try),
(lt, ":total_effect", 1200),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 4),
(str_store_string, s0, "str_retirement_text_5"),
(else_try),
(lt, ":total_effect", 1850),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 5),
(str_store_string, s0, "str_retirement_text_6"),
(else_try),
(lt, ":total_effect", 2500),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 6),
(str_store_string, s0, "str_retirement_text_7"),
(else_try),
(lt, ":total_effect", 3500),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 7),
(str_store_string, s0, "str_retirement_text_8"),
(else_try),
(lt, ":total_effect", 5000),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 8),
(str_store_string, s0, "str_retirement_text_9"),
(else_try),
(create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_retirement_troop", 9),
(str_store_string, s0, "str_retirement_text_10"),
(try_end),
(position_set_x, pos1, 0),
(position_set_y, pos1, 120),
(overlay_set_position, reg1, pos1),
(create_text_overlay, reg1, s0, tf_double_space|tf_scrollable),
(position_set_x, pos1, 600),
(position_set_y, pos1, 120),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 360),
(position_set_y, pos1, 190),
(overlay_set_area_size, reg1, pos1),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg1, pos1),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_retirement_1"),
(jump_to_menu, "mnu_end_game"),
(start_presentation, "prsnt_game_credits"),
(else_try),
(eq, ":object", "$g_presentation_obj_retirement_2"),
(presentation_set_duration, 0),
(change_screen_return),
(try_end),
]),
]),
("budget_report", 0, mesh_load_window,
[(ti_on_presentation_load,
[(presentation_set_duration, 999999),
(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg1, "mesh_pic_payment"),
(position_set_x, pos1, 800),
(position_set_y, pos1, 800),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 170),
(position_set_y, pos1, 0),
(overlay_set_position, reg1, pos1),
(create_text_overlay, reg1, "str_weekly_budget", tf_center_justify),
(position_set_x, pos1, 1500),
(position_set_y, pos1, 1500),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 260),
(position_set_y, pos1, 650),
(overlay_set_position, reg1, pos1),
(str_clear, s0),
(create_text_overlay, "$g_presentation_obj_bugdet_report_container", s0, tf_scrollable_style_2),
(position_set_x, pos1, 0),
(position_set_y, pos1, 100),
(overlay_set_position, "$g_presentation_obj_bugdet_report_container", pos1),
(position_set_x, pos1, 505),
(position_set_y, pos1, 500),
(overlay_set_area_size, "$g_presentation_obj_bugdet_report_container", pos1),
(set_container_overlay, "$g_presentation_obj_bugdet_report_container"),
(game_get_reduce_campaign_ai, ":reduce_campaign_ai"),
(try_begin),
(eq, ":reduce_campaign_ai", 0), #hard
(assign, ":num_centers_needed_for_efficiency_loss", 2),
(assign, ":tax_efficiency_loss_ratio_per_center", 5),
(else_try),
(eq, ":reduce_campaign_ai", 1), #medium
(assign, ":num_centers_needed_for_efficiency_loss", 4),
(assign, ":tax_efficiency_loss_ratio_per_center", 4),
(else_try),
(eq, ":reduce_campaign_ai", 2), #easy
(assign, ":num_centers_needed_for_efficiency_loss", 6),
(assign, ":tax_efficiency_loss_ratio_per_center", 3),
(try_end),
(assign, ":num_lines", 0),
(assign, ":num_owned_center_values_for_tax_efficiency", 0),
(assign, ":all_centers_accumulated_total", 0),
(assign, ":all_centers_accumulated_taxes_and_rents", 0),
(try_for_range, ":center_no", centers_begin, centers_end),
(try_begin),
(party_slot_ge, ":center_no", slot_center_player_enterprise, 1),
(val_add, ":num_lines", 1),
(try_end),
(party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(val_add, ":num_lines", 1),
(val_add, ":num_owned_center_values_for_tax_efficiency", 1),
(try_begin),
(is_between, ":center_no", towns_begin, towns_end),
(val_add, ":num_lines", 1),
(val_add, ":num_owned_center_values_for_tax_efficiency", 1),
(try_end),
(try_end),
(try_begin),
(gt, "$players_kingdom", 0),
(neq, "$players_kingdom", "fac_player_supporters_faction"),
(neq, "$players_kingdom", "fac_player_faction"),
(eq, "$player_has_homage", 0),
(val_add, ":num_lines", 1),
(try_end),
(try_begin),
(gt, ":num_owned_center_values_for_tax_efficiency", ":num_centers_needed_for_efficiency_loss"),
#gt accumulated total is ignored
(val_add, ":num_lines", 1),
(try_end),
(try_for_parties, ":party_no"),
(assign, ":garrison_troop", 0),
(try_begin),
(this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_town),
(party_slot_eq, ":party_no", slot_party_type, spt_castle),
(party_slot_eq, ":party_no", slot_town_lord, "trp_player"),
(assign, ":garrison_troop", 1),
(else_try),
(this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_town),
(party_slot_eq, ":party_no", slot_party_type, spt_castle),
(neg|party_slot_ge, ":party_no", slot_town_lord, 1), #unassigned
(store_faction_of_party, ":center_faction", ":party_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(assign, ":garrison_troop", 1),
(try_end),
(this_or_next|eq, ":party_no", "p_main_party"),
(eq, ":garrison_troop", 1),
(val_add, ":num_lines", 1), #include empty towns/castles
(try_end),
(try_begin),
(gt, "$g_player_debt_to_party_members", 0),
(val_add, ":num_lines", 2), #include new debt line
(try_end),
(val_add, ":num_lines", 3),
(store_mul, ":cur_y", 27, ":num_lines"),
(assign, ":net_change", 0), #this is the amount added
(try_for_range, ":center_no", centers_begin, centers_end),
#Enterprise
(try_begin),
(party_get_slot, ":enterprise_output", ":center_no", slot_center_player_enterprise),
(gt, ":enterprise_output", 1),
(neg|party_slot_ge, ":center_no", slot_center_player_enterprise_days_until_complete, 1),
(str_store_party_name, s0, ":center_no"),
(call_script, "script_process_player_enterprise", ":enterprise_output", ":center_no"),
(assign, ":net_profit", reg0),
(assign, ":price_of_single_output", reg4),
(assign, ":price_of_single_input", reg5),
(assign, ":price_of_secondary_input", reg10),
(store_sub, ":town_order", ":center_no", towns_begin),
(store_add, ":craftsman_troop", ":town_order", "trp_town_1_master_craftsman"),
(item_get_slot, ":outputs_added_to_market", ":enterprise_output", slot_item_output_per_run),
(assign, ":outputs_added_to_warehouse", 0),
#Enterprise impact of outputs
(try_begin),
#output placed in inventory: deduct selling price and add one good
(party_slot_eq, ":center_no", slot_center_player_enterprise_production_order, 1),
#Count empty slots
(assign, ":empty_slots", 0),
(troop_get_inventory_capacity, ":total_capacity", ":craftsman_troop"),
(try_for_range, ":capacity_iterator", 0, ":total_capacity"),
(troop_get_inventory_slot, ":slot", ":craftsman_troop", ":capacity_iterator"),
(lt, ":slot", 1),
(val_add, ":empty_slots", 1),
(try_end),
(assign, ":outputs_added_to_warehouse", ":outputs_added_to_market"),
(val_min, ":outputs_added_to_warehouse", ":empty_slots"),
(gt, ":outputs_added_to_warehouse", 0),
(store_mul, ":cancelled_sales", ":price_of_single_output", ":outputs_added_to_warehouse"),
(val_sub, ":net_profit", ":cancelled_sales"),
(val_sub, ":outputs_added_to_market", ":outputs_added_to_warehouse"),
(try_end),
#If the transaction is for real, and not just a budget check
(try_begin),
(eq, "$g_apply_budget_report_to_gold", 1),
(troop_add_items, ":craftsman_troop", ":enterprise_output", ":outputs_added_to_warehouse"),
#Affect prices by outputs added to market
(store_sub, ":item_slot_no", ":enterprise_output", trade_goods_begin),
(val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
(party_get_slot, ":current_index", ":center_no", ":item_slot_no"),
(store_mul, ":impact_on_price", ":outputs_added_to_market", 15),
(val_sub, ":current_index", ":impact_on_price"),
(party_set_slot, ":center_no", ":item_slot_no",":current_index"),
(gt, "$cheat_mode", 0),
(str_store_troop_name, s3, ":craftsman_troop"),
(assign, reg3, ":outputs_added_to_warehouse"),
(display_message, "@{!}DEBUG -- Adding {reg3} items to {s3}"),
(try_end),
#Enterprise impact of outputs
(item_get_slot, ":inputs_taken_from_market", ":enterprise_output", slot_item_input_number),
(try_begin),
(item_slot_ge, ":enterprise_output", slot_item_secondary_raw_material, 1),
(assign, ":2ary_inputs_taken_from_market", ":inputs_taken_from_market"),
(else_try),
(assign, ":2ary_inputs_taken_from_market", 0),
(try_end),
(assign, ":inputs_taken_from_warehouse", 0),
(assign, ":2ary_inputs_taken_from_warehouse", 0),
(try_begin),
#input present in inventory: reimburse for input cost and remove one good
(troop_get_inventory_capacity, ":total_capacity", ":craftsman_troop"),
(try_for_range, ":capacity_iterator", 0, ":total_capacity"),
(troop_get_inventory_slot, ":item_in_slot", ":craftsman_troop", ":capacity_iterator"),
(lt, ":inputs_taken_from_warehouse", ":inputs_taken_from_market"),
(item_slot_eq, ":enterprise_output", slot_item_primary_raw_material, ":item_in_slot"),
#(troop_inventory_slot_get_item_amount, ":item_ammo", ":craftsman_troop", ":capacity_iterator"),
#(troop_inventory_slot_get_item_max_amount, ":item_max_ammo", ":craftsman_troop", ":capacity_iterator"),
#(eq, ":item_ammo", ":item_max_ammo"),
(val_add, ":inputs_taken_from_warehouse", 1),
(else_try),
(lt, ":2ary_inputs_taken_from_warehouse", ":2ary_inputs_taken_from_market"),
(item_slot_eq, ":enterprise_output", slot_item_secondary_raw_material, ":item_in_slot"),
#(troop_inventory_slot_get_item_amount, ":item_ammo", ":craftsman_troop", ":capacity_iterator"),
#(troop_inventory_slot_get_item_max_amount, ":item_max_ammo", ":craftsman_troop", ":capacity_iterator"),
#(eq, ":item_ammo", ":item_max_ammo"),
(val_add, ":2ary_inputs_taken_from_warehouse", 1),
(try_end),
(try_begin),
(gt, ":inputs_taken_from_warehouse", 0),
(val_sub, ":inputs_taken_from_market", ":inputs_taken_from_warehouse"),
(store_mul, ":savings_from_warehoused_inputs", ":price_of_single_input", ":inputs_taken_from_warehouse"),
(val_add, ":net_profit", ":savings_from_warehoused_inputs"),
(try_end),
(try_begin),
(gt, ":2ary_inputs_taken_from_warehouse", 0),
(val_sub, ":2ary_inputs_taken_from_market", ":2ary_inputs_taken_from_warehouse"),
(assign, ":savings_from_warehoused_inputs", ":price_of_secondary_input"),
(val_add, ":net_profit", ":savings_from_warehoused_inputs"),
(try_end),
(try_end),
#If the transaction is for real, and not just a budget check
(try_begin),
(eq, "$g_apply_budget_report_to_gold", 1),
(item_get_slot, ":raw_material", ":enterprise_output", slot_item_primary_raw_material),
(troop_remove_items, ":craftsman_troop", ":raw_material", ":inputs_taken_from_warehouse"),
(item_get_slot, ":secondary_raw_material", ":enterprise_output", slot_item_secondary_raw_material),
(troop_remove_items, ":craftsman_troop", ":secondary_raw_material", ":2ary_inputs_taken_from_warehouse"),
#Affect prices by intputs added to market
(store_sub, ":item_slot_no", ":raw_material", trade_goods_begin),
(val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
(party_get_slot, ":current_index", ":center_no", ":item_slot_no"),
(store_mul, ":impact_on_price", ":outputs_added_to_market", 15),
(val_add, ":current_index", ":impact_on_price"),
(party_set_slot, ":center_no", ":item_slot_no",":current_index"),
(try_begin),
(gt, ":2ary_inputs_taken_from_market", 0),
(store_sub, ":item_slot_no", ":secondary_raw_material", trade_goods_begin),
(val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
(party_get_slot, ":current_index", ":center_no", ":item_slot_no"),
(val_add, ":current_index", 15),
(party_set_slot, ":center_no", ":item_slot_no",":current_index"),
(try_end),
(try_end),
(call_script, "script_get_enterprise_name", ":enterprise_output"),
(str_store_string, s5, reg0),
(create_text_overlay, reg1, "str_enterprise_s5_at_s0", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":net_profit"),
#Enterprise revenue strings
(try_begin),
(store_faction_of_party, ":faction_no", ":center_no"),
(store_relation, ":relation", ":faction_no", "$players_kingdom"),
(lt, ":relation", 0),
(assign, reg0, 0),
(assign, ":net_profit", 0),
(create_text_overlay, reg1, "str_under_sequestration", tf_right_align|tf_single_line),
(overlay_set_color, reg1, 0xFF0000),
(else_try),
(ge, reg0, 0),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(overlay_set_color, reg1, 0x00AA00),
(else_try),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(overlay_set_color, reg1, 0xFF0000),
(try_end),
(val_add, ":all_centers_accumulated_total", ":net_profit"),
(val_add, ":net_change", ":net_profit"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(try_end),
#Enterprise ends, taxes begin
(party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(party_get_slot, ":accumulated_rents", ":center_no", slot_center_accumulated_rents),
(party_get_slot, ":accumulated_tariffs", ":center_no", slot_center_accumulated_tariffs),
(store_add, ":accumulated_total", ":accumulated_rents", ":accumulated_tariffs"),
(val_add, ":all_centers_accumulated_total", ":accumulated_total"),
(val_add, ":all_centers_accumulated_taxes_and_rents", ":accumulated_total"),
(val_add, ":net_change", ":accumulated_total"),
(str_store_party_name, s0, ":center_no"),
(create_text_overlay, reg1, "str_rents_from_s0", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, ":accumulated_rents", 0),
(assign, reg0, ":accumulated_rents"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(overlay_set_color, reg1, 0x00AA00),
(else_try),
(create_text_overlay, reg1, "@None", tf_right_align|tf_single_line),
(try_end),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(try_begin),
(is_between, ":center_no", towns_begin, towns_end),
(create_text_overlay, reg1, "str_tariffs_from_s0", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, ":accumulated_tariffs", 0),
(assign, reg0, ":accumulated_tariffs"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(overlay_set_color, reg1, 0x00AA00),
(else_try),
(create_text_overlay, reg1, "@None", tf_right_align|tf_single_line),
(try_end),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(try_end),
(try_end),
(try_begin),
(gt, "$players_kingdom", 0),
(neq, "$players_kingdom", "fac_player_supporters_faction"),
(neq, "$players_kingdom", "fac_player_faction"),
(eq, "$player_has_homage", 0),
(str_store_faction_name, s0, "$players_kingdom"),
(create_text_overlay, reg1, "str_mercenary_payment_from_s0", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(call_script, "script_party_calculate_strength", "p_main_party", 0),
(assign, ":offer_value", reg0),
(val_div, ":offer_value", 2),
(val_add, ":offer_value", 30),
(call_script, "script_round_value", ":offer_value"),
(val_add, ":net_change", reg0),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(overlay_set_color, reg1, 0x00AA00),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(try_end),
(try_begin),
(gt, ":num_owned_center_values_for_tax_efficiency", ":num_centers_needed_for_efficiency_loss"),
(gt, ":all_centers_accumulated_total", 0),
(store_sub, ":ratio_lost", ":num_owned_center_values_for_tax_efficiency", ":num_centers_needed_for_efficiency_loss"),
(val_mul, ":ratio_lost", ":tax_efficiency_loss_ratio_per_center"),
(val_min, ":ratio_lost", 65),
#(store_mul, ":tax_lost", ":all_centers_accumulated_total", ":ratio_lost"),
(store_mul, ":tax_lost", ":all_centers_accumulated_taxes_and_rents", ":ratio_lost"),
(val_div, ":tax_lost", 100),
(val_sub, ":net_change", ":tax_lost"),
(create_text_overlay, reg1, "str_loss_due_to_tax_inefficiency", 0),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(store_mul, reg0, ":tax_lost", -1),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(overlay_set_color, reg1, 0xFF0000),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(try_end),
(try_for_parties, ":party_no"),
(assign, ":garrison_troop", 0),
(try_begin),
(this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_town),
(party_slot_eq, ":party_no", slot_party_type, spt_castle),
(party_slot_eq, ":party_no", slot_town_lord, "trp_player"),
(assign, ":garrison_troop", 1),
(else_try),
(this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_town),
(party_slot_eq, ":party_no", slot_party_type, spt_castle),
(neg|party_slot_ge, ":party_no", slot_town_lord, 1), #unassigned
(store_faction_of_party, ":center_faction", ":party_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
(assign, ":garrison_troop", 1),
(try_end),
(this_or_next|eq, ":party_no", "p_main_party"),
(eq, ":garrison_troop", 1),
(assign, ":total_wage", 0),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
(party_stack_get_size, ":stack_size", ":party_no", ":i_stack"),
(call_script, "script_game_get_troop_wage", ":stack_troop", ":party_no"),
(assign, ":cur_wage", reg0),
(val_mul, ":cur_wage", ":stack_size"),
(val_add, ":total_wage", ":cur_wage"),
(try_end),
(try_begin),
(eq, ":garrison_troop", 1),
(val_div, ":total_wage", 2), #Half payment for garrisons
(else_try),
(eq, ":party_no", "p_main_party"),
(store_sub, ":total_payment_ratio", 14, "$g_cur_week_half_daily_wage_payments"), #between 0 and 7
(val_mul, ":total_wage", ":total_payment_ratio"),
(val_div, ":total_wage", 14),
(try_end),
## (gt, ":total_wage", 0),
(val_mul, ":total_wage", -1),
(val_add, ":net_change", ":total_wage"),
(str_store_party_name, s0, ":party_no"),
(try_begin),
(eq, ":party_no", "p_main_party"),
(str_store_string, s0, "str_s0s_party"),
(try_end),
(create_text_overlay, reg1, "str_wages_for_s0", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(try_begin),
(lt, ":total_wage", 0),
(assign, reg0, ":total_wage"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(overlay_set_color, reg1, 0xFF0000),
(else_try),
(create_text_overlay, reg1, "@None", tf_right_align|tf_single_line),
(try_end),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(try_end),
(try_begin),
(gt, "$g_player_debt_to_party_members", 0),
(val_sub, ":net_change", "$g_player_debt_to_party_members"),
(create_text_overlay, reg1, "str_earlier_debts", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(store_mul, reg0, "$g_player_debt_to_party_members", -1),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(overlay_set_color, reg1, 0xFF0000),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(try_end),
(create_mesh_overlay, reg1, "mesh_white_plane"),
(overlay_set_color, reg1, 0x000000),
(position_set_x, pos1, 24000),
(position_set_y, pos1, 50),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(store_add, ":line_y", ":cur_y", 25),
(position_set_y, pos1, ":line_y"),
(overlay_set_position, reg1, pos1),
(create_text_overlay, reg1, "str_net_change", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":net_change"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(try_begin),
(gt, reg0, 0),
(overlay_set_color, reg1, 0x00AA00),
(else_try),
(lt, reg0, 0),
(overlay_set_color, reg1, 0xFF0000),
(try_end),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(create_text_overlay, reg1, "str_earlier_wealth", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(store_troop_gold, ":player_wealth", "trp_player"),
(assign, reg0, ":player_wealth"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(val_mul, ":net_change", -1),
(try_begin),
(ge, ":player_wealth", ":net_change"),
(assign, ":player_wealth_dif", ":net_change"),
(assign, ":player_new_debt_to_party_members", 0),
(else_try),
(assign, ":player_wealth_dif", ":player_wealth"),
(store_sub, ":player_new_debt_to_party_members", ":net_change", ":player_wealth"),
(try_end),
(create_text_overlay, reg1, "str_new_wealth", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(store_sub, reg0, ":player_wealth", ":player_wealth_dif"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(try_begin),
(gt, ":player_new_debt_to_party_members", 0),
(create_text_overlay, reg1, "str_new_debts", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(assign, reg0, ":player_new_debt_to_party_members"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(neq, "$g_apply_budget_report_to_gold", 0),
(call_script, "script_objectionable_action", tmt_egalitarian, "str_men_unpaid"),
(try_end),
(set_container_overlay, -1),
(create_button_overlay, "$g_presentation_obj_budget_report_1", "@Continue..."),
(position_set_x, pos1, 225),
(position_set_y, pos1, 60),
(overlay_set_position, "$g_presentation_obj_budget_report_1", pos1),
(try_begin),
(eq, "$g_apply_budget_report_to_gold", 1),
(assign, "$g_player_debt_to_party_members", ":player_new_debt_to_party_members"),
(try_begin),
(gt, ":player_wealth_dif", 0),
(troop_remove_gold, "trp_player", ":player_wealth_dif"),
(else_try),
(val_mul, ":player_wealth_dif", -1),
(troop_add_gold, "trp_player", ":player_wealth_dif"),
(try_end),
(try_for_range, ":center_no", centers_begin, centers_end),
(party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(party_set_slot, ":center_no", slot_center_accumulated_rents, 0),
(party_set_slot, ":center_no", slot_center_accumulated_tariffs, 0),
(try_end),
(assign, "$g_cur_week_half_daily_wage_payments", 0),#Reseting the weekly half wage payments
(try_end),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_budget_report_1"),
(presentation_set_duration, 0),
(try_end),
]),
]),
("game_before_quit", 0, mesh_load_window,
[
(ti_on_presentation_load,
[
(try_begin),
(is_trial_version),
(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg0, "mesh_quit_adv"),
(position_set_x, pos1, -1),
(position_set_y, pos1, -1),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1002),
(position_set_y, pos1, 1002),
(overlay_set_size, reg0, pos1),
(assign, "$g_game_before_quit_state", 0),
(presentation_set_duration, 999999),
(try_end),
]),
(ti_on_presentation_run,
[
(store_trigger_param_1, ":cur_time"),
(gt, ":cur_time", 500),
(try_begin),
(this_or_next|key_clicked, key_space),
(this_or_next|key_clicked, key_enter),
(this_or_next|key_clicked, key_escape),
(this_or_next|key_clicked, key_back_space),
(this_or_next|key_clicked, key_left_mouse_button),
(key_clicked, key_right_mouse_button),
(try_begin),
(eq, "$g_game_before_quit_state", 0),
(val_add, "$g_game_before_quit_state", 1),
(create_mesh_overlay, reg0, "mesh_quit_adv_b"),
(position_set_x, pos1, -1),
(position_set_y, pos1, -1),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1002),
(position_set_y, pos1, 1002),
(overlay_set_size, reg0, pos1),
(else_try),
(presentation_set_duration, 0),
(try_end),
(try_end),
]),
]),
("multiplayer_duel_start_counter", prsntf_read_only|prsntf_manual_end_only, 0, [
(ti_on_presentation_load, [
(set_fixed_point_multiplier, 1000),
(assign, "$g_multiplayer_duel_start_counter_overlay", -1),
(assign, "$g_multiplayer_last_duel_start_counter_value", -1),
(str_clear, s0),
(create_text_overlay, "$g_multiplayer_duel_start_counter_overlay", s0, tf_center_justify|tf_with_outline),
(overlay_set_color, "$g_multiplayer_duel_start_counter_overlay", 0xFFFFFF),
(position_set_x, pos1, 500),
(position_set_y, pos1, 600),
(overlay_set_position, "$g_multiplayer_duel_start_counter_overlay", pos1),
(position_set_x, pos1, 2000),
(position_set_y, pos1, 2000),
(overlay_set_size, "$g_multiplayer_duel_start_counter_overlay", pos1),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_run, [
(ge, "$g_multiplayer_duel_start_counter_overlay", 0),
(store_mission_timer_a, ":current_time"),
(store_sub, ":seconds_past_in_duel_start", ":current_time", "$g_multiplayer_duel_start_time"),
(store_sub, ":seconds_left_in_duel_start", 3, ":seconds_past_in_duel_start"),
(try_begin),
(le, ":seconds_left_in_duel_start", 0),
(presentation_set_duration, 0),
(else_try),
(neq, "$g_multiplayer_last_duel_start_counter_value", ":seconds_left_in_duel_start"),
(assign, "$g_multiplayer_last_duel_start_counter_value", ":seconds_left_in_duel_start"),
(assign, reg0, ":seconds_left_in_duel_start"),
(str_store_string, s0, "str_duel_starts_in_reg0_seconds"),
(overlay_set_text, "$g_multiplayer_duel_start_counter_overlay", s0),
(try_end),
]),
]),
]
| Python |
import types
from header_game_menus import *
from module_info import *
from module_game_menus import *
from module_parties import *
from process_operations import *
from process_common import *
def save_parties(parties):
file = open(export_dir + "parties.txt","w")
file.write("partiesfile version 1\n")
file.write("%d %d\n"%(len(parties), len(parties)))
for i_party in xrange(len(parties)):
party = parties[i_party]
if (party[5] >= 0):
add_tag_use(tag_uses,tag_faction,party[5])
file.write(" 1 %d %d "%(i_party, i_party))
# file.write(" 1 %d "%(i_party))
file.write("p_%s %s %d "%(convert_to_identifier(party[0]),replace_spaces(party[1]),party[2]))
menu_no = 0
menu_param = party[3]
if (type(menu_param) == types.StringType):
menu_no = find_object(game_menus,menu_param)
if (menu_no < 0):
print "Error: Unable to find menu-id :" + menu_param
else:
menu_no = menu_param
file.write("%d "%(menu_no))
file.write("%d %d %d %d %d "%(party[4], party[5], party[6], party[6],party[7]))
ai_behavior_object = 0
ai_param = party[8]
if (type(ai_param) == types.StringType):
ai_behavior_object = find_object(parties,ai_param)
if (ai_behavior_object < 0):
print "Error: Unable to find party-id :" + ai_param
else:
ai_behavior_object = ai_param
file.write("%d %d "%(ai_behavior_object,ai_behavior_object))
position = party[9]
default_behavior_location = position
file.write("%f %f "%(default_behavior_location[0],default_behavior_location[1]))
file.write("%f %f "%(default_behavior_location[0],default_behavior_location[1]))
file.write("%f %f 0.0 "%position)
member_list = party[10]
file.write("%d "%len(member_list))
for member in member_list:
add_tag_use(tag_uses,tag_troop,member[0])
file.write("%d %d 0 %d "%(member[0],member[1],member[2]))
bearing = 0.0
if (len(party) > 11):
bearing = (3.1415926 / 180.0) * party[11]
file.write("\n%f\n"%(bearing))
file.close()
def save_python_header(parties):
file = open("./ID_parties.py","w")
for i_party in xrange(len(parties)):
file.write("p_%s = %d\n"%(convert_to_identifier(parties[i_party][0]),i_party))
file.close()
print "Exporting parties"
tag_uses = load_tag_uses(export_dir)
save_python_header(parties)
save_parties(parties)
save_tag_uses(export_dir, tag_uses)
#print "Generating C header..."
#save_c_header()
#print "Generating Python header..."
#print "Finished."
| Python |
from module_info import *
from process_common import *
from process_operations import *
print "Checking global variable usages..."
variable_uses = []
variables = load_variables(export_dir,variable_uses)
i = 0
while (i < len(variables)):
if (variable_uses[i] == 0):
print "WARNING: Global variable never used: " + variables[i]
i = i + 1
| Python |
from header_common import *
from module_info import *
from module_sounds import *
def write_python_header(sounds):
file = open("./ID_sounds.py","w")
for i_sound in xrange(len(sounds)):
file.write("snd_%s = %d\n"%(sounds[i_sound][0],i_sound))
file.write("\n\n")
file.close()
def write_sounds(sound_samples, sounds):
ofile = open(export_dir + "sounds.txt","w")
ofile.write("soundsfile version 3\n")
ofile.write("%d\n"%len(sound_samples))
for sound_sample in sound_samples:
ofile.write(" %s %d\n"%sound_sample)
ofile.write("%d\n"%len(sounds))
for sound in sounds:
ofile.write("snd_%s %d %d "%(sound[0], sound[1],len(sound[2])))
sample_list = sound[2]
for s in sample_list:
ofile.write("%d %d "%(s[0], s[1]))
ofile.write("\n")
ofile.close()
def compile_sounds(sounds):
all_sounds = []
for sound in sounds:
sound_files = sound[2]
sound_flags = sound[1]
for i_sound_file in xrange(len(sound_files)):
sound_file = sound_files[i_sound_file]
if (type(sound_file) != type([])):
sound_file = [sound_file, 0]
sound_no = 0
found = 0
while (sound_no< (len(all_sounds))) and (not found):
if all_sounds[sound_no][0] == sound_file[0]:
found = 1
else:
sound_no += 1
if not found:
all_sounds.append((sound_file[0], sound_flags))
sound_no = len(all_sounds) - 1
sound_files[i_sound_file] = [sound_no, sound_file[1]]
return all_sounds
print "Exporting sounds..."
sound_samples = compile_sounds(sounds)
write_sounds(sound_samples, sounds)
write_python_header(sounds)
| Python |
mesh_pic_bandits = 0
mesh_pic_mb_warrior_1 = 1
mesh_pic_messenger = 2
mesh_pic_prisoner_man = 3
mesh_pic_prisoner_fem = 4
mesh_pic_prisoner_wilderness = 5
mesh_pic_siege_sighted = 6
mesh_pic_siege_sighted_fem = 7
mesh_pic_camp = 8
mesh_pic_payment = 9
mesh_pic_escape_1 = 10
mesh_pic_escape_1_fem = 11
mesh_pic_victory = 12
mesh_pic_defeat = 13
mesh_pic_wounded = 14
mesh_pic_wounded_fem = 15
mesh_pic_steppe_bandits = 16
mesh_pic_mountain_bandits = 17
mesh_pic_sea_raiders = 18
mesh_pic_deserters = 19
mesh_pic_forest_bandits = 20
mesh_pic_cattle = 21
mesh_pic_looted_village = 22
mesh_pic_village_p = 23
mesh_pic_village_s = 24
mesh_pic_village_w = 25
mesh_pic_recruits = 26
mesh_pic_arms_swadian = 27
mesh_pic_arms_vaegir = 28
mesh_pic_arms_khergit = 29
mesh_pic_arms_nord = 30
mesh_pic_arms_rhodok = 31
mesh_pic_sarranid_arms = 32
mesh_pic_castle1 = 33
mesh_pic_castledes = 34
mesh_pic_castlesnow = 35
mesh_pic_charge = 36
mesh_pic_khergit = 37
mesh_pic_nord = 38
mesh_pic_rhodock = 39
mesh_pic_sally_out = 40
mesh_pic_siege_attack = 41
mesh_pic_swad = 42
mesh_pic_town1 = 43
mesh_pic_towndes = 44
mesh_pic_townriot = 45
mesh_pic_townsnow = 46
mesh_pic_vaegir = 47
mesh_pic_villageriot = 48
mesh_pic_sarranid_encounter = 49
mesh_mp_score_a = 50
mesh_mp_score_b = 51
mesh_portrait_blend_out = 52
mesh_load_window = 53
mesh_checkbox_off = 54
mesh_checkbox_on = 55
mesh_white_plane = 56
mesh_white_dot = 57
mesh_player_dot = 58
mesh_flag_infantry = 59
mesh_flag_archers = 60
mesh_flag_cavalry = 61
mesh_inv_slot = 62
mesh_mp_ingame_menu = 63
mesh_mp_inventory_left = 64
mesh_mp_inventory_right = 65
mesh_mp_inventory_choose = 66
mesh_mp_inventory_slot_glove = 67
mesh_mp_inventory_slot_horse = 68
mesh_mp_inventory_slot_armor = 69
mesh_mp_inventory_slot_helmet = 70
mesh_mp_inventory_slot_boot = 71
mesh_mp_inventory_slot_empty = 72
mesh_mp_inventory_slot_equip = 73
mesh_mp_inventory_left_arrow = 74
mesh_mp_inventory_right_arrow = 75
mesh_mp_ui_host_main = 76
mesh_mp_ui_host_maps_1 = 77
mesh_mp_ui_host_maps_2 = 78
mesh_mp_ui_host_maps_3 = 79
mesh_mp_ui_host_maps_4 = 80
mesh_mp_ui_host_maps_5 = 81
mesh_mp_ui_host_maps_6 = 82
mesh_mp_ui_host_maps_7 = 83
mesh_mp_ui_host_maps_8 = 84
mesh_mp_ui_host_maps_9 = 85
mesh_mp_ui_host_maps_10 = 86
mesh_mp_ui_host_maps_11 = 87
mesh_mp_ui_host_maps_12 = 88
mesh_mp_ui_host_maps_13 = 89
mesh_mp_ui_host_maps_randomp = 90
mesh_mp_ui_host_maps_randoms = 91
mesh_mp_ui_command_panel = 92
mesh_mp_ui_command_border_l = 93
mesh_mp_ui_command_border_r = 94
mesh_mp_ui_welcome_panel = 95
mesh_flag_project_sw = 96
mesh_flag_project_vg = 97
mesh_flag_project_kh = 98
mesh_flag_project_nd = 99
mesh_flag_project_rh = 100
mesh_flag_project_sr = 101
mesh_flag_projects_end = 102
mesh_flag_project_sw_miss = 103
mesh_flag_project_vg_miss = 104
mesh_flag_project_kh_miss = 105
mesh_flag_project_nd_miss = 106
mesh_flag_project_rh_miss = 107
mesh_flag_project_sr_miss = 108
mesh_flag_project_misses_end = 109
mesh_color_picker = 110
mesh_custom_map_banner_01 = 111
mesh_custom_map_banner_02 = 112
mesh_custom_map_banner_03 = 113
mesh_custom_banner_01 = 114
mesh_custom_banner_02 = 115
mesh_custom_banner_bg = 116
mesh_custom_banner_fg01 = 117
mesh_custom_banner_fg02 = 118
mesh_custom_banner_fg03 = 119
mesh_custom_banner_fg04 = 120
mesh_custom_banner_fg05 = 121
mesh_custom_banner_fg06 = 122
mesh_custom_banner_fg07 = 123
mesh_custom_banner_fg08 = 124
mesh_custom_banner_fg09 = 125
mesh_custom_banner_fg10 = 126
mesh_custom_banner_fg11 = 127
mesh_custom_banner_fg12 = 128
mesh_custom_banner_fg13 = 129
mesh_custom_banner_fg14 = 130
mesh_custom_banner_fg15 = 131
mesh_custom_banner_fg16 = 132
mesh_custom_banner_fg17 = 133
mesh_custom_banner_fg18 = 134
mesh_custom_banner_fg19 = 135
mesh_custom_banner_fg20 = 136
mesh_custom_banner_fg21 = 137
mesh_custom_banner_fg22 = 138
mesh_custom_banner_fg23 = 139
mesh_custom_banner_charge_01 = 140
mesh_custom_banner_charge_02 = 141
mesh_custom_banner_charge_03 = 142
mesh_custom_banner_charge_04 = 143
mesh_custom_banner_charge_05 = 144
mesh_custom_banner_charge_06 = 145
mesh_custom_banner_charge_07 = 146
mesh_custom_banner_charge_08 = 147
mesh_custom_banner_charge_09 = 148
mesh_custom_banner_charge_10 = 149
mesh_custom_banner_charge_11 = 150
mesh_custom_banner_charge_12 = 151
mesh_custom_banner_charge_13 = 152
mesh_custom_banner_charge_14 = 153
mesh_custom_banner_charge_15 = 154
mesh_custom_banner_charge_16 = 155
mesh_custom_banner_charge_17 = 156
mesh_custom_banner_charge_18 = 157
mesh_custom_banner_charge_19 = 158
mesh_custom_banner_charge_20 = 159
mesh_custom_banner_charge_21 = 160
mesh_custom_banner_charge_22 = 161
mesh_custom_banner_charge_23 = 162
mesh_custom_banner_charge_24 = 163
mesh_custom_banner_charge_25 = 164
mesh_custom_banner_charge_26 = 165
mesh_custom_banner_charge_27 = 166
mesh_custom_banner_charge_28 = 167
mesh_custom_banner_charge_29 = 168
mesh_custom_banner_charge_30 = 169
mesh_custom_banner_charge_31 = 170
mesh_custom_banner_charge_32 = 171
mesh_custom_banner_charge_33 = 172
mesh_custom_banner_charge_34 = 173
mesh_custom_banner_charge_35 = 174
mesh_custom_banner_charge_36 = 175
mesh_custom_banner_charge_37 = 176
mesh_custom_banner_charge_38 = 177
mesh_custom_banner_charge_39 = 178
mesh_custom_banner_charge_40 = 179
mesh_custom_banner_charge_41 = 180
mesh_custom_banner_charge_42 = 181
mesh_custom_banner_charge_43 = 182
mesh_custom_banner_charge_44 = 183
mesh_custom_banner_charge_45 = 184
mesh_custom_banner_charge_46 = 185
mesh_tableau_mesh_custom_banner = 186
mesh_tableau_mesh_custom_banner_square = 187
mesh_tableau_mesh_custom_banner_tall = 188
mesh_tableau_mesh_custom_banner_short = 189
mesh_tableau_mesh_shield_round_1 = 190
mesh_tableau_mesh_shield_round_2 = 191
mesh_tableau_mesh_shield_round_3 = 192
mesh_tableau_mesh_shield_round_4 = 193
mesh_tableau_mesh_shield_round_5 = 194
mesh_tableau_mesh_shield_small_round_1 = 195
mesh_tableau_mesh_shield_small_round_2 = 196
mesh_tableau_mesh_shield_small_round_3 = 197
mesh_tableau_mesh_shield_kite_1 = 198
mesh_tableau_mesh_shield_kite_2 = 199
mesh_tableau_mesh_shield_kite_3 = 200
mesh_tableau_mesh_shield_kite_4 = 201
mesh_tableau_mesh_shield_heater_1 = 202
mesh_tableau_mesh_shield_heater_2 = 203
mesh_tableau_mesh_shield_pavise_1 = 204
mesh_tableau_mesh_shield_pavise_2 = 205
mesh_heraldic_armor_bg = 206
mesh_tableau_mesh_heraldic_armor_a = 207
mesh_tableau_mesh_heraldic_armor_b = 208
mesh_tableau_mesh_heraldic_armor_c = 209
mesh_tableau_mesh_heraldic_armor_d = 210
mesh_outer_terrain_plain_1 = 211
mesh_banner_a01 = 212
mesh_banner_a02 = 213
mesh_banner_a03 = 214
mesh_banner_a04 = 215
mesh_banner_a05 = 216
mesh_banner_a06 = 217
mesh_banner_a07 = 218
mesh_banner_a08 = 219
mesh_banner_a09 = 220
mesh_banner_a10 = 221
mesh_banner_a11 = 222
mesh_banner_a12 = 223
mesh_banner_a13 = 224
mesh_banner_a14 = 225
mesh_banner_a15 = 226
mesh_banner_a16 = 227
mesh_banner_a17 = 228
mesh_banner_a18 = 229
mesh_banner_a19 = 230
mesh_banner_a20 = 231
mesh_banner_a21 = 232
mesh_banner_b01 = 233
mesh_banner_b02 = 234
mesh_banner_b03 = 235
mesh_banner_b04 = 236
mesh_banner_b05 = 237
mesh_banner_b06 = 238
mesh_banner_b07 = 239
mesh_banner_b08 = 240
mesh_banner_b09 = 241
mesh_banner_b10 = 242
mesh_banner_b11 = 243
mesh_banner_b12 = 244
mesh_banner_b13 = 245
mesh_banner_b14 = 246
mesh_banner_b15 = 247
mesh_banner_b16 = 248
mesh_banner_b17 = 249
mesh_banner_b18 = 250
mesh_banner_b19 = 251
mesh_banner_b20 = 252
mesh_banner_b21 = 253
mesh_banner_c01 = 254
mesh_banner_c02 = 255
mesh_banner_c03 = 256
mesh_banner_c04 = 257
mesh_banner_c05 = 258
mesh_banner_c06 = 259
mesh_banner_c07 = 260
mesh_banner_c08 = 261
mesh_banner_c09 = 262
mesh_banner_c10 = 263
mesh_banner_c11 = 264
mesh_banner_c12 = 265
mesh_banner_c13 = 266
mesh_banner_c14 = 267
mesh_banner_c15 = 268
mesh_banner_c16 = 269
mesh_banner_c17 = 270
mesh_banner_c18 = 271
mesh_banner_c19 = 272
mesh_banner_c20 = 273
mesh_banner_c21 = 274
mesh_banner_d01 = 275
mesh_banner_d02 = 276
mesh_banner_d03 = 277
mesh_banner_d04 = 278
mesh_banner_d05 = 279
mesh_banner_d06 = 280
mesh_banner_d07 = 281
mesh_banner_d08 = 282
mesh_banner_d09 = 283
mesh_banner_d10 = 284
mesh_banner_d11 = 285
mesh_banner_d12 = 286
mesh_banner_d13 = 287
mesh_banner_d14 = 288
mesh_banner_d15 = 289
mesh_banner_d16 = 290
mesh_banner_d17 = 291
mesh_banner_d18 = 292
mesh_banner_d19 = 293
mesh_banner_d20 = 294
mesh_banner_d21 = 295
mesh_banner_e01 = 296
mesh_banner_e02 = 297
mesh_banner_e03 = 298
mesh_banner_e04 = 299
mesh_banner_e05 = 300
mesh_banner_e06 = 301
mesh_banner_e07 = 302
mesh_banner_e08 = 303
mesh_banner_e09 = 304
mesh_banner_e10 = 305
mesh_banner_e11 = 306
mesh_banner_e12 = 307
mesh_banner_e13 = 308
mesh_banner_e14 = 309
mesh_banner_e15 = 310
mesh_banner_e16 = 311
mesh_banner_e17 = 312
mesh_banner_e18 = 313
mesh_banner_e19 = 314
mesh_banner_e20 = 315
mesh_banner_e21 = 316
mesh_banner_f01 = 317
mesh_banner_f02 = 318
mesh_banner_f03 = 319
mesh_banner_f04 = 320
mesh_banner_f05 = 321
mesh_banner_f06 = 322
mesh_banner_f07 = 323
mesh_banner_f08 = 324
mesh_banner_f09 = 325
mesh_banner_f10 = 326
mesh_banner_f11 = 327
mesh_banner_f12 = 328
mesh_banner_f13 = 329
mesh_banner_f14 = 330
mesh_banner_f15 = 331
mesh_banner_f16 = 332
mesh_banner_f17 = 333
mesh_banner_f18 = 334
mesh_banner_f19 = 335
mesh_banner_f20 = 336
mesh_banner_g01 = 337
mesh_banner_g02 = 338
mesh_banner_g03 = 339
mesh_banner_g04 = 340
mesh_banner_g05 = 341
mesh_banner_g06 = 342
mesh_banner_g07 = 343
mesh_banner_g08 = 344
mesh_banner_g09 = 345
mesh_banner_g10 = 346
mesh_banner_kingdom_a = 347
mesh_banner_kingdom_b = 348
mesh_banner_kingdom_c = 349
mesh_banner_kingdom_d = 350
mesh_banner_kingdom_e = 351
mesh_banner_kingdom_f = 352
mesh_banner_f21 = 353
mesh_arms_a01 = 354
mesh_arms_a02 = 355
mesh_arms_a03 = 356
mesh_arms_a04 = 357
mesh_arms_a05 = 358
mesh_arms_a06 = 359
mesh_arms_a07 = 360
mesh_arms_a08 = 361
mesh_arms_a09 = 362
mesh_arms_a10 = 363
mesh_arms_a11 = 364
mesh_arms_a12 = 365
mesh_arms_a13 = 366
mesh_arms_a14 = 367
mesh_arms_a15 = 368
mesh_arms_a16 = 369
mesh_arms_a17 = 370
mesh_arms_a18 = 371
mesh_arms_a19 = 372
mesh_arms_a20 = 373
mesh_arms_a21 = 374
mesh_arms_b01 = 375
mesh_arms_b02 = 376
mesh_arms_b03 = 377
mesh_arms_b04 = 378
mesh_arms_b05 = 379
mesh_arms_b06 = 380
mesh_arms_b07 = 381
mesh_arms_b08 = 382
mesh_arms_b09 = 383
mesh_arms_b10 = 384
mesh_arms_b11 = 385
mesh_arms_b12 = 386
mesh_arms_b13 = 387
mesh_arms_b14 = 388
mesh_arms_b15 = 389
mesh_arms_b16 = 390
mesh_arms_b17 = 391
mesh_arms_b18 = 392
mesh_arms_b19 = 393
mesh_arms_b20 = 394
mesh_arms_b21 = 395
mesh_arms_c01 = 396
mesh_arms_c02 = 397
mesh_arms_c03 = 398
mesh_arms_c04 = 399
mesh_arms_c05 = 400
mesh_arms_c06 = 401
mesh_arms_c07 = 402
mesh_arms_c08 = 403
mesh_arms_c09 = 404
mesh_arms_c10 = 405
mesh_arms_c11 = 406
mesh_arms_c12 = 407
mesh_arms_c13 = 408
mesh_arms_c14 = 409
mesh_arms_c15 = 410
mesh_arms_c16 = 411
mesh_arms_c17 = 412
mesh_arms_c18 = 413
mesh_arms_c19 = 414
mesh_arms_c20 = 415
mesh_arms_c21 = 416
mesh_arms_d01 = 417
mesh_arms_d02 = 418
mesh_arms_d03 = 419
mesh_arms_d04 = 420
mesh_arms_d05 = 421
mesh_arms_d06 = 422
mesh_arms_d07 = 423
mesh_arms_d08 = 424
mesh_arms_d09 = 425
mesh_arms_d10 = 426
mesh_arms_d11 = 427
mesh_arms_d12 = 428
mesh_arms_d13 = 429
mesh_arms_d14 = 430
mesh_arms_d15 = 431
mesh_arms_d16 = 432
mesh_arms_d17 = 433
mesh_arms_d18 = 434
mesh_arms_d19 = 435
mesh_arms_d20 = 436
mesh_arms_d21 = 437
mesh_arms_e01 = 438
mesh_arms_e02 = 439
mesh_arms_e03 = 440
mesh_arms_e04 = 441
mesh_arms_e05 = 442
mesh_arms_e06 = 443
mesh_arms_e07 = 444
mesh_arms_e08 = 445
mesh_arms_e09 = 446
mesh_arms_e10 = 447
mesh_arms_e11 = 448
mesh_arms_e12 = 449
mesh_arms_e13 = 450
mesh_arms_e14 = 451
mesh_arms_e15 = 452
mesh_arms_e16 = 453
mesh_arms_e17 = 454
mesh_arms_e18 = 455
mesh_arms_e19 = 456
mesh_arms_e20 = 457
mesh_arms_e21 = 458
mesh_arms_f01 = 459
mesh_arms_f02 = 460
mesh_arms_f03 = 461
mesh_arms_f04 = 462
mesh_arms_f05 = 463
mesh_arms_f06 = 464
mesh_arms_f07 = 465
mesh_arms_f08 = 466
mesh_arms_f09 = 467
mesh_arms_f10 = 468
mesh_arms_f11 = 469
mesh_arms_f12 = 470
mesh_arms_f13 = 471
mesh_arms_f14 = 472
mesh_arms_f15 = 473
mesh_arms_f16 = 474
mesh_arms_f17 = 475
mesh_arms_f18 = 476
mesh_arms_f19 = 477
mesh_arms_f20 = 478
mesh_arms_g01 = 479
mesh_arms_g02 = 480
mesh_arms_g03 = 481
mesh_arms_g04 = 482
mesh_arms_g05 = 483
mesh_arms_g06 = 484
mesh_arms_g07 = 485
mesh_arms_g08 = 486
mesh_arms_g09 = 487
mesh_arms_g10 = 488
mesh_arms_kingdom_a = 489
mesh_arms_kingdom_b = 490
mesh_arms_kingdom_c = 491
mesh_arms_kingdom_d = 492
mesh_arms_kingdom_e = 493
mesh_arms_kingdom_f = 494
mesh_arms_f21 = 495
mesh_banners_default_a = 496
mesh_banners_default_b = 497
mesh_banners_default_c = 498
mesh_banners_default_d = 499
mesh_banners_default_e = 500
mesh_troop_label_banner = 501
mesh_ui_kingdom_shield_1 = 502
mesh_ui_kingdom_shield_2 = 503
mesh_ui_kingdom_shield_3 = 504
mesh_ui_kingdom_shield_4 = 505
mesh_ui_kingdom_shield_5 = 506
mesh_ui_kingdom_shield_6 = 507
mesh_mouse_arrow_down = 508
mesh_mouse_arrow_right = 509
mesh_mouse_arrow_left = 510
mesh_mouse_arrow_up = 511
mesh_mouse_arrow_plus = 512
mesh_mouse_left_click = 513
mesh_mouse_right_click = 514
mesh_status_ammo_ready = 515
mesh_main_menu_background = 516
mesh_loading_background = 517
mesh_ui_quick_battle_a = 518
mesh_white_bg_plane_a = 519
mesh_cb_ui_icon_infantry = 520
mesh_cb_ui_icon_archer = 521
mesh_cb_ui_icon_horseman = 522
mesh_cb_ui_main = 523
mesh_cb_ui_maps_scene_01 = 524
mesh_cb_ui_maps_scene_02 = 525
mesh_cb_ui_maps_scene_03 = 526
mesh_cb_ui_maps_scene_04 = 527
mesh_cb_ui_maps_scene_05 = 528
mesh_cb_ui_maps_scene_06 = 529
mesh_cb_ui_maps_scene_07 = 530
mesh_cb_ui_maps_scene_08 = 531
mesh_cb_ui_maps_scene_09 = 532
mesh_mp_ui_host_maps_14 = 533
mesh_mp_ui_host_maps_15 = 534
mesh_quit_adv = 535
mesh_quit_adv_b = 536
mesh_ui_kingdom_shield_7 = 537
mesh_flag_project_rb = 538
mesh_flag_project_rb_miss = 539
mesh_mp_ui_host_maps_16 = 540
mesh_mp_ui_host_maps_17 = 541
mesh_mp_ui_host_maps_18 = 542
| Python |
arf_blend_in_0 = 0x00000001
arf_blend_in_1 = 0x00000002
arf_blend_in_2 = 0x00000003
arf_blend_in_3 = 0x00000004
arf_blend_in_4 = 0x00000005
arf_blend_in_5 = 0x00000006
arf_blend_in_6 = 0x00000007
arf_blend_in_7 = 0x00000008
arf_blend_in_8 = 0x00000009
arf_blend_in_9 = 0x0000000a
arf_blend_in_10 = 0x0000000b
arf_blend_in_11 = 0x0000000c
arf_blend_in_12 = 0x0000000d
arf_blend_in_13 = 0x0000000e
arf_blend_in_14 = 0x0000000f
arf_blend_in_15 = 0x00000010
arf_blend_in_16 = 0x00000011
arf_blend_in_17 = 0x00000012
arf_blend_in_18 = 0x00000013
arf_blend_in_19 = 0x00000014
arf_blend_in_20 = 0x00000015
arf_blend_in_21 = 0x00000016
arf_blend_in_22 = 0x00000017
arf_blend_in_23 = 0x00000018
arf_blend_in_24 = 0x00000019
arf_blend_in_25 = 0x0000001a
arf_blend_in_26 = 0x0000001b
arf_blend_in_27 = 0x0000001c
arf_blend_in_28 = 0x0000001d
arf_blend_in_29 = 0x0000001e
arf_blend_in_30 = 0x0000001f
arf_blend_in_31 = 0x00000020
arf_blend_in_32 = 0x00000021
arf_blend_in_48 = 0x00000031
arf_blend_in_64 = 0x00000041
arf_blend_in_128 = 0x00000081
arf_blend_in_254 = 0x000000ff
arf_make_walk_sound = 0x00000100
arf_make_custom_sound = 0x00000200
##arf_start_pos_0 = 0x00000100
##arf_end_pos_0 = 0x00000200
##arf_start_pos_0_25 = 0x00000400
##arf_end_pos_0_25 = 0x00000800
##arf_start_pos_0_5 = 0x00001000
##arf_end_pos_0_5 = 0x00002000
##arf_start_pos_0_75 = 0x00004000
##arf_end_pos_0_75 = 0x00008000
##arf_loop_pos_0 = arf_start_pos_0 | arf_end_pos_0
##arf_loop_pos_0_25 = arf_start_pos_0_25 | arf_end_pos_0_25
##arf_loop_pos_0_5 = arf_start_pos_0_5 | arf_end_pos_0_5
##arf_loop_pos_0_75 = arf_start_pos_0_75 | arf_end_pos_0_75
##arf_phase_even = 0x00010000
##arf_phase_odd = 0x00030000
##arf_phase_inverse_even = 0x00050000
##arf_phase_inverse_odd = 0x00070000
arf_two_handed_blade = 0x01000000
arf_lancer = 0x02000000
arf_stick_item_to_left_hand = 0x04000000
arf_cyclic = 0x10000000
arf_use_walk_progress = 0x20000000
arf_use_stand_progress = 0x40000000
arf_use_inv_walk_progress = 0x80000000
##arf_walk = arf_phase_even | arf_cyclic
#-----------------------------------------
amf_priority_mask = 0x00000fff
amf_rider_rot_bow = 0x00001000
amf_rider_rot_throw = 0x00002000
amf_rider_rot_crossbow = 0x00003000
amf_rider_rot_pistol = 0x00004000
amf_rider_rot_overswing = 0x00005000
amf_rider_rot_thrust = 0x00006000
amf_rider_rot_swing_right = 0x00007000
amf_rider_rot_swing_left = 0x00008000
amf_rider_rot_couched_lance = 0x00009000
amf_rider_rot_shield = 0x0000a000
amf_rider_rot_defend = 0x0000b000
amf_start_instantly = 0x00010000
amf_use_cycle_period = 0x00100000
amf_use_weapon_speed = 0x00200000
amf_use_defend_speed = 0x00400000
amf_accurate_body = 0x00800000
amf_client_prediction = 0x01000000
amf_play = 0x02000000
amf_keep = 0x04000000
amf_restart = 0x08000000 # restart animation even if it is the current animation
amf_hide_weapon = 0x10000000
amf_client_owner_prediction = 0x20000000
amf_use_inertia = 0x40000000
amf_continue_to_next = 0x80000000
#-----------------------------------------
acf_synch_with_horse = 0x00000001
acf_align_with_ground = 0x00000002
acf_enforce_lowerbody = 0x00000100
acf_enforce_rightside = 0x00000200
acf_enforce_all = 0x00000400
acf_parallels_for_look_slope = 0x00001000
acf_lock_camera = 0x00002000
acf_displace_position = 0x00004000
acf_ignore_slope = 0x00008000
acf_thrust = 0x00010000
acf_right_cut = 0x00020000
acf_left_cut = 0x00040000
acf_overswing = 0x00080000
acf_rot_vertical_mask = 0x00300000
acf_rot_vertical_bow = 0x00100000
acf_rot_vertical_sword = 0x00200000
acf_anim_length_mask = 0xff000000
acf_anim_length_bits = 24
def acf_anim_length(x):
return (x << acf_anim_length_bits) & acf_anim_length_mask
#------------------------------------------
#### Do not edit these lines
def get_byte(f):
if f == 0.0:
return 0
i = int(f * 255.0)
if (i< 1):
i=1
elif (i > 255):
i = 255
return i
def pack2f(a,b):
ai = get_byte(a)
bi = get_byte(b)
return ((bi << 8) | ai)
def pack4f(a,b,c,d):
ai = get_byte(a)
bi = get_byte(b)
ci = get_byte(c)
di = get_byte(d)
return ((di << 24) | (ci << 16) | (bi << 8) | ai)
| Python |
from header_common import *
from header_parties import *
from ID_troops import *
from ID_factions import *
from ID_party_templates import *
from ID_map_icons import *
####################################################################################################################
# Each party record contains the following fields:
# 1) Party id: used for referencing parties in other files.
# The prefix p_ is automatically added before each party id.
# 2) Party name.
# 3) Party flags. See header_parties.py for a list of available flags
# 4) Menu. ID of the menu to use when this party is met. The value 0 uses the default party encounter system.
# 5) Party-template. ID of the party template this party belongs to. Use pt_none as the default value.
# 6) Faction.
# 7) Personality. See header_parties.py for an explanation of personality flags.
# 8) Ai-behavior
# 9) Ai-target party
# 10) Initial coordinates.
# 11) List of stacks. Each stack record is a triple that contains the following fields:
# 11.1) Troop-id.
# 11.2) Number of troops in this stack.
# 11.3) Member flags. Use pmf_is_prisoner to note that this member is a prisoner.
# 12) Party direction in degrees [optional]
####################################################################################################################
no_menu = 0
#pf_town = pf_is_static|pf_always_visible|pf_hide_defenders|pf_show_faction
pf_town = pf_is_static|pf_always_visible|pf_show_faction|pf_label_large
pf_castle = pf_is_static|pf_always_visible|pf_show_faction|pf_label_medium
pf_village = pf_is_static|pf_always_visible|pf_hide_defenders|pf_label_small
#sample_party = [(trp_swadian_knight,1,0), (trp_swadian_peasant,10,0), (trp_swadian_crossbowman,1,0), (trp_swadian_man_at_arms, 1, 0), (trp_swadian_footman, 1, 0), (trp_swadian_militia,1,0)]
# NEW TOWNS:
# NORMANDY: Rouen, Caen, Bayeux, Coutances, Evreux, Avranches
# Brittany: Rennes, Nantes,
# Maine: Le Mans
# Anjou: Angers
parties = [
("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),[(trp_player,1,0)]),
("temp_party","{!}temp_party",pf_disabled, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0,0),[]),
("camp_bandits","{!}camp_bandits",pf_disabled, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(1,1),[(trp_temp_troop,3,0)]),
#parties before this point are hardwired. Their order should not be changed.
("temp_party_2","{!}temp_party_2",pf_disabled, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0,0),[]),
#Used for calculating casulties.
("temp_casualties","{!}casualties",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("temp_casualties_2","{!}casualties",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("temp_casualties_3","{!}casualties",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("temp_wounded","{!}enemies_wounded",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("temp_killed", "{!}enemies_killed", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("main_party_backup","{!}_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("encountered_party_backup","{!}_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
# ("ally_party_backup","_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("collective_friends_backup","{!}_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("player_casualties","{!}_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("enemy_casualties","{!}_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("ally_casualties","{!}_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("collective_enemy","{!}collective_enemy",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
#TODO: remove this and move all to collective ally
("collective_ally","{!}collective_ally",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("collective_friends","{!}collective_ally",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
("total_enemy_casualties","{!}_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), #ganimet hesaplari icin #new:
("routed_enemies","{!}routed_enemies",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), #new:
# ("village_reinforcements","village_reinforcements",pf_is_static|pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
###############################################################
("zendar","Zendar",pf_disabled|icon_town|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(18,60),[]),
("town_1","Sargoth", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-17.6, 79.7),[], 170),
("town_2","Tihr", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-53.5, 78.4),[], 120),
("town_3","Veluca", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-57.4, -44.5),[], 80),
("town_4","Suno", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-70, 15.4),[], 290),
("town_5","Jelkala", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-74.6, -79.7),[], 90),
("town_6","Praven", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-96, 26.4),[], 155),
("town_7","Uxkhal", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-50, -8.5),[], 240),
("town_8","Reyvadin", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(48.44, 39.3),[], 175),
("town_9","Khudan", icon_town_snow|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(94, 65.2),[], 90),
("town_10","Tulga", icon_town_steppe|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(135.5, -22),[], 310),
("town_11","Curaw", icon_town_snow|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(43, 67.5),[], 150),
("town_12","Wercheg", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-1.2, 108.9),[], 25),
("town_13","Rivacheg",icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(64.8, 113.7),[], 60),
("town_14","Halmar", icon_town_steppe|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(55.5, -45),[], 135),
("town_15","Yalen", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-132.8, -47.3),[], 45),
("town_16","Dhirim", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(14, -2),[], 0),
("town_17","Ichamur", icon_town_steppe|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(121.8, 8.6),[], 90),
("town_18","Narra", icon_town_steppe|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(88, -26.5),[], 135),
("town_19","Shariz", icon_town_desert|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(15, -107),[], 45),
("town_20","Durquba", icon_town_desert|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(90, -95.1),[], 270),
("town_21","Ahmerrad", icon_town_desert|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(130.5, -78.5),[], 330),
("town_22","Bariyye", icon_town_desert|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(165, -106.7),[], 225),
# Aztaq_Castle
# Malabadi_Castle
("castle_1","Culmarr_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-101.3, -21),[],50),
("castle_2","Malayurg_Castle",icon_castle_b|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(97.5, -2.2),[],75),
("castle_3","Bulugha_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(47.5, 111.3),[],100),
("castle_4","Radoghir_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(32.5, 47.8),[],180),
("castle_5","Tehlrog_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-4.8, 63.7),[],90),
("castle_6","Tilbaut_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(37.6, 17.1),[],55),
("castle_7","Sungetche_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(109.5, 41.5),[],45),
("castle_8","Jeirbe_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(35.2, 89),[],30),
("castle_9","Jamiche_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-7.5, -82.6),[],100),
("castle_10","Alburq_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(24.2, 96.85),[],110),
("castle_11","Curin_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-27.50, 83.46),[],75),
("castle_12","Chalbek_Castle",icon_castle_b|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-84.75, 105.5),[],95),
("castle_13","Kelredan_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-10.6, 17.6),[],115),
("castle_14","Maras_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-122.4, -18.1),[],90),
("castle_15","Ergellon_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-52.5, -28),[],235),
("castle_16","Almerra_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-10.6, -65.6),[],45),
("castle_17","Distar_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(140.3, -10.8),[],15),
("castle_18","Ismirala_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(14.4, 70.1),[],300),
("castle_19","Yruma_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(69.5, 55.6),[],280),
("castle_20","Derchios_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(16, 11.5),[],260),
("castle_21","Ibdeles_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-73, -89.5),[],260),
("castle_22","Unuzdaq_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(33, -64),[],260),
("castle_23","Tevarin_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-124.8, 44.3),[],80),
("castle_24","Reindi_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(24.9, -35.6),[],260),
("castle_25","Ryibelet_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-57, 30.6),[],260),
("castle_26","Senuzgda_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-2.5, -9.5),[],260),
("castle_27","Rindyar_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(63.3, -2),[],260),
("castle_28","Grunwalder_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-36.4, -39.3),[],260),
("castle_29","Nelag_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(147.7, 50.4),[],280),
("castle_30","Asugan_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(176, -47),[],260),
("castle_31","Vyincourd_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-65.7, -12.5),[],260),
("castle_32","Knudarr_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(2, 30.1),[],260),
("castle_33","Etrosq_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-101.4, -32.1),[],80),
("castle_34","Hrus_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-72.5, 78.6),[],260),
("castle_35","Haringoth_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-110, 0),[],260),
("castle_36","Jelbegi_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-47.3, 53.2),[],260),
("castle_37","Dramug_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(55.3, 23),[],260),
("castle_38","Tulbuk_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(141.7, 33.3),[],260),
("castle_39","Slezkh_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(56.8, 74.5),[],280),
("castle_40","Uhhun_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(62.9, -26),[],260),
("castle_41","Jameyyed_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(71.3, -71.1),[],260),
("castle_42","Teramma_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(70, -96),[],80),
("castle_43","Sharwa_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(172, -65),[],260),
("castle_44","Durrin_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(128, -87),[],260),
("castle_45","Caraf_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(30.6, -110.6),[],260),
("castle_46","Weyyah_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(13.3, -84.4),[],260),
("castle_47","Samarra_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(116, -74),[],260),
("castle_48","Bardaq_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(157, -80),[],260),
# Rinimad
# Rietal Derchios Gerdus
# Tuavus Pamir vezona
("village_1", "Yaragar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-60, -9.5),[], 100),
("village_2", "Burglen", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-13.5, 3.5),[], 110),
("village_3", "Azgad", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-97.4, 36),[], 120),
("village_4", "Nomar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-36.6, -13.2),[], 130),
("village_5", "Kulum", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-122.7, 106.3),[], 170),
("village_6", "Emirin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(5.5, -2.5),[], 100),
("village_7", "Amere", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(39.3, -5.25),[], 110),
("village_8", "Haen", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-49.7, 74),[], 120),
("village_9", "Buvran", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-85, -75.35),[], 130),
("village_10","Mechin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(8.8, 34.75),[], 170),
("village_11","Dusturil", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(137.2, -36.5),[], 100),
("village_12","Emer", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-45.8, -58.5),[], 110),
("village_13","Nemeja", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-119, 3),[], 120),
("village_14","Sumbuja", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(40,52),[], 130),
("village_15","Ryibelet", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-49.3, 26.25),[], 170),
("village_16","Shapeshte", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(74, 86.8),[], 170),
("village_17","Mazen", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(44.7, 91.4),[], 35),
("village_18","Ulburban", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(73.7, 30.1),[], 170),
("village_19","Hanun", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(152.3, 53.5),[], 170),
("village_20","Uslum", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(116, 80.3),[], 170),
("village_21","Bazeck", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(60.4, 85),[], 100),
("village_22","Shulus", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(125.4, 64),[], 110),
("village_23","Ilvia", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-133.3, -37.6),[], 120),
("village_24","Ruldi", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-57.6, -73),[], 130),
("village_25","Dashbigha", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(125.2, -8),[], 170),
("village_26","Pagundur", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-58.5, -30.8),[], 170),
("village_27","Glunmar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-146.3, -16.6),[], 170),
("village_28","Tash_Kulun", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(95, -11.4),[], 170),
("village_29","Buillin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-90.6, 110.9),[], 170),
("village_30","Ruvar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(29.2, 114.3),[], 170),
("village_31","Ambean", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-24, 53),[], 100),
("village_32","Tosdhar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(8.3 , 14.5 ),[], 110),
("village_33","Ruluns", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-59, 10.6),[], 120),
("village_34","Ehlerdah", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(34.15, -30),[], 130),
("village_35","Fearichen", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(2.14, 86.9),[], 170),
("village_36","Jayek", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(17.4, 100.7),[], 170),
("village_37","Ada_Kulun", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(164.4, 26),[], 170),
("village_38","Ibiran", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-42.8, 11.25),[], 170),
("village_39","Reveran", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-124.3, -29.5),[], 170),
("village_40","Saren", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-12, -53),[], 170),
("village_41","Dugan", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(175, -39.5),[], 100),
("village_42","Dirigh_Aban", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(115.4, 21.6),[], 110),
("village_43","Zagush", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(99.4, -21.3),[], 120),
("village_44","Peshmi", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(51.8, -50),[], 130),
("village_45","Bulugur", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(151.5, -3),[], 170),
("village_46","Fedner", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-82.4, -48.8),[], 170),
("village_47","Epeshe", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-101.2, -53.7),[], 170),
("village_48","Veidar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-103, 15.3),[], 170),
("village_49","Tismirr", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(90.8, 60.5),[], 10),
("village_50","Karindi", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(64.1, 55.9),[], 170),
("village_51","Jelbegi", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-40, 62),[], 100),
("village_52","Amashke", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(38.2, -67.7),[], 110),
("village_53","Balanli", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-130.3, 42),[], 120),
("village_54","Chide", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-19, 15.5),[], 130),
("village_55","Tadsamesh", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(37.3, 23.7),[], 170),
("village_56","Fenada", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-5.55, 75.5),[], 170),
("village_57","Ushkuru", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(24.75, -7.7),[], 170),
("village_58","Vezin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(78.50, 118.3),[], 170),
("village_59","Dumar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-101, -45),[], 170),
("village_60","Tahlberl", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-26.6, 30),[], 170),
("village_61","Aldelen", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-99.8, 85.65),[], 100),
("village_62","Rebache", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(36.7, 59.5),[], 100),
("village_63","Rduna", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(70.75, 1.6),[], 100),
("village_64","Serindiar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-41.5, -35.8),[], 100),
("village_65","Iyindah", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-86.3, 12.4),[], 100),
("village_66","Fisdnar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(109, 127.5),[], 100),
("village_67","Tebandra", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(65, 23),[], 100),
("village_68","Ibdeles", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-72.6, -97.5),[], 100),
("village_69","Kwynn", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-26.5, 77.6),[], 100),
("village_70","Dirigsene", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-94, -27),[], 100),
("village_71","Tshibtin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-9, -20),[], 20),
("village_72","Elberl", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-144, 16.15),[], 60),
("village_73","Chaeza", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-63.2, -51.4),[], 55),
("village_74","Ayyike", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(49, 31),[], 15),
("village_75","Bhulaban", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(110.2, 48.8),[], 10),
("village_76","Kedelke", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(91.5, -34.8),[], 35),
("village_77","Rizi", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-64.8, 81.5),[], 160),
("village_78","Sarimish", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-30.2, -53.3),[], 180),
("village_79","Istiniar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-134.1, -5.5),[], 0),
("village_80","Vayejeg", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-1.5, 56),[], 40),
("village_81","Odasan", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-17.2, 123.6),[], 20),
("village_82","Yalibe", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(12, -26),[], 60),
("village_83","Gisim", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-79.9, 55.2),[], 55),
("village_84","Chelez", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-45.6, -83),[], 15),
("village_85","Ismirala", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(22.8, 71.7),[], 10),
("village_86","Slezkh", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(60.5, 68.2),[], 35),
("village_87","Udiniad", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(52.3, 111.8),[], 160),
("village_88","Tulbuk", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(135.8, 24.7),[], 180),
("village_89","Uhhun", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(70.1, -27.9),[], 0),
("village_90","Jamiche", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-12.7, -85.5),[], 40),
("village_91","Ayn Assuadi", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(21.6, -95.3),[], 20),
("village_92","Dhibbain", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(42.5, -111.6),[], 60),
("village_93","Qalyut", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(50, -94.8),[], 55),
("village_94","Mazigh", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(75.4, -61.65),[], 15),
("village_95","Tamnuh", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(99, -90.5),[], 10),
("village_96","Habba", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(107, -75),[], 35),
("village_97","Sekhtem", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(82.3, -76.8),[], 160),
("village_98","Mawiti", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(117.7, -62.2),[], 180),
("village_99","Fishara", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(158.35, -98),[], 0),
("village_100","Iqbayl", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(150, -106.5),[], 40),
("village_101","Uzgha", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(154, -69.5),[], 20),
("village_102","Shibal Zumr", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(77.2, -91),[], 60),
("village_103","Mijayet", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(121, -95.6),[], 55),
("village_104","Tazjunat", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(159, -58.5),[], 15),
("village_105","Aab", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(135, -88.5),[], 10),
("village_106","Hawaha", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(10.3, -91.0),[], 35),
("village_107","Unriya", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(156.6, -84),[], 160),
("village_108","Mit Nun", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(28.8, -107.3),[], 180),
("village_109","Tilimsal", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(53, -114.5),[], 0),
("village_110","Rushdigh", icon_village_c|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(38, -104),[], 40),
("salt_mine","Salt_Mine",icon_village_a|pf_disabled|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(14.2, -31),[]),
("four_ways_inn","Four_Ways_Inn",icon_village_a|pf_disabled|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(4.8, -39.6),[]),
("test_scene","test_scene",icon_village_a|pf_disabled|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(10.8, -19.6),[]),
#("test_scene","test_scene",icon_village_a|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(10.8, -19.6),[]),
("battlefields","battlefields",pf_disabled|icon_village_a|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(10.8, -16.6),[]),
("dhorak_keep","Dhorak_Keep",icon_town|pf_disabled|pf_is_static|pf_always_visible|pf_no_label|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-50,-58),[]),
("training_ground","Training Ground", pf_disabled|icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(3, -7),[]),
("training_ground_1", "Training Field", icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(37.4, 102.8),[], 100),
("training_ground_2", "Training Field", icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-12.8, 33),[], 100),
("training_ground_3", "Training Field", icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(70.5, 72.0),[], 100),
("training_ground_4", "Training Field", icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(11.5, -75.2),[], 100),
("training_ground_5", "Training Field", icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-125.8, 12.5),[], 100),
# bridge_a
("Bridge_1","{!}1",icon_bridge_snow_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(39.37, 65.10),[], -44.8),
("Bridge_2","{!}2",icon_bridge_snow_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(56.44, 77.88),[], 4.28),
("Bridge_3","{!}3",icon_bridge_snow_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(70.87, 87.95),[], 64.5),
("Bridge_4","{!}4",icon_bridge_snow_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(93.71, 62.13),[], -2.13),
("Bridge_5","{!}5",icon_bridge_snow_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(11.02, 72.61),[], 21.5),
("Bridge_6","{!}6",icon_bridge_b|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-8.83, 52.24),[], -73.5),
("Bridge_7","{!}7",icon_bridge_b|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-29.79, 76.84),[], -64),
("Bridge_8","{!}8",icon_bridge_b|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-64.05, -6),[], 1.72),
("Bridge_9","{!}9",icon_bridge_b|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-64.95, -9.60),[], -33.76),
("Bridge_10","{!}10",icon_bridge_b|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-75.32, -75.27),[], -44.07),
("Bridge_11","{!}11",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-24.39, 67.82),[], 81.3),
("Bridge_12","{!}12",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-114.33, -1.94),[], -35.5),
("Bridge_13","{!}13",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-84.02, -7),[], -17.7),
("Bridge_14","{!}14",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-23.36, 75.8),[], 66.6),
("looter_spawn_point" ,"{!}looter_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(26, 77),[(trp_looter,15,0)]),
("steppe_bandit_spawn_point" ,"the steppes",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(125, 9),[(trp_looter,15,0)]),
("taiga_bandit_spawn_point" ,"the tundra",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(78, 84),[(trp_looter,15,0)]),
## ("black_khergit_spawn_point" ,"black_khergit_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(47.1, -73.3),[(trp_looter,15,0)]),
("forest_bandit_spawn_point" ,"the forests",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(-35, 18),[(trp_looter,15,0)]),
("mountain_bandit_spawn_point","the highlands",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(-90, -26.8),[(trp_looter,15,0)]),
("sea_raider_spawn_point_1" ,"the coast",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(48.5, 110),[(trp_looter,15,0)]),
("sea_raider_spawn_point_2" ,"the coast",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(-42, 76.7),[(trp_looter,15,0)]),
("desert_bandit_spawn_point" ,"the deserts",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(110, -100),[(trp_looter,15,0)]),
# add extra towns before this point
("spawn_points_end" ,"{!}last_spawn_point", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0., 0),[(trp_looter,15,0)]),
("reserved_1" ,"{!}last_spawn_point", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0., 0),[(trp_looter,15,0)]),
("reserved_2" ,"{!}last_spawn_point", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0., 0),[(trp_looter,15,0)]),
("reserved_3" ,"{!}last_spawn_point", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0., 0),[(trp_looter,15,0)]),
("reserved_4" ,"{!}last_spawn_point", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0., 0),[(trp_looter,15,0)]),
("reserved_5" ,"{!}last_spawn_point", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0., 0),[(trp_looter,15,0)]),
]
| Python |
sf_base_att_str = 0x000
sf_base_att_agi = 0x001
sf_base_att_int = 0x002
sf_base_att_cha = 0x003
sf_effects_party = 0x010
sf_inactive = 0x100
skl_trade = 0
skl_leadership = 1
skl_prisoner_management = 2
skl_reserved_1 = 3
skl_reserved_2 = 4
skl_reserved_3 = 5
skl_reserved_4 = 6
skl_persuasion = 7
skl_engineer = 8
skl_first_aid = 9
skl_surgery = 10
skl_wound_treatment = 11
skl_inventory_management = 12
skl_spotting = 13
skl_pathfinding = 14
skl_tactics = 15
skl_tracking = 16
skl_trainer = 17
skl_reserved_5 = 18
skl_reserved_6 = 19
skl_reserved_7 = 20
skl_reserved_8 = 21
skl_looting = 22
skl_horse_archery = 23
skl_riding = 24
skl_athletics = 25
skl_shield = 26
skl_weapon_master = 27
skl_reserved_9 = 28
skl_reserved_10 = 29
skl_reserved_11 = 30
skl_reserved_12 = 31
skl_reserved_13 = 32
skl_power_draw = 33
skl_power_throw = 34
skl_power_strike = 35
skl_ironflesh = 36
skl_reserved_14 = 37
skl_reserved_15 = 38
skl_reserved_16 = 39
skl_reserved_17 = 40
skl_reserved_18 = 41
knows_trade_1 = 1
knows_trade_2 = 2
knows_trade_3 = 3
knows_trade_4 = 4
knows_trade_5 = 5
knows_trade_6 = 6
knows_trade_7 = 7
knows_trade_8 = 8
knows_trade_9 = 9
knows_trade_10 = 10
knows_leadership_1 = 16
knows_leadership_2 = 32
knows_leadership_3 = 48
knows_leadership_4 = 64
knows_leadership_5 = 80
knows_leadership_6 = 96
knows_leadership_7 = 112
knows_leadership_8 = 128
knows_leadership_9 = 144
knows_leadership_10 = 160
knows_prisoner_management_1 = 256
knows_prisoner_management_2 = 512
knows_prisoner_management_3 = 768
knows_prisoner_management_4 = 1024
knows_prisoner_management_5 = 1280
knows_prisoner_management_6 = 1536
knows_prisoner_management_7 = 1792
knows_prisoner_management_8 = 2048
knows_prisoner_management_9 = 2304
knows_prisoner_management_10 = 2560
knows_reserved_1_1 = 4096
knows_reserved_1_2 = 8192
knows_reserved_1_3 = 12288
knows_reserved_1_4 = 16384
knows_reserved_1_5 = 20480
knows_reserved_1_6 = 24576
knows_reserved_1_7 = 28672
knows_reserved_1_8 = 32768
knows_reserved_1_9 = 36864
knows_reserved_1_10 = 40960
knows_reserved_2_1 = 65536
knows_reserved_2_2 = 131072
knows_reserved_2_3 = 196608
knows_reserved_2_4 = 262144
knows_reserved_2_5 = 327680
knows_reserved_2_6 = 393216
knows_reserved_2_7 = 458752
knows_reserved_2_8 = 524288
knows_reserved_2_9 = 589824
knows_reserved_2_10 = 655360
knows_reserved_3_1 = 1048576
knows_reserved_3_2 = 2097152
knows_reserved_3_3 = 3145728
knows_reserved_3_4 = 4194304
knows_reserved_3_5 = 5242880
knows_reserved_3_6 = 6291456
knows_reserved_3_7 = 7340032
knows_reserved_3_8 = 8388608
knows_reserved_3_9 = 9437184
knows_reserved_3_10 = 10485760
knows_reserved_4_1 = 16777216
knows_reserved_4_2 = 33554432
knows_reserved_4_3 = 50331648
knows_reserved_4_4 = 67108864
knows_reserved_4_5 = 83886080
knows_reserved_4_6 = 100663296
knows_reserved_4_7 = 117440512
knows_reserved_4_8 = 134217728
knows_reserved_4_9 = 150994944
knows_reserved_4_10 = 167772160
knows_persuasion_1 = 268435456
knows_persuasion_2 = 536870912
knows_persuasion_3 = 805306368
knows_persuasion_4 = 1073741824
knows_persuasion_5 = 1342177280
knows_persuasion_6 = 1610612736
knows_persuasion_7 = 1879048192
knows_persuasion_8 = 2147483648
knows_persuasion_9 = 2415919104
knows_persuasion_10 = 2684354560
knows_engineer_1 = 4294967296
knows_engineer_2 = 8589934592
knows_engineer_3 = 12884901888
knows_engineer_4 = 17179869184
knows_engineer_5 = 21474836480
knows_engineer_6 = 25769803776
knows_engineer_7 = 30064771072
knows_engineer_8 = 34359738368
knows_engineer_9 = 38654705664
knows_engineer_10 = 42949672960
knows_first_aid_1 = 68719476736
knows_first_aid_2 = 137438953472
knows_first_aid_3 = 206158430208
knows_first_aid_4 = 274877906944
knows_first_aid_5 = 343597383680
knows_first_aid_6 = 412316860416
knows_first_aid_7 = 481036337152
knows_first_aid_8 = 549755813888
knows_first_aid_9 = 618475290624
knows_first_aid_10 = 687194767360
knows_surgery_1 = 1099511627776
knows_surgery_2 = 2199023255552
knows_surgery_3 = 3298534883328
knows_surgery_4 = 4398046511104
knows_surgery_5 = 5497558138880
knows_surgery_6 = 6597069766656
knows_surgery_7 = 7696581394432
knows_surgery_8 = 8796093022208
knows_surgery_9 = 9895604649984
knows_surgery_10 = 10995116277760
knows_wound_treatment_1 = 17592186044416
knows_wound_treatment_2 = 35184372088832
knows_wound_treatment_3 = 52776558133248
knows_wound_treatment_4 = 70368744177664
knows_wound_treatment_5 = 87960930222080
knows_wound_treatment_6 = 105553116266496
knows_wound_treatment_7 = 123145302310912
knows_wound_treatment_8 = 140737488355328
knows_wound_treatment_9 = 158329674399744
knows_wound_treatment_10 = 175921860444160
knows_inventory_management_1 = 281474976710656
knows_inventory_management_2 = 562949953421312
knows_inventory_management_3 = 844424930131968
knows_inventory_management_4 = 1125899906842624
knows_inventory_management_5 = 1407374883553280
knows_inventory_management_6 = 1688849860263936
knows_inventory_management_7 = 1970324836974592
knows_inventory_management_8 = 2251799813685248
knows_inventory_management_9 = 2533274790395904
knows_inventory_management_10 = 2814749767106560
knows_spotting_1 = 4503599627370496
knows_spotting_2 = 9007199254740992
knows_spotting_3 = 13510798882111488
knows_spotting_4 = 18014398509481984
knows_spotting_5 = 22517998136852480
knows_spotting_6 = 27021597764222976
knows_spotting_7 = 31525197391593472
knows_spotting_8 = 36028797018963968
knows_spotting_9 = 40532396646334464
knows_spotting_10 = 45035996273704960
knows_pathfinding_1 = 72057594037927936
knows_pathfinding_2 = 144115188075855872
knows_pathfinding_3 = 216172782113783808
knows_pathfinding_4 = 288230376151711744
knows_pathfinding_5 = 360287970189639680
knows_pathfinding_6 = 432345564227567616
knows_pathfinding_7 = 504403158265495552
knows_pathfinding_8 = 576460752303423488
knows_pathfinding_9 = 648518346341351424
knows_pathfinding_10 = 720575940379279360
knows_tactics_1 = 1152921504606846976
knows_tactics_2 = 2305843009213693952
knows_tactics_3 = 3458764513820540928
knows_tactics_4 = 4611686018427387904
knows_tactics_5 = 5764607523034234880
knows_tactics_6 = 6917529027641081856
knows_tactics_7 = 8070450532247928832
knows_tactics_8 = 9223372036854775808
knows_tactics_9 = 10376293541461622784
knows_tactics_10 = 11529215046068469760
knows_tracking_1 = 18446744073709551616
knows_tracking_2 = 36893488147419103232
knows_tracking_3 = 55340232221128654848
knows_tracking_4 = 73786976294838206464
knows_tracking_5 = 92233720368547758080
knows_tracking_6 = 110680464442257309696
knows_tracking_7 = 129127208515966861312
knows_tracking_8 = 147573952589676412928
knows_tracking_9 = 166020696663385964544
knows_tracking_10 = 184467440737095516160
knows_trainer_1 = 295147905179352825856
knows_trainer_2 = 590295810358705651712
knows_trainer_3 = 885443715538058477568
knows_trainer_4 = 1180591620717411303424
knows_trainer_5 = 1475739525896764129280
knows_trainer_6 = 1770887431076116955136
knows_trainer_7 = 2066035336255469780992
knows_trainer_8 = 2361183241434822606848
knows_trainer_9 = 2656331146614175432704
knows_trainer_10 = 2951479051793528258560
knows_reserved_5_1 = 4722366482869645213696
knows_reserved_5_2 = 9444732965739290427392
knows_reserved_5_3 = 14167099448608935641088
knows_reserved_5_4 = 18889465931478580854784
knows_reserved_5_5 = 23611832414348226068480
knows_reserved_5_6 = 28334198897217871282176
knows_reserved_5_7 = 33056565380087516495872
knows_reserved_5_8 = 37778931862957161709568
knows_reserved_5_9 = 42501298345826806923264
knows_reserved_5_10 = 47223664828696452136960
knows_reserved_6_1 = 75557863725914323419136
knows_reserved_6_2 = 151115727451828646838272
knows_reserved_6_3 = 226673591177742970257408
knows_reserved_6_4 = 302231454903657293676544
knows_reserved_6_5 = 377789318629571617095680
knows_reserved_6_6 = 453347182355485940514816
knows_reserved_6_7 = 528905046081400263933952
knows_reserved_6_8 = 604462909807314587353088
knows_reserved_6_9 = 680020773533228910772224
knows_reserved_6_10 = 755578637259143234191360
knows_reserved_7_1 = 1208925819614629174706176
knows_reserved_7_2 = 2417851639229258349412352
knows_reserved_7_3 = 3626777458843887524118528
knows_reserved_7_4 = 4835703278458516698824704
knows_reserved_7_5 = 6044629098073145873530880
knows_reserved_7_6 = 7253554917687775048237056
knows_reserved_7_7 = 8462480737302404222943232
knows_reserved_7_8 = 9671406556917033397649408
knows_reserved_7_9 = 10880332376531662572355584
knows_reserved_7_10 = 12089258196146291747061760
knows_reserved_8_1 = 19342813113834066795298816
knows_reserved_8_2 = 38685626227668133590597632
knows_reserved_8_3 = 58028439341502200385896448
knows_reserved_8_4 = 77371252455336267181195264
knows_reserved_8_5 = 96714065569170333976494080
knows_reserved_8_6 = 116056878683004400771792896
knows_reserved_8_7 = 135399691796838467567091712
knows_reserved_8_8 = 154742504910672534362390528
knows_reserved_8_9 = 174085318024506601157689344
knows_reserved_8_10 = 193428131138340667952988160
knows_looting_1 = 309485009821345068724781056
knows_looting_2 = 618970019642690137449562112
knows_looting_3 = 928455029464035206174343168
knows_looting_4 = 1237940039285380274899124224
knows_looting_5 = 1547425049106725343623905280
knows_looting_6 = 1856910058928070412348686336
knows_looting_7 = 2166395068749415481073467392
knows_looting_8 = 2475880078570760549798248448
knows_looting_9 = 2785365088392105618523029504
knows_looting_10 = 3094850098213450687247810560
knows_horse_archery_1 = 4951760157141521099596496896
knows_horse_archery_2 = 9903520314283042199192993792
knows_horse_archery_3 = 14855280471424563298789490688
knows_horse_archery_4 = 19807040628566084398385987584
knows_horse_archery_5 = 24758800785707605497982484480
knows_horse_archery_6 = 29710560942849126597578981376
knows_horse_archery_7 = 34662321099990647697175478272
knows_horse_archery_8 = 39614081257132168796771975168
knows_horse_archery_9 = 44565841414273689896368472064
knows_horse_archery_10 = 49517601571415210995964968960
knows_riding_1 = 79228162514264337593543950336
knows_riding_2 = 158456325028528675187087900672
knows_riding_3 = 237684487542793012780631851008
knows_riding_4 = 316912650057057350374175801344
knows_riding_5 = 396140812571321687967719751680
knows_riding_6 = 475368975085586025561263702016
knows_riding_7 = 554597137599850363154807652352
knows_riding_8 = 633825300114114700748351602688
knows_riding_9 = 713053462628379038341895553024
knows_riding_10 = 792281625142643375935439503360
knows_athletics_1 = 1267650600228229401496703205376
knows_athletics_2 = 2535301200456458802993406410752
knows_athletics_3 = 3802951800684688204490109616128
knows_athletics_4 = 5070602400912917605986812821504
knows_athletics_5 = 6338253001141147007483516026880
knows_athletics_6 = 7605903601369376408980219232256
knows_athletics_7 = 8873554201597605810476922437632
knows_athletics_8 = 10141204801825835211973625643008
knows_athletics_9 = 11408855402054064613470328848384
knows_athletics_10 = 12676506002282294014967032053760
knows_shield_1 = 20282409603651670423947251286016
knows_shield_2 = 40564819207303340847894502572032
knows_shield_3 = 60847228810955011271841753858048
knows_shield_4 = 81129638414606681695789005144064
knows_shield_5 = 101412048018258352119736256430080
knows_shield_6 = 121694457621910022543683507716096
knows_shield_7 = 141976867225561692967630759002112
knows_shield_8 = 162259276829213363391578010288128
knows_shield_9 = 182541686432865033815525261574144
knows_shield_10 = 202824096036516704239472512860160
knows_weapon_master_1 = 324518553658426726783156020576256
knows_weapon_master_2 = 649037107316853453566312041152512
knows_weapon_master_3 = 973555660975280180349468061728768
knows_weapon_master_4 = 1298074214633706907132624082305024
knows_weapon_master_5 = 1622592768292133633915780102881280
knows_weapon_master_6 = 1947111321950560360698936123457536
knows_weapon_master_7 = 2271629875608987087482092144033792
knows_weapon_master_8 = 2596148429267413814265248164610048
knows_weapon_master_9 = 2920666982925840541048404185186304
knows_weapon_master_10 = 3245185536584267267831560205762560
knows_reserved_9_1 = 5192296858534827628530496329220096
knows_reserved_9_2 = 10384593717069655257060992658440192
knows_reserved_9_3 = 15576890575604482885591488987660288
knows_reserved_9_4 = 20769187434139310514121985316880384
knows_reserved_9_5 = 25961484292674138142652481646100480
knows_reserved_9_6 = 31153781151208965771182977975320576
knows_reserved_9_7 = 36346078009743793399713474304540672
knows_reserved_9_8 = 41538374868278621028243970633760768
knows_reserved_9_9 = 46730671726813448656774466962980864
knows_reserved_9_10 = 51922968585348276285304963292200960
knows_reserved_10_1 = 83076749736557242056487941267521536
knows_reserved_10_2 = 166153499473114484112975882535043072
knows_reserved_10_3 = 249230249209671726169463823802564608
knows_reserved_10_4 = 332306998946228968225951765070086144
knows_reserved_10_5 = 415383748682786210282439706337607680
knows_reserved_10_6 = 498460498419343452338927647605129216
knows_reserved_10_7 = 581537248155900694395415588872650752
knows_reserved_10_8 = 664613997892457936451903530140172288
knows_reserved_10_9 = 747690747629015178508391471407693824
knows_reserved_10_10 = 830767497365572420564879412675215360
knows_reserved_11_1 = 1329227995784915872903807060280344576
knows_reserved_11_2 = 2658455991569831745807614120560689152
knows_reserved_11_3 = 3987683987354747618711421180841033728
knows_reserved_11_4 = 5316911983139663491615228241121378304
knows_reserved_11_5 = 6646139978924579364519035301401722880
knows_reserved_11_6 = 7975367974709495237422842361682067456
knows_reserved_11_7 = 9304595970494411110326649421962412032
knows_reserved_11_8 = 10633823966279326983230456482242756608
knows_reserved_11_9 = 11963051962064242856134263542523101184
knows_reserved_11_10 = 13292279957849158729038070602803445760
knows_reserved_12_1 = 21267647932558653966460912964485513216
knows_reserved_12_2 = 42535295865117307932921825928971026432
knows_reserved_12_3 = 63802943797675961899382738893456539648
knows_reserved_12_4 = 85070591730234615865843651857942052864
knows_reserved_12_5 = 106338239662793269832304564822427566080
knows_reserved_12_6 = 127605887595351923798765477786913079296
knows_reserved_12_7 = 148873535527910577765226390751398592512
knows_reserved_12_8 = 170141183460469231731687303715884105728
knows_reserved_12_9 = 191408831393027885698148216680369618944
knows_reserved_12_10 = 212676479325586539664609129644855132160
knows_reserved_13_1 = 340282366920938463463374607431768211456
knows_reserved_13_2 = 680564733841876926926749214863536422912
knows_reserved_13_3 = 1020847100762815390390123822295304634368
knows_reserved_13_4 = 1361129467683753853853498429727072845824
knows_reserved_13_5 = 1701411834604692317316873037158841057280
knows_reserved_13_6 = 2041694201525630780780247644590609268736
knows_reserved_13_7 = 2381976568446569244243622252022377480192
knows_reserved_13_8 = 2722258935367507707706996859454145691648
knows_reserved_13_9 = 3062541302288446171170371466885913903104
knows_reserved_13_10 = 3402823669209384634633746074317682114560
knows_power_draw_1 = 5444517870735015415413993718908291383296
knows_power_draw_2 = 10889035741470030830827987437816582766592
knows_power_draw_3 = 16333553612205046246241981156724874149888
knows_power_draw_4 = 21778071482940061661655974875633165533184
knows_power_draw_5 = 27222589353675077077069968594541456916480
knows_power_draw_6 = 32667107224410092492483962313449748299776
knows_power_draw_7 = 38111625095145107907897956032358039683072
knows_power_draw_8 = 43556142965880123323311949751266331066368
knows_power_draw_9 = 49000660836615138738725943470174622449664
knows_power_draw_10 = 54445178707350154154139937189082913832960
knows_power_throw_1 = 87112285931760246646623899502532662132736
knows_power_throw_2 = 174224571863520493293247799005065324265472
knows_power_throw_3 = 261336857795280739939871698507597986398208
knows_power_throw_4 = 348449143727040986586495598010130648530944
knows_power_throw_5 = 435561429658801233233119497512663310663680
knows_power_throw_6 = 522673715590561479879743397015195972796416
knows_power_throw_7 = 609786001522321726526367296517728634929152
knows_power_throw_8 = 696898287454081973172991196020261297061888
knows_power_throw_9 = 784010573385842219819615095522793959194624
knows_power_throw_10 = 871122859317602466466238995025326621327360
knows_power_strike_1 = 1393796574908163946345982392040522594123776
knows_power_strike_2 = 2787593149816327892691964784081045188247552
knows_power_strike_3 = 4181389724724491839037947176121567782371328
knows_power_strike_4 = 5575186299632655785383929568162090376495104
knows_power_strike_5 = 6968982874540819731729911960202612970618880
knows_power_strike_6 = 8362779449448983678075894352243135564742656
knows_power_strike_7 = 9756576024357147624421876744283658158866432
knows_power_strike_8 = 11150372599265311570767859136324180752990208
knows_power_strike_9 = 12544169174173475517113841528364703347113984
knows_power_strike_10 = 13937965749081639463459823920405225941237760
knows_ironflesh_1 = 22300745198530623141535718272648361505980416
knows_ironflesh_2 = 44601490397061246283071436545296723011960832
knows_ironflesh_3 = 66902235595591869424607154817945084517941248
knows_ironflesh_4 = 89202980794122492566142873090593446023921664
knows_ironflesh_5 = 111503725992653115707678591363241807529902080
knows_ironflesh_6 = 133804471191183738849214309635890169035882496
knows_ironflesh_7 = 156105216389714361990750027908538530541862912
knows_ironflesh_8 = 178405961588244985132285746181186892047843328
knows_ironflesh_9 = 200706706786775608273821464453835253553823744
knows_ironflesh_10 = 223007451985306231415357182726483615059804160
knows_reserved_14_1 = 356811923176489970264571492362373784095686656
knows_reserved_14_2 = 713623846352979940529142984724747568191373312
knows_reserved_14_3 = 1070435769529469910793714477087121352287059968
knows_reserved_14_4 = 1427247692705959881058285969449495136382746624
knows_reserved_14_5 = 1784059615882449851322857461811868920478433280
knows_reserved_14_6 = 2140871539058939821587428954174242704574119936
knows_reserved_14_7 = 2497683462235429791852000446536616488669806592
knows_reserved_14_8 = 2854495385411919762116571938898990272765493248
knows_reserved_14_9 = 3211307308588409732381143431261364056861179904
knows_reserved_14_10 = 3568119231764899702645714923623737840956866560
knows_reserved_15_1 = 5708990770823839524233143877797980545530986496
knows_reserved_15_2 = 11417981541647679048466287755595961091061972992
knows_reserved_15_3 = 17126972312471518572699431633393941636592959488
knows_reserved_15_4 = 22835963083295358096932575511191922182123945984
knows_reserved_15_5 = 28544953854119197621165719388989902727654932480
knows_reserved_15_6 = 34253944624943037145398863266787883273185918976
knows_reserved_15_7 = 39962935395766876669632007144585863818716905472
knows_reserved_15_8 = 45671926166590716193865151022383844364247891968
knows_reserved_15_9 = 51380916937414555718098294900181824909778878464
knows_reserved_15_10 = 57089907708238395242331438777979805455309864960
knows_reserved_16_1 = 91343852333181432387730302044767688728495783936
knows_reserved_16_2 = 182687704666362864775460604089535377456991567872
knows_reserved_16_3 = 274031556999544297163190906134303066185487351808
knows_reserved_16_4 = 365375409332725729550921208179070754913983135744
knows_reserved_16_5 = 456719261665907161938651510223838443642478919680
knows_reserved_16_6 = 548063113999088594326381812268606132370974703616
knows_reserved_16_7 = 639406966332270026714112114313373821099470487552
knows_reserved_16_8 = 730750818665451459101842416358141509827966271488
knows_reserved_16_9 = 822094670998632891489572718402909198556462055424
knows_reserved_16_10 = 913438523331814323877303020447676887284957839360
knows_reserved_17_1 = 1461501637330902918203684832716283019655932542976
knows_reserved_17_2 = 2923003274661805836407369665432566039311865085952
knows_reserved_17_3 = 4384504911992708754611054498148849058967797628928
knows_reserved_17_4 = 5846006549323611672814739330865132078623730171904
knows_reserved_17_5 = 7307508186654514591018424163581415098279662714880
knows_reserved_17_6 = 8769009823985417509222108996297698117935595257856
knows_reserved_17_7 = 10230511461316320427425793829013981137591527800832
knows_reserved_17_8 = 11692013098647223345629478661730264157247460343808
knows_reserved_17_9 = 13153514735978126263833163494446547176903392886784
knows_reserved_17_10 = 14615016373309029182036848327162830196559325429760
knows_reserved_18_1 = 23384026197294446691258957323460528314494920687616
knows_reserved_18_2 = 46768052394588893382517914646921056628989841375232
knows_reserved_18_3 = 70152078591883340073776871970381584943484762062848
knows_reserved_18_4 = 93536104789177786765035829293842113257979682750464
knows_reserved_18_5 = 116920130986472233456294786617302641572474603438080
knows_reserved_18_6 = 140304157183766680147553743940763169886969524125696
knows_reserved_18_7 = 163688183381061126838812701264223698201464444813312
knows_reserved_18_8 = 187072209578355573530071658587684226515959365500928
knows_reserved_18_9 = 210456235775650020221330615911144754830454286188544
knows_reserved_18_10 = 233840261972944466912589573234605283144949206876160
num_skill_words = 6
| Python |
import string
from module_info import *
from module_quests import *
from process_common import *
def save_quests():
ofile = open(export_dir + "quests.txt","w")
ofile.write("questsfile version 1\n")
ofile.write("%d\n"%(len(quests)))
for i_quest in xrange(len(quests)):
quest = quests[i_quest]
ofile.write("qst_%s %s %d "%(quest[0],(string.replace(quest[1]," ","_")),quest[2]))
ofile.write("%s "%(string.replace(quest[3]," ","_")))
ofile.write("\n")
ofile.close()
def save_python_header():
ofile = open("./ID_quests.py","w")
for i_quest in xrange(len(quests)):
ofile.write("qst_%s = %d\n"%(quests[i_quest][0],i_quest))
for i_quest in xrange(len(quests)):
ofile.write("qsttag_%s = %d\n"%(quests[i_quest][0],opmask_quest_index|i_quest))
ofile.write("\n\n")
ofile.close()
print "Exporting quest data..."
save_quests()
save_python_header()
| Python |
from module_info import *
from module_scenes import *
from process_common import *
def save_python_header():
ofile = open("./ID_scenes.py","w")
for i_scene in xrange(len(scenes)):
ofile.write("scn_%s = %d\n"%(convert_to_identifier(scenes[i_scene][0]),i_scene))
ofile.close()
print "Exporting scene data..."
save_python_header()
from process_operations import *
from module_troops import *
scene_name_pos = 0
passages_pos = 8
scene_outer_terrain_pos = 10
def write_vec(ofile,vec):
ofile.write(" %f %f %f "%vec)
def write_passage(ofile,scenes,passage):
scene_no = 0
found = 0
while (not found) and (scene_no < len(scenes)):
if (scenes[scene_no][0] == passage):
found = 1
else:
scene_no += 1
if (passage == "exit"):
scene_no = 100000
elif (passage == ""):
scene_no = 0
elif not found:
print "Error passage not found:"
print passage
do_error()
ofile.write(" %d "%scene_no)
def save_scenes(variables,variable_uses,tag_uses):
ofile = open(export_dir + "scenes.txt","w")
ofile.write("scenesfile version 1\n")
ofile.write(" %d\n"%len(scenes))
for scene in scenes:
ofile.write("scn_%s %s %d %s %s %f %f %f %f %f %s "%(convert_to_identifier(scene[0]),replace_spaces(scene[0]),scene[1], scene[2],scene[3],scene[4][0],scene[4][1],scene[5][0],scene[5][1],scene[6],scene[7]))
passages = scene[passages_pos]
ofile.write("\n %d "%len(passages))
for passage in passages:
write_passage(ofile,scenes,passage)
chest_troops = scene[9]
ofile.write("\n %d "%len(chest_troops))
for chest_troop in chest_troops:
troop_no = find_troop(troops,chest_troop)
if (troop_no < 0):
print "Error unable to find chest-troop: " + chest_troop
troop_no = 0
else:
add_tag_use(tag_uses,tag_troop,troop_no)
ofile.write(" %d "%troop_no)
ofile.write("\n")
if (len(scene) > scene_outer_terrain_pos):
ofile.write(" %s "%scene[scene_outer_terrain_pos])
else:
ofile.write(" 0 ")
ofile.write("\n")
ofile.close()
variable_uses = []
variables = load_variables(export_dir, variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_scenes(variables,variable_uses,tag_uses)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir,tag_uses)
save_quick_strings(export_dir,quick_strings)
| Python |
# -*- coding: cp1252 -*-
from header_common import *
from header_scene_props import *
from header_operations import *
from header_triggers import *
from header_sounds import *
from module_constants import *
import string
####################################################################################################################
# Each scene prop record contains the following fields:
# 1) Scene prop id: used for referencing scene props in other files. The prefix spr_ is automatically added before each scene prop id.
# 2) Scene prop flags. See header_scene_props.py for a list of available flags
# 3) Mesh name: Name of the mesh.
# 4) Physics object name:
# 5) Triggers: Simple triggers that are associated with the scene prop
####################################################################################################################
check_item_use_trigger = (ti_on_scene_prop_use,
[
(store_trigger_param_1, ":agent_id"),
(store_trigger_param_2, ":instance_id"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_use_item", ":instance_id", ":agent_id"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
(try_end),
])
check_sally_door_use_trigger_double = (ti_on_scene_prop_use,
[
(store_trigger_param_1, ":agent_id"),
(store_trigger_param_2, ":instance_id"),
(agent_get_position, pos1, ":agent_id"),
(prop_instance_get_starting_position, pos2, ":instance_id"),
(scene_prop_get_slot, ":opened_or_closed", ":instance_id", scene_prop_open_or_close_slot),
(try_begin),
#out doors like castle sally door can be opened only from inside, if door coordinate is behind your coordinate. Also it can be closed from both sides.
(prop_instance_get_scene_prop_kind, ":scene_prop_id", ":instance_id"),
(assign, ":can_open_door", 0),
(try_begin),
(neg|eq, ":scene_prop_id", "spr_viking_keep_destroy_sally_door_right"),
(neg|eq, ":scene_prop_id", "spr_viking_keep_destroy_sally_door_left"),
(neg|eq, ":scene_prop_id", "spr_earth_sally_gate_right"),
(neg|eq, ":scene_prop_id", "spr_earth_sally_gate_left"),
(position_is_behind_position, pos1, pos2),
(assign, ":can_open_door", 1),
(else_try),
(this_or_next|eq, ":scene_prop_id", "spr_viking_keep_destroy_sally_door_right"),
(this_or_next|eq, ":scene_prop_id", "spr_viking_keep_destroy_sally_door_left"),
(this_or_next|eq, ":scene_prop_id", "spr_earth_sally_gate_right"),
(eq, ":scene_prop_id", "spr_earth_sally_gate_left"),
(neg|position_is_behind_position, pos1, pos2),
(assign, ":can_open_door", 1),
(try_end),
(this_or_next|eq, ":can_open_door", 1),
(eq, ":opened_or_closed", 1),
(try_begin),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_use_item", ":instance_id", ":agent_id"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
(try_end),
(try_end),
(try_end),
])
check_sally_door_use_trigger = (ti_on_scene_prop_use,
[
(store_trigger_param_1, ":agent_id"),
(store_trigger_param_2, ":instance_id"),
(agent_get_position, pos1, ":agent_id"),
(prop_instance_get_starting_position, pos2, ":instance_id"),
(scene_prop_get_slot, ":opened_or_closed", ":instance_id", scene_prop_open_or_close_slot),
(try_begin),
#out doors like castle sally door can be opened only from inside, if door coordinate is behind your coordinate. Also it can be closed from both sides.
(this_or_next|position_is_behind_position, pos1, pos2),
(eq, ":opened_or_closed", 1),
(try_begin),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_use_item", ":instance_id", ":agent_id"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
(try_end),
(try_end),
(try_end),
])
check_castle_door_use_trigger = (ti_on_scene_prop_use,
[
(store_trigger_param_1, ":agent_id"),
(store_trigger_param_2, ":instance_id"),
(agent_get_position, pos1, ":agent_id"),
(prop_instance_get_starting_position, pos2, ":instance_id"),
(scene_prop_get_slot, ":opened_or_closed", ":instance_id", scene_prop_open_or_close_slot),
(try_begin),
(ge, ":agent_id", 0),
(agent_get_team, ":agent_team", ":agent_id"),
#in doors like castle room doors can be opened from both sides, but only defenders can open these doors. Also it can be closed from both sides.
(this_or_next|eq, ":agent_team", 0),
(eq, ":opened_or_closed", 1),
(try_begin),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_use_item", ":instance_id", ":agent_id"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
(try_end),
(try_end),
(try_end),
])
check_ladder_animate_trigger = (ti_on_scene_prop_is_animating,
[
(store_trigger_param_1, ":instance_id"),
(store_trigger_param_2, ":remaining_time"),
(call_script, "script_check_creating_ladder_dust_effect", ":instance_id", ":remaining_time"),
])
check_ladder_animation_finish_trigger = (ti_on_scene_prop_animation_finished,
[
(store_trigger_param_1, ":instance_id"),
(prop_instance_enable_physics, ":instance_id", 1),
])
scene_props = [
("invalid_object",0,"question_mark","0", []),
("inventory",sokf_type_container|sokf_place_at_origin,"package","bobaggage", []),
("empty", 0, "0", "0", []),
("chest_a",sokf_type_container,"chest_gothic","bochest_gothic", []),
("container_small_chest",sokf_type_container,"package","bobaggage", []),
("container_chest_b",sokf_type_container,"chest_b","bo_chest_b", []),
("container_chest_c",sokf_type_container,"chest_c","bo_chest_c", []),
("player_chest",sokf_type_container,"player_chest","bo_player_chest", []),
("locked_player_chest",0,"player_chest","bo_player_chest", []),
("light_sun",sokf_invisible,"light_sphere","0", [
(ti_on_init_scene_prop,
[
(neg|is_currently_night),
(store_trigger_param_1, ":prop_instance_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_scale, pos5, ":prop_instance_no"),
(position_get_scale_x, ":scale", pos5),
(store_time_of_day,reg(12)),
(try_begin),
(is_between,reg(12),5,20),
(store_mul, ":red", 5 * 200, ":scale"),
(store_mul, ":green", 5 * 193, ":scale"),
(store_mul, ":blue", 5 * 180, ":scale"),
(else_try),
(store_mul, ":red", 5 * 90, ":scale"),
(store_mul, ":green", 5 * 115, ":scale"),
(store_mul, ":blue", 5 * 150, ":scale"),
(try_end),
(val_div, ":red", 100),
(val_div, ":green", 100),
(val_div, ":blue", 100),
(set_current_color,":red", ":green", ":blue"),
(set_position_delta,0,0,0),
(add_point_light_to_entity, 0, 0),
]),
]),
("light",sokf_invisible,"light_sphere","0", [
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":prop_instance_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_scale, pos5, ":prop_instance_no"),
(position_get_scale_x, ":scale", pos5),
(store_mul, ":red", 3 * 200, ":scale"),
(store_mul, ":green", 3 * 145, ":scale"),
(store_mul, ":blue", 3 * 45, ":scale"),
(val_div, ":red", 100),
(val_div, ":green", 100),
(val_div, ":blue", 100),
(set_current_color,":red", ":green", ":blue"),
(set_position_delta,0,0,0),
(add_point_light_to_entity, 10, 30),
]),
]),
("light_red",sokf_invisible,"light_sphere","0", [
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":prop_instance_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_scale, pos5, ":prop_instance_no"),
(position_get_scale_x, ":scale", pos5),
(store_mul, ":red", 2 * 170, ":scale"),
(store_mul, ":green", 2 * 100, ":scale"),
(store_mul, ":blue", 2 * 30, ":scale"),
(val_div, ":red", 100),
(val_div, ":green", 100),
(val_div, ":blue", 100),
(set_current_color,":red", ":green", ":blue"),
(set_position_delta,0,0,0),
(add_point_light_to_entity, 20, 30),
]),
]),
("light_night",sokf_invisible,"light_sphere","0", [
(ti_on_init_scene_prop,
[
# (store_time_of_day,reg(12)),
# (neg|is_between,reg(12),5,20),
(is_currently_night, 0),
(store_trigger_param_1, ":prop_instance_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_scale, pos5, ":prop_instance_no"),
(position_get_scale_x, ":scale", pos5),
(store_mul, ":red", 3 * 160, ":scale"),
(store_mul, ":green", 3 * 145, ":scale"),
(store_mul, ":blue", 3 * 100, ":scale"),
(val_div, ":red", 100),
(val_div, ":green", 100),
(val_div, ":blue", 100),
(set_current_color,":red", ":green", ":blue"),
(set_position_delta,0,0,0),
(add_point_light_to_entity, 10, 30),
]),
]),
("torch",0,"torch_a","0",
[
(ti_on_init_scene_prop,
[
(set_position_delta,0,-35,48),
(particle_system_add_new, "psys_torch_fire"),
(particle_system_add_new, "psys_torch_smoke"),
(particle_system_add_new, "psys_torch_fire_sparks"),
(play_sound, "snd_torch_loop", 0),
(set_position_delta,0,-35,56),
(particle_system_add_new, "psys_fire_glow_1"),
# (particle_system_emit, "psys_fire_glow_1",9000000),
#second method
(get_trigger_object_position, pos2),
(set_position_delta,0,0,0),
(position_move_y, pos2, -35),
(position_move_z, pos2, 55),
(particle_system_burst, "psys_fire_glow_fixed", pos2, 1),
]),
]),
("torch_night",0,"torch_a","0",
[
(ti_on_init_scene_prop,
[
# (store_time_of_day,reg(12)),
# (neg|is_between,reg(12),5,20),
(is_currently_night, 0),
(set_position_delta,0,-35,48),
(particle_system_add_new, "psys_torch_fire"),
(particle_system_add_new, "psys_torch_smoke"),
(particle_system_add_new, "psys_torch_fire_sparks"),
(set_position_delta,0,-35,56),
(particle_system_add_new, "psys_fire_glow_1"),
(particle_system_emit, "psys_fire_glow_1",9000000),
(play_sound, "snd_torch_loop", 0),
]),
]),
# ("Baggage",sokf_place_at_origin|sokf_entity_body,"package","bobaggage"),
("barrier_20m",sokf_invisible|sokf_type_barrier,"barrier_20m","bo_barrier_20m", []),
("barrier_16m",sokf_invisible|sokf_type_barrier,"barrier_16m","bo_barrier_16m", []),
("barrier_8m" ,sokf_invisible|sokf_type_barrier,"barrier_8m" ,"bo_barrier_8m" , []),
("barrier_4m" ,sokf_invisible|sokf_type_barrier,"barrier_4m" ,"bo_barrier_4m" , []),
("barrier_2m" ,sokf_invisible|sokf_type_barrier,"barrier_2m" ,"bo_barrier_2m" , []),
("exit_4m" ,sokf_invisible|sokf_type_barrier_leave,"barrier_4m" ,"bo_barrier_4m" , []),
("exit_8m" ,sokf_invisible|sokf_type_barrier_leave,"barrier_8m" ,"bo_barrier_8m" , []),
("exit_16m" ,sokf_invisible|sokf_type_barrier_leave,"barrier_16m" ,"bo_barrier_16m" , []),
("ai_limiter_2m" ,sokf_invisible|sokf_type_ai_limiter,"barrier_2m" ,"bo_barrier_2m" , []),
("ai_limiter_4m" ,sokf_invisible|sokf_type_ai_limiter,"barrier_4m" ,"bo_barrier_4m" , []),
("ai_limiter_8m" ,sokf_invisible|sokf_type_ai_limiter,"barrier_8m" ,"bo_barrier_8m" , []),
("ai_limiter_16m",sokf_invisible|sokf_type_ai_limiter,"barrier_16m","bo_barrier_16m", []),
("Shield",sokf_dynamic,"0","boshield", []),
("shelves",0,"shelves","boshelves", []),
("table_tavern",0,"table_tavern","botable_tavern", []),
("table_castle_a",0,"table_castle_a","bo_table_castle_a", []),
("chair_castle_a",0,"chair_castle_a","bo_chair_castle_a", []),
("pillow_a",0,"pillow_a","bo_pillow", []),
("pillow_b",0,"pillow_b","bo_pillow", []),
("pillow_c",0,"pillow_c","0", []),
("interior_castle_g_square_keep_b",0,"interior_castle_g_square_keep_b","bo_interior_castle_g_square_keep_b", []),
("carpet_with_pillows_a",0,"carpet_with_pillows_a","bo_carpet_with_pillows", []),
("carpet_with_pillows_b",0,"carpet_with_pillows_b","bo_carpet_with_pillows", []),
("table_round_a",0,"table_round_a","bo_table_round_a", []),
("table_round_b",0,"table_round_b","bo_table_round_b", []),
("fireplace_b",0,"fireplace_b","bo_fireplace_b", []),
("fireplace_c",0,"fireplace_c","bo_fireplace_c", []),
("sofa_a",0,"sofa_a","bo_sofa", []),
("sofa_b",0,"sofa_b","bo_sofa", []),
("ewer_a",0,"ewer_a","bo_ewer_a", []),
("end_table_a",0,"end_table_a","bo_end_table_a", []),
("fake_houses_steppe_a",0,"fake_houses_steppe_a","0", []),
("fake_houses_steppe_b",0,"fake_houses_steppe_b","0", []),
("fake_houses_steppe_c",0,"fake_houses_steppe_c","0", []),
("boat_destroy",0,"boat_destroy","bo_boat_destroy", []),
("destroy_house_a",0,"destroy_house_a","bo_destroy_house_a", []),
("destroy_house_b",0,"destroy_house_b","bo_destroy_house_b", []),
("destroy_house_c",0,"destroy_house_c","bo_destroy_house_c", []),
("destroy_heap",0,"destroy_heap","bo_destroy_heap", []),
("destroy_castle_a",0,"destroy_castle_a","bo_destroy_castle_a", []),
("destroy_castle_b",0,"destroy_castle_b","bo_destroy_castle_b", []),
("destroy_castle_c",0,"destroy_castle_c","bo_destroy_castle_c", []),
("destroy_castle_d",0,"destroy_castle_d","bo_destroy_castle_d", []),
("destroy_windmill",0,"destroy_windmill","bo_destroy_windmill", []),
("destroy_tree_a",0,"destroy_tree_a","bo_destroy_tree_a", []),
("destroy_tree_b",0,"destroy_tree_b","bo_destroy_tree_b", []),
("destroy_bridge_a",0,"destroy_bridge_a","bo_destroy_bridge_a", []),
("destroy_bridge_b",0,"destroy_bridge_b","bo_destroy_bridge_b", []),
("catapult",0,"Catapult","bo_Catapult", []),
("catapult_destructible",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible,"Catapult","bo_Catapult", [
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 1600),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(prop_instance_get_position, pos1, ":instance_no"),
(particle_system_burst, "psys_dummy_smoke_big", pos1, 100),
(particle_system_burst, "psys_dummy_straw_big", pos1, 100),
(position_move_z, pos1, -500),
(position_rotate_x, pos1, 90),
(prop_instance_animate_to_position, ":instance_no", pos1, 300), #animate to 6 meters below in 6 second
(try_begin),
(eq, "$g_round_ended", 0),
(scene_prop_get_team, ":scene_prop_team_no", ":instance_no"),
(try_begin),
(eq, ":scene_prop_team_no", 0),
(assign, ":scene_prop_team_no_multiplier", -1),
(else_try),
(assign, ":scene_prop_team_no_multiplier", 1),
(try_end),
(try_begin),
(eq, "$g_number_of_targets_destroyed", 0),
(store_mul, ":target_no_mul_scene_prop_team", ":scene_prop_team_no_multiplier", 1), #1 means destroyed object is a catapult
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_target_destroyed, ":target_no_mul_scene_prop_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"),
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_target_destroyed, ":target_no_mul_scene_prop_team"),
(try_end),
(val_add, "$g_number_of_targets_destroyed", 1),
(else_try),
(store_mul, ":target_no_mul_scene_prop_team", ":scene_prop_team_no_multiplier", 9), #9 means attackers destroyed all targets
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_target_destroyed, ":target_no_mul_scene_prop_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"),
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_target_destroyed, ":target_no_mul_scene_prop_team"),
(try_end),
(val_add, "$g_number_of_targets_destroyed", 1),
(try_end),
(try_end),
#giving gold for destroying target (for catapult)
#step-1 calculating total damage given to that scene prop
(assign, ":total_damage_given", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(try_begin),
(eq, "spr_catapult_destructible", "$g_destructible_target_1"),
(player_get_slot, ":damage_given", ":player_no", slot_player_damage_given_to_target_1),
(else_try),
(player_get_slot, ":damage_given", ":player_no", slot_player_damage_given_to_target_2),
(try_end),
(val_add, ":total_damage_given", ":damage_given"),
(try_end),
#step-2 sharing 1000 gold (if num active players < 20 then 50 * num active players) to players which gave damage with the damage amounts.
(assign, ":destroy_money_addition", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(val_add, ":destroy_money_addition", 50),
(try_end),
(try_begin),
(ge, ":destroy_money_addition", multi_destroy_target_money_add),
(assign, ":destroy_money_addition", multi_destroy_target_money_add),
(try_end),
(val_mul, ":destroy_money_addition", "$g_multiplayer_battle_earnings_multiplier"),
(val_div, ":destroy_money_addition", 100),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(try_begin),
(eq, "spr_catapult_destructible", "$g_destructible_target_1"),
(player_get_slot, ":damage_given", ":player_no", slot_player_damage_given_to_target_1),
(else_try),
(player_get_slot, ":damage_given", ":player_no", slot_player_damage_given_to_target_2),
(try_end),
(player_get_gold, ":player_gold", ":player_no"), #give money to player which helped flag to be owned by new_flag_owner team
(val_mul, ":damage_given", ":destroy_money_addition"),
(try_begin),
(ge, ":total_damage_given", ":damage_given"),
(gt, ":damage_given", 0),
(store_div, ":gold_earned", ":damage_given", ":total_damage_given"),
(else_try),
(assign, ":gold_earned", 0),
(try_end),
(val_add, ":player_gold", ":gold_earned"),
(player_set_gold, ":player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(try_end),
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(set_fixed_point_multiplier, 1),
(position_get_x, ":attacker_agent_id", pos2),
(try_begin),
(ge, ":attacker_agent_id", 0),
(agent_is_alive, ":attacker_agent_id"),
(agent_is_human, ":attacker_agent_id"),
(neg|agent_is_non_player, ":attacker_agent_id"),
(agent_get_player_id, ":attacker_player_id", ":attacker_agent_id"),
(ge, ":attacker_player_id", 0),
(player_is_active, ":attacker_player_id"),
(try_begin),
(eq, "spr_catapult_destructible", "$g_destructible_target_1"),
(player_get_slot, ":damage_given", ":attacker_player_id", slot_player_damage_given_to_target_1),
(val_add, ":damage_given", ":damage"),
(player_set_slot, ":attacker_player_id", slot_player_damage_given_to_target_1, ":damage_given"),
(else_try),
(player_get_slot, ":damage_given", ":attacker_player_id", slot_player_damage_given_to_target_2),
(val_add, ":damage_given", ":damage"),
(player_set_slot, ":attacker_player_id", slot_player_damage_given_to_target_2, ":damage_given"),
(try_end),
(try_end),
(try_end),
]),
]),
("broom",0,"broom","0", []),
("garlic",0,"garlic","0", []),
("garlic_b",0,"garlic_b","0", []),
("destroy_a",0,"destroy_a","0", []),
("destroy_b",0,"destroy_b","0", []),
("bridge_wooden",0,"bridge_wooden","bo_bridge_wooden", []),
("bridge_wooden_snowy",0,"bridge_wooden_snowy","bo_bridge_wooden", []),
("grave_a",0,"grave_a","bo_grave_a", []),
("village_house_e",0,"village_house_e","bo_village_house_e", []),
("village_house_f",0,"village_house_f","bo_village_house_f", []),
("village_house_g",0,"village_house_g","bo_village_house_g", []),
("village_house_h",0,"village_house_h","bo_village_house_h", []),
("village_house_i",0,"village_house_i","bo_village_house_i", []),
("village_house_j",0,"village_house_j","bo_village_house_j", []),
("village_wall_a",0,"village_wall_a","bo_village_wall_a", []),
("village_wall_b",0,"village_wall_b","bo_village_wall_b", []),
("village_snowy_house_a",0,"village_snowy_house_a","bo_village_snowy_house_a", []),
("village_snowy_house_b",0,"village_snowy_house_b","bo_village_snowy_house_b", []),
("village_snowy_house_c",0,"village_snowy_house_c","bo_village_snowy_house_c", []),
("village_snowy_house_d",0,"village_snowy_house_d","bo_village_snowy_house_d", []),
("village_snowy_house_e",0,"village_snowy_house_e","bo_village_snowy_house_e", []),
("village_snowy_house_f",0,"village_snowy_house_f","bo_village_snowy_house_f", []),
("town_house_steppe_a",0,"town_house_steppe_a","bo_town_house_steppe_a", []),
("town_house_steppe_b",0,"town_house_steppe_b","bo_town_house_steppe_b", []),
("town_house_steppe_c",0,"town_house_steppe_c","bo_town_house_steppe_c", []),
("town_house_steppe_d",0,"town_house_steppe_d","bo_town_house_steppe_d", []),
("town_house_steppe_e",0,"town_house_steppe_e","bo_town_house_steppe_e", []),
("town_house_steppe_f",0,"town_house_steppe_f","bo_town_house_steppe_f", []),
("town_house_steppe_g",0,"town_house_steppe_g","bo_town_house_steppe_g", []),
("town_house_steppe_h",0,"town_house_steppe_h","bo_town_house_steppe_h", []),
("town_house_steppe_i",0,"town_house_steppe_i","bo_town_house_steppe_i", []),
("carpet_a",0,"carpet_a","0", []),
("carpet_b",0,"carpet_b","0", []),
("carpet_c",0,"carpet_c","0", []),
("carpet_d",0,"carpet_d","0", []),
("carpet_e",0,"carpet_e","0", []),
("carpet_f",0,"carpet_f","0", []),
("awning_a",0,"awning_a","bo_awning", []),
("awning_b",0,"awning_b","bo_awning", []),
("awning_c",0,"awning_c","bo_awning", []),
("awning_long",0,"awning_long","bo_awning_long", []),
("awning_long_b",0,"awning_long_b","bo_awning_long", []),
("awning_d",0,"awning_d","bo_awning_d", []),
("ship",0,"ship","bo_ship", []),
("ship_b",0,"ship_b","bo_ship_b", []),
("ship_c",0,"ship_c","bo_ship_c", []),
("ship_d",0,"ship_d","bo_ship_d", []),
("snowy_barrel_a",0,"snowy_barrel_a","bo_snowy_barrel_a", []),
("snowy_fence",0,"snowy_fence","bo_snowy_fence", []),
("snowy_wood_heap",0,"snowy_wood_heap","bo_snowy_wood_heap", []),
("village_snowy_stable_a",0,"village_snowy_stable_a","bo_village_snowy_stable_a", []),
("village_straw_house_a",0,"village_straw_house_a","bo_village_straw_house_a", []),
("village_stable_a",0,"village_stable_a","bo_village_stable_a", []),
("village_shed_a",0,"village_shed_a","bo_village_shed_a", []),
("village_shed_b",0,"village_shed_b","bo_village_shed_b", []),
("dungeon_door_cell_a",0,"dungeon_door_cell_a","bo_dungeon_door_cell_a", []),
("dungeon_door_cell_b",0,"dungeon_door_cell_b","bo_dungeon_door_cell_b", []),
("dungeon_door_entry_a",0,"dungeon_door_entry_a","bo_dungeon_door_entry_a", []),
("dungeon_door_entry_b",0,"dungeon_door_entry_b","bo_dungeon_door_entry_a", []),
("dungeon_door_entry_c",0,"dungeon_door_entry_c","bo_dungeon_door_entry_a", []),
("dungeon_door_direction_a",0,"dungeon_door_direction_a","bo_dungeon_door_direction_a", []),
("dungeon_door_direction_b",0,"dungeon_door_direction_b","bo_dungeon_door_direction_a", []),
("dungeon_door_stairs_a",0,"dungeon_door_stairs_a","bo_dungeon_door_stairs_a", []),
("dungeon_door_stairs_b",0,"dungeon_door_stairs_b","bo_dungeon_door_stairs_a", []),
("dungeon_bed_a",0,"dungeon_bed_a","0", []),
("dungeon_bed_b",0,"dungeon_bed_b","bo_dungeon_bed_b", []),
("torture_tool_a",0,"torture_tool_a","bo_torture_tool_a", []),
("torture_tool_b",0,"torture_tool_b","0", []),
("torture_tool_c",0,"torture_tool_c","bo_torture_tool_c", []),
("skeleton_head",0,"skeleton_head","0", []),
("skeleton_bone",0,"skeleton_bone","0", []),
("skeleton_a",0,"skeleton_a","bo_skeleton_a", []),
("dungeon_stairs_a",sokf_type_ladder,"dungeon_stairs_a","bo_dungeon_stairs_a", []),
("dungeon_stairs_b",sokf_type_ladder,"dungeon_stairs_b","bo_dungeon_stairs_a", []),
("dungeon_torture_room_a",0,"dungeon_torture_room_a","bo_dungeon_torture_room_a", []),
("dungeon_entry_a",0,"dungeon_entry_a","bo_dungeon_entry_a", []),
("dungeon_entry_b",0,"dungeon_entry_b","bo_dungeon_entry_b", []),
("dungeon_entry_c",0,"dungeon_entry_c","bo_dungeon_entry_c", []),
("dungeon_cell_a",0,"dungeon_cell_a","bo_dungeon_cell_a", []),
("dungeon_cell_b",0,"dungeon_cell_b","bo_dungeon_cell_b", []),
("dungeon_cell_c",0,"dungeon_cell_c","bo_dungeon_cell_c", []),
("dungeon_corridor_a",0,"dungeon_corridor_a","bo_dungeon_corridor_a", []),
("dungeon_corridor_b",0,"dungeon_corridor_b","bo_dungeon_corridor_b", []),
("dungeon_corridor_c",0,"dungeon_corridor_c","bo_dungeon_corridor_b", []),
("dungeon_corridor_d",0,"dungeon_corridor_d","bo_dungeon_corridor_b", []),
("dungeon_direction_a",0,"dungeon_direction_a","bo_dungeon_direction_a", []),
("dungeon_direction_b",0,"dungeon_direction_b","bo_dungeon_direction_a", []),
("dungeon_room_a",0,"dungeon_room_a","bo_dungeon_room_a", []),
("dungeon_tower_stairs_a",sokf_type_ladder,"dungeon_tower_stairs_a","bo_dungeon_tower_stairs_a", []),
("dungeon_tower_cell_a",0,"dungeon_tower_cell_a","bo_dungeon_tower_cell_a", []),
("tunnel_a",0,"tunnel_a","bo_tunnel_a", []),
("tunnel_salt",0,"tunnel_salt","bo_tunnel_salt", []),
("salt_a",0,"salt_a","bo_salt_a", []),
("door_destructible",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible|spr_use_time(2),"tutorial_door_a","bo_tutorial_door_a", [
check_item_use_trigger,
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 2000),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(play_sound, "snd_dummy_hit"),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
]),
]),
("tutorial_door_a",sokf_moveable,"tutorial_door_a","bo_tutorial_door_a", []),
("tutorial_door_b",sokf_moveable,"tutorial_door_b","bo_tutorial_door_b", []),
("tutorial_flag_yellow",sokf_moveable|sokf_face_player,"tutorial_flag_yellow","0", []),
("tutorial_flag_red",sokf_moveable|sokf_face_player,"tutorial_flag_red","0", []),
("tutorial_flag_blue",sokf_moveable|sokf_face_player,"tutorial_flag_blue","0", []),
("interior_prison_a",0,"interior_prison_a","bo_interior_prison_a", []),
("interior_prison_b",0,"interior_prison_b","bo_interior_prison_b", []),
("interior_prison_cell_a",0,"interior_prison_cell_a","bo_interior_prison_cell_a", []),
("interior_prison_d",0,"interior_prison_d","bo_interior_prison_d", []),
("arena_archery_target_a",0,"arena_archery_target_a","bo_arena_archery_target_a", []),
("archery_butt_a",0,"archery_butt","bo_archery_butt", [
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(prop_instance_get_position, pos2, ":instance_no"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos3, ":player_agent"),
(get_distance_between_positions, ":player_distance", pos3, pos2),
(position_transform_position_to_local, pos4, pos2, pos1),
(position_set_y, pos4, 0),
(position_set_x, pos2, 0),
(position_set_y, pos2, 0),
(position_set_z, pos2, 0),
(get_distance_between_positions, ":target_distance", pos4, pos2),
(assign, ":point_earned", 43), #Calculating a point between 0-12
(val_sub, ":point_earned", ":target_distance"),
(val_mul, ":point_earned", 1299),
(val_div, ":point_earned", 4300),
(try_begin),
(lt, ":point_earned", 0),
(assign, ":point_earned", 0),
(try_end),
(val_div, ":player_distance", 91), #Converting to yards
(assign, reg60, ":point_earned"),
(assign, reg61, ":player_distance"),
(display_message, "str_archery_target_hit"),
]),
]),
("archery_target_with_hit_a",0,"arena_archery_target_a","bo_arena_archery_target_a", [
(ti_on_scene_prop_hit,
[
(set_fixed_point_multiplier, 100),
(store_trigger_param_1, ":instance_no"),
(position_get_x, ":attacker_agent_id", pos2),
(val_div, ":attacker_agent_id", 100),
(get_player_agent_no, ":player_agent"),
(try_begin),
(eq, ":player_agent", ":attacker_agent_id"),
(prop_instance_get_position, pos2, ":instance_no"),
(agent_get_position, pos3, ":player_agent"),
(get_distance_between_positions, ":player_distance", pos3, pos2),
(position_transform_position_to_local, pos4, pos2, pos1),
(position_set_y, pos4, 0),
(position_set_x, pos2, 0),
(position_set_y, pos2, 0),
(position_set_z, pos2, 0),
(get_distance_between_positions, ":target_distance", pos4, pos2),
(assign, ":point_earned", 43), #Calculating a point between 0-12
(val_sub, ":point_earned", ":target_distance"),
(val_mul, ":point_earned", 1299),
(val_div, ":point_earned", 4300),
(try_begin),
(lt, ":point_earned", 0),
(assign, ":point_earned", 0),
(try_end),
(assign, "$g_last_archery_point_earned", ":point_earned"),
(val_div, ":player_distance", 91), #Converting to yards
(assign, reg60, ":point_earned"),
(assign, reg61, ":player_distance"),
(display_message, "str_archery_target_hit"),
(eq, "$g_tutorial_training_ground_horseman_trainer_state", 6),
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 2),
(prop_instance_get_variation_id_2, ":var_id_2", ":instance_no"),
(val_sub, ":var_id_2", 1),
(eq, "$g_tutorial_training_ground_current_score", ":var_id_2"),
(val_add, "$g_tutorial_training_ground_current_score", 1),
(try_end),
]),
]),
("dummy_a",sokf_destructible|sokf_moveable,"arena_archery_target_b","bo_arena_archery_target_b", [
(ti_on_scene_prop_destroy,
[
(store_trigger_param_1, ":instance_no"),
(prop_instance_get_starting_position, pos1, ":instance_no"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, 2, ":player_agent"),
(assign, ":rotate_side", 80),
(try_begin),
(position_is_behind_position, 2, 1),
(val_mul, ":rotate_side", -1),
(try_end),
(position_rotate_x, 1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", 1, 70), #animate to position 1 in 0.7 second
(val_add, "$tutorial_num_total_dummies_destroyed", 1),
(play_sound, "snd_dummy_destroyed"),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(assign, reg60, ":damage"),
(val_div, ":damage", 8),
(prop_instance_get_position, pos2, ":instance_no"),
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos3, ":player_agent"),
(try_begin),
(position_is_behind_position, pos3, pos2),
(val_mul, ":damage", -1),
(try_end),
(position_rotate_x, 2, ":damage"),
(display_message, "str_delivered_damage"),
(prop_instance_animate_to_position, ":instance_no", 2, 30), #animate to position 1 in 0.3 second
(play_sound, "snd_dummy_hit"),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
]),
]),
("band_a",0,"band_a","0", []),
("arena_sign",0,"arena_arms","0", []),
("castle_h_battlement_a",0,"castle_h_battlement_a","bo_castle_h_battlement_a", []),
("castle_h_battlement_b",0,"castle_h_battlement_b","bo_castle_h_battlement_b", []),
("castle_h_battlement_c",0,"castle_h_battlement_c","bo_castle_h_battlement_c", []),
("castle_h_battlement_a2",0,"castle_h_battlement_a2","bo_castle_h_battlement_a2", []),
("castle_h_battlement_b2",0,"castle_h_battlement_b2","bo_castle_h_battlement_b2", []),
("castle_h_corner_a",0,"castle_h_corner_a","bo_castle_h_corner_a", []),
("castle_h_corner_c",0,"castle_h_corner_c","bo_castle_h_corner_c", []),
("castle_h_stairs_a",sokf_type_ladder,"castle_h_stairs_a","bo_castle_h_stairs_a", []),
("castle_h_stairs_b",0,"castle_h_stairs_b","bo_castle_h_stairs_b", []),
("castle_h_gatehouse_a",0,"castle_h_gatehouse_a","bo_castle_h_gatehouse_a", []),
("castle_h_keep_a",0,"castle_h_keep_a","bo_castle_h_keep_a", []),
("castle_h_keep_b",0,"castle_h_keep_b","bo_castle_h_keep_b", []),
("castle_h_house_a",0,"castle_h_house_a","bo_castle_h_house_a", []),
("castle_h_house_b",0,"castle_h_house_b","bo_castle_h_house_b", []),
("castle_h_house_c",0,"castle_h_house_c","bo_castle_h_house_b", []),
("castle_h_battlement_barrier",0,"castle_h_battlement_barrier","bo_castle_h_battlement_barrier", []),
("full_keep_b",sokf_type_ladder,"full_keep_b","bo_full_keep_b", []),
("castle_f_keep_a",0,"castle_f_keep_a","bo_castle_f_keep_a", []),
("castle_f_battlement_a",0,"castle_f_battlement_a","bo_castle_f_battlement_a", []),
("castle_f_battlement_a_destroyed",0,"castle_f_battlement_a_destroyed","bo_castle_f_battlement_a_destroyed", []),
("castle_f_battlement_b",0,"castle_f_battlement_b","bo_castle_f_battlement_b", []),
("castle_f_battlement_c",0,"castle_f_battlement_c","bo_castle_f_battlement_c", []),
("castle_f_battlement_d",0,"castle_f_battlement_d","bo_castle_f_battlement_d", []),
("castle_f_battlement_e",0,"castle_f_battlement_e","bo_castle_f_battlement_e", []),
("castle_f_sally_port_elevation",0,"castle_f_sally_port_elevation","bo_castle_f_sally_port_elevation", []),
("castle_f_battlement_corner_a",0,"castle_f_battlement_corner_a","bo_castle_f_battlement_corner_a", []),
("castle_f_battlement_corner_b",0,"castle_f_battlement_corner_b","bo_castle_f_battlement_corner_b", []),
("castle_f_battlement_corner_c",0,"castle_f_battlement_corner_c","bo_castle_f_battlement_corner_c", []),
("castle_f_door_a",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible|spr_use_time(0),"castle_f_door_a","bo_castle_f_door_a", [
check_castle_door_use_trigger,
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 1000),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
#(assign, reg0, ":z_difference"),
#(display_message, "@{!}z dif : {reg0}"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
("castle_f_doors_top_a",0,"castle_f_doors_top_a","bo_castle_f_doors_top_a", []),
("castle_f_sally_door_a",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible|spr_use_time(0),"castle_f_sally_door_a","bo_castle_f_sally_door_a", [
check_sally_door_use_trigger,
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 1000),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
("castle_f_stairs_a",sokf_type_ladder,"castle_f_stairs_a","bo_castle_f_stairs_a", []),
("castle_f_tower_a",sokf_type_ladder,"castle_f_tower_a","bo_castle_f_tower_a", []),
("castle_f_wall_stairs_a",sokf_type_ladder,"castle_f_wall_stairs_a","bo_castle_f_wall_stairs_a", []),
("castle_f_wall_stairs_b",sokf_type_ladder,"castle_f_wall_stairs_b","bo_castle_f_wall_stairs_b", []),
("castle_f_wall_way_a",0,"castle_f_wall_way_a","bo_castle_f_wall_way_a", []),
("castle_f_wall_way_b",0,"castle_f_wall_way_b","bo_castle_f_wall_way_b", []),
("castle_f_gatehouse_a",0,"castle_f_gatehouse_a","bo_castle_f_gatehouse_a", []),
("castle_g_battlement_a",0,"castle_g_battlement_a","bo_castle_g_battlement_a", []),
("castle_g_battlement_a1",0,"castle_g_battlement_a1","bo_castle_g_battlement_a1", []),
("castle_g_battlement_c",0,"castle_g_battlement_c","bo_castle_g_battlement_c", []),
("castle_g_corner_a",0,"castle_g_corner_a","bo_castle_g_corner_a", []),
("castle_g_corner_c",0,"castle_g_corner_c","bo_castle_g_corner_c", []),
("castle_g_tower_a",sokf_type_ladder,"castle_g_tower_a","bo_castle_g_tower_a", []),
("castle_g_gate_house",0,"castle_g_gate_house","bo_castle_g_gate_house", []),
("castle_g_gate_house_door_a",0,"castle_g_gate_house_door_a","bo_castle_g_gate_house_door_a", []),
("castle_g_gate_house_door_b",0,"castle_g_gate_house_door_b","bo_castle_g_gate_house_door_b", []),
("castle_g_square_keep_a",0,"castle_g_square_keep_a","bo_castle_g_square_keep_a", []),
("castle_i_battlement_a",0,"castle_i_battlement_a","bo_castle_i_battlement_a", []),
("castle_i_battlement_a1",0,"castle_i_battlement_a1","bo_castle_i_battlement_a1", []),
("castle_i_battlement_c",0,"castle_i_battlement_c","bo_castle_i_battlement_c", []),
("castle_i_corner_a",0,"castle_i_corner_a","bo_castle_i_corner_a", []),
("castle_i_corner_c",0,"castle_i_corner_c","bo_castle_i_corner_c", []),
("castle_i_tower_a",sokf_type_ladder,"castle_i_tower_a","bo_castle_i_tower_a", []),
("castle_i_gate_house",0,"castle_i_gate_house","bo_castle_i_gate_house", []),
("castle_i_gate_house_door_a",0,"castle_i_gate_house_door_a","bo_castle_i_gate_house_door_a", []),
("castle_i_gate_house_door_b",0,"castle_i_gate_house_door_b","bo_castle_i_gate_house_door_b", []),
("castle_i_square_keep_a",0,"castle_i_square_keep_a","bo_castle_i_square_keep_a", []),
("mosque_a",0,"mosque_a","bo_mosque_a", []),
("stone_minaret_a",0,"stone_minaret_a","bo_stone_minaret_a", []),
("stone_house_a",0,"stone_house_a","bo_stone_house_a", []),
("stone_house_b",0,"stone_house_b","bo_stone_house_b", []),
("stone_house_c",0,"stone_house_c","bo_stone_house_c", []),
("stone_house_d",0,"stone_house_d","bo_stone_house_d", []),
("stone_house_e",0,"stone_house_e","bo_stone_house_e", []),
("stone_house_f",0,"stone_house_f","bo_stone_house_f", []),
("banner_pole", sokf_moveable, "banner_pole", "bo_banner_pole", []),
("custom_banner_01",0,"custom_banner_01","0",
[
(ti_on_init_scene_prop,
[
(party_get_slot, ":leader_troop", "$g_encountered_party", slot_town_lord),
(try_begin),
(ge, ":leader_troop", 0),
(cur_scene_prop_set_tableau_material, "tableau_custom_banner_default", ":leader_troop"),
(try_end),
]),
]),
("custom_banner_02",0,"custom_banner_02","0",
[
(ti_on_init_scene_prop,
[
(party_get_slot, ":leader_troop", "$g_encountered_party", slot_town_lord),
(try_begin),
(ge, ":leader_troop", 0),
(cur_scene_prop_set_tableau_material, "tableau_custom_banner_default", ":leader_troop"),
(try_end),
]),
]),
("banner_a",0,"banner_a01","0", []),
("banner_b",0,"banner_a02","0", []),
("banner_c",0,"banner_a03","0", []),
("banner_d",0,"banner_a04","0", []),
("banner_e",0,"banner_a05","0", []),
("banner_f",0,"banner_a06","0", []),
("banner_g",0,"banner_a07","0", []),
("banner_h",0,"banner_a08","0", []),
("banner_i",0,"banner_a09","0", []),
("banner_j",0,"banner_a10","0", []),
("banner_k",0,"banner_a11","0", []),
("banner_l",0,"banner_a12","0", []),
("banner_m",0,"banner_a13","0", []),
("banner_n",0,"banner_a14","0", []),
("banner_o",0,"banner_f21","0", []),
("banner_p",0,"banner_a16","0", []),
("banner_q",0,"banner_a17","0", []),
("banner_r",0,"banner_a18","0", []),
("banner_s",0,"banner_a19","0", []),
("banner_t",0,"banner_a20","0", []),
("banner_u",0,"banner_a21","0", []),
("banner_ba",0,"banner_b01","0", []),
("banner_bb",0,"banner_b02","0", []),
("banner_bc",0,"banner_b03","0", []),
("banner_bd",0,"banner_b04","0", []),
("banner_be",0,"banner_b05","0", []),
("banner_bf",0,"banner_b06","0", []),
("banner_bg",0,"banner_b07","0", []),
("banner_bh",0,"banner_b08","0", []),
("banner_bi",0,"banner_b09","0", []),
("banner_bj",0,"banner_b10","0", []),
("banner_bk",0,"banner_b11","0", []),
("banner_bl",0,"banner_b12","0", []),
("banner_bm",0,"banner_b13","0", []),
("banner_bn",0,"banner_b14","0", []),
("banner_bo",0,"banner_b15","0", []),
("banner_bp",0,"banner_b16","0", []),
("banner_bq",0,"banner_b17","0", []),
("banner_br",0,"banner_b18","0", []),
("banner_bs",0,"banner_b19","0", []),
("banner_bt",0,"banner_b20","0", []),
("banner_bu",0,"banner_b21","0", []),
("banner_ca",0,"banner_c01","0", []),
("banner_cb",0,"banner_c02","0", []),
("banner_cc",0,"banner_c03","0", []),
("banner_cd",0,"banner_c04","0", []),
("banner_ce",0,"banner_c05","0", []),
("banner_cf",0,"banner_c06","0", []),
("banner_cg",0,"banner_c07","0", []),
("banner_ch",0,"banner_c08","0", []),
("banner_ci",0,"banner_c09","0", []),
("banner_cj",0,"banner_c10","0", []),
("banner_ck",0,"banner_c11","0", []),
("banner_cl",0,"banner_c12","0", []),
("banner_cm",0,"banner_c13","0", []),
("banner_cn",0,"banner_c14","0", []),
("banner_co",0,"banner_c15","0", []),
("banner_cp",0,"banner_c16","0", []),
("banner_cq",0,"banner_c17","0", []),
("banner_cr",0,"banner_c18","0", []),
("banner_cs",0,"banner_c19","0", []),
("banner_ct",0,"banner_c20","0", []),
("banner_cu",0,"banner_c21","0", []),
("banner_da",0,"banner_d01","0", []),
("banner_db",0,"banner_d02","0", []),
("banner_dc",0,"banner_d03","0", []),
("banner_dd",0,"banner_d04","0", []),
("banner_de",0,"banner_d05","0", []),
("banner_df",0,"banner_d06","0", []),
("banner_dg",0,"banner_d07","0", []),
("banner_dh",0,"banner_d08","0", []),
("banner_di",0,"banner_d09","0", []),
("banner_dj",0,"banner_d10","0", []),
("banner_dk",0,"banner_d11","0", []),
("banner_dl",0,"banner_d12","0", []),
("banner_dm",0,"banner_d13","0", []),
("banner_dn",0,"banner_d14","0", []),
("banner_do",0,"banner_d15","0", []),
("banner_dp",0,"banner_d16","0", []),
("banner_dq",0,"banner_d17","0", []),
("banner_dr",0,"banner_d18","0", []),
("banner_ds",0,"banner_d19","0", []),
("banner_dt",0,"banner_d20","0", []),
("banner_du",0,"banner_d21","0", []),
("banner_ea",0,"banner_e01","0", []),
("banner_eb",0,"banner_e02","0", []),
("banner_ec",0,"banner_e03","0", []),
("banner_ed",0,"banner_e04","0", []),
("banner_ee",0,"banner_e05","0", []),
("banner_ef",0,"banner_e06","0", []),
("banner_eg",0,"banner_e07","0", []),
("banner_eh",0,"banner_e08","0", []),
("banner_ei",0,"banner_e09","0", []),
("banner_ej",0,"banner_e10","0", []),
("banner_ek",0,"banner_e11","0", []),
("banner_el",0,"banner_e12","0", []),
("banner_em",0,"banner_e13","0", []),
("banner_en",0,"banner_e14","0", []),
("banner_eo",0,"banner_e15","0", []),
("banner_ep",0,"banner_e16","0", []),
("banner_eq",0,"banner_e17","0", []),
("banner_er",0,"banner_e18","0", []),
("banner_es",0,"banner_e19","0", []),
("banner_et",0,"banner_e20","0", []),
("banner_eu",0,"banner_e21","0", []),
("banner_f01", 0, "banner_f01", "0", []),
("banner_f02", 0, "banner_f02", "0", []),
("banner_f03", 0, "banner_f03", "0", []),
("banner_f04", 0, "banner_f04", "0", []),
("banner_f05", 0, "banner_f05", "0", []),
("banner_f06", 0, "banner_f06", "0", []),
("banner_f07", 0, "banner_f07", "0", []),
("banner_f08", 0, "banner_f08", "0", []),
("banner_f09", 0, "banner_f09", "0", []),
("banner_f10", 0, "banner_f10", "0", []),
("banner_f11", 0, "banner_f11", "0", []),
("banner_f12", 0, "banner_f12", "0", []),
("banner_f13", 0, "banner_f13", "0", []),
("banner_f14", 0, "banner_f14", "0", []),
("banner_f15", 0, "banner_f15", "0", []),
("banner_f16", 0, "banner_f16", "0", []),
("banner_f17", 0, "banner_f17", "0", []),
("banner_f18", 0, "banner_f18", "0", []),
("banner_f19", 0, "banner_f19", "0", []),
("banner_f20", 0, "banner_f20", "0", []),
("banner_g01", 0, "banner_f01", "0", []),
("banner_g02", 0, "banner_f02", "0", []),
("banner_g03", 0, "banner_f03", "0", []),
("banner_g04", 0, "banner_f04", "0", []),
("banner_g05", 0, "banner_f05", "0", []),
("banner_g06", 0, "banner_f06", "0", []),
("banner_g07", 0, "banner_f07", "0", []),
("banner_g08", 0, "banner_f08", "0", []),
("banner_g09", 0, "banner_f09", "0", []),
("banner_g10", 0, "banner_f10", "0", []),
("banner_kingdom_a", 0, "banner_kingdom_a", "0", []),
("banner_kingdom_b", 0, "banner_kingdom_b", "0", []),
("banner_kingdom_c", 0, "banner_kingdom_c", "0", []),
("banner_kingdom_d", 0, "banner_kingdom_d", "0", []),
("banner_kingdom_e", 0, "banner_kingdom_e", "0", []),
("banner_kingdom_f", 0, "banner_kingdom_f", "0", []),
("banner_f21", 0, "banner_a15", "0", []),
("tavern_chair_a",0,"tavern_chair_a","bo_tavern_chair_a", []),
("tavern_chair_b",0,"tavern_chair_b","bo_tavern_chair_b", []),
("tavern_table_a",0,"tavern_table_a","bo_tavern_table_a", []),
("tavern_table_b",0,"tavern_table_b","bo_tavern_table_b", []),
("fireplace_a",0,"fireplace_a","bo_fireplace_a", []),
("barrel",0,"barrel","bobarrel", []),
("bench_tavern",0,"bench_tavern","bobench_tavern", []),
("bench_tavern_b",0,"bench_tavern_b","bo_bench_tavern_b", []),
("bowl_wood",0,"bowl_wood","0", []),
("chandelier_table",0,"chandelier_table","0", []),
("chandelier_tavern",0,"chandelier_tavern","0", []),
("chest_gothic",0,"chest_gothic","bochest_gothic", []),
("chest_b",0,"chest_b","bo_chest_b", []),
("chest_c",0,"chest_c","bo_chest_c", []),
("counter_tavern",0,"counter_tavern","bocounter_tavern", []),
("cup",0,"cup","0", []),
("dish_metal",0,"dish_metal","0", []),
("gothic_chair",0,"gothic_chair","bogothic_chair", []),
("gothic_stool",0,"gothic_stool","bogothic_stool", []),
("grate",0,"grate","bograte", []),
("jug",0,"jug","0", []),
("potlamp",0,"potlamp","0", []),
("weapon_rack",0,"weapon_rack","boweapon_rack", []),
("weapon_rack_big",0,"weapon_rack_big","boweapon_rack_big", []),
("tavern_barrel",0,"barrel","bobarrel", []),
("tavern_barrel_b",0,"tavern_barrel_b","bo_tavern_barrel_b", []),
("merchant_sign",0,"merchant_sign","bo_tavern_sign", []),
("tavern_sign",0,"tavern_sign","bo_tavern_sign", []),
("sack",0,"sack","0", []),
("skull_a",0,"skull_a","0", []),
("skull_b",0,"skull_b","0", []),
("skull_c",0,"skull_c","0", []),
("skull_d",0,"skull_d","0", []),
("skeleton_cow",0,"skeleton_cow","0", []),
("cupboard_a",0,"cupboard_a","bo_cupboard_a", []),
("box_a",0,"box_a","bo_box_a", []),
("bucket_a",0,"bucket_a","bo_bucket_a", []),
("straw_a",0,"straw_a","0", []),
("straw_b",0,"straw_b","0", []),
("straw_c",0,"straw_c","0", []),
("cloth_a",0,"cloth_a","0", []),
("cloth_b",0,"cloth_b","0", []),
("mat_a",0,"mat_a","0", []),
("mat_b",0,"mat_b","0", []),
("mat_c",0,"mat_c","0", []),
("mat_d",0,"mat_d","0", []),
("wood_a",0,"wood_a","bo_wood_a", []),
("wood_b",0,"wood_b","bo_wood_b", []),
("wood_heap",0,"wood_heap_a","bo_wood_heap_a", []),
("wood_heap_b",0,"wood_heap_b","bo_wood_heap_b", []),
("water_well_a",0,"water_well_a","bo_water_well_a", []),
("net_a",0,"net_a","bo_net_a", []),
("net_b",0,"net_b","0", []),
("meat_hook",0,"meat_hook","0", []),
("cooking_pole",0,"cooking_pole","0", []),
("bowl_a",0,"bowl_a","0", []),
("bucket_b",0,"bucket_b","0", []),
("washtub_a",0,"washtub_a","bo_washtub_a", []),
("washtub_b",0,"washtub_b","bo_washtub_b", []),
("table_trunk_a",0,"table_trunk_a","bo_table_trunk_a", []),
("chair_trunk_a",0,"chair_trunk_a","bo_chair_trunk_a", []),
("chair_trunk_b",0,"chair_trunk_b","bo_chair_trunk_b", []),
("chair_trunk_c",0,"chair_trunk_c","bo_chair_trunk_c", []),
("table_trestle_long",0,"table_trestle_long","bo_table_trestle_long", []),
("table_trestle_small",0,"table_trestle_small","bo_table_trestle_small", []),
("chair_trestle",0,"chair_trestle","bo_chair_trestle", []),
("wheel",0,"wheel","bo_wheel", []),
("ladder",sokf_type_ladder,"ladder","boladder", []),
("cart",0,"cart","bo_cart", []),
("village_stand",0,"village_stand","bovillage_stand", []),
("wooden_stand",0,"wooden_stand","bowooden_stand", []),
("table_small",0,"table_small","bo_table_small", []),
("table_small_b",0,"table_small_b","bo_table_small_b", []),
("small_timber_frame_house_a",0,"small_timber_frame_house_a","bo_small_timber_frame_house_a", []),
("timber_frame_house_b",0,"tf_house_b","bo_tf_house_b", []),
("timber_frame_house_c",0,"tf_house_c","bo_tf_house_c", []),
("timber_frame_extension_a",0,"timber_frame_extension_a","bo_timber_frame_extension_a", []),
("timber_frame_extension_b",0,"timber_frame_extension_b","bo_timber_frame_extension_b", []),
("stone_stairs_a",sokf_type_ladder,"stone_stairs_a","bo_stone_stairs_a", []),
("stone_stairs_b",sokf_type_ladder,"stone_stairs_b","bo_stone_stairs_b", []),
("railing_a",0,"railing_a","bo_railing_a", []),
("side_building_a",0,"side_building_a","bo_side_building_a", []),
("battlement_a",0,"battlement_a","bo_battlement_a", []),
("battlement_a_destroyed",0,"battlement_a_destroyed","bo_battlement_a_destroyed", []),
("round_tower_a",0,"round_tower_a","bo_round_tower_a", []),
("small_round_tower_a",0,"small_round_tower_a","bo_small_round_tower_a", []),
("small_round_tower_roof_a",0,"small_round_tower_roof_a","bo_small_round_tower_roof_a", []),
("square_keep_a",0,"square_keep_a","bo_square_keep_a", []),
("square_tower_roof_a",0,"square_tower_roof_a","0", []),
("gate_house_a",0,"gate_house_a","bo_gate_house_a", []),
("gate_house_b",0,"gate_house_b","bo_gate_house_b", []),
("small_wall_a",0,"small_wall_a","bo_small_wall_a", []),
("small_wall_b",0,"small_wall_b","bo_small_wall_b", []),
("small_wall_c",0,"small_wall_c","bo_small_wall_c", []),
("small_wall_c_destroy",0,"small_wall_c_destroy","bo_small_wall_c_destroy", []),
("small_wall_d",0,"small_wall_d","bo_small_wall_d", []),
("small_wall_e",0,"small_wall_e","bo_small_wall_d", []),
("small_wall_f",0,"small_wall_f","bo_small_wall_f", []),
("small_wall_f2",0,"small_wall_f2","bo_small_wall_f2", []),
("town_house_a",0,"town_house_a","bo_town_house_a", []),
("town_house_b",0,"town_house_b","bo_town_house_b", []),
("town_house_c",0,"town_house_c","bo_town_house_c", []),
("town_house_d",0,"town_house_d","bo_town_house_d", []),
("town_house_e",0,"town_house_e","bo_town_house_e", []),
("town_house_f",0,"town_house_f","bo_town_house_f", []),
("town_house_g",0,"town_house_g","bo_town_house_g", []),
("town_house_h",0,"town_house_h","bo_town_house_h", []),
("town_house_i",0,"town_house_i","bo_town_house_i", []),
("town_house_j",0,"town_house_j","bo_town_house_j", []),
("town_house_l",0,"town_house_l","bo_town_house_l", []),
("town_house_m",0,"town_house_m","bo_town_house_m", []),
("town_house_n",0,"town_house_n","bo_town_house_n", []),
("town_house_o",0,"town_house_o","bo_town_house_o", []),
("town_house_p",0,"town_house_p","bo_town_house_p", []),
("town_house_q",0,"town_house_q","bo_town_house_q", []),
("passage_house_a",0,"passage_house_a","bo_passage_house_a", []),
("passage_house_b",0,"passage_house_b","bo_passage_house_b", []),
("passage_house_c",0,"passage_house_c","bo_passage_house_c", []),
("passage_house_d",0,"passage_house_d","bo_passage_house_d", []),
("passage_house_c_door",0,"passage_house_c_door","bo_passage_house_c_door", []),
("house_extension_a",0,"house_extension_a","bo_house_extension_a", []),
("house_extension_b",0,"house_extension_b","bo_house_extension_b", []),
("house_extension_c",0,"house_extension_c","bo_house_extension_a", []),#reuse
("house_extension_d",0,"house_extension_d","bo_house_extension_d", []),
("house_extension_e",0,"house_extension_e","bo_house_extension_e", []),
("house_extension_f",0,"house_extension_f","bo_house_extension_f", []),
("house_extension_f2",0,"house_extension_f2","bo_house_extension_f", []),
("house_extension_g",0,"house_extension_g","bo_house_extension_g", []),
("house_extension_g2",0,"house_extension_g2","bo_house_extension_g", []),
("house_extension_h",0,"house_extension_h","bo_house_extension_h", []),
("house_extension_i",0,"house_extension_i","bo_house_extension_i", []),
("house_roof_door",0,"house_roof_door","bo_house_roof_door", []),
("door_extension_a",0,"door_extension_a","bo_door_extension_a", []),
("stairs_arch_a",sokf_type_ladder,"stairs_arch_a","bo_stairs_arch_a", []),
("town_house_r",0,"town_house_r","bo_town_house_r", []),
("town_house_s",0,"town_house_s","bo_town_house_s", []),
("town_house_t",0,"town_house_t","bo_town_house_t", []),
("town_house_u",0,"town_house_u","bo_town_house_u", []),
("town_house_v",0,"town_house_v","bo_town_house_v", []),
("town_house_w",0,"town_house_w","bo_town_house_w", []),
("town_house_y",0,"town_house_y","bo_town_house_y", []),
("town_house_z",0,"town_house_z","bo_town_house_z", []),
("town_house_za",0,"town_house_za","bo_town_house_za", []),
("windmill",0,"windmill","bo_windmill", []),
("windmill_fan_turning",sokf_moveable,"windmill_fan_turning","bo_windmill_fan_turning", []),
("windmill_fan",0,"windmill_fan","bo_windmill_fan", []),
("fake_house_a",0,"fake_house_a","bo_fake_house_a", []),
("fake_house_b",0,"fake_house_b","bo_fake_house_b", []),
("fake_house_c",0,"fake_house_c","bo_fake_house_c", []),
("fake_house_d",0,"fake_house_d","bo_fake_house_d", []),
("fake_house_e",0,"fake_house_e","bo_fake_house_e", []),
("fake_house_f",0,"fake_house_f","bo_fake_house_f", []),
("fake_house_snowy_a",0,"fake_house_snowy_a","bo_fake_house_a", []),
("fake_house_snowy_b",0,"fake_house_snowy_b","bo_fake_house_b", []),
("fake_house_snowy_c",0,"fake_house_snowy_c","bo_fake_house_c", []),
("fake_house_snowy_d",0,"fake_house_snowy_d","bo_fake_house_d", []),
("fake_house_far_a",0,"fake_house_far_a","0", []),
("fake_house_far_b",0,"fake_house_far_b","0", []),
("fake_house_far_c",0,"fake_house_far_c","0", []),
("fake_house_far_d",0,"fake_house_far_d","0", []),
("fake_house_far_e",0,"fake_house_far_e","0", []),
("fake_house_far_f",0,"fake_house_far_f","0", []),
("fake_house_far_snowycrude_a",0,"fake_house_far_snowy_a","0", []),
("fake_house_far_snowy_b",0,"fake_house_far_snowy_b","0", []),
("fake_house_far_snowy_c",0,"fake_house_far_snowy_c","0", []),
("fake_house_far_snowy_d",0,"fake_house_far_snowy_d","0", []),
("earth_wall_a",0,"earth_wall_a","bo_earth_wall_a", []),
("earth_wall_a2",0,"earth_wall_a2","bo_earth_wall_a2", []),
("earth_wall_b",0,"earth_wall_b","bo_earth_wall_b", []),
("earth_wall_b2",0,"earth_wall_b2","bo_earth_wall_b2", []),
("earth_stairs_a",sokf_type_ladder,"earth_stairs_a","bo_earth_stairs_a", []),
("earth_stairs_b",sokf_type_ladder,"earth_stairs_b","bo_earth_stairs_b", []),
("earth_tower_small_a",0,"earth_tower_small_a","bo_earth_tower_small_a", []),
("earth_gate_house_a",0,"earth_gate_house_a","bo_earth_gate_house_a", []),
("earth_gate_a",0,"earth_gate_a","bo_earth_gate_a", []),
("earth_square_keep_a",0,"earth_square_keep_a","bo_earth_square_keep_a", []),
("earth_house_a",0,"earth_house_a","bo_earth_house_a", []),
("earth_house_b",0,"earth_house_b","bo_earth_house_b", []),
("earth_house_c",0,"earth_house_c","bo_earth_house_c", []),
("earth_house_d",0,"earth_house_d","bo_earth_house_d", []),
("village_steppe_a",0,"village_steppe_a","bo_village_steppe_a", []),
("village_steppe_b",0,"village_steppe_b","bo_village_steppe_b", []),
("village_steppe_c",0,"village_steppe_c","bo_village_steppe_c", []),
("village_steppe_d",0,"village_steppe_d","bo_village_steppe_d", []),
("village_steppe_e",0,"village_steppe_e","bo_village_steppe_e", []),
("village_steppe_f",0,"village_steppe_f","bo_village_steppe_f", []),
("town_house_aa",0,"town_house_aa","bo_town_house_aa", []),
("snowy_house_a",0,"snowy_house_a","bo_snowy_house_a", []),
("snowy_house_b",0,"snowy_house_b","bo_snowy_house_b", []),
("snowy_house_c",0,"snowy_house_c","bo_snowy_house_c", []),
("snowy_house_d",0,"snowy_house_d","bo_snowy_house_d", []),
("snowy_house_e",0,"snowy_house_e","bo_snowy_house_e", []),
("snowy_house_f",0,"snowy_house_f","bo_snowy_house_f", []),
("snowy_house_g",0,"snowy_house_g","bo_snowy_house_g", []),
("snowy_house_h",0,"snowy_house_h","bo_snowy_house_h", []),
("snowy_house_i",0,"snowy_house_i","bo_snowy_house_i", []),
("snowy_wall_a",0,"snowy_wall_a","bo_snowy_wall_a", []),
("snowy_stand",0,"snowy_stand","bo_snowy_stand", []),
("snowy_heap_a",0,"snowy_heap_a","bo_snowy_heap_a", []),
("snowy_trunks_a",0,"snowy_trunks_a","bo_snowy_trunks_a", []),
("snowy_castle_tower_a",0,"snowy_castle_tower_a","bo_snowy_castle_tower_a", []),
("snowy_castle_battlement_a",0,"snowy_castle_battlement_a","bo_snowy_castle_battlement_a", []),
("snowy_castle_battlement_a_destroyed",0,"snowy_castle_battlement_a_destroyed","bo_snowy_castle_battlement_a_destroyed", []),
("snowy_castle_battlement_b",0,"snowy_castle_battlement_b","bo_snowy_castle_battlement_b", []),
("snowy_castle_battlement_corner_a",0,"snowy_castle_battlement_corner_a","bo_snowy_castle_battlement_corner_a", []),
("snowy_castle_battlement_corner_b",0,"snowy_castle_battlement_corner_b","bo_snowy_castle_battlement_corner_b", []),
("snowy_castle_battlement_corner_c",0,"snowy_castle_battlement_corner_c","bo_snowy_castle_battlement_corner_c", []),
("snowy_castle_battlement_stairs_a",0,"snowy_castle_battlement_stairs_a","bo_snowy_castle_battlement_stairs_a", []),
("snowy_castle_battlement_stairs_b",0,"snowy_castle_battlement_stairs_b","bo_snowy_castle_battlement_stairs_b", []),
("snowy_castle_gate_house_a",0,"snowy_castle_gate_house_a","bo_snowy_castle_gate_house_a", []),
("snowy_castle_round_tower_a",0,"snowy_castle_round_tower_a","bo_snowy_castle_round_tower_a", []),
("snowy_castle_square_keep_a",0,"snowy_castle_square_keep_a","bo_snowy_castle_square_keep_a", []),
("snowy_castle_stairs_a",sokf_type_ladder,"snowy_castle_stairs_a","bo_snowy_castle_stairs_a", []),
("square_keep_b",0,"square_keep_b","bo_square_keep_b", []),
("square_keep_c",0,"square_keep_c","bo_square_keep_c", []),
("square_keep_d",0,"square_keep_d","bo_square_keep_d", []),
("square_keep_e",0,"square_keep_e","bo_square_keep_e", []),
("square_keep_f",0,"square_keep_f","bo_square_keep_f", []),
("square_extension_a",0,"square_extension_a","bo_square_extension_a", []),
("square_stairs_a",0,"square_stairs_a","bo_square_stairs_a", []),
("castle_courtyard_house_a",0,"castle_courtyard_house_a","bo_castle_courtyard_house_a", []),
("castle_courtyard_house_b",0,"castle_courtyard_house_b","bo_castle_courtyard_house_b", []),
("castle_courtyard_house_c",0,"castle_courtyard_house_c","bo_castle_courtyard_house_c", []),
("castle_courtyard_a",0,"castle_courtyard_a","bo_castle_courtyard_a", []),
("gatehouse_b",0,"gatehouse_b","bo_gatehouse_b", []),
("castle_gaillard",0,"castle_gaillard","bo_castle_gaillard", []),
("castle_e_battlement_a",0,"castle_e_battlement_a","bo_castle_e_battlement_a", []),
("castle_e_battlement_c",0,"castle_e_battlement_c","bo_castle_e_battlement_c", []),
("castle_e_battlement_a_destroyed",0,"castle_e_battlement_a_destroyed","bo_castle_e_battlement_a_destroyed", []),
("castle_e_sally_door_a",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible|spr_use_time(0),"castle_e_sally_door_a","bo_castle_e_sally_door_a", [
check_sally_door_use_trigger,
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 3000),
]),
## (ti_on_scene_prop_destroy,
## [
## (play_sound, "snd_dummy_destroyed"),
##
## (try_begin),
## (multiplayer_is_server),
## (store_trigger_param_1, ":instance_no"),
## (store_trigger_param_2, ":attacker_agent_no"),
##
## (try_begin),
## (ge, ":attacker_agent_no", 0),
## (prop_instance_get_position, pos1, ":instance_no"),
## (agent_get_position, pos2, ":attacker_agent_no"),
## (assign, ":rotate_side", 80),
## (try_begin),
## (position_is_behind_position, pos2, pos1),
## (val_mul, ":rotate_side", -1),
## (try_end),
## (else_try),
## (assign, ":rotate_side", 80),
## (try_end),
##
## (position_rotate_x, pos1, ":rotate_side"),
## (prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
## (try_end),
## ]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
#(assign, reg0, ":z_difference"),
#(display_message, "@{!}z dif : {reg0}"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
("castle_e_corner",0,"castle_e_corner","bo_castle_e_corner", []),
("castle_e_corner_b",0,"castle_e_corner_b","bo_castle_e_corner_b", []),
("castle_e_corner_c",0,"castle_e_corner_c","bo_castle_e_corner_c", []),
("castle_e_stairs_a",0,"castle_e_stairs_a","bo_castle_e_stairs_a", []),
("castle_e_tower",0,"castle_e_tower","bo_castle_e_tower", []),
("castle_e_gate_house_a",0,"castle_e_gate_house_a","bo_castle_e_gate_house_a", []),
("castle_e_keep_a",0,"castle_e_keep_a","bo_castle_e_keep_a", []),
("stand_thatched",0,"stand_thatched","bo_stand_thatched", []),
("stand_cloth",0,"stand_cloth","bo_stand_cloth", []),
("castle_e_house_a",0,"castle_e_house_a","bo_castle_e_house_a", []),
("castle_e_house_b",0,"castle_e_house_b","bo_castle_e_house_b", []),
("arena_block_a",0,"arena_block_a","bo_arena_block_ab", []),
("arena_block_b",0,"arena_block_b","bo_arena_block_ab", []),
("arena_block_c",0,"arena_block_c","bo_arena_block_c", []),
("arena_block_d",0,"arena_block_d","bo_arena_block_def", []),
("arena_block_e",0,"arena_block_e","bo_arena_block_def", []),
("arena_block_f",0,"arena_block_f","bo_arena_block_def", []),
("arena_block_g",0,"arena_block_g","bo_arena_block_ghi", []),
("arena_block_h",0,"arena_block_h","bo_arena_block_ghi", []),
("arena_block_i",0,"arena_block_i","bo_arena_block_ghi", []),
("arena_block_j",0,"arena_block_j","bo_arena_block_j", []),
("arena_block_j_awning",0,"arena_block_j_awning","bo_arena_block_j_awning", []),
("arena_palisade_a",0,"arena_palisade_a","bo_arena_palisade_a", []),
("arena_wall_a",0,"arena_wall_a","bo_arena_wall_ab", []),
("arena_wall_b",0,"arena_wall_b","bo_arena_wall_ab", []),
("arena_barrier_a",0,"arena_barrier_a","bo_arena_barrier_a", []),
("arena_barrier_b",0,"arena_barrier_b","bo_arena_barrier_bc", []),
("arena_barrier_c",0,"arena_barrier_c","bo_arena_barrier_bc", []),
("arena_tower_a",0,"arena_tower_a","bo_arena_tower_abc", []),
("arena_tower_b",0,"arena_tower_b","bo_arena_tower_abc", []),
("arena_tower_c",0,"arena_tower_c","bo_arena_tower_abc", []),
("arena_spectator_a",0,"arena_spectator_a","0", []),
("arena_spectator_b",0,"arena_spectator_b","0", []),
("arena_spectator_c",0,"arena_spectator_c","0", []),
("arena_spectator_sitting_a",0,"arena_spectator_sitting_a","0", []),
("arena_spectator_sitting_b",0,"arena_spectator_sitting_b","0", []),
("arena_spectator_sitting_c",0,"arena_spectator_sitting_c","0", []),
("courtyard_gate_a",0,"courtyard_entry_a","bo_courtyard_entry_a", []),
("courtyard_gate_b",0,"courtyard_entry_b","bo_courtyard_entry_b", []),
("courtyard_gate_c",0,"courtyard_entry_c","bo_courtyard_entry_c", []),
("courtyard_gate_snowy",0,"courtyard_entry_snowy","bo_courtyard_entry_a", []),
("castle_tower_a",0,"castle_tower_a","bo_castle_tower_a", []),
("castle_battlement_a",0,"castle_battlement_a","bo_castle_battlement_a", []),
("castle_battlement_b",0,"castle_battlement_b","bo_castle_battlement_b", []),
("castle_battlement_c",0,"castle_battlement_c","bo_castle_battlement_c", []),
("castle_battlement_a_destroyed",0,"castle_battlement_a_destroyed","bo_castle_battlement_a_destroyed", []),
("castle_battlement_b_destroyed",0,"castle_battlement_b_destroyed","bo_castle_battlement_b_destroyed", []),
("castle_battlement_corner_a",0,"castle_battlement_corner_a","bo_castle_battlement_corner_a", []),
("castle_battlement_corner_b",0,"castle_battlement_corner_b","bo_castle_battlement_corner_b", []),
("castle_battlement_corner_c",0,"castle_battlement_corner_c","bo_castle_battlement_corner_c", []),
("castle_battlement_stairs_a",0,"castle_battlement_stairs_a","bo_castle_battlement_stairs_a", []),
("castle_battlement_stairs_b",0,"castle_battlement_stairs_b","bo_castle_battlement_stairs_b", []),
("castle_gate_house_a",0,"castle_gate_house_a","bo_castle_gate_house_a", []),
("castle_round_tower_a",0,"castle_round_tower_a","bo_castle_round_tower_a", []),
("castle_square_keep_a",0,"castle_square_keep_a","bo_castle_square_keep_a", []),
("castle_stairs_a",sokf_type_ladder,"castle_stairs_a","bo_castle_stairs_a", []),
("castle_drawbridge_open",0,"castle_drawbridges_open","bo_castle_drawbridges_open", []),
("castle_drawbridge_closed",0,"castle_drawbridges_closed","bo_castle_drawbridges_closed", []),
("spike_group_a",0,"spike_group_a","bo_spike_group_a", []),
("spike_a",0,"spike_a","bo_spike_a", []),
("belfry_a",sokf_moveable,"belfry_a","bo_belfry_a", []),
("belfry_b",sokf_moveable,"belfry_b","bo_belfry_b", []),
("belfry_b_platform_a",sokf_moveable,"belfry_b_platform_a","bo_belfry_b_platform_a", []),
("belfry_old",0,"belfry_a","bo_belfry_a", []),
("belfry_platform_a",sokf_moveable,"belfry_platform_a","bo_belfry_platform_a", []),
("belfry_platform_b",sokf_moveable,"belfry_platform_b","bo_belfry_platform_b", []),
("belfry_platform_old",0,"belfry_platform_b","bo_belfry_platform_b", []),
("belfry_wheel",sokf_moveable,"belfry_wheel",0, []),
("belfry_wheel_old",0,"belfry_wheel",0, []),
("mangonel",0,"mangonel","bo_mangonel", []),
("trebuchet_old",0,"trebuchet_old","bo_trebuchet_old", []),
("trebuchet_new",0,"trebuchet_new","bo_trebuchet_old", []),
("trebuchet_destructible",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible,"trebuchet_new","bo_trebuchet_old", [
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 2400),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(prop_instance_get_position, pos1, ":instance_no"),
(particle_system_burst, "psys_dummy_smoke_big", pos1, 100),
(particle_system_burst, "psys_dummy_straw_big", pos1, 100),
(position_move_z, pos1, -500),
(position_rotate_x, pos1, 90),
(prop_instance_animate_to_position, ":instance_no", pos1, 300), #animate to 6 meters below in 6 second
(try_begin),
(eq, "$g_round_ended", 0),
(scene_prop_get_team, ":scene_prop_team_no", ":instance_no"),
(try_begin),
(eq, ":scene_prop_team_no", 0),
(assign, ":scene_prop_team_no_multiplier", -1),
(else_try),
(assign, ":scene_prop_team_no_multiplier", 1),
(try_end),
(try_begin),
(eq, "$g_number_of_targets_destroyed", 0),
(store_mul, ":target_no_mul_scene_prop_team", ":scene_prop_team_no_multiplier", 2), #2 means destroyed object is a trebuchet
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_target_destroyed, ":target_no_mul_scene_prop_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"),
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_target_destroyed, ":target_no_mul_scene_prop_team"),
(try_end),
(val_add, "$g_number_of_targets_destroyed", 1),
(else_try),
(store_mul, ":target_no_mul_scene_prop_team", ":scene_prop_team_no_multiplier", 9), #9 means attackers destroyed all targets
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_show_multiplayer_message", multiplayer_message_type_target_destroyed, ":target_no_mul_scene_prop_team"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"),
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_target_destroyed, ":target_no_mul_scene_prop_team"),
(try_end),
(val_add, "$g_number_of_targets_destroyed", 1),
(try_end),
(try_end),
#giving gold for destroying target (for trebuchet)
#step-1 calculating total damage given to that scene prop
(assign, ":total_damage_given", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(try_begin),
(eq, "spr_trebuchet_destructible", "$g_destructible_target_1"),
(player_get_slot, ":damage_given", ":player_no", slot_player_damage_given_to_target_1),
(else_try),
(player_get_slot, ":damage_given", ":player_no", slot_player_damage_given_to_target_2),
(try_end),
(val_add, ":total_damage_given", ":damage_given"),
(try_end),
#step-2 sharing 1000 gold (if num active players < 20 then 50 * num active players) to players which gave damage with the damage amounts.
#(scene_prop_get_max_hit_points, ":max_hit_points", ":instance_no"),
(assign, ":destroy_money_addition", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(val_add, ":destroy_money_addition", 50),
(try_end),
(try_begin),
(ge, ":destroy_money_addition", multi_destroy_target_money_add),
(assign, ":destroy_money_addition", multi_destroy_target_money_add),
(try_end),
(val_mul, ":destroy_money_addition", "$g_multiplayer_battle_earnings_multiplier"),
(val_div, ":destroy_money_addition", 100),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"),
(player_is_active, ":player_no"),
(try_begin),
(eq, "spr_trebuchet_destructible", "$g_destructible_target_1"),
(player_get_slot, ":damage_given", ":player_no", slot_player_damage_given_to_target_1),
(else_try),
(player_get_slot, ":damage_given", ":player_no", slot_player_damage_given_to_target_2),
(try_end),
(player_get_gold, ":player_gold", ":player_no"), #give money to player which helped flag to be owned by new_flag_owner team
(val_mul, ":damage_given", ":destroy_money_addition"),
(store_div, ":gold_earned", ":damage_given", ":total_damage_given"),
(val_add, ":player_gold", ":gold_earned"),
(player_set_gold, ":player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(try_end),
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(set_fixed_point_multiplier, 1),
(position_get_x, ":attacker_agent_id", pos2),
(try_begin),
(ge, ":attacker_agent_id", 0),
(agent_is_alive, ":attacker_agent_id"),
(agent_is_human, ":attacker_agent_id"),
(neg|agent_is_non_player, ":attacker_agent_id"),
(agent_get_player_id, ":attacker_player_id", ":attacker_agent_id"),
(ge, ":attacker_player_id", 0),
(player_is_active, ":attacker_player_id"),
(try_begin),
(eq, "spr_trebuchet_destructible", "$g_destructible_target_1"),
(player_get_slot, ":damage_given", ":attacker_player_id", slot_player_damage_given_to_target_1),
(val_add, ":damage_given", ":damage"),
(player_set_slot, ":attacker_player_id", slot_player_damage_given_to_target_1, ":damage_given"),
(else_try),
(player_get_slot, ":damage_given", ":attacker_player_id", slot_player_damage_given_to_target_2),
(val_add, ":damage_given", ":damage"),
(player_set_slot, ":attacker_player_id", slot_player_damage_given_to_target_2, ":damage_given"),
(try_end),
(try_end),
(try_end),
]),
]),
("stone_ball",0,"stone_ball","0", []),
("village_house_a",0,"village_house_a","bo_village_house_a", []),
("village_house_b",0,"village_house_b","bo_village_house_b", []),
("village_house_c",0,"village_house_c","bo_village_house_c", []),
("village_house_d",0,"village_house_d","bo_village_house_d", []),
("farm_house_a",0,"farm_house_a","bo_farm_house_a", []),
("farm_house_b",0,"farm_house_b","bo_farm_house_b", []),
("farm_house_c",0,"farm_house_c","bo_farm_house_c", []),
("mountain_house_a",0,"mountain_house_a","bo_mountain_house_a", []),
("mountain_house_b",0,"mountain_house_b","bo_mountain_house_b", []),
("village_hut_a",0,"village_hut_a","bo_village_hut_a", []),
("crude_fence",0,"fence","bo_fence", []),
("crude_fence_small",0,"crude_fence_small","bo_crude_fence_small", []),
("crude_fence_small_b",0,"crude_fence_small_b","bo_crude_fence_small_b", []),
("ramp_12m",0,"ramp_12m","bo_ramp_12m", []),
("ramp_14m",0,"ramp_14m","bo_ramp_14m", []),
("siege_ladder_6m",sokf_type_ladder,"siege_ladder_move_6m","bo_siege_ladder_move_6m", []),
("siege_ladder_8m",sokf_type_ladder,"siege_ladder_move_8m","bo_siege_ladder_move_8m", []),
("siege_ladder_10m",sokf_type_ladder,"siege_ladder_move_10m","bo_siege_ladder_move_10m", []),
("siege_ladder_12m",sokf_type_ladder,"siege_ladder_12m","bo_siege_ladder_12m", []),
("siege_ladder_14m",sokf_type_ladder,"siege_ladder_14m","bo_siege_ladder_14m", []),
("siege_ladder_move_6m",sokf_type_ladder|sokf_moveable|spr_use_time(2),"siege_ladder_move_6m","bo_siege_ladder_move_6m", [
check_item_use_trigger,
check_ladder_animate_trigger,
check_ladder_animation_finish_trigger,
]),
("siege_ladder_move_8m",sokf_type_ladder|sokf_moveable|spr_use_time(2),"siege_ladder_move_8m","bo_siege_ladder_move_8m", [
check_item_use_trigger,
check_ladder_animate_trigger,
check_ladder_animation_finish_trigger,
]),
("siege_ladder_move_10m",sokf_type_ladder|sokf_moveable|spr_use_time(3),"siege_ladder_move_10m","bo_siege_ladder_move_10m", [
check_item_use_trigger,
check_ladder_animate_trigger,
check_ladder_animation_finish_trigger,
]),
("siege_ladder_move_12m",sokf_type_ladder|sokf_moveable|spr_use_time(3),"siege_ladder_move_12m","bo_siege_ladder_move_12m", [
check_item_use_trigger,
check_ladder_animate_trigger,
check_ladder_animation_finish_trigger,
]),
("siege_ladder_move_14m",sokf_type_ladder|sokf_moveable|spr_use_time(4),"siege_ladder_move_14m","bo_siege_ladder_move_14m", [
check_item_use_trigger,
check_ladder_animate_trigger,
check_ladder_animation_finish_trigger,
]),
("portcullis",sokf_moveable,"portcullis_a","bo_portcullis_a", []),
("bed_a",0,"bed_a","bo_bed_a", []),
("bed_b",0,"bed_b","bo_bed_b", []),
("bed_c",0,"bed_c","bo_bed_c", []),
("bed_d",0,"bed_d","bo_bed_d", []),
("bed_e",0,"bed_e","bo_bed_e", []),
("bed_f",0,"bed_f","bo_bed_f", []),
("towngate_door_left",sokf_moveable,"door_g_left","bo_door_left", []),
("towngate_door_right",sokf_moveable,"door_g_right","bo_door_right", []),
("towngate_rectangle_door_left",sokf_moveable,"towngate_rectangle_door_left","bo_towngate_rectangle_door_left", []),
("towngate_rectangle_door_right",sokf_moveable,"towngate_rectangle_door_right","bo_towngate_rectangle_door_right", []),
("door_screen",sokf_moveable,"door_screen","0", []),
("door_a",sokf_moveable,"door_a","bo_door_a", []),
("door_b",sokf_moveable,"door_b","bo_door_a", []),
("door_c",sokf_moveable,"door_c","bo_door_a", []),
("door_d",sokf_moveable,"door_d","bo_door_a", []),
("tavern_door_a",sokf_moveable,"tavern_door_a","bo_tavern_door_a", []),
("tavern_door_b",sokf_moveable,"tavern_door_b","bo_tavern_door_a", []),
("door_e_left",sokf_moveable,"door_e_left","bo_door_left", []),
("door_e_right",sokf_moveable,"door_e_right","bo_door_right", []),
("door_f_left",sokf_moveable,"door_f_left","bo_door_left", []),
("door_f_right",sokf_moveable,"door_f_right","bo_door_right", []),
("door_h_left",sokf_moveable,"door_g_left","bo_door_left", []),
("door_h_right",sokf_moveable,"door_g_right","bo_door_right", []),
("draw_bridge_a",0,"draw_bridge_a","bo_draw_bridge_a", []),
("chain_1m",0,"chain_1m","0", []),
("chain_2m",0,"chain_2m","0", []),
("chain_5m",0,"chain_5m","0", []),
("chain_10m",0,"chain_10m","0", []),
("bridge_modular_a",0,"bridge_modular_a","bo_bridge_modular_a", []),
("bridge_modular_b",0,"bridge_modular_b","bo_bridge_modular_b", []),
("church_a",0,"church_a","bo_church_a", []),
("church_tower_a",0,"church_tower_a","bo_church_tower_a", []),
("stone_step_a",0,"floor_stone_a","bo_floor_stone_a", []),
("stone_step_b",0,"stone_step_b","0", []),
("stone_step_c",0,"stone_step_c","0", []),
("stone_heap",0,"stone_heap","bo_stone_heap", []),
("stone_heap_b",0,"stone_heap_b","bo_stone_heap", []),
("panel_door_a",0,"house_door_a","bo_house_door_a", []),
("panel_door_b",0,"house_door_b","bo_house_door_a", []),
("smoke_stain",0,"soot_a","0", []),
("brazier_with_fire",0,"brazier","bo_brazier", [
(ti_on_scene_prop_init,
[
(set_position_delta,0,0,85),
(particle_system_add_new, "psys_brazier_fire_1"),
(particle_system_add_new, "psys_fire_sparks_1"),
(set_position_delta,0,0,100),
(particle_system_add_new, "psys_fire_glow_1"),
(particle_system_emit, "psys_fire_glow_1",9000000),
]),
]),
("cooking_fire",0,"fire_floor","0",
[
(ti_on_scene_prop_init,
[
(set_position_delta,0,0,12),
(particle_system_add_new, "psys_cooking_fire_1"),
(particle_system_add_new, "psys_fire_sparks_1"),
(particle_system_add_new, "psys_cooking_smoke"),
(set_position_delta,0,0,50),
(particle_system_add_new, "psys_fire_glow_1"),
(particle_system_emit, "psys_fire_glow_1",9000000),
]),
]),
("cauldron_a",0,"cauldron_a","bo_cauldron_a", []),
("fry_pan_a",0,"fry_pan_a","0", []),
("tripod_cauldron_a",0,"tripod_cauldron_a","bo_tripod_cauldron_a", []),
("tripod_cauldron_b",0,"tripod_cauldron_b","bo_tripod_cauldron_b", []),
("open_stable_a",0,"open_stable_a","bo_open_stable_a", []),
("open_stable_b",0,"open_stable_b","bo_open_stable_b", []),
("plate_a",0,"plate_a","0", []),
("plate_b",0,"plate_b","0", []),
("plate_c",0,"plate_c","0", []),
("lettuce",0,"lettuce","0", []),
("hanger",0,"hanger","0", []),
("knife_eating",0,"knife_eating","0", []),
("colander",0,"colander","0", []),
("ladle",0,"ladle","0", []),
("spoon",0,"spoon","0", []),
("skewer",0,"skewer","0", []),
("grape_a",0,"grape_a","0", []),
("grape_b",0,"grape_b","0", []),
("apple_a",0,"apple_a","0", []),
("apple_b",0,"apple_b","0", []),
("maize_a",0,"maize_a","0", []),
("maize_b",0,"maize_b","0", []),
("cabbage",0,"cabbage","0", []),
("flax_bundle",0,"raw_flax","0",[]),
("olive_plane",0,"olive_plane","0",[]),
("grapes_plane",0,"grapes_plane","0",[]),
("date_fruit_plane",0,"date_fruit_plane","0",[]),
("bowl",0,"bowl_big","0",[]),
("bowl_small",0,"bowl_small","0",[]),
("dye_blue",0,"raw_dye_blue","0",[]),
("dye_red",0,"raw_dye_red","0",[]),
("dye_yellow",0,"raw_dye_yellow","0",[]),
("basket",0,"basket_small","0",[]),
("basket_big",0,"basket_large","0",[]),
("basket_big_green",0,"basket_big","0",[]),
("leatherwork_frame",0,"leatherwork_frame","0", []),
("cabbage_b",0,"cabbage_b","0", []),
("bean",0,"bean","0", []),
("basket_a",0,"basket_a","bo_basket_a", []),
("feeding_trough_a",0,"feeding_trough_a","bo_feeding_trough_a", []),
("marrow_a",0,"marrow_a","0", []),
("marrow_b",0,"marrow_b","0", []),
("squash_plant",0,"marrow_c","0", []),
("gatehouse_new_a",sokf_type_ladder,"gatehouse_new_a","bo_gatehouse_new_a", []),
("gatehouse_new_b",sokf_type_ladder,"gatehouse_new_b","bo_gatehouse_new_b", []),
("gatehouse_new_snowy_a",0,"gatehouse_new_snowy_a","bo_gatehouse_new_b", []),
("winch",sokf_moveable,"winch","bo_winch", []),
("winch_b",sokf_moveable|spr_use_time(5),"winch_b","bo_winch", [
(ti_on_scene_prop_use,
[
(store_trigger_param_1, ":agent_id"),
(store_trigger_param_2, ":instance_id"),
#for only server itself-----------------------------------------------------------------------------------------------
(call_script, "script_use_item", ":instance_id", ":agent_id"),
#for only server itself-----------------------------------------------------------------------------------------------
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
(try_end),
]),
]),
("drawbridge",0,"drawbridge","bo_drawbridge", []),
("gatehouse_door_left",sokf_moveable,"gatehouse_door_left","bo_gatehouse_door_left", []),
("gatehouse_door_right",sokf_moveable,"gatehouse_door_right","bo_gatehouse_door_right", []),
("cheese_a",0,"cheese_a","0", []),
("cheese_b",0,"cheese_b","0", []),
("cheese_slice_a",0,"cheese_slice_a","0", []),
("bread_a",0,"bread_a","0", []),
("bread_b",0,"bread_b","0", []),
("bread_slice_a",0,"bread_slice_a","0", []),
("fish_a",0,"fish_a","0", []),
("fish_roasted_a",0,"fish_roasted_a","0", []),
("chicken_roasted",0,"chicken","0", []),
("food_steam",0,"0","0",
[
(ti_on_scene_prop_init,
[
(set_position_delta,0,0,0),
(particle_system_add_new, "psys_food_steam"),
]),
]),
########################
("city_smoke",0,"0","0",
[
(ti_on_scene_prop_init,
[
(store_time_of_day,reg(12)),
(neg|is_between,reg(12),5,20),
(set_position_delta,0,0,0),
(particle_system_add_new, "psys_night_smoke_1"),
]),
]),
("city_fire_fly_night",0,"0","0",
[
(ti_on_scene_prop_init,
[
(store_time_of_day,reg(12)),
(neg|is_between,reg(12),5,20),
(set_position_delta,0,0,0),
(particle_system_add_new, "psys_fire_fly_1"),
]),
]),
("city_fly_day",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_bug_fly_1"),
]),
]),
("flue_smoke_tall",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_flue_smoke_tall"),
]),
]),
("flue_smoke_short",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_flue_smoke_short"),
]),
]),
("moon_beam",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_moon_beam_1"),
(particle_system_add_new, "psys_moon_beam_paricle_1"),
]),
]),
("fire_small",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_fireplace_fire_small"),
]),
]),
("fire_big",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_fireplace_fire_big"),
]),
]),
("battle_field_smoke",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_war_smoke_tall"),
]),
]),
("Village_fire_big",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_village_fire_big"),
(set_position_delta,0,0,100),
(particle_system_add_new, "psys_village_fire_smoke_big"),
]),
]),
#########################
("candle_a",0,"candle_a","0",
[
(ti_on_scene_prop_init,
[
(set_position_delta,0,0,27),
(particle_system_add_new, "psys_candle_light"),
]),
]),
("candle_b",0,"candle_b","0",
[
(ti_on_scene_prop_init,
[
(set_position_delta,0,0,25),
(particle_system_add_new, "psys_candle_light"),
]),
]),
("candle_c",0,"candle_c","0", [
(ti_on_scene_prop_init,
[
(set_position_delta,0,0,10),
(particle_system_add_new, "psys_candle_light_small"),
]),
]),
("lamp_a",0,"lamp_a","0", [
(ti_on_scene_prop_init,
[
(set_position_delta,66,0,2),
(particle_system_add_new, "psys_candle_light"),
]),
]),
("lamp_b",0,"lamp_b","0", [
(ti_on_scene_prop_init,
[
(set_position_delta,65,0,-7),
(particle_system_add_new, "psys_lamp_fire"),
(set_position_delta,70,0,-5),
(particle_system_add_new, "psys_fire_glow_1"),
(particle_system_emit, "psys_fire_glow_1",9000000),
(play_sound, "snd_fire_loop", 0),
]),
]),
("hook_a",0,"hook_a","0", []),
("window_night",0,"window_night","0", []),
("fried_pig",0,"pork","0", []),
("village_oven",0,"village_oven","bo_village_oven", []),
("dungeon_water_drops",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_dungeon_water_drops"),
]),
]),
("shadow_circle_1",0,"shadow_circle_1","0", []),
("shadow_circle_2",0,"shadow_circle_2","0", []),
("shadow_square_1",0,"shadow_square_1","0", []),
("shadow_square_2",0,"shadow_square_2","0", []),
("wheelbarrow",0,"wheelbarrow","bo_wheelbarrow", []),
("gourd",sokf_moveable|sokf_destructible|spr_hit_points(1),"gourd","bo_gourd",
[
(ti_on_scene_prop_destroy,
[
(store_trigger_param_1, ":instance_no"),
(val_add, "$g_last_destroyed_gourds", 1),
(prop_instance_get_position, pos1, ":instance_no"),
(copy_position, pos2, pos1),
(position_set_z, pos2, -100000),
(particle_system_burst, "psys_gourd_smoke", pos1, 2),
(particle_system_burst, "psys_gourd_piece_1", pos1, 1),
(particle_system_burst, "psys_gourd_piece_2", pos1, 5),
(prop_instance_animate_to_position, ":instance_no", pos2, 1),
(play_sound, "snd_gourd_destroyed"),
]),
]),
("gourd_spike",sokf_moveable,"gourd_spike","bo_gourd_spike",[]),
("obstacle_fence_1",0,"fence","bo_fence", []),
("obstacle_fallen_tree_a",0,"destroy_tree_a","bo_destroy_tree_a", []),
("obstacle_fallen_tree_b",0,"destroy_tree_b","bo_destroy_tree_b", []),
("siege_wall_a",0,"siege_wall_a","bo_siege_wall_a", []),
("siege_large_shield_a",0,"siege_large_shield_a","bo_siege_large_shield_a", []),
("granary_a",0,"granary_a","bo_granary_a", []),
("small_wall_connect_a",0,"small_wall_connect_a","bo_small_wall_connect_a", []),
("full_stable_a",0,"full_stable_a","bo_full_stable_a", []),
("full_stable_b",0,"full_stable_b","bo_full_stable_b", []),
("full_stable_c",0,"full_stable_c","bo_full_stable_c", []),
("full_stable_d",0,"full_stable_d","bo_full_stable_d", []),
("arabian_house_a",0,"arabian_house_a","bo_arabian_house_a", []),
("arabian_house_b",0,"arabian_house_b","bo_arabian_house_b", []),
("arabian_house_c",0,"arabian_house_c","bo_arabian_house_c", []),
("arabian_house_d",0,"arabian_house_d","bo_arabian_house_d", []),
("arabian_house_e",0,"arabian_house_e","bo_arabian_house_e", []),
("arabian_house_f",0,"arabian_house_f","bo_arabian_house_f", []),
("arabian_house_g",0,"arabian_house_g","bo_arabian_house_g", []),
("arabian_house_h",0,"arabian_house_h","bo_arabian_house_h", []),
("arabian_house_i",0,"arabian_house_i","bo_arabian_house_i", []),
("arabian_square_keep_a",0,"arabian_square_keep_a","bo_arabian_square_keep_a", []),
("arabian_passage_house_a",0,"arabian_passage_house_a","bo_arabian_passage_house_a", []),
("arabian_wall_a",0,"arabian_wall_a","bo_arabian_wall_a", []),
("arabian_wall_b",0,"arabian_wall_b","bo_arabian_wall_b", []),
("arabian_ground_a",0,"arabian_ground_a","bo_arabian_ground_a", []),
("arabian_parterre_a",0,"arabian_parterre_a","bo_arabian_parterre_a", []),
("well_shaft",0,"well_shaft","bo_well_shaft", []),
("horse_mill",0,"horse_mill","bo_horse_mill", []),
("horse_mill_collar",0,"horse_mill_collar","bo_horse_mill_collar", []),
("arabian_stable",0,"arabian_stable","bo_arabian_stable", []),
("arabian_tent",0,"arabian_tent","bo_arabian_tent", []),
("arabian_tent_b",0,"arabian_tent_b","bo_arabian_tent_b", []),
("desert_plant_a",0,"desert_plant_a","0", []),
("arabian_castle_battlement_a",0,"arabian_castle_battlement_a","bo_arabian_castle_battlement_a", []),
("arabian_castle_battlement_b_destroyed",0,"arabian_castle_battlement_b_destroyed","bo_arabian_castle_battlement_b_destroyed", []),
("arabian_castle_battlement_c",0,"arabian_castle_battlement_c","bo_arabian_castle_battlement_c", []),
("arabian_castle_battlement_d",0,"arabian_castle_battlement_d","bo_arabian_castle_battlement_d", []),
("arabian_castle_corner_a",0,"arabian_castle_corner_a","bo_arabian_castle_corner_a", []),
("arabian_castle_stairs",sokf_type_ladder,"arabian_castle_stairs","bo_arabian_castle_stairs", []),
("arabian_castle_stairs_b",sokf_type_ladder,"arabian_castle_stairs_b","bo_arabian_castle_stairs_b", []),
("arabian_castle_stairs_c",sokf_type_ladder,"arabian_castle_stairs_c","bo_arabian_castle_stairs_c", []),
("arabian_castle_battlement_section_a",0,"arabian_castle_battlement_section_a","bo_arabian_castle_battlement_section_a", []),
("arabian_castle_gate_house_a",0,"arabian_castle_gate_house_a","bo_arabian_castle_gate_house_a", []),
("arabian_castle_house_a",0,"arabian_castle_house_a","bo_arabian_castle_house_a", []),
("arabian_castle_house_b",0,"arabian_castle_house_b","bo_arabian_castle_house_b", []),
("arabian_castle_keep_a",0,"arabian_castle_keep_a","bo_arabian_castle_keep_a", []),
("arabian_house_a2",0,"arabian_house_a2","bo_arabian_house_a2", []),
("arabian_village_house_a",0,"arabian_village_house_a","bo_arabian_village_house_a", []),
("arabian_village_house_b",0,"arabian_village_house_b","bo_arabian_village_house_b", []),
("arabian_village_house_c",0,"arabian_village_house_c","bo_arabian_village_house_c", []),
("arabian_village_house_d",0,"arabian_village_house_d","bo_arabian_village_house_d", []),
("arabian_village_stable",0,"arabian_village_stable","bo_arabian_village_stable", []),
("arabian_village_hut",0,"arabian_village_hut","bo_arabian_village_hut", []),
("arabian_village_stairs",sokf_type_ladder,"arabian_village_stairs","bo_arabian_village_stairs", []),
("tree_a01",0,"tree_a01","bo_tree_a01", []),
("stairs_a",sokf_type_ladder,"stairs_a","bo_stairs_a", []),
("headquarters_flag_red",sokf_moveable|sokf_face_player,"tutorial_flag_red","0", []),
("headquarters_flag_blue",sokf_moveable|sokf_face_player,"tutorial_flag_blue","0", []),
("headquarters_flag_gray",sokf_moveable|sokf_face_player,"tutorial_flag_yellow","0", []),
("headquarters_flag_red_code_only",sokf_moveable|sokf_face_player,"mp_flag_red","0", []),
("headquarters_flag_blue_code_only",sokf_moveable|sokf_face_player,"mp_flag_blue","0", []),
("headquarters_flag_gray_code_only",sokf_moveable|sokf_face_player,"mp_flag_white","0", []),
("headquarters_pole_code_only",sokf_moveable,"mp_flag_pole","0", []),
("headquarters_flag_swadian",sokf_moveable|sokf_face_player,"flag_swadian","0", []),
("headquarters_flag_vaegir",sokf_moveable|sokf_face_player,"flag_vaegir","0", []),
("headquarters_flag_khergit",sokf_moveable|sokf_face_player,"flag_khergit","0", []),
("headquarters_flag_nord",sokf_moveable|sokf_face_player,"flag_nord","0", []),
("headquarters_flag_rhodok",sokf_moveable|sokf_face_player,"flag_rhodok","0", []),
("headquarters_flag_sarranid",sokf_moveable|sokf_face_player,"flag_sarranid","0", []),
("glow_a", 0, "glow_a", "0", []),
("glow_b", 0, "glow_b", "0", []),
("arabian_castle_corner_b",0,"arabian_castle_corner_b","bo_arabian_castle_corner_b", []),
("dummy_a_undestructable",sokf_destructible,"arena_archery_target_b","bo_arena_archery_target_b",
[
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 10000000),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(set_fixed_point_multiplier, 1),
(position_get_x, ":attacker_agent_id", pos2),
(get_player_agent_no, ":player_agent"),
(eq, ":player_agent", ":attacker_agent_id"),
(assign, reg60, ":damage"),
(display_message, "str_delivered_damage"),
(eq, "$g_tutorial_training_ground_horseman_trainer_state", 6),
(eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 1),
(prop_instance_get_variation_id_2, ":var_id_2", ":instance_no"),
(val_sub, ":var_id_2", 1),
(eq, "$g_tutorial_training_ground_current_score", ":var_id_2"),
(val_add, "$g_tutorial_training_ground_current_score", 1),
(try_end),
(play_sound, "snd_dummy_hit"),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
]),
]),
("cave_entrance_1",0,"cave_entrance_1","bo_cave_entrance_1", []),
("pointer_arrow", 0, "pointer_arrow", "0", []),
("fireplace_d_interior",0,"fireplace_d","bo_fireplace_d", []),
("ship_sail_off",0,"ship_sail_off","bo_ship_sail_off", []),
("ship_sail_off_b",0,"ship_sail_off_b","bo_ship_sail_off", []),
("ship_c_sail_off",0,"ship_c_sail_off","bo_ship_c_sail_off", []),
("ramp_small_a",0,"ramp_small_a","bo_ramp_small_a", []),
("castle_g_battlement_b",0,"castle_g_battlement_b","bo_castle_g_battlement_b", []),
("box_a_dynamic",sokf_moveable|sokf_dynamic_physics,"box_a","bo_box_a", []),
("desert_field",0,"desert_field","bo_desert_field", []),
("water_river",0,"water_plane","0", []),
("viking_house_a",0,"viking_house_a","bo_viking_house_a", []),
("viking_house_b",0,"viking_house_b","bo_viking_house_b", []),
("viking_house_c",0,"viking_house_c","bo_viking_house_c", []),
("viking_house_d",0,"viking_house_d","bo_viking_house_d", []),
("viking_house_e",0,"viking_house_e","bo_viking_house_e", []),
("viking_stable_a",0,"viking_stable_a","bo_viking_stable_a", []),
("viking_keep",0,"viking_keep","bo_viking_keep", []),
("viking_house_c_destroy",0,"viking_house_c_destroy","bo_viking_house_c_destroy", []),
("viking_house_b_destroy",0,"viking_house_b_destroy","bo_viking_house_b_destroy", []),
("harbour_a",0,"harbour_a","bo_harbour_a", []),
("sea_foam_a",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_sea_foam_a"),
]),
]),
("viking_keep_destroy",0,"viking_keep_destroy","bo_viking_keep_destroy", []),
("viking_keep_destroy_door",0,"viking_keep_destroy_door","bo_viking_keep_destroy_door", []),
("earth_tower_small_b",0,"earth_tower_small_b","bo_earth_tower_small_b", []),
("earth_gate_house_b",0,"earth_gate_house_b","bo_earth_gate_house_b", []),
("earth_tower_a",0,"earth_tower_a","bo_earth_tower_a", []),
("earth_stairs_c",0,"earth_stairs_c","bo_earth_stairs_c", []),
("earth_sally_gate_left",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible|spr_use_time(0),"earth_sally_gate_left","bo_earth_sally_gate_left", [
check_sally_door_use_trigger_double,
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 2000),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
("earth_sally_gate_right",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible|spr_use_time(0),"earth_sally_gate_right","bo_earth_sally_gate_right", [
check_sally_door_use_trigger_double,
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 2000),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
#("earth_sally_gate_left",0,"earth_sally_gate_left","bo_earth_sally_gate_left", []),
#("earth_sally_gate_right",0,"earth_sally_gate_right","bo_earth_sally_gate_right", []),
("barrier_box",sokf_invisible|sokf_type_barrier3d,"barrier_box","bo_barrier_box", []),
("barrier_capsule",sokf_invisible|sokf_type_barrier3d,"barrier_capsule","bo_barrier_capsule", []),
("barrier_cone" ,sokf_invisible|sokf_type_barrier3d,"barrier_cone" ,"bo_barrier_cone" , []),
("barrier_sphere" ,sokf_invisible|sokf_type_barrier3d,"barrier_sphere" ,"bo_barrier_sphere" , []),
("viking_keep_destroy_sally_door_right",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible|spr_use_time(0),"viking_keep_destroy_sally_door_right","bo_viking_keep_destroy_sally_door_right", [
check_sally_door_use_trigger_double,
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 3000),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
("viking_keep_destroy_sally_door_left",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible|spr_use_time(0),"viking_keep_destroy_sally_door_left","bo_viking_keep_destroy_sally_door_left", [
check_sally_door_use_trigger_double,
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 3000),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
("castle_f_door_b",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible|spr_use_time(0),"castle_e_sally_door_a","bo_castle_e_sally_door_a", [
check_castle_door_use_trigger,
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 1000),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
#(assign, reg0, ":z_difference"),
#(display_message, "@{!}z dif : {reg0}"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
("ctf_flag_kingdom_1", sokf_moveable|sokf_face_player, "ctf_flag_kingdom_1", "0", []),
("ctf_flag_kingdom_2", sokf_moveable|sokf_face_player, "ctf_flag_kingdom_2", "0", []),
("ctf_flag_kingdom_3", sokf_moveable|sokf_face_player, "ctf_flag_kingdom_3", "0", []),
("ctf_flag_kingdom_4", sokf_moveable|sokf_face_player, "ctf_flag_kingdom_4", "0", []),
("ctf_flag_kingdom_5", sokf_moveable|sokf_face_player, "ctf_flag_kingdom_5", "0", []),
("ctf_flag_kingdom_6", sokf_moveable|sokf_face_player, "ctf_flag_kingdom_6", "0", []),
("ctf_flag_kingdom_7", sokf_moveable|sokf_face_player, "ctf_flag_kingdom_7", "0", []),
("headquarters_flag_rebel",sokf_moveable|sokf_face_player,"flag_rebel","0", []),
("arabian_lighthouse_a",0,"arabian_lighthouse_a","bo_arabian_lighthouse_a", []),
("arabian_ramp_a",0,"arabian_ramp_a","bo_arabian_ramp_a", []),
("arabian_ramp_b",0,"arabian_ramp_b","bo_arabian_ramp_b", []),
("winery_interior",0,"winery_interior","bo_winery_interior", []),
("winery_barrel_shelf",0,"winery_barrel_shelf","bo_winery_barrel_shelf", []),
("winery_wall_shelf",0,"winery_wall_shelf","bo_winery_wall_shelf", []),
("winery_huge_barrel",0,"winery_huge_barrel","bo_winery_huge_barrel", []),
("winery_wine_press",0,"winery_wine_press","bo_winery_wine_press", []),
("winery_middle_barrel",0,"winery_middle_barrel","bo_winery_middle_barrel", []),
("winery_wine_cart_small_loaded",0,"winery_wine_cart_small_loaded","bo_winery_wine_cart_small_loaded", []),
("winery_wine_cart_small_empty",0,"winery_wine_cart_small_empty","bo_winery_wine_cart_small_empty", []),
("winery_wine_cart_empty",0,"winery_wine_cart_empty","bo_winery_wine_cart_empty", []),
("winery_wine_cart_loaded",0,"winery_wine_cart_loaded","bo_winery_wine_cart_loaded", []),
("weavery_interior",0,"weavery_interior","bo_weavery_interior", []),
("weavery_loom_a",0,"weavery_loom_a","bo_weavery_loom_a", []),
("weavery_spinning_wheel",0,"weavery_spinning_wheel","bo_weavery_spinning_wheel", []),
("mill_interior",0,"mill_interior","bo_mill_interior", []),
("mill_flour_sack", 0,"mill_flour_sack","bo_mill_flour_sack", []),
("mill_flour_sack_desk_a", 0,"mill_flour_sack_desk_a","bo_mill_flour_sack_desk_a", []),
("mill_flour_sack_desk_b", 0,"mill_flour_sack_desk_b","bo_mill_flour_sack_desk_b", []),
("smithy_interior", 0,"smithy_interior","bo_smithy_interior", []),
("smithy_grindstone_wheel", 0,"smithy_grindstone_wheel","bo_smithy_grindstone_wheel", []),
("smithy_forge_bellows", 0,"smithy_forge_bellows","bo_smithy_forge_bellows", []),
("smithy_forge", 0,"smithy_forge","bo_smithy_forge", []),
("smithy_anvil", 0,"smithy_anvil","bo_smithy_anvil", []),
("tannery_hide_a", 0,"tannery_hide_a","bo_tannery_hide_a", []),
("tannery_hide_b", 0,"tannery_hide_b","bo_tannery_hide_b", []),
("tannery_pools_a", 0,"tannery_pools_a","bo_tannery_pools_a", []),
("tannery_pools_b", 0,"tannery_pools_b","bo_tannery_pools_b", []),
("fountain", 0, "fountain", "bo_fountain", []),
("rhodok_houses_a",0,"rhodok_houses_a","bo_rhodok_houses_a", []),
("rhodok_houses_b",0,"rhodok_houses_b","bo_rhodok_houses_b", []),
("rhodok_houses_c",0,"rhodok_houses_c","bo_rhodok_houses_c", []),
("rhodok_houses_d",0,"rhodok_houses_d","bo_rhodok_houses_d", []),
("rhodok_houses_e",0,"rhodok_houses_e","bo_rhodok_houses_e", []),
("rhodok_house_passage_a",0,"rhodok_house_passage_a","bo_rhodok_house_passage_a", []),
("bridge_b",0,"bridge_b","bo_bridge_b", []),
("brewery_pool", 0,"brewery_pool","bo_brewery_pool", []),
("brewery_big_bucket", 0,"brewery_big_bucket","bo_brewery_big_bucket", []),
("brewery_interior", 0,"brewery_interior","bo_brewery_interior", []),
("brewery_bucket_platform_a", 0,"brewery_bucket_platform_a","bo_brewery_bucket_platform_a", []),
("brewery_bucket_platform_b", 0,"brewery_bucket_platform_b","bo_brewery_bucket_platform_b", []),
("weavery_dye_pool_r",0,"weavery_dye_pool_r","bo_weavery_dye_pool_r", []),
("weavery_dye_pool_y",0,"weavery_dye_pool_y","bo_weavery_dye_pool_y", []),
("weavery_dye_pool_b",0,"weavery_dye_pool_b","bo_weavery_dye_pool_b", []),
("weavery_dye_pool_p",0,"weavery_dye_pool_p","bo_weavery_dye_pool_p", []),
("weavery_dye_pool_g",0,"weavery_dye_pool_g","bo_weavery_dye_pool_g", []),
("oil_press_interior",0,"oil_press_interior","bo_oil_press_interior", []),
("city_swad_01" ,0,"city_swad_01" ,"bo_city_swad_01" , []),
("city_swad_02" ,0,"city_swad_02" ,"bo_city_swad_02" , []),
("city_swad_03" ,0,"city_swad_03" ,"bo_city_swad_03" , []),
("city_swad_04" ,0,"city_swad_04" ,"bo_city_swad_04" , []),
("city_swad_passage_01" ,0,"city_swad_passage_01" ,"bo_city_swad_passage_01" , []),
("city_swad_05" ,0,"city_swad_05" ,"bo_city_swad_05" , []),
("arena_block_j_a",0,"arena_block_j_a","bo_arena_block_j_a", []),
("arena_underway_a",0,"arena_underway_a","bo_arena_underway_a", []),
("arena_circle_a",0,"arena_circle_a","bo_arena_circle_a", []),
("rope_bridge_15m",0,"rope_bridge_15m","bo_rope_bridge_15m", []),
("tree_house_a",0,"tree_house_a","bo_tree_house_a", []),
("tree_house_guard_a",0,"tree_house_guard_a","bo_tree_house_guard_a", []),
("tree_house_guard_b",0,"tree_house_guard_b","bo_tree_house_guard_b", []),
("tree_shelter_a",0,"tree_shelter_a","bo_tree_shelter_a", []),
("yellow_fall_leafs_a",0,"0","0",
[
(ti_on_scene_prop_init,
[
(particle_system_add_new, "psys_fall_leafs_a"),
]),
]),
]
| Python |
import string
from header_common import *
from module_info import *
from module_strings import *
from process_common import *
def save_strings(strings):
ofile = open(export_dir + "strings.txt","w")
ofile.write("stringsfile version 1\n")
ofile.write("%d\n"%len(strings))
for i_string in xrange(len(strings)):
str = strings[i_string]
ofile.write("str_%s %s\n"%(convert_to_identifier(str[0]),replace_spaces(str[1])))
ofile.close()
def save_python_header():
ofile = open("./ID_strings.py","w")
for i_string in xrange(len(strings)):
ofile.write("str_%s = %d\n"%(convert_to_identifier(strings[i_string][0]),i_string))
ofile.write("\n\n")
ofile.close()
print "Exporting strings..."
save_python_header()
save_strings(strings)
| Python |
from header_factions import *
####################################################################################################################
# Each faction record contains the following fields:
# 1) Faction id: used for referencing factions in other files.
# The prefix fac_ is automatically added before each faction id.
# 2) Faction name.
# 3) Faction flags. See header_factions.py for a list of available flags
# 4) Faction coherence. Relation between members of this faction.
# 5) Relations. This is a list of relation records.
# Each relation record is a tuple that contains the following fields:
# 5.1) Faction. Which other faction this relation is referring to
# 5.2) Value: Relation value between the two factions.
# Values range between -1 and 1.
# 6) Ranks
# 7) Faction color (default is gray)
####################################################################################################################
default_kingdom_relations = [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.05),("mountain_bandits", -0.02),("forest_bandits", -0.02)]
factions = [
("no_faction","No Faction",0, 0.9, [], []),
("commoners","Commoners",0, 0.1,[("player_faction",0.1)], []),
("outlaws","Outlaws", max_player_rating(-30), 0.5,[("commoners",-0.6),("player_faction",-0.15)], [], 0x888888),
# Factions before this point are hardwired into the game end their order should not be changed.
("neutral","Neutral",0, 0.1,[("player_faction",0.0)], [],0xFFFFFF),
("innocents","Innocents", ff_always_hide_label, 0.5,[("outlaws",-0.05)], []),
("merchants","Merchants", ff_always_hide_label, 0.5,[("outlaws",-0.5),], []),
("dark_knights","{!}Dark Knights", 0, 0.5,[("innocents",-0.9),("player_faction",-0.4)], []),
("culture_1", "{!}culture_1", 0, 0.9, [], []),
("culture_2", "{!}culture_2", 0, 0.9, [], []),
("culture_3", "{!}culture_3", 0, 0.9, [], []),
("culture_4", "{!}culture_4", 0, 0.9, [], []),
("culture_5", "{!}culture_5", 0, 0.9, [], []),
("culture_6", "{!}culture_6", 0, 0.9, [], []),
# ("swadian_caravans","Swadian Caravans", 0, 0.5,[("outlaws",-0.8), ("dark_knights",-0.2)], []),
# ("vaegir_caravans","Vaegir Caravans", 0, 0.5,[("outlaws",-0.8), ("dark_knights",-0.2)], []),
("player_faction","Player Faction",0, 0.9, [], []),
("player_supporters_faction","Player's Supporters",0, 0.9, [("player_faction",1.00),("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xFF4433), #changed name so that can tell difference if shows up on map
("kingdom_1", "Kingdom of Swadia", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xEE7744),
("kingdom_2", "Kingdom of Vaegirs", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCCBB99),
("kingdom_3", "Khergit Khanate", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC99FF),
("kingdom_4", "Kingdom of Nords", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DDDD),
("kingdom_5", "Kingdom of Rhodoks", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DD33),
("kingdom_6", "Sarranid Sultanate", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDDDD33),
## ("kingdom_1_rebels", "Swadian rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
## ("kingdom_2_rebels", "Vaegir rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
## ("kingdom_3_rebels", "Khergit rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
## ("kingdom_4_rebels", "Nord rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
## ("kingdom_5_rebels", "Rhodok rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211),
("kingdoms_end","{!}kingdoms_end", 0, 0,[], []),
("robber_knights", "{!}robber_knights", 0, 0.1, [], []),
("khergits","{!}Khergits", 0, 0.5,[("player_faction",0.0)], []),
("black_khergits","{!}Black Khergits", 0, 0.5,[("player_faction",-0.3),("kingdom_1",-0.02),("kingdom_2",-0.02)], []),
## ("rebel_peasants","Rebel Peasants", 0, 0.5,[("vaegirs",-0.5),("player_faction",0.0)], []),
("manhunters","Manhunters", 0, 0.5,[("outlaws",-0.6),("player_faction",0.1)], []),
("deserters","Deserters", 0, 0.5,[("manhunters",-0.6),("merchants",-0.5),("player_faction",-0.1)], [], 0x888888),
("mountain_bandits","Mountain Bandits", 0, 0.5,[("commoners",-0.2),("merchants",-0.5),("manhunters",-0.6),("player_faction",-0.15)], [], 0x888888),
("forest_bandits","Forest Bandits", 0, 0.5,[("commoners",-0.2),("merchants",-0.5),("manhunters",-0.6),("player_faction",-0.15)], [], 0x888888),
("undeads","{!}Undeads", max_player_rating(-30), 0.5,[("commoners",-0.7),("player_faction",-0.5)], []),
("slavers","{!}Slavers", 0, 0.1, [], []),
("peasant_rebels","{!}Peasant Rebels", 0, 1.0,[("noble_refugees",-1.0),("player_faction",-0.4)], []),
("noble_refugees","{!}Noble Refugees", 0, 0.5,[], []),
]
| Python |
from module_info import *
from module_factions import *
from process_common import *
faction_name_pos = 0
faction_flags_pos = 2
faction_coherence_pos = 3
faction_relations_pos = 4
faction_ranks_pos = 5
def compile_relations():
relations = []
for i in xrange(len(factions)):
r = [0.0 for j in range(len(factions))]
relations.append(r)
for i_faction in xrange(len(factions)):
relations[i_faction][i_faction] = factions[i_faction][faction_coherence_pos]
rels = factions[i_faction][faction_relations_pos]
for rel in rels:
rel_name = rel[0]
other_pos = -1
for j_f in xrange(len(factions)):
if factions[j_f][faction_name_pos] == rel_name:
other_pos = j_f
if other_pos == -1:
print "ERROR faction not found: "+ rel_name
else:
relations[other_pos][i_faction] = rel[1]
relations[i_faction][other_pos] = rel[1]
return relations
def save_factions(relations):
file = open(export_dir + "factions.txt","w")
file.write("factionsfile version 1\n")
file.write("%d\n"%len(factions))
for i_faction in xrange(len(factions)):
faction = factions[i_faction]
fac_color = 0xAAAAAA
if len(faction) == 7:
fac_color = faction[6]
file.write("fac_%s %s %d %d \n"%(convert_to_identifier(faction[0]), replace_spaces(faction[1]), faction[2], fac_color))
for reln in relations[i_faction]:
file.write(" %f "%reln)
file.write("\n")
ranks = []
if (len(faction) > (faction_ranks_pos)):
ranks = faction[faction_ranks_pos]
file.write("%d "%(len(ranks)))
for rank in ranks:
file.write(" %s "%(replace_spaces(rank)))
file.close()
def two_to_pow(x):
result = 1
for i in xrange(x):
result = result * 2
return result
def save_python_header():
file = open("./ID_factions.py","w")
for i_faction in xrange(len(factions)):
file.write("fac_%s = %d\n"%(factions[i_faction][0],i_faction))
file.write("\n\n")
file.close()
print "Exporting faction data..."
save_python_header()
relations = compile_relations()
save_factions(relations)
| Python |
from header_common import *
from header_parties import *
from ID_troops import *
from ID_factions import *
from ID_map_icons import *
pmf_is_prisoner = 0x0001
####################################################################################################################
# Each party template record contains the following fields:
# 1) Party-template id: used for referencing party-templates in other files.
# The prefix pt_ is automatically added before each party-template id.
# 2) Party-template name.
# 3) Party flags. See header_parties.py for a list of available flags
# 4) Menu. ID of the menu to use when this party is met. The value 0 uses the default party encounter system.
# 5) Faction
# 6) Personality. See header_parties.py for an explanation of personality flags.
# 7) List of stacks. Each stack record is a tuple that contains the following fields:
# 7.1) Troop-id.
# 7.2) Minimum number of troops in the stack.
# 7.3) Maximum number of troops in the stack.
# 7.4) Member flags(optional). Use pmf_is_prisoner to note that this member is a prisoner.
# Note: There can be at most 6 stacks.
####################################################################################################################
party_templates = [
("none","none",icon_gray_knight,0,fac_commoners,merchant_personality,[]),
("rescued_prisoners","Rescued Prisoners",icon_gray_knight,0,fac_commoners,merchant_personality,[]),
("enemy","Enemy",icon_gray_knight,0,fac_undeads,merchant_personality,[]),
("hero_party","Hero Party",icon_gray_knight,0,fac_commoners,merchant_personality,[]),
####################################################################################################################
# Party templates before this point are hard-wired into the game and should not be changed.
####################################################################################################################
## ("old_garrison","Old Garrison",icon_vaegir_knight,0,fac_neutral,merchant_personality,[]),
("village_defenders","Village Defenders",icon_peasant,0,fac_commoners,merchant_personality,[(trp_farmer,10,20),(trp_peasant_woman,0,4)]),
("cattle_herd","Cattle Herd",icon_cattle|carries_goods(10),0,fac_neutral,merchant_personality,[(trp_cattle,80,120)]),
## ("vaegir_nobleman","Vaegir Nobleman",icon_vaegir_knight|carries_goods(10)|pf_quest_party,0,fac_commoners,merchant_personality,[(trp_nobleman,1,1),(trp_vaegir_knight,2,6),(trp_vaegir_horseman,4,12)]),
## ("swadian_nobleman","Swadian Nobleman",icon_gray_knight|carries_goods(10)|pf_quest_party,0,fac_commoners,merchant_personality,[(trp_nobleman,1,1),(trp_swadian_knight,2,6),(trp_swadian_man_at_arms,4,12)]),
# Ryan BEGIN
("looters","Looters",icon_axeman|carries_goods(8),0,fac_outlaws,bandit_personality,[(trp_looter,3,45)]),
# Ryan END
("manhunters","Manhunters",icon_gray_knight,0,fac_manhunters,soldier_personality,[(trp_manhunter,9,40)]),
## ("peasant","Peasant",icon_peasant,0,fac_commoners,merchant_personality,[(trp_farmer,1,6),(trp_peasant_woman,0,7)]),
# ("black_khergit_raiders","Black Khergit Raiders",icon_khergit_horseman_b|carries_goods(2),0,fac_black_khergits,bandit_personality,[(trp_black_khergit_guard,1,10),(trp_black_khergit_horseman,5,5)]),
("steppe_bandits","Steppe Bandits",icon_khergit|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_steppe_bandit,4,58)]),
("taiga_bandits","Tundra Bandits",icon_axeman|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_taiga_bandit,4,58)]),
("desert_bandits","Desert Bandits",icon_vaegir_knight|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_desert_bandit,4,58)]),
("forest_bandits","Forest Bandits",icon_axeman|carries_goods(2),0,fac_forest_bandits,bandit_personality,[(trp_forest_bandit,4,52)]),
("mountain_bandits","Mountain Bandits",icon_axeman|carries_goods(2),0,fac_mountain_bandits,bandit_personality,[(trp_mountain_bandit,4,60)]),
("sea_raiders","Sea Raiders",icon_axeman|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_sea_raider,5,50)]),
("deserters","Deserters",icon_vaegir_knight|carries_goods(3),0,fac_deserters,bandit_personality,[]),
("merchant_caravan","Merchant Caravan",icon_gray_knight|carries_goods(20)|pf_auto_remove_in_town|pf_quest_party,0,fac_commoners,escorted_merchant_personality,[(trp_caravan_master,1,1),(trp_caravan_guard,5,25)]),
("troublesome_bandits","Troublesome Bandits",icon_axeman|carries_goods(9)|pf_quest_party,0,fac_outlaws,bandit_personality,[(trp_bandit,14,55)]),
("bandits_awaiting_ransom","Bandits Awaiting Ransom",icon_axeman|carries_goods(9)|pf_auto_remove_in_town|pf_quest_party,0,fac_neutral,bandit_personality,[(trp_bandit,24,58),(trp_kidnapped_girl,1,1,pmf_is_prisoner)]),
("kidnapped_girl","Kidnapped Girl",icon_woman|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_kidnapped_girl,1,1)]),
("village_farmers","Village Farmers",icon_peasant|pf_civilian,0,fac_innocents,merchant_personality,[(trp_farmer,5,10),(trp_peasant_woman,3,8)]),
("spy_partners", "Unremarkable Travellers", icon_gray_knight|carries_goods(10)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_spy_partner,1,1),(trp_caravan_guard,5,11)]),
("runaway_serfs","Runaway Serfs",icon_peasant|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_farmer,6,7), (trp_peasant_woman,3,3)]),
("spy", "Ordinary Townsman", icon_gray_knight|carries_goods(4)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_spy,1,1)]),
("sacrificed_messenger", "Sacrificed Messenger", icon_gray_knight|carries_goods(3)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[]),
## ("conspirator", "Conspirators", icon_gray_knight|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_conspirator,3,4)]),
## ("conspirator_leader", "Conspirator Leader", icon_gray_knight|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_conspirator_leader,1,1)]),
## ("peasant_rebels", "Peasant Rebels", icon_peasant,0,fac_peasant_rebels,bandit_personality,[(trp_peasant_rebel,33,97)]),
## ("noble_refugees", "Noble Refugees", icon_gray_knight|carries_goods(12)|pf_quest_party,0,fac_noble_refugees,merchant_personality,[(trp_noble_refugee,3,5),(trp_noble_refugee_woman,5,7)]),
("forager_party","Foraging Party",icon_gray_knight|carries_goods(5)|pf_show_faction,0,fac_commoners,merchant_personality,[]),
("scout_party","Scouts",icon_gray_knight|carries_goods(1)|pf_show_faction,0,fac_commoners,bandit_personality,[]),
("patrol_party","Patrol",icon_gray_knight|carries_goods(2)|pf_show_faction,0,fac_commoners,soldier_personality,[]),
# ("war_party", "War Party",icon_gray_knight|carries_goods(3),0,fac_commoners,soldier_personality,[]),
("messenger_party","Messenger",icon_gray_knight|pf_show_faction,0,fac_commoners,merchant_personality,[]),
("raider_party","Raiders",icon_gray_knight|carries_goods(16)|pf_quest_party,0,fac_commoners,bandit_personality,[]),
("raider_captives","Raider Captives",0,0,fac_commoners,0,[(trp_peasant_woman,6,30,pmf_is_prisoner)]),
("kingdom_caravan_party","Caravan",icon_mule|carries_goods(25)|pf_show_faction,0,fac_commoners,merchant_personality,[(trp_caravan_master,1,1),(trp_caravan_guard,12,40)]),
("prisoner_train_party","Prisoner Train",icon_gray_knight|carries_goods(5)|pf_show_faction,0,fac_commoners,merchant_personality,[]),
("default_prisoners","Default Prisoners",0,0,fac_commoners,0,[(trp_bandit,5,10,pmf_is_prisoner)]),
("routed_warriors","Routed Enemies",icon_vaegir_knight,0,fac_commoners,soldier_personality,[]),
# Caravans
("center_reinforcements","Reinforcements",icon_axeman|carries_goods(16),0,fac_commoners,soldier_personality,[(trp_townsman,5,30),(trp_watchman,4,20)]),
("kingdom_hero_party","War Party",icon_flagbearer_a|pf_show_faction|pf_default_behavior,0,fac_commoners,soldier_personality,[]),
# Reinforcements
# each faction includes three party templates. One is less-modernised, one is med-modernised and one is high-modernised
# less-modernised templates are generally includes 7-14 troops in total,
# med-modernised templates are generally includes 5-10 troops in total,
# high-modernised templates are generally includes 3-5 troops in total
("kingdom_1_reinforcements_a", "{!}kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_swadian_recruit,5,10),(trp_swadian_militia,2,4)]),
("kingdom_1_reinforcements_b", "{!}kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_swadian_footman,3,6),(trp_swadian_skirmisher,2,4)]),
("kingdom_1_reinforcements_c", "{!}kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_swadian_man_at_arms,2,4),(trp_swadian_crossbowman,1,2)]), #Swadians are a bit less-powered thats why they have a bit more troops in their modernised party template (3-6, others 3-5)
("kingdom_2_reinforcements_a", "{!}kingdom_2_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_vaegir_recruit,5,10),(trp_vaegir_footman,2,4)]),
("kingdom_2_reinforcements_b", "{!}kingdom_2_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_vaegir_veteran,2,4),(trp_vaegir_skirmisher,2,4),(trp_vaegir_footman,1,2)]),
("kingdom_2_reinforcements_c", "{!}kingdom_2_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_vaegir_horseman,2,3),(trp_vaegir_infantry,1,2)]),
("kingdom_3_reinforcements_a", "{!}kingdom_3_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_khergit_tribesman,3,5),(trp_khergit_skirmisher,4,9)]), #Khergits are a bit less-powered thats why they have a bit more 2nd upgraded(trp_khergit_skirmisher) than non-upgraded one(trp_khergit_tribesman).
("kingdom_3_reinforcements_b", "{!}kingdom_3_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_khergit_horseman,2,4),(trp_khergit_horse_archer,2,4),(trp_khergit_skirmisher,1,2)]),
("kingdom_3_reinforcements_c", "{!}kingdom_3_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_khergit_horseman,2,4),(trp_khergit_veteran_horse_archer,2,3)]), #Khergits are a bit less-powered thats why they have a bit more troops in their modernised party template (4-7, others 3-5)
("kingdom_4_reinforcements_a", "{!}kingdom_4_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_nord_footman,5,10),(trp_nord_recruit,2,4)]),
("kingdom_4_reinforcements_b", "{!}kingdom_4_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_nord_huntsman,2,5),(trp_nord_archer,2,3),(trp_nord_footman,1,2)]),
("kingdom_4_reinforcements_c", "{!}kingdom_4_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_nord_warrior,3,5)]),
("kingdom_5_reinforcements_a", "{!}kingdom_5_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_tribesman,5,10),(trp_rhodok_spearman,2,4)]),
("kingdom_5_reinforcements_b", "{!}kingdom_5_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_crossbowman,3,6),(trp_rhodok_trained_crossbowman,2,4)]),
("kingdom_5_reinforcements_c", "{!}kingdom_5_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rhodok_veteran_spearman,2,3),(trp_rhodok_veteran_crossbowman,1,2)]),
("kingdom_6_reinforcements_a", "{!}kingdom_6_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_sarranid_recruit,5,10),(trp_sarranid_footman,2,4)]),
("kingdom_6_reinforcements_b", "{!}kingdom_6_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_sarranid_skirmisher,2,4),(trp_sarranid_veteran_footman,2,3),(trp_sarranid_footman,1,3)]),
("kingdom_6_reinforcements_c", "{!}kingdom_6_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_sarranid_horseman,3,5)]),
## ("kingdom_1_reinforcements_a", "kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_swadian_footman,3,7),(trp_swadian_skirmisher,5,10),(trp_swadian_militia,11,26)]),
## ("kingdom_1_reinforcements_b", "kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_swadian_man_at_arms,5,10),(trp_swadian_infantry,5,10),(trp_swadian_crossbowman,3,8)]),
## ("kingdom_1_reinforcements_c", "kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_swadian_knight,2,6),(trp_swadian_sergeant,2,5),(trp_swadian_sharpshooter,2,5)]),
##
## ("kingdom_2_reinforcements_a", "kingdom_2_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_vaegir_veteran,3,7),(trp_vaegir_skirmisher,5,10),(trp_vaegir_footman,11,26)]),
## ("kingdom_2_reinforcements_b", "kingdom_2_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_vaegir_horseman,4,9),(trp_vaegir_infantry,5,10),(trp_vaegir_archer,3,8)]),
## ("kingdom_2_reinforcements_c", "kingdom_2_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_vaegir_knight,3,7),(trp_vaegir_guard,2,5),(trp_vaegir_marksman,2,5)]),
##
## ("kingdom_3_reinforcements_a", "kingdom_3_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_khergit_horseman,3,7),(trp_khergit_skirmisher,5,10),(trp_khergit_tribesman,11,26)]),
## ("kingdom_3_reinforcements_b", "kingdom_3_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_khergit_veteran_horse_archer,4,9),(trp_khergit_horse_archer,5,10),(trp_khergit_horseman,3,8)]),
## ("kingdom_3_reinforcements_c", "kingdom_3_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_khergit_lancer,3,7),(trp_khergit_veteran_horse_archer,2,5),(trp_khergit_horse_archer,2,5)]),
##
## ("kingdom_4_reinforcements_a", "kingdom_4_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_nord_trained_footman,3,7),(trp_nord_footman,5,10),(trp_nord_recruit,11,26)]),
## ("kingdom_4_reinforcements_b", "kingdom_4_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_nord_veteran,4,9),(trp_nord_warrior,5,10),(trp_nord_footman,3,8)]),
## ("kingdom_4_reinforcements_c", "kingdom_4_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_nord_champion,1,3),(trp_nord_veteran,2,5),(trp_nord_warrior,2,5)]),
##
## ("kingdom_5_reinforcements_a", "kingdom_5_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_spearman,3,7),(trp_rhodok_crossbowman,5,10),(trp_rhodok_tribesman,11,26)]),
## ("kingdom_5_reinforcements_b", "kingdom_5_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_trained_spearman,4,9),(trp_rhodok_spearman,5,10),(trp_rhodok_crossbowman,3,8)]),
## ("kingdom_5_reinforcements_c", "kingdom_5_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rhodok_sergeant,3,7),(trp_rhodok_veteran_spearman,2,5),(trp_rhodok_veteran_crossbowman,2,5)]),
("steppe_bandit_lair" ,"Steppe Bandit Lair",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_steppe_bandit,15,58)]),
("taiga_bandit_lair","Tundra Bandit Lair",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_taiga_bandit,15,58)]),
("desert_bandit_lair" ,"Desert Bandit Lair",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_desert_bandit,15,58)]),
("forest_bandit_lair" ,"Forest Bandit Camp",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_forest_bandit,15,58)]),
("mountain_bandit_lair" ,"Mountain Bandit Hideout",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_mountain_bandit,15,58)]),
("sea_raider_lair","Sea Raider Landing",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_sea_raider,15,50)]),
("looter_lair","Kidnappers' Hideout",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_looter,15,25)]),
("bandit_lair_templates_end","{!}bandit_lair_templates_end",icon_axeman|carries_goods(2)|pf_is_static,0,fac_outlaws,bandit_personality,[(trp_sea_raider,15,50)]),
("leaded_looters","Band of robbers",icon_axeman|carries_goods(8)|pf_quest_party,0,fac_neutral,bandit_personality,[(trp_looter_leader,1,1),(trp_looter,3,3)]),
]
| Python |
import string
from module_info import *
from module_info_pages import *
from process_common import *
def save_info_pages():
ofile = open(export_dir + "info_pages.txt","w")
ofile.write("infopagesfile version 1\n")
ofile.write("%d\n"%(len(info_pages)))
for i_info_page in xrange(len(info_pages)):
info_page = info_pages[i_info_page]
ofile.write("ip_%s %s %s"%(info_page[0],string.replace(info_page[1]," ","_"), string.replace(info_page[2]," ","_")))
ofile.write("\n")
ofile.close()
def save_python_header():
ofile = open("./ID_info_pages.py","w")
for i_info_page in xrange(len(info_pages)):
ofile.write("ip_%s = %d\n"%(info_pages[i_info_page][0],i_info_page))
ofile.write("\n\n")
ofile.close()
print "Exporting info_page data..."
save_info_pages()
save_python_header()
| Python |
prsnt_game_credits = 0
prsnt_game_profile_banner_selection = 1
prsnt_game_custom_battle_designer = 2
prsnt_game_multiplayer_admin_panel = 3
prsnt_multiplayer_welcome_message = 4
prsnt_multiplayer_team_select = 5
prsnt_multiplayer_troop_select = 6
prsnt_multiplayer_item_select = 7
prsnt_multiplayer_message_1 = 8
prsnt_multiplayer_message_2 = 9
prsnt_multiplayer_message_3 = 10
prsnt_multiplayer_round_time_counter = 11
prsnt_multiplayer_team_score_display = 12
prsnt_multiplayer_flag_projection_display = 13
prsnt_multiplayer_flag_projection_display_bt = 14
prsnt_multiplayer_destructible_targets_display = 15
prsnt_multiplayer_respawn_time_counter = 16
prsnt_multiplayer_stats_chart = 17
prsnt_multiplayer_stats_chart_deathmatch = 18
prsnt_multiplayer_escape_menu = 19
prsnt_multiplayer_poll_menu = 20
prsnt_multiplayer_show_players_list = 21
prsnt_multiplayer_show_maps_list = 22
prsnt_multiplayer_show_factions_list = 23
prsnt_multiplayer_show_number_of_bots_list = 24
prsnt_multiplayer_poll = 25
prsnt_tutorial_show_mouse_movement = 26
prsnt_name_kingdom = 27
prsnt_banner_selection = 28
prsnt_custom_banner = 29
prsnt_banner_charge_positioning = 30
prsnt_banner_charge_selection = 31
prsnt_banner_background_selection = 32
prsnt_banner_flag_type_selection = 33
prsnt_banner_flag_map_type_selection = 34
prsnt_color_selection = 35
prsnt_marshall_selection = 36
prsnt_battle = 37
prsnt_sliders = 38
prsnt_arena_training = 39
prsnt_retirement = 40
prsnt_budget_report = 41
prsnt_game_before_quit = 42
prsnt_multiplayer_duel_start_counter = 43
| Python |
import string
from header_common import *
from module_info import *
from module_skills import *
from process_common import *
skill_name_pos = 1
skill_attribute_pos = 2
skill_max_level_pos= 3
skill_desc_pos = 4
def save_skills():
ofile = open(export_dir + "skills.txt","w")
ofile.write("%d\n"%(len(skills)))
for i_skill in xrange(len(skills)):
skill = skills[i_skill]
ofile.write("skl_%s %s "%(skill[0], replace_spaces(skill[1])))
ofile.write("%d %d %s\n"%(skill[skill_attribute_pos],skill[skill_max_level_pos],(string.replace(skill[skill_desc_pos]," ","_"))))
ofile.close()
def save_python_header():
ofile = open("./ID_skills.py","w")
for i_skill in xrange(len(skills)):
ofile.write("skl_%s = %d\n"%(skills[i_skill][0],i_skill))
ofile.write("\n\n")
ofile.close()
print "Exporting skills..."
save_python_header()
save_skills()
| Python |
from module_info import *
from module_particle_systems import *
from process_common import *
id_pos = 0
flags_pos = 1
mesh_name_pos = 2
num_particles_pos = 3
life_pos = 4
damping_pos = 5
gravity_pos = 6
turb_size_pos = 7
turb_wt_pos = 8
alpha_key_pos = 9
red_key_pos = alpha_key_pos + 2
green_key_pos = red_key_pos + 2
blue_key_pos = green_key_pos + 2
scale_key_pos = blue_key_pos + 2
emit_box_size_pos = scale_key_pos + 2
emit_velocity_pos = emit_box_size_pos + 1
emit_rndmness_pos = emit_velocity_pos + 1
angular_speed_pos = emit_rndmness_pos + 1
angular_damping_pos = angular_speed_pos + 1
def save_psys_keys(ofile, keys1, keys2):
ofile.write("%f %f %f %f\n"%(keys1[0], keys1[1], keys2[0], keys2[1]))
def save_particle_systems():
ofile = open(export_dir + "particle_systems.txt","w")
ofile.write("particle_systemsfile version 1\n")
ofile.write("%d\n"%len(particle_systems))
for psys in particle_systems:
ofile.write("psys_%s %d %s "%(psys[0], psys[1], psys[2]))
ofile.write("%d %f %f %f %f %f \n"%(psys[num_particles_pos], psys[life_pos], psys[damping_pos], psys[gravity_pos], psys[turb_size_pos], psys[turb_wt_pos]))
save_psys_keys(ofile,psys[alpha_key_pos],psys[alpha_key_pos+1])
save_psys_keys(ofile,psys[red_key_pos],psys[red_key_pos+1])
save_psys_keys(ofile,psys[green_key_pos],psys[green_key_pos+1])
save_psys_keys(ofile,psys[blue_key_pos],psys[blue_key_pos+1])
save_psys_keys(ofile,psys[scale_key_pos],psys[scale_key_pos+1])
ofile.write("%f %f %f "%(psys[emit_box_size_pos][0],psys[emit_box_size_pos][1],psys[emit_box_size_pos][2]))
ofile.write("%f %f %f "%(psys[emit_velocity_pos][0],psys[emit_velocity_pos][1],psys[emit_velocity_pos][2]))
ofile.write("%f \n"%(psys[emit_rndmness_pos]))
if (len(psys) >= (angular_speed_pos + 1)):
ofile.write("%f "%(psys[angular_speed_pos]))
else:
ofile.write("0.0 ")
if (len(psys) >= (angular_damping_pos + 1)):
ofile.write("%f "%(psys[angular_damping_pos]))
else:
ofile.write("0.0 ")
ofile.write("\n")
ofile.close()
def save_python_header():
ofile = open("./ID_particle_systems.py","w")
for i_particle_system in xrange(len(particle_systems)):
ofile.write("psys_%s = %d\n"%(particle_systems[i_particle_system][0],i_particle_system))
ofile.close()
print "Exporting particle data..."
save_particle_systems()
save_python_header()
| Python |
pt_none = 0
pt_rescued_prisoners = 1
pt_enemy = 2
pt_hero_party = 3
pt_village_defenders = 4
pt_cattle_herd = 5
pt_looters = 6
pt_manhunters = 7
pt_steppe_bandits = 8
pt_taiga_bandits = 9
pt_desert_bandits = 10
pt_forest_bandits = 11
pt_mountain_bandits = 12
pt_sea_raiders = 13
pt_deserters = 14
pt_merchant_caravan = 15
pt_troublesome_bandits = 16
pt_bandits_awaiting_ransom = 17
pt_kidnapped_girl = 18
pt_village_farmers = 19
pt_spy_partners = 20
pt_runaway_serfs = 21
pt_spy = 22
pt_sacrificed_messenger = 23
pt_forager_party = 24
pt_scout_party = 25
pt_patrol_party = 26
pt_messenger_party = 27
pt_raider_party = 28
pt_raider_captives = 29
pt_kingdom_caravan_party = 30
pt_prisoner_train_party = 31
pt_default_prisoners = 32
pt_routed_warriors = 33
pt_center_reinforcements = 34
pt_kingdom_hero_party = 35
pt_kingdom_1_reinforcements_a = 36
pt_kingdom_1_reinforcements_b = 37
pt_kingdom_1_reinforcements_c = 38
pt_kingdom_2_reinforcements_a = 39
pt_kingdom_2_reinforcements_b = 40
pt_kingdom_2_reinforcements_c = 41
pt_kingdom_3_reinforcements_a = 42
pt_kingdom_3_reinforcements_b = 43
pt_kingdom_3_reinforcements_c = 44
pt_kingdom_4_reinforcements_a = 45
pt_kingdom_4_reinforcements_b = 46
pt_kingdom_4_reinforcements_c = 47
pt_kingdom_5_reinforcements_a = 48
pt_kingdom_5_reinforcements_b = 49
pt_kingdom_5_reinforcements_c = 50
pt_kingdom_6_reinforcements_a = 51
pt_kingdom_6_reinforcements_b = 52
pt_kingdom_6_reinforcements_c = 53
pt_steppe_bandit_lair = 54
pt_taiga_bandit_lair = 55
pt_desert_bandit_lair = 56
pt_forest_bandit_lair = 57
pt_mountain_bandit_lair = 58
pt_sea_raider_lair = 59
pt_looter_lair = 60
pt_bandit_lair_templates_end = 61
pt_leaded_looters = 62
| Python |
from header_map_icons import *
from module_constants import *
from header_operations import *
from header_triggers import *
from ID_sounds import *
####################################################################################################################
# Each map icon record contains the following fields:
# 1) Map icon id: used for referencing map icons in other files.
# The prefix icon_ is automatically added before each map icon id.
# 2) Map icon flags. See header_map icons.py for a list of available flags
# 3) Mesh name.
# 4) Scale.
# 5) Sound.
# 6) Offset x position for the flag icon.
# 7) Offset y position for the flag icon.
# 8) Offset z position for the flag icon.
####################################################################################################################
banner_scale = 0.3
avatar_scale = 0.15
map_icons = [
("player",0,"player", avatar_scale, snd_footstep_grass, 0.15, 0.173, 0),
("player_horseman",0,"player_horseman", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("gray_knight",0,"knight_a", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("vaegir_knight",0,"knight_b", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("flagbearer_a",0,"flagbearer_a", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("flagbearer_b",0,"flagbearer_b", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("peasant",0,"peasant_a", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0),
("khergit",0,"khergit_horseman", avatar_scale,snd_gallop, 0.15, 0.173, 0),
("khergit_horseman_b",0,"khergit_horseman_b", avatar_scale,snd_gallop, 0.15, 0.173, 0),
("axeman",0,"bandit_a", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0),
("woman",0,"woman_a", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0),
("woman_b",0,"woman_b", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0),
("town",mcn_no_shadow,"map_town_a", 0.35,0),
("town_steppe",mcn_no_shadow,"map_town_steppe_a", 0.35,0),
("town_desert",mcn_no_shadow,"map_town_desert_a", 0.35,0),
("village_a",mcn_no_shadow,"map_village_a", 0.45, 0),
("village_b",mcn_no_shadow,"map_village_b", 0.45, 0),
("village_c",mcn_no_shadow,"map_village_c", 0.45, 0),
("village_burnt_a",mcn_no_shadow,"map_village_burnt_a", 0.45, 0),
("village_deserted_a",mcn_no_shadow,"map_village_deserted_a", 0.45, 0),
("village_burnt_b",mcn_no_shadow,"map_village_burnt_b", 0.45, 0),
("village_deserted_b",mcn_no_shadow,"map_village_deserted_b", 0.45, 0),
("village_burnt_c",mcn_no_shadow,"map_village_burnt_c", 0.45, 0),
("village_deserted_c",mcn_no_shadow,"map_village_deserted_c", 0.45, 0),
("village_snow_a",mcn_no_shadow,"map_village_snow_a", 0.45, 0),
("village_snow_burnt_a",mcn_no_shadow,"map_village_snow_burnt_a", 0.45, 0),
("village_snow_deserted_a",mcn_no_shadow,"map_village_snow_deserted_a", 0.45, 0),
("camp",mcn_no_shadow,"camp_tent", 0.13, 0),
("ship",mcn_no_shadow,"boat_sail_on", 0.23, snd_footstep_grass, 0.0, 0.05, 0),
("ship_on_land",mcn_no_shadow,"boat_sail_off", 0.23, 0),
("castle_a",mcn_no_shadow,"map_castle_a", 0.35,0),
("castle_b",mcn_no_shadow,"map_castle_b", 0.35,0),
("castle_c",mcn_no_shadow,"map_castle_c", 0.35,0),
("castle_d",mcn_no_shadow,"map_castle_d", 0.35,0),
("town_snow",mcn_no_shadow,"map_town_snow_a", 0.35,0),
("castle_snow_a",mcn_no_shadow,"map_castle_snow_a", 0.35,0),
("castle_snow_b",mcn_no_shadow,"map_castle_snow_b", 0.35,0),
("mule",0,"icon_mule", 0.2,snd_footstep_grass, 0.15, 0.173, 0),
("cattle",0,"icon_cow", 0.2,snd_footstep_grass, 0.15, 0.173, 0),
("training_ground",mcn_no_shadow,"training", 0.35,0),
("bridge_a",mcn_no_shadow,"map_river_bridge_a", 1.27,0),
("bridge_b",mcn_no_shadow,"map_river_bridge_b", 0.7,0),
("bridge_snow_a",mcn_no_shadow,"map_river_bridge_snow_a", 1.27,0),
("custom_banner_01",0,"custom_map_banner_01", banner_scale, 0,
[
(ti_on_init_map_icon,
[
(store_trigger_param_1, ":party_no"),
(party_get_slot, ":leader_troop", ":party_no", slot_town_lord),
(try_begin),
(ge, ":leader_troop", 0),
(cur_map_icon_set_tableau_material, "tableau_custom_banner_square", ":leader_troop"),
(try_end),
]),
]),
("custom_banner_02",0,"custom_map_banner_02", banner_scale, 0,
[
(ti_on_init_map_icon,
[
(store_trigger_param_1, ":party_no"),
(party_get_slot, ":leader_troop", ":party_no", slot_town_lord),
(try_begin),
(ge, ":leader_troop", 0),
(cur_map_icon_set_tableau_material, "tableau_custom_banner_short", ":leader_troop"),
(try_end),
]),
]),
("custom_banner_03",0,"custom_map_banner_03", banner_scale, 0,
[
(ti_on_init_map_icon,
[
(store_trigger_param_1, ":party_no"),
(party_get_slot, ":leader_troop", ":party_no", slot_town_lord),
(try_begin),
(ge, ":leader_troop", 0),
(cur_map_icon_set_tableau_material, "tableau_custom_banner_tall", ":leader_troop"),
(try_end),
]),
]),
# Banners
("banner_01",0,"map_flag_01", banner_scale,0),
("banner_02",0,"map_flag_02", banner_scale,0),
("banner_03",0,"map_flag_03", banner_scale,0),
("banner_04",0,"map_flag_04", banner_scale,0),
("banner_05",0,"map_flag_05", banner_scale,0),
("banner_06",0,"map_flag_06", banner_scale,0),
("banner_07",0,"map_flag_07", banner_scale,0),
("banner_08",0,"map_flag_08", banner_scale,0),
("banner_09",0,"map_flag_09", banner_scale,0),
("banner_10",0,"map_flag_10", banner_scale,0),
("banner_11",0,"map_flag_11", banner_scale,0),
("banner_12",0,"map_flag_12", banner_scale,0),
("banner_13",0,"map_flag_13", banner_scale,0),
("banner_14",0,"map_flag_14", banner_scale,0),
("banner_15",0,"map_flag_f21", banner_scale,0),
("banner_16",0,"map_flag_16", banner_scale,0),
("banner_17",0,"map_flag_17", banner_scale,0),
("banner_18",0,"map_flag_18", banner_scale,0),
("banner_19",0,"map_flag_19", banner_scale,0),
("banner_20",0,"map_flag_20", banner_scale,0),
("banner_21",0,"map_flag_21", banner_scale,0),
("banner_22",0,"map_flag_22", banner_scale,0),
("banner_23",0,"map_flag_23", banner_scale,0),
("banner_24",0,"map_flag_24", banner_scale,0),
("banner_25",0,"map_flag_25", banner_scale,0),
("banner_26",0,"map_flag_26", banner_scale,0),
("banner_27",0,"map_flag_27", banner_scale,0),
("banner_28",0,"map_flag_28", banner_scale,0),
("banner_29",0,"map_flag_29", banner_scale,0),
("banner_30",0,"map_flag_30", banner_scale,0),
("banner_31",0,"map_flag_31", banner_scale,0),
("banner_32",0,"map_flag_32", banner_scale,0),
("banner_33",0,"map_flag_33", banner_scale,0),
("banner_34",0,"map_flag_34", banner_scale,0),
("banner_35",0,"map_flag_35", banner_scale,0),
("banner_36",0,"map_flag_36", banner_scale,0),
("banner_37",0,"map_flag_37", banner_scale,0),
("banner_38",0,"map_flag_38", banner_scale,0),
("banner_39",0,"map_flag_39", banner_scale,0),
("banner_40",0,"map_flag_40", banner_scale,0),
("banner_41",0,"map_flag_41", banner_scale,0),
("banner_42",0,"map_flag_42", banner_scale,0),
("banner_43",0,"map_flag_43", banner_scale,0),
("banner_44",0,"map_flag_44", banner_scale,0),
("banner_45",0,"map_flag_45", banner_scale,0),
("banner_46",0,"map_flag_46", banner_scale,0),
("banner_47",0,"map_flag_47", banner_scale,0),
("banner_48",0,"map_flag_48", banner_scale,0),
("banner_49",0,"map_flag_49", banner_scale,0),
("banner_50",0,"map_flag_50", banner_scale,0),
("banner_51",0,"map_flag_51", banner_scale,0),
("banner_52",0,"map_flag_52", banner_scale,0),
("banner_53",0,"map_flag_53", banner_scale,0),
("banner_54",0,"map_flag_54", banner_scale,0),
("banner_55",0,"map_flag_55", banner_scale,0),
("banner_56",0,"map_flag_56", banner_scale,0),
("banner_57",0,"map_flag_57", banner_scale,0),
("banner_58",0,"map_flag_58", banner_scale,0),
("banner_59",0,"map_flag_59", banner_scale,0),
("banner_60",0,"map_flag_60", banner_scale,0),
("banner_61",0,"map_flag_61", banner_scale,0),
("banner_62",0,"map_flag_62", banner_scale,0),
("banner_63",0,"map_flag_63", banner_scale,0),
("banner_64",0,"map_flag_d01", banner_scale,0),
("banner_65",0,"map_flag_d02", banner_scale,0),
("banner_66",0,"map_flag_d03", banner_scale,0),
("banner_67",0,"map_flag_d04", banner_scale,0),
("banner_68",0,"map_flag_d05", banner_scale,0),
("banner_69",0,"map_flag_d06", banner_scale,0),
("banner_70",0,"map_flag_d07", banner_scale,0),
("banner_71",0,"map_flag_d08", banner_scale,0),
("banner_72",0,"map_flag_d09", banner_scale,0),
("banner_73",0,"map_flag_d10", banner_scale,0),
("banner_74",0,"map_flag_d11", banner_scale,0),
("banner_75",0,"map_flag_d12", banner_scale,0),
("banner_76",0,"map_flag_d13", banner_scale,0),
("banner_77",0,"map_flag_d14", banner_scale,0),
("banner_78",0,"map_flag_d15", banner_scale,0),
("banner_79",0,"map_flag_d16", banner_scale,0),
("banner_80",0,"map_flag_d17", banner_scale,0),
("banner_81",0,"map_flag_d18", banner_scale,0),
("banner_82",0,"map_flag_d19", banner_scale,0),
("banner_83",0,"map_flag_d20", banner_scale,0),
("banner_84",0,"map_flag_d21", banner_scale,0),
("banner_85",0,"map_flag_e01", banner_scale,0),
("banner_86",0,"map_flag_e02", banner_scale,0),
("banner_87",0,"map_flag_e03", banner_scale,0),
("banner_88",0,"map_flag_e04", banner_scale,0),
("banner_89",0,"map_flag_e05", banner_scale,0),
("banner_90",0,"map_flag_e06", banner_scale,0),
("banner_91",0,"map_flag_e07", banner_scale,0),
("banner_92",0,"map_flag_e08", banner_scale,0),
("banner_93",0,"map_flag_e09", banner_scale,0),
("banner_94",0,"map_flag_e10", banner_scale,0),
("banner_95",0,"map_flag_e11", banner_scale,0),
("banner_96",0,"map_flag_e12", banner_scale,0),
("banner_97",0,"map_flag_e13", banner_scale,0),
("banner_98",0,"map_flag_e14", banner_scale,0),
("banner_99",0,"map_flag_e15", banner_scale,0),
("banner_100",0,"map_flag_e16", banner_scale,0),
("banner_101",0,"map_flag_e17", banner_scale,0),
("banner_102",0,"map_flag_e18", banner_scale,0),
("banner_103",0,"map_flag_e19", banner_scale,0),
("banner_104",0,"map_flag_e20", banner_scale,0),
("banner_105",0,"map_flag_e21", banner_scale,0),
("banner_106",0,"map_flag_f01", banner_scale,0),
("banner_107",0,"map_flag_f02", banner_scale,0),
("banner_108",0,"map_flag_f03", banner_scale,0),
("banner_109",0,"map_flag_f04", banner_scale,0),
("banner_110",0,"map_flag_f05", banner_scale,0),
("banner_111",0,"map_flag_f06", banner_scale,0),
("banner_112",0,"map_flag_f07", banner_scale,0),
("banner_113",0,"map_flag_f08", banner_scale,0),
("banner_114",0,"map_flag_f09", banner_scale,0),
("banner_115",0,"map_flag_f10", banner_scale,0),
("banner_116",0,"map_flag_f11", banner_scale,0),
("banner_117",0,"map_flag_f12", banner_scale,0),
("banner_118",0,"map_flag_f13", banner_scale,0),
("banner_119",0,"map_flag_f14", banner_scale,0),
("banner_120",0,"map_flag_f15", banner_scale,0),
("banner_121",0,"map_flag_f16", banner_scale,0),
("banner_122",0,"map_flag_f17", banner_scale,0),
("banner_123",0,"map_flag_f18", banner_scale,0),
("banner_124",0,"map_flag_f19", banner_scale,0),
("banner_125",0,"map_flag_f20", banner_scale,0),
("banner_126",0,"map_flag_f01", banner_scale,0),
("banner_127",0,"map_flag_f02", banner_scale,0),
("banner_128",0,"map_flag_f03", banner_scale,0),
("banner_129",0,"map_flag_f04", banner_scale,0),
("banner_130",0,"map_flag_f05", banner_scale,0),
("banner_131",0,"map_flag_f06", banner_scale,0),
("banner_132",0,"map_flag_f07", banner_scale,0),
("banner_133",0,"map_flag_f08", banner_scale,0),
("banner_134",0,"map_flag_f09", banner_scale,0),
("banner_135",0,"map_flag_f10", banner_scale,0),
("map_flag_kingdom_a",0,"map_flag_kingdom_a", banner_scale,0),
("map_flag_kingdom_b",0,"map_flag_kingdom_b", banner_scale,0),
("map_flag_kingdom_c",0,"map_flag_kingdom_c", banner_scale,0),
("map_flag_kingdom_d",0,"map_flag_kingdom_d", banner_scale,0),
("map_flag_kingdom_e",0,"map_flag_kingdom_e", banner_scale,0),
("map_flag_kingdom_f",0,"map_flag_kingdom_f", banner_scale,0),
("banner_136",0,"map_flag_15", banner_scale,0),
("bandit_lair",mcn_no_shadow,"map_bandit_lair", 0.45, 0),
]
| Python |
trp_player = 0
trp_multiplayer_profile_troop_male = 1
trp_multiplayer_profile_troop_female = 2
trp_temp_troop = 3
trp_find_item_cheat = 4
trp_random_town_sequence = 5
trp_tournament_participants = 6
trp_tutorial_maceman = 7
trp_tutorial_archer = 8
trp_tutorial_swordsman = 9
trp_novice_fighter = 10
trp_regular_fighter = 11
trp_veteran_fighter = 12
trp_champion_fighter = 13
trp_arena_training_fighter_1 = 14
trp_arena_training_fighter_2 = 15
trp_arena_training_fighter_3 = 16
trp_arena_training_fighter_4 = 17
trp_arena_training_fighter_5 = 18
trp_arena_training_fighter_6 = 19
trp_arena_training_fighter_7 = 20
trp_arena_training_fighter_8 = 21
trp_arena_training_fighter_9 = 22
trp_arena_training_fighter_10 = 23
trp_cattle = 24
trp_farmer = 25
trp_townsman = 26
trp_watchman = 27
trp_caravan_guard = 28
trp_mercenary_swordsman = 29
trp_hired_blade = 30
trp_mercenary_crossbowman = 31
trp_mercenary_horseman = 32
trp_mercenary_cavalry = 33
trp_mercenaries_end = 34
trp_swadian_recruit = 35
trp_swadian_militia = 36
trp_swadian_footman = 37
trp_swadian_infantry = 38
trp_swadian_sergeant = 39
trp_swadian_skirmisher = 40
trp_swadian_crossbowman = 41
trp_swadian_sharpshooter = 42
trp_swadian_man_at_arms = 43
trp_swadian_knight = 44
trp_swadian_messenger = 45
trp_swadian_deserter = 46
trp_swadian_prison_guard = 47
trp_swadian_castle_guard = 48
trp_vaegir_recruit = 49
trp_vaegir_footman = 50
trp_vaegir_skirmisher = 51
trp_vaegir_archer = 52
trp_vaegir_marksman = 53
trp_vaegir_veteran = 54
trp_vaegir_infantry = 55
trp_vaegir_guard = 56
trp_vaegir_horseman = 57
trp_vaegir_knight = 58
trp_vaegir_messenger = 59
trp_vaegir_deserter = 60
trp_vaegir_prison_guard = 61
trp_vaegir_castle_guard = 62
trp_khergit_tribesman = 63
trp_khergit_skirmisher = 64
trp_khergit_horseman = 65
trp_khergit_horse_archer = 66
trp_khergit_veteran_horse_archer = 67
trp_khergit_lancer = 68
trp_khergit_messenger = 69
trp_khergit_deserter = 70
trp_khergit_prison_guard = 71
trp_khergit_castle_guard = 72
trp_nord_recruit = 73
trp_nord_footman = 74
trp_nord_trained_footman = 75
trp_nord_warrior = 76
trp_nord_veteran = 77
trp_nord_champion = 78
trp_nord_huntsman = 79
trp_nord_archer = 80
trp_nord_veteran_archer = 81
trp_nord_messenger = 82
trp_nord_deserter = 83
trp_nord_prison_guard = 84
trp_nord_castle_guard = 85
trp_rhodok_tribesman = 86
trp_rhodok_spearman = 87
trp_rhodok_trained_spearman = 88
trp_rhodok_veteran_spearman = 89
trp_rhodok_sergeant = 90
trp_rhodok_crossbowman = 91
trp_rhodok_trained_crossbowman = 92
trp_rhodok_veteran_crossbowman = 93
trp_rhodok_sharpshooter = 94
trp_rhodok_messenger = 95
trp_rhodok_deserter = 96
trp_rhodok_prison_guard = 97
trp_rhodok_castle_guard = 98
trp_sarranid_recruit = 99
trp_sarranid_footman = 100
trp_sarranid_veteran_footman = 101
trp_sarranid_infantry = 102
trp_sarranid_guard = 103
trp_sarranid_skirmisher = 104
trp_sarranid_archer = 105
trp_sarranid_master_archer = 106
trp_sarranid_horseman = 107
trp_sarranid_mamluke = 108
trp_sarranid_messenger = 109
trp_sarranid_deserter = 110
trp_sarranid_prison_guard = 111
trp_sarranid_castle_guard = 112
trp_looter = 113
trp_bandit = 114
trp_brigand = 115
trp_mountain_bandit = 116
trp_forest_bandit = 117
trp_sea_raider = 118
trp_steppe_bandit = 119
trp_taiga_bandit = 120
trp_desert_bandit = 121
trp_black_khergit_horseman = 122
trp_manhunter = 123
trp_slave_driver = 124
trp_slave_hunter = 125
trp_slave_crusher = 126
trp_slaver_chief = 127
trp_follower_woman = 128
trp_hunter_woman = 129
trp_fighter_woman = 130
trp_sword_sister = 131
trp_refugee = 132
trp_peasant_woman = 133
trp_caravan_master = 134
trp_kidnapped_girl = 135
trp_town_walker_1 = 136
trp_town_walker_2 = 137
trp_khergit_townsman = 138
trp_khergit_townswoman = 139
trp_sarranid_townsman = 140
trp_sarranid_townswoman = 141
trp_village_walker_1 = 142
trp_village_walker_2 = 143
trp_spy_walker_1 = 144
trp_spy_walker_2 = 145
trp_tournament_master = 146
trp_trainer = 147
trp_constable_hareck = 148
trp_ramun_the_slave_trader = 149
trp_guide = 150
trp_xerina = 151
trp_dranton = 152
trp_kradus = 153
trp_tutorial_trainer = 154
trp_tutorial_student_1 = 155
trp_tutorial_student_2 = 156
trp_tutorial_student_3 = 157
trp_tutorial_student_4 = 158
trp_galeas = 159
trp_farmer_from_bandit_village = 160
trp_trainer_1 = 161
trp_trainer_2 = 162
trp_trainer_3 = 163
trp_trainer_4 = 164
trp_trainer_5 = 165
trp_ransom_broker_1 = 166
trp_ransom_broker_2 = 167
trp_ransom_broker_3 = 168
trp_ransom_broker_4 = 169
trp_ransom_broker_5 = 170
trp_ransom_broker_6 = 171
trp_ransom_broker_7 = 172
trp_ransom_broker_8 = 173
trp_ransom_broker_9 = 174
trp_ransom_broker_10 = 175
trp_tavern_traveler_1 = 176
trp_tavern_traveler_2 = 177
trp_tavern_traveler_3 = 178
trp_tavern_traveler_4 = 179
trp_tavern_traveler_5 = 180
trp_tavern_traveler_6 = 181
trp_tavern_traveler_7 = 182
trp_tavern_traveler_8 = 183
trp_tavern_traveler_9 = 184
trp_tavern_traveler_10 = 185
trp_tavern_bookseller_1 = 186
trp_tavern_bookseller_2 = 187
trp_tavern_minstrel_1 = 188
trp_tavern_minstrel_2 = 189
trp_tavern_minstrel_3 = 190
trp_tavern_minstrel_4 = 191
trp_tavern_minstrel_5 = 192
trp_kingdom_heroes_including_player_begin = 193
trp_npc1 = 194
trp_npc2 = 195
trp_npc3 = 196
trp_npc4 = 197
trp_npc5 = 198
trp_npc6 = 199
trp_npc7 = 200
trp_npc8 = 201
trp_npc9 = 202
trp_npc10 = 203
trp_npc11 = 204
trp_npc12 = 205
trp_npc13 = 206
trp_npc14 = 207
trp_npc15 = 208
trp_npc16 = 209
trp_kingdom_1_lord = 210
trp_kingdom_2_lord = 211
trp_kingdom_3_lord = 212
trp_kingdom_4_lord = 213
trp_kingdom_5_lord = 214
trp_kingdom_6_lord = 215
trp_knight_1_1 = 216
trp_knight_1_2 = 217
trp_knight_1_3 = 218
trp_knight_1_4 = 219
trp_knight_1_5 = 220
trp_knight_1_6 = 221
trp_knight_1_7 = 222
trp_knight_1_8 = 223
trp_knight_1_9 = 224
trp_knight_1_10 = 225
trp_knight_1_11 = 226
trp_knight_1_12 = 227
trp_knight_1_13 = 228
trp_knight_1_14 = 229
trp_knight_1_15 = 230
trp_knight_1_16 = 231
trp_knight_1_17 = 232
trp_knight_1_18 = 233
trp_knight_1_19 = 234
trp_knight_1_20 = 235
trp_knight_2_1 = 236
trp_knight_2_2 = 237
trp_knight_2_3 = 238
trp_knight_2_4 = 239
trp_knight_2_5 = 240
trp_knight_2_6 = 241
trp_knight_2_7 = 242
trp_knight_2_8 = 243
trp_knight_2_9 = 244
trp_knight_2_10 = 245
trp_knight_2_11 = 246
trp_knight_2_12 = 247
trp_knight_2_13 = 248
trp_knight_2_14 = 249
trp_knight_2_15 = 250
trp_knight_2_16 = 251
trp_knight_2_17 = 252
trp_knight_2_18 = 253
trp_knight_2_19 = 254
trp_knight_2_20 = 255
trp_knight_3_1 = 256
trp_knight_3_2 = 257
trp_knight_3_3 = 258
trp_knight_3_4 = 259
trp_knight_3_5 = 260
trp_knight_3_6 = 261
trp_knight_3_7 = 262
trp_knight_3_8 = 263
trp_knight_3_9 = 264
trp_knight_3_10 = 265
trp_knight_3_11 = 266
trp_knight_3_12 = 267
trp_knight_3_13 = 268
trp_knight_3_14 = 269
trp_knight_3_15 = 270
trp_knight_3_16 = 271
trp_knight_3_17 = 272
trp_knight_3_18 = 273
trp_knight_3_19 = 274
trp_knight_3_20 = 275
trp_knight_4_1 = 276
trp_knight_4_2 = 277
trp_knight_4_3 = 278
trp_knight_4_4 = 279
trp_knight_4_5 = 280
trp_knight_4_6 = 281
trp_knight_4_7 = 282
trp_knight_4_8 = 283
trp_knight_4_9 = 284
trp_knight_4_10 = 285
trp_knight_4_11 = 286
trp_knight_4_12 = 287
trp_knight_4_13 = 288
trp_knight_4_14 = 289
trp_knight_4_15 = 290
trp_knight_4_16 = 291
trp_knight_4_17 = 292
trp_knight_4_18 = 293
trp_knight_4_19 = 294
trp_knight_4_20 = 295
trp_knight_5_1 = 296
trp_knight_5_2 = 297
trp_knight_5_3 = 298
trp_knight_5_4 = 299
trp_knight_5_5 = 300
trp_knight_5_6 = 301
trp_knight_5_7 = 302
trp_knight_5_8 = 303
trp_knight_5_9 = 304
trp_knight_5_10 = 305
trp_knight_5_11 = 306
trp_knight_5_12 = 307
trp_knight_5_13 = 308
trp_knight_5_14 = 309
trp_knight_5_15 = 310
trp_knight_5_16 = 311
trp_knight_5_17 = 312
trp_knight_5_18 = 313
trp_knight_5_19 = 314
trp_knight_5_20 = 315
trp_knight_6_1 = 316
trp_knight_6_2 = 317
trp_knight_6_3 = 318
trp_knight_6_4 = 319
trp_knight_6_5 = 320
trp_knight_6_6 = 321
trp_knight_6_7 = 322
trp_knight_6_8 = 323
trp_knight_6_9 = 324
trp_knight_6_10 = 325
trp_knight_6_11 = 326
trp_knight_6_12 = 327
trp_knight_6_13 = 328
trp_knight_6_14 = 329
trp_knight_6_15 = 330
trp_knight_6_16 = 331
trp_knight_6_17 = 332
trp_knight_6_18 = 333
trp_knight_6_19 = 334
trp_knight_6_20 = 335
trp_kingdom_1_pretender = 336
trp_kingdom_2_pretender = 337
trp_kingdom_3_pretender = 338
trp_kingdom_4_pretender = 339
trp_kingdom_5_pretender = 340
trp_kingdom_6_pretender = 341
trp_knight_1_1_wife = 342
trp_kingdom_1_lady_1 = 343
trp_kingdom_1_lady_2 = 344
trp_knight_1_lady_3 = 345
trp_knight_1_lady_4 = 346
trp_kingdom_l_lady_5 = 347
trp_kingdom_1_lady_6 = 348
trp_kingdom_1_lady_7 = 349
trp_kingdom_1_lady_8 = 350
trp_kingdom_1_lady_9 = 351
trp_kingdom_1_lady_10 = 352
trp_kingdom_1_lady_11 = 353
trp_kingdom_1_lady_12 = 354
trp_kingdom_l_lady_13 = 355
trp_kingdom_1_lady_14 = 356
trp_kingdom_1_lady_15 = 357
trp_kingdom_1_lady_16 = 358
trp_kingdom_1_lady_17 = 359
trp_kingdom_1_lady_18 = 360
trp_kingdom_1_lady_19 = 361
trp_kingdom_1_lady_20 = 362
trp_kingdom_2_lady_1 = 363
trp_kingdom_2_lady_2 = 364
trp_kingdom_2_lady_3 = 365
trp_kingdom_2_lady_4 = 366
trp_kingdom_2_lady_5 = 367
trp_kingdom_2_lady_6 = 368
trp_kingdom_2_lady_7 = 369
trp_kingdom_2_lady_8 = 370
trp_kingdom_2_lady_9 = 371
trp_kingdom_2_lady_10 = 372
trp_kingdom_2_lady_11 = 373
trp_kingdom_2_lady_12 = 374
trp_kingdom_2_lady_13 = 375
trp_kingdom_2_lady_14 = 376
trp_kingdom_2_lady_15 = 377
trp_kingdom_2_lady_16 = 378
trp_kingdom_2_lady_17 = 379
trp_kingdom_2_lady_18 = 380
trp_kingdom_2_lady_19 = 381
trp_kingdom_2_lady_20 = 382
trp_kingdom_3_lady_1 = 383
trp_kingdom_3_lady_2 = 384
trp_kingdom_3_lady_3 = 385
trp_kingdom_3_lady_4 = 386
trp_kingdom_3_lady_5 = 387
trp_kingdom_3_lady_6 = 388
trp_kingdom_3_lady_7 = 389
trp_kingdom_3_lady_8 = 390
trp_kingdom_3_lady_9 = 391
trp_kingdom_3_lady_10 = 392
trp_kingdom_3_lady_11 = 393
trp_kingdom_3_lady_12 = 394
trp_kingdom_3_lady_13 = 395
trp_kingdom_3_lady_14 = 396
trp_kingdom_3_lady_15 = 397
trp_kingdom_3_lady_16 = 398
trp_kingdom_3_lady_17 = 399
trp_kingdom_3_lady_18 = 400
trp_kingdom_3_lady_19 = 401
trp_kingdom_3_lady_20 = 402
trp_kingdom_4_lady_1 = 403
trp_kingdom_4_lady_2 = 404
trp_kingdom_4_lady_3 = 405
trp_kingdom_4_lady_4 = 406
trp_kingdom_4_lady_5 = 407
trp_kingdom_4_lady_6 = 408
trp_kingdom_4_lady_7 = 409
trp_knight_4_2b_daughter_1 = 410
trp_kingdom_4_lady_9 = 411
trp_knight_4_2c_wife_1 = 412
trp_kingdom_4_lady_11 = 413
trp_knight_4_2c_daughter = 414
trp_knight_4_1b_wife = 415
trp_kingdom_4_lady_14 = 416
trp_knight_4_1b_daughter = 417
trp_knight_4_2b_daughter_2 = 418
trp_kingdom_4_lady_17 = 419
trp_knight_4_2c_wife_2 = 420
trp_knight_4_1c_daughter = 421
trp_kingdom_4_lady_20 = 422
trp_kingdom_5_lady_1 = 423
trp_kingdom_5_lady_2 = 424
trp_kingdom_5_lady_3 = 425
trp_kingdom_5_lady_4 = 426
trp_kingdom_5_5_wife = 427
trp_kingdom_5_2b_wife_1 = 428
trp_kingdom_5_1c_daughter_1 = 429
trp_kingdom_5_2c_daughter_1 = 430
trp_kingdom_5_1c_wife_1 = 431
trp_kingdom_5_2c_wife_1 = 432
trp_kingdom_5_1c_daughter_2 = 433
trp_kingdom_5_2c_daughter_2 = 434
trp_kingdom_5_1b_wife = 435
trp_kingdom_5_2b_wife_2 = 436
trp_kingdom_5_1c_daughter_3 = 437
trp_kingdom_5_lady_16 = 438
trp_kingdom_5_1c_wife_2 = 439
trp_kingdom_5_2c_wife_2 = 440
trp_kingdom_5_1c_daughter_4 = 441
trp_kingdom_5_lady_20 = 442
trp_kingdom_6_lady_1 = 443
trp_kingdom_6_lady_2 = 444
trp_kingdom_6_lady_3 = 445
trp_kingdom_6_lady_4 = 446
trp_kingdom_6_lady_5 = 447
trp_kingdom_6_lady_6 = 448
trp_kingdom_6_lady_7 = 449
trp_kingdom_6_lady_8 = 450
trp_kingdom_6_lady_9 = 451
trp_kingdom_6_lady_10 = 452
trp_kingdom_6_lady_11 = 453
trp_kingdom_6_lady_12 = 454
trp_kingdom_6_lady_13 = 455
trp_kingdom_6_lady_14 = 456
trp_kingdom_6_lady_15 = 457
trp_kingdom_6_lady_16 = 458
trp_kingdom_6_lady_17 = 459
trp_kingdom_6_lady_18 = 460
trp_kingdom_6_lady_19 = 461
trp_kingdom_6_lady_20 = 462
trp_heroes_end = 463
trp_town_1_seneschal = 464
trp_town_2_seneschal = 465
trp_town_3_seneschal = 466
trp_town_4_seneschal = 467
trp_town_5_seneschal = 468
trp_town_6_seneschal = 469
trp_town_7_seneschal = 470
trp_town_8_seneschal = 471
trp_town_9_seneschal = 472
trp_town_10_seneschal = 473
trp_town_11_seneschal = 474
trp_town_12_seneschal = 475
trp_town_13_seneschal = 476
trp_town_14_seneschal = 477
trp_town_15_seneschal = 478
trp_town_16_seneschal = 479
trp_town_17_seneschal = 480
trp_town_18_seneschal = 481
trp_town_19_seneschal = 482
trp_town_20_seneschal = 483
trp_town_21_seneschal = 484
trp_town_22_seneschal = 485
trp_castle_1_seneschal = 486
trp_castle_2_seneschal = 487
trp_castle_3_seneschal = 488
trp_castle_4_seneschal = 489
trp_castle_5_seneschal = 490
trp_castle_6_seneschal = 491
trp_castle_7_seneschal = 492
trp_castle_8_seneschal = 493
trp_castle_9_seneschal = 494
trp_castle_10_seneschal = 495
trp_castle_11_seneschal = 496
trp_castle_12_seneschal = 497
trp_castle_13_seneschal = 498
trp_castle_14_seneschal = 499
trp_castle_15_seneschal = 500
trp_castle_16_seneschal = 501
trp_castle_17_seneschal = 502
trp_castle_18_seneschal = 503
trp_castle_19_seneschal = 504
trp_castle_20_seneschal = 505
trp_castle_21_seneschal = 506
trp_castle_22_seneschal = 507
trp_castle_23_seneschal = 508
trp_castle_24_seneschal = 509
trp_castle_25_seneschal = 510
trp_castle_26_seneschal = 511
trp_castle_27_seneschal = 512
trp_castle_28_seneschal = 513
trp_castle_29_seneschal = 514
trp_castle_30_seneschal = 515
trp_castle_31_seneschal = 516
trp_castle_32_seneschal = 517
trp_castle_33_seneschal = 518
trp_castle_34_seneschal = 519
trp_castle_35_seneschal = 520
trp_castle_36_seneschal = 521
trp_castle_37_seneschal = 522
trp_castle_38_seneschal = 523
trp_castle_39_seneschal = 524
trp_castle_40_seneschal = 525
trp_castle_41_seneschal = 526
trp_castle_42_seneschal = 527
trp_castle_43_seneschal = 528
trp_castle_44_seneschal = 529
trp_castle_45_seneschal = 530
trp_castle_46_seneschal = 531
trp_castle_47_seneschal = 532
trp_castle_48_seneschal = 533
trp_town_1_arena_master = 534
trp_town_2_arena_master = 535
trp_town_3_arena_master = 536
trp_town_4_arena_master = 537
trp_town_5_arena_master = 538
trp_town_6_arena_master = 539
trp_town_7_arena_master = 540
trp_town_8_arena_master = 541
trp_town_9_arena_master = 542
trp_town_10_arena_master = 543
trp_town_11_arena_master = 544
trp_town_12_arena_master = 545
trp_town_13_arena_master = 546
trp_town_14_arena_master = 547
trp_town_15_arena_master = 548
trp_town_16_arena_master = 549
trp_town_17_arena_master = 550
trp_town_18_arena_master = 551
trp_town_19_arena_master = 552
trp_town_20_arena_master = 553
trp_town_21_arena_master = 554
trp_town_22_arena_master = 555
trp_town_1_armorer = 556
trp_town_2_armorer = 557
trp_town_3_armorer = 558
trp_town_4_armorer = 559
trp_town_5_armorer = 560
trp_town_6_armorer = 561
trp_town_7_armorer = 562
trp_town_8_armorer = 563
trp_town_9_armorer = 564
trp_town_10_armorer = 565
trp_town_11_armorer = 566
trp_town_12_armorer = 567
trp_town_13_armorer = 568
trp_town_14_armorer = 569
trp_town_15_armorer = 570
trp_town_16_armorer = 571
trp_town_17_armorer = 572
trp_town_18_armorer = 573
trp_town_19_armorer = 574
trp_town_20_armorer = 575
trp_town_21_armorer = 576
trp_town_22_armorer = 577
trp_town_1_weaponsmith = 578
trp_town_2_weaponsmith = 579
trp_town_3_weaponsmith = 580
trp_town_4_weaponsmith = 581
trp_town_5_weaponsmith = 582
trp_town_6_weaponsmith = 583
trp_town_7_weaponsmith = 584
trp_town_8_weaponsmith = 585
trp_town_9_weaponsmith = 586
trp_town_10_weaponsmith = 587
trp_town_11_weaponsmith = 588
trp_town_12_weaponsmith = 589
trp_town_13_weaponsmith = 590
trp_town_14_weaponsmith = 591
trp_town_15_weaponsmith = 592
trp_town_16_weaponsmith = 593
trp_town_17_weaponsmith = 594
trp_town_18_weaponsmith = 595
trp_town_19_weaponsmith = 596
trp_town_20_weaponsmith = 597
trp_town_21_weaponsmith = 598
trp_town_22_weaponsmith = 599
trp_town_1_tavernkeeper = 600
trp_town_2_tavernkeeper = 601
trp_town_3_tavernkeeper = 602
trp_town_4_tavernkeeper = 603
trp_town_5_tavernkeeper = 604
trp_town_6_tavernkeeper = 605
trp_town_7_tavernkeeper = 606
trp_town_8_tavernkeeper = 607
trp_town_9_tavernkeeper = 608
trp_town_10_tavernkeeper = 609
trp_town_11_tavernkeeper = 610
trp_town_12_tavernkeeper = 611
trp_town_13_tavernkeeper = 612
trp_town_14_tavernkeeper = 613
trp_town_15_tavernkeeper = 614
trp_town_16_tavernkeeper = 615
trp_town_17_tavernkeeper = 616
trp_town_18_tavernkeeper = 617
trp_town_19_tavernkeeper = 618
trp_town_20_tavernkeeper = 619
trp_town_21_tavernkeeper = 620
trp_town_22_tavernkeeper = 621
trp_town_1_merchant = 622
trp_town_2_merchant = 623
trp_town_3_merchant = 624
trp_town_4_merchant = 625
trp_town_5_merchant = 626
trp_town_6_merchant = 627
trp_town_7_merchant = 628
trp_town_8_merchant = 629
trp_town_9_merchant = 630
trp_town_10_merchant = 631
trp_town_11_merchant = 632
trp_town_12_merchant = 633
trp_town_13_merchant = 634
trp_town_14_merchant = 635
trp_town_15_merchant = 636
trp_town_16_merchant = 637
trp_town_17_merchant = 638
trp_town_18_merchant = 639
trp_town_19_merchant = 640
trp_town_20_merchant = 641
trp_town_21_merchant = 642
trp_town_22_merchant = 643
trp_salt_mine_merchant = 644
trp_town_1_horse_merchant = 645
trp_town_2_horse_merchant = 646
trp_town_3_horse_merchant = 647
trp_town_4_horse_merchant = 648
trp_town_5_horse_merchant = 649
trp_town_6_horse_merchant = 650
trp_town_7_horse_merchant = 651
trp_town_8_horse_merchant = 652
trp_town_9_horse_merchant = 653
trp_town_10_horse_merchant = 654
trp_town_11_horse_merchant = 655
trp_town_12_horse_merchant = 656
trp_town_13_horse_merchant = 657
trp_town_14_horse_merchant = 658
trp_town_15_horse_merchant = 659
trp_town_16_horse_merchant = 660
trp_town_17_horse_merchant = 661
trp_town_18_horse_merchant = 662
trp_town_19_horse_merchant = 663
trp_town_20_horse_merchant = 664
trp_town_21_horse_merchant = 665
trp_town_22_horse_merchant = 666
trp_town_1_mayor = 667
trp_town_2_mayor = 668
trp_town_3_mayor = 669
trp_town_4_mayor = 670
trp_town_5_mayor = 671
trp_town_6_mayor = 672
trp_town_7_mayor = 673
trp_town_8_mayor = 674
trp_town_9_mayor = 675
trp_town_10_mayor = 676
trp_town_11_mayor = 677
trp_town_12_mayor = 678
trp_town_13_mayor = 679
trp_town_14_mayor = 680
trp_town_15_mayor = 681
trp_town_16_mayor = 682
trp_town_17_mayor = 683
trp_town_18_mayor = 684
trp_town_19_mayor = 685
trp_town_20_mayor = 686
trp_town_21_mayor = 687
trp_town_22_mayor = 688
trp_village_1_elder = 689
trp_village_2_elder = 690
trp_village_3_elder = 691
trp_village_4_elder = 692
trp_village_5_elder = 693
trp_village_6_elder = 694
trp_village_7_elder = 695
trp_village_8_elder = 696
trp_village_9_elder = 697
trp_village_10_elder = 698
trp_village_11_elder = 699
trp_village_12_elder = 700
trp_village_13_elder = 701
trp_village_14_elder = 702
trp_village_15_elder = 703
trp_village_16_elder = 704
trp_village_17_elder = 705
trp_village_18_elder = 706
trp_village_19_elder = 707
trp_village_20_elder = 708
trp_village_21_elder = 709
trp_village_22_elder = 710
trp_village_23_elder = 711
trp_village_24_elder = 712
trp_village_25_elder = 713
trp_village_26_elder = 714
trp_village_27_elder = 715
trp_village_28_elder = 716
trp_village_29_elder = 717
trp_village_30_elder = 718
trp_village_31_elder = 719
trp_village_32_elder = 720
trp_village_33_elder = 721
trp_village_34_elder = 722
trp_village_35_elder = 723
trp_village_36_elder = 724
trp_village_37_elder = 725
trp_village_38_elder = 726
trp_village_39_elder = 727
trp_village_40_elder = 728
trp_village_41_elder = 729
trp_village_42_elder = 730
trp_village_43_elder = 731
trp_village_44_elder = 732
trp_village_45_elder = 733
trp_village_46_elder = 734
trp_village_47_elder = 735
trp_village_48_elder = 736
trp_village_49_elder = 737
trp_village_50_elder = 738
trp_village_51_elder = 739
trp_village_52_elder = 740
trp_village_53_elder = 741
trp_village_54_elder = 742
trp_village_55_elder = 743
trp_village_56_elder = 744
trp_village_57_elder = 745
trp_village_58_elder = 746
trp_village_59_elder = 747
trp_village_60_elder = 748
trp_village_61_elder = 749
trp_village_62_elder = 750
trp_village_63_elder = 751
trp_village_64_elder = 752
trp_village_65_elder = 753
trp_village_66_elder = 754
trp_village_67_elder = 755
trp_village_68_elder = 756
trp_village_69_elder = 757
trp_village_70_elder = 758
trp_village_71_elder = 759
trp_village_72_elder = 760
trp_village_73_elder = 761
trp_village_74_elder = 762
trp_village_75_elder = 763
trp_village_76_elder = 764
trp_village_77_elder = 765
trp_village_78_elder = 766
trp_village_79_elder = 767
trp_village_80_elder = 768
trp_village_81_elder = 769
trp_village_82_elder = 770
trp_village_83_elder = 771
trp_village_84_elder = 772
trp_village_85_elder = 773
trp_village_86_elder = 774
trp_village_87_elder = 775
trp_village_88_elder = 776
trp_village_89_elder = 777
trp_village_90_elder = 778
trp_village_91_elder = 779
trp_village_92_elder = 780
trp_village_93_elder = 781
trp_village_94_elder = 782
trp_village_95_elder = 783
trp_village_96_elder = 784
trp_village_97_elder = 785
trp_village_98_elder = 786
trp_village_99_elder = 787
trp_village_100_elder = 788
trp_village_101_elder = 789
trp_village_102_elder = 790
trp_village_103_elder = 791
trp_village_104_elder = 792
trp_village_105_elder = 793
trp_village_106_elder = 794
trp_village_107_elder = 795
trp_village_108_elder = 796
trp_village_109_elder = 797
trp_village_110_elder = 798
trp_merchants_end = 799
trp_town_1_master_craftsman = 800
trp_town_2_master_craftsman = 801
trp_town_3_master_craftsman = 802
trp_town_4_master_craftsman = 803
trp_town_5_master_craftsman = 804
trp_town_6_master_craftsman = 805
trp_town_7_master_craftsman = 806
trp_town_8_master_craftsman = 807
trp_town_9_master_craftsman = 808
trp_town_10_master_craftsman = 809
trp_town_11_master_craftsman = 810
trp_town_12_master_craftsman = 811
trp_town_13_master_craftsman = 812
trp_town_14_master_craftsman = 813
trp_town_15_master_craftsman = 814
trp_town_16_master_craftsman = 815
trp_town_17_master_craftsman = 816
trp_town_18_master_craftsman = 817
trp_town_19_master_craftsman = 818
trp_town_20_master_craftsman = 819
trp_town_21_master_craftsman = 820
trp_town_22_master_craftsman = 821
trp_zendar_chest = 822
trp_tutorial_chest_1 = 823
trp_tutorial_chest_2 = 824
trp_bonus_chest_1 = 825
trp_bonus_chest_2 = 826
trp_bonus_chest_3 = 827
trp_household_possessions = 828
trp_temp_array_a = 829
trp_temp_array_b = 830
trp_temp_array_c = 831
trp_stack_selection_amounts = 832
trp_stack_selection_ids = 833
trp_notification_menu_types = 834
trp_notification_menu_var1 = 835
trp_notification_menu_var2 = 836
trp_banner_background_color_array = 837
trp_multiplayer_data = 838
trp_local_merchant = 839
trp_tax_rebel = 840
trp_trainee_peasant = 841
trp_fugitive = 842
trp_belligerent_drunk = 843
trp_hired_assassin = 844
trp_fight_promoter = 845
trp_spy = 846
trp_spy_partner = 847
trp_nurse_for_lady = 848
trp_temporary_minister = 849
trp_quick_battle_6_player = 850
trp_swadian_crossbowman_multiplayer_ai = 851
trp_swadian_infantry_multiplayer_ai = 852
trp_swadian_man_at_arms_multiplayer_ai = 853
trp_vaegir_archer_multiplayer_ai = 854
trp_vaegir_spearman_multiplayer_ai = 855
trp_vaegir_horseman_multiplayer_ai = 856
trp_khergit_dismounted_lancer_multiplayer_ai = 857
trp_khergit_veteran_horse_archer_multiplayer_ai = 858
trp_khergit_lancer_multiplayer_ai = 859
trp_nord_veteran_multiplayer_ai = 860
trp_nord_scout_multiplayer_ai = 861
trp_nord_archer_multiplayer_ai = 862
trp_rhodok_veteran_crossbowman_multiplayer_ai = 863
trp_rhodok_veteran_spearman_multiplayer_ai = 864
trp_rhodok_scout_multiplayer_ai = 865
trp_sarranid_infantry_multiplayer_ai = 866
trp_sarranid_archer_multiplayer_ai = 867
trp_sarranid_horseman_multiplayer_ai = 868
trp_swadian_crossbowman_multiplayer = 869
trp_swadian_infantry_multiplayer = 870
trp_swadian_man_at_arms_multiplayer = 871
trp_vaegir_archer_multiplayer = 872
trp_vaegir_spearman_multiplayer = 873
trp_vaegir_horseman_multiplayer = 874
trp_khergit_veteran_horse_archer_multiplayer = 875
trp_khergit_lancer_multiplayer = 876
trp_nord_archer_multiplayer = 877
trp_nord_veteran_multiplayer = 878
trp_nord_scout_multiplayer = 879
trp_rhodok_veteran_crossbowman_multiplayer = 880
trp_rhodok_sergeant_multiplayer = 881
trp_rhodok_horseman_multiplayer = 882
trp_sarranid_archer_multiplayer = 883
trp_sarranid_footman_multiplayer = 884
trp_sarranid_mamluke_multiplayer = 885
trp_multiplayer_end = 886
trp_nurse = 887
trp_log_array_entry_type = 888
trp_log_array_entry_time = 889
trp_log_array_actor = 890
trp_log_array_center_object = 891
trp_log_array_center_object_lord = 892
trp_log_array_center_object_faction = 893
trp_log_array_troop_object = 894
trp_log_array_troop_object_faction = 895
trp_log_array_faction_object = 896
trp_quick_battle_troop_1 = 897
trp_quick_battle_troop_2 = 898
trp_quick_battle_troop_3 = 899
trp_quick_battle_troop_4 = 900
trp_quick_battle_troop_5 = 901
trp_quick_battle_troop_6 = 902
trp_quick_battle_troop_7 = 903
trp_quick_battle_troop_8 = 904
trp_quick_battle_troop_9 = 905
trp_quick_battle_troop_10 = 906
trp_quick_battle_troop_11 = 907
trp_quick_battle_troops_end = 908
trp_tutorial_fighter_1 = 909
trp_tutorial_fighter_2 = 910
trp_tutorial_fighter_3 = 911
trp_tutorial_fighter_4 = 912
trp_tutorial_archer_1 = 913
trp_tutorial_master_archer = 914
trp_tutorial_rider_1 = 915
trp_tutorial_rider_2 = 916
trp_tutorial_master_horseman = 917
trp_swadian_merchant = 918
trp_vaegir_merchant = 919
trp_khergit_merchant = 920
trp_nord_merchant = 921
trp_rhodok_merchant = 922
trp_sarranid_merchant = 923
trp_startup_merchants_end = 924
trp_sea_raider_leader = 925
trp_looter_leader = 926
trp_bandit_leaders_end = 927
trp_relative_of_merchant = 928
trp_relative_of_merchants_end = 929
| Python |
from header_common import *
from ID_animations import *
from header_mission_templates import *
from header_tableau_materials import *
from header_items import *
from module_constants import *
####################################################################################################################
# Each tableau material contains the following fields:
# 1) Tableau id (string): used for referencing tableaux in other files. The prefix tab_ is automatically added before each tableau-id.
# 2) Tableau flags (int). See header_tableau_materials.py for a list of available flags
# 3) Tableau sample material name (string).
# 4) Tableau width (int).
# 5) Tableau height (int).
# 6) Tableau mesh min x (int): divided by 1000 and used when a mesh is auto-generated using the tableau material
# 7) Tableau mesh min y (int): divided by 1000 and used when a mesh is auto-generated using the tableau material
# 8) Tableau mesh max x (int): divided by 1000 and used when a mesh is auto-generated using the tableau material
# 9) Tableau mesh max y (int): divided by 1000 and used when a mesh is auto-generated using the tableau material
# 10) Operations block (list): A list of operations. See header_operations.py for reference.
# The operations block is executed when the tableau is activated.
#
####################################################################################################################
#banner height = 200, width = 85 with wood, 75 without wood
tableaus = [
("game_character_sheet", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 266, 532,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_troop_character_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_troop_character_alpha_mask", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 300),
]),
("game_inventory_window", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 180, 270,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_troop_inventory_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_troop_inventory_alpha_mask", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 300),
]),
("game_profile_window", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 320, 480, [
(store_script_param, ":profile_no", 1),
(assign, ":gender", ":profile_no"),
(val_mod, ":gender", 2),
(try_begin),
(eq, ":gender", 0),
(assign, ":troop_no", "trp_multiplayer_profile_troop_male"),
(else_try),
(assign, ":troop_no", "trp_multiplayer_profile_troop_female"),
(try_end),
(troop_set_face_key_from_current_profile, ":troop_no"),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_troop_profile_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_troop_profile_alpha_mask", ":troop_no", pos1, 0, 0),
]),
("game_party_window", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 300, 300,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_troop_party_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_troop_party_alpha_mask", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 300),
]),
("game_troop_label_banner", 0, "tableau_with_transparency", 256, 256, -128, 0, 128, 256,
[
(store_script_param, ":banner_mesh", 1),
(cur_tableau_set_background_color, 0xFF888888),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000),
(init_position, pos1),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 120, 0),
#(init_position, pos1),
#(position_set_z, pos1, 10),
#(cur_tableau_add_mesh, "mesh_troop_label_banner", pos1, 112, 0),
]),
("round_shield_1", 0, "sample_shield_round_1", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 125),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 120, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("round_shield_2", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("round_shield_3", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_3", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("round_shield_4", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 125),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 123, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_4", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("round_shield_5", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 125),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 122, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_5", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("small_round_shield_1", 0, "sample_shield_small_round_1", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 127, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_small_round_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("small_round_shield_2", 0, "sample_shield_small_round_2", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 127, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_small_round_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("small_round_shield_3", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 127, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_small_round_3", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
]),
("kite_shield_1", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -60),
(position_set_y, pos1, 140),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("kite_shield_2", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -57),
(position_set_y, pos1, 140),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("kite_shield_3", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -57),
(position_set_y, pos1, 140),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_3", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("kite_shield_4", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 160),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 120, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_4", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heater_shield_1", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -60),
(position_set_y, pos1, 151),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_heater_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heater_shield_2", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 150),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_heater_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("pavise_shield_1", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -54),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 118, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_1", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("pavise_shield_2", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, -54),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_2", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heraldic_armor_a", 0, "sample_heraldic_armor_a", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin),
(troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"),
(cur_tableau_set_background_color, ":background_color"),
(init_position, pos1),
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"),
# (cur_tableau_add_mesh, "mesh_heraldic_armor_bg", pos1, 200, 0),
(init_position, pos1),
(position_set_z, pos1, 50),
(position_set_x, pos1, -25),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 103, 0),
# (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_a", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heraldic_armor_b", 0, "sample_heraldic_armor_b", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin),
(troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"),
(cur_tableau_set_background_color, ":background_color"),
(init_position, pos1),
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"),
(init_position, pos1),
(position_set_z, pos1, 10),
(position_set_x, pos1, -5),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 113, 0),
# (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_b", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heraldic_armor_c", 0, "sample_heraldic_armor_c", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin),
(troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"),
(cur_tableau_set_background_color, ":background_color"),
(init_position, pos1),
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"),
(init_position, pos1),
(position_set_z, pos1, 10),
(position_set_x, pos1, -0),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 115, 0),
# (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_c", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("heraldic_armor_d", 0, "sample_heraldic_armor_d", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin),
(troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"),
(cur_tableau_set_background_color, ":background_color"),
(init_position, pos1),
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"),
(init_position, pos1),
(position_set_z, pos1, 10),
(position_set_x, pos1, -0),
(position_set_y, pos1, 130),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 113, 0),
# (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_d", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
("troop_note_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau", ":troop_no"),
]),
("troop_note_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFFC6BB94),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau", ":troop_no"),
]),
("troop_character_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau_for_character", ":troop_no"),
]),
("troop_character_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFFE0CFB1),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau_for_character", ":troop_no"),
]),
("troop_inventory_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau_for_inventory", ":troop_no"),
]),
("troop_inventory_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF6A583A),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau_for_inventory", ":troop_no"),
]),
("troop_profile_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau_for_profile", ":troop_no"),
]),
("troop_profile_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFFF9E7A8),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau_for_profile", ":troop_no"),
]),
("troop_party_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau_for_party", ":troop_no"),
]),
("troop_party_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFFBE9C72),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau_for_party", ":troop_no"),
]),
("troop_note_mesh", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 350, 350,
[
(store_script_param, ":troop_no", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_troop_note_color", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_troop_note_alpha_mask", ":troop_no", pos1, 0, 0),
(position_set_z, pos1, 300),
(cur_tableau_add_mesh, "mesh_portrait_blend_out", pos1, 0, 0),
]),
("center_note_mesh", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 200, 200,
[
(store_script_param, ":center_no", 1),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(init_position, pos8),
(position_set_x, pos8, -210),
(position_set_y, pos8, 200),
(position_set_z, pos8, 300),
(cur_tableau_add_point_light, pos8, 550,500,450),
## (party_get_slot, ":troop_no", ":center_no", slot_town_lord),
## (try_begin),
## (ge, ":troop_no", 0),
## (troop_get_slot, ":banner_spr", ":troop_no", slot_troop_banner_scene_prop),
## (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
## (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
## (val_sub, ":banner_spr", banner_scene_props_begin),
## (store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin),
## (try_end),
##
## (init_position, pos1),
## (position_set_x, pos1, -60),
## (position_set_y, pos1, -100),
## (position_set_z, pos1, 230),
## (position_rotate_x, pos1, 90),
## (assign, ":banner_scale", 105),
(cur_tableau_set_camera_parameters, 1, 10, 10, 10, 10000),
## (position_set_x, pos1, -100),
(init_position, pos1),
(position_set_z, pos1, 0),
(position_set_z, pos1, -500),
(init_position, pos1),
(position_set_y, pos1, -100),
(position_set_x, pos1, -100),
(position_set_z, pos1, 100),
(position_rotate_z, pos1, 200),
## (cur_tableau_add_mesh, ":banner_mesh", pos1, ":banner_scale", 0),
(party_get_icon, ":map_icon", ":center_no"),
(try_begin),
(ge, ":map_icon", 0),
(cur_tableau_add_map_icon, ":map_icon", pos1, 0),
(try_end),
(init_position, pos5),
(position_set_x, pos5, -90),
(position_set_z, pos5, 500),
(position_set_y, pos5, 480),
(position_rotate_x, pos5, -90),
(position_rotate_z, pos5, 180),
(position_rotate_x, pos5, -35),
(cur_tableau_set_camera_position, pos5),
]),
("faction_note_mesh_for_menu", 0, "pic_arms_swadian", 1024, 512, 0, 0, 450, 225,
[
(store_script_param, ":faction_no", 1),
(cur_tableau_set_background_color, 0xFFFFFFFF),
(set_fixed_point_multiplier, 100),
(try_begin),
(is_between, ":faction_no", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
(store_add, ":banner_mesh", "mesh_pic_arms_swadian", ":faction_no"),
(val_sub, ":banner_mesh", "fac_kingdom_1"),
(init_position, pos1),
(position_set_y, pos1, -5),
(position_set_x, pos1, -45),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 160, 80, 0, 100000),
(try_end),
]),
("faction_note_mesh", 0, "pic_arms_swadian", 1024, 512, 0, 0, 500, 250,
[
(store_script_param, ":faction_no", 1),
(cur_tableau_set_background_color, 0xFFFFFFFF),
(set_fixed_point_multiplier, 100),
(try_begin),
(is_between, ":faction_no", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
(store_add, ":banner_mesh", "mesh_pic_arms_swadian", ":faction_no"),
(val_sub, ":banner_mesh", "fac_kingdom_1"),
(init_position, pos1),
(position_set_y, pos1, -5),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 50, 0, 100000),
(try_end),
]),
("faction_note_mesh_banner", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 200, 200,
[
(store_script_param, ":faction_no", 1),
(set_fixed_point_multiplier, 100),
(try_begin),
(faction_get_slot, ":leader_troop", ":faction_no", slot_faction_leader),
(ge, ":leader_troop", 0),
(troop_get_slot, ":banner_spr", ":leader_troop", slot_troop_banner_scene_prop),
(store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
(is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
(val_sub, ":banner_spr", banner_scene_props_begin),
(store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin),
(init_position, pos1),
(position_set_y, pos1, 100),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 210, 210, 0, 100000),
(try_end),
]),
("2_factions_mesh", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 200, 200,
[
(store_script_param, ":faction_no", 1),
(store_mod, ":faction_no_2", ":faction_no", 128),
(val_div, ":faction_no", 128),
(val_add, ":faction_no", kingdoms_begin),
(val_add, ":faction_no_2", kingdoms_begin),
(set_fixed_point_multiplier, 100),
(try_begin),
(faction_get_slot, ":leader_troop", ":faction_no", slot_faction_leader),
(ge, ":leader_troop", 0),
(troop_get_slot, ":banner_spr", ":leader_troop", slot_troop_banner_scene_prop),
(store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
(is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
(val_sub, ":banner_spr", banner_scene_props_begin),
(store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin),
(init_position, pos1),
(position_set_x, pos1, -50),
(position_set_y, pos1, 100),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(try_end),
(try_begin),
(faction_get_slot, ":leader_troop", ":faction_no_2", slot_faction_leader),
(ge, ":leader_troop", 0),
(troop_get_slot, ":banner_spr", ":leader_troop", slot_troop_banner_scene_prop),
(store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
(is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
(val_sub, ":banner_spr", banner_scene_props_begin),
(store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin),
(init_position, pos1),
(position_set_x, pos1, 50),
(position_set_y, pos1, 100),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
(try_end),
(cur_tableau_set_camera_parameters, 0, 210, 210, 0, 100000),
]),
("color_picker", 0, "missiles", 32, 32, 0, 0, 0, 0,
[
(store_script_param, ":color", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(cur_tableau_add_mesh, "mesh_color_picker", pos1, 0, 0),
(position_move_z, pos1, 1),
(position_move_x, pos1, -2),
(position_move_y, pos1, -2),
(cur_tableau_add_mesh_with_vertex_color, "mesh_white_plane", pos1, 200, 0, ":color"),
(cur_tableau_set_camera_parameters, 0, 20, 20, 0, 100000),
]),
("custom_banner_square_no_mesh", 0, "missiles", 512, 512, 0, 0, 300, 300,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", 0, 0, 10000, 10000, 9800, 9800, 10000, 10000, 0),
(cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000),
]),
("custom_banner_default", 0, "missiles", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", -9, -2, 7450, 19400, 7200, 18000, 9000, 10000, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000),
]),
("custom_banner_tall", 0, "missiles", 512, 256, 0, 0, 0, 0,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", -9, 12, 8250, 18000, 8000, 21000, 10000, 10000, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000),
]),
("custom_banner_square", 0, "missiles", 256, 256, 0, 0, 0, 0,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", -11, 10, 7700, 7700, 7500, 7500, 8300, 10000, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner_square", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000),
]),
("custom_banner_short", 0, "missiles", 256, 512, 0, 0, 0, 0,
[
(store_script_param, ":troop_no", 1),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", ":troop_no", -10, 0, 8050, 5000, 4200, 4800, 6600, 10000, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner_short", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 100, 50, 0, 100000),
]),
## ("custom_banner", 0, "missiles", 256, 512, 0, 0, 0, 0,
## [
## (store_script_param, ":troop_no", 1),
##
## (set_fixed_point_multiplier, 100),
## (troop_get_slot, ":bg_type", ":troop_no", slot_troop_custom_banner_bg_type),
## (val_add, ":bg_type", custom_banner_backgrounds_begin),
## (troop_get_slot, ":bg_color_1", ":troop_no", slot_troop_custom_banner_bg_color_1),
## (troop_get_slot, ":bg_color_2", ":troop_no", slot_troop_custom_banner_bg_color_2),
## (troop_get_slot, ":num_charges", ":troop_no", slot_troop_custom_banner_num_charges),
## (troop_get_slot, ":positioning", ":troop_no", slot_troop_custom_banner_positioning),
## (call_script, "script_get_troop_custom_banner_num_positionings", ":troop_no"),
## (assign, ":num_positionings", reg0),
## (val_mod, ":positioning", ":num_positionings"),
##
## (init_position, pos1),
##
## (position_move_z, pos1, -10),
## (cur_tableau_add_mesh_with_vertex_color, ":bg_type", pos1, 0, 0, ":bg_color_1"),
## (position_move_z, pos1, -10),
## (cur_tableau_add_mesh_with_vertex_color, "mesh_custom_banner_bg", pos1, 0, 0, ":bg_color_2"),
## (init_position, pos1),
## (position_move_z, pos1, -50),
## (cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0),
##
## (call_script, "script_get_custom_banner_charge_type_position_scale_color", "trp_player", ":positioning"),
## (try_begin),
## (ge, ":num_charges", 1),
## (cur_tableau_add_mesh_with_vertex_color, reg0, pos0, reg1, 0, reg2),
## (try_end),
## (try_begin),
## (ge, ":num_charges", 2),
## (cur_tableau_add_mesh_with_vertex_color, reg3, pos1, reg4, 0, reg5),
## (try_end),
## (try_begin),
## (ge, ":num_charges", 3),
## (cur_tableau_add_mesh_with_vertex_color, reg6, pos2, reg7, 0, reg8),
## (try_end),
## (try_begin),
## (ge, ":num_charges", 4),
## (cur_tableau_add_mesh_with_vertex_color, reg9, pos3, reg10, 0, reg11),
## (try_end),
##
## (cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000),
## ]),
("background_selection", 0, "missiles", 512, 512, 0, 0, 100, 100,
[
(store_script_param, ":banner_bg", 1),
(troop_get_slot, ":old_bg", "trp_player", slot_troop_custom_banner_bg_type),
(troop_set_slot, "trp_player", slot_troop_custom_banner_bg_type, ":banner_bg"),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", "trp_player", 0, 0, 10000, 10000, 9800, 9800, 10000, 10000, 0),
(cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000),
(troop_set_slot, "trp_player", slot_troop_custom_banner_bg_type, ":old_bg"),
]),
("positioning_selection", 0, "missiles", 512, 512, 0, 0, 100, 100,
[
(store_script_param, ":positioning", 1),
(troop_get_slot, ":old_positioning", "trp_player", slot_troop_custom_banner_positioning),
(troop_set_slot, "trp_player", slot_troop_custom_banner_positioning, ":positioning"),
(set_fixed_point_multiplier, 100),
(call_script, "script_draw_banner_to_region", "trp_player", 0, 0, 10000, 10000, 9800, 9800, 10000, 10000, 0),
(cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000),
(troop_set_slot, "trp_player", slot_troop_custom_banner_positioning, ":old_positioning"),
]),
## ("retirement_troop", 0, "troop_portrait", 1024, 1024, 0, 0, 600, 600,
## [
## (store_script_param, ":type", 1),
## (set_fixed_point_multiplier, 100),
## (cur_tableau_set_background_color, 0x00000000),
## (cur_tableau_set_ambient_light, 10,11,15),
##
## (init_position, pos8),
## (position_set_x, pos8, -210),
## (position_set_y, pos8, 200),
## (position_set_z, pos8, 300),
## (cur_tableau_add_point_light, pos8, 550,500,450),
##
## (cur_tableau_set_override_flags, af_override_all),
##
## (try_begin),
## (eq, ":type", 0),
## (cur_tableau_add_override_item, "itm_pilgrim_hood"),
## (cur_tableau_add_override_item, "itm_pilgrim_disguise"),
## (cur_tableau_add_override_item, "itm_wrapping_boots"),
## (assign, ":animation", "anim_pose_1"),
## (else_try),
## (eq, ":type", 1),
## (cur_tableau_add_override_item, "itm_black_hood"),
## (cur_tableau_add_override_item, "itm_shirt"),
## (cur_tableau_add_override_item, "itm_wrapping_boots"),
## (assign, ":animation", "anim_pose_1"),
## (else_try),
## (eq, ":type", 2),
## (cur_tableau_add_override_item, "itm_coarse_tunic"),
## (cur_tableau_add_override_item, "itm_wrapping_boots"),
## (assign, ":animation", "anim_pose_2"),
## (else_try),
## (eq, ":type", 3),
## (cur_tableau_add_override_item, "itm_linen_tunic"),
## (cur_tableau_add_override_item, "itm_woolen_hose"),
## (assign, ":animation", "anim_pose_2"),
## (else_try),
## (eq, ":type", 4),
## (cur_tableau_add_override_item, "itm_leather_apron"),
## (cur_tableau_add_override_item, "itm_leather_boots"),
## (assign, ":animation", "anim_pose_3"),
## (else_try),
## (eq, ":type", 5),
## (cur_tableau_add_override_item, "itm_short_tunic"),
## (cur_tableau_add_override_item, "itm_leather_boots"),
## (assign, ":animation", "anim_pose_3"),
## (else_try),
## (eq, ":type", 6),
## (cur_tableau_add_override_item, "itm_tabard"),
## (cur_tableau_add_override_item, "itm_leather_boots"),
## (assign, ":animation", "anim_pose_4"),
## (else_try),
## (eq, ":type", 7),
## (cur_tableau_add_override_item, "itm_courtly_outfit"),
## (cur_tableau_add_override_item, "itm_mail_boots"),
## (assign, ":animation", "anim_pose_4"),
## (else_try),
## (eq, ":type", 8),
## (cur_tableau_add_override_item, "itm_nobleman_outfit"),
## (cur_tableau_add_override_item, "itm_woolen_hose"),
## (assign, ":animation", "anim_pose_4"),
## (else_try),
## (eq, ":type", 9),
## (cur_tableau_add_override_item, "itm_heraldic_mail_with_surcoat"),
## (cur_tableau_add_override_item, "itm_mail_boots"),
## (assign, ":animation", "anim_pose_5"),
## (else_try),
## (cur_tableau_add_override_item, "itm_heraldic_mail_with_tabard"),
## (cur_tableau_add_override_item, "itm_iron_greaves"),
## (assign, ":animation", "anim_pose_5"),
## (try_end),
##
## (init_position, pos2),
## (cur_tableau_set_camera_parameters, 1, 6, 6, 10, 10000),
##
## (init_position, pos5),
## (position_set_z, pos5, 96),
## (position_set_y, pos5, 350),
##
#### (troop_get_inventory_slot, ":horse_item", "trp_player", ek_horse),
#### (try_begin),
#### (gt, ":horse_item", 0),
#### (position_rotate_z, pos2, -40),
#### (cur_tableau_add_horse, ":horse_item", pos2, anim_horse_stand, 0),
#### (assign, ":animation", anim_ride_0),
#### (position_set_z, pos5, 125),
#### (position_set_y, pos5, 480),
#### (try_end),
##
## (cur_tableau_add_troop, "trp_player", pos2, ":animation" , 0),
##
## (position_rotate_x, pos5, -90),
## (position_rotate_z, pos5, 180),
## (cur_tableau_set_camera_position, pos5),
## ]),
("retired_troop_alpha_mask", 0, "mat_troop_portrait_mask", 2048, 2048, 0, 0, 600, 600,
[
(store_script_param, ":type", 1),
(cur_tableau_set_background_color, 0x00888888),
(cur_tableau_set_ambient_light, 10,11,15),
(cur_tableau_render_as_alpha_mask),
(call_script, "script_add_troop_to_cur_tableau_for_retirement", ":type"),
]),
("retired_troop_color", 0, "mat_troop_portrait_color", 2048, 2048, 0, 0, 600, 600,
[
(store_script_param, ":type", 1),
(cur_tableau_set_background_color, 0xFFe7d399),
(cur_tableau_set_ambient_light, 10,11,15),
(call_script, "script_add_troop_to_cur_tableau_for_retirement", ":type"),
]),
("retirement_troop", 0, "tableau_with_transparency", 2048, 2048, 0, 0, 600, 600,
[
(store_script_param, ":type", 1),
(cur_tableau_set_background_color, 0xFF888888),
(cur_tableau_set_ambient_light, 10,11,15),
(set_fixed_point_multiplier, 100),
(cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000),
(init_position, pos1),
(position_set_z, pos1, 100),
(position_set_x, pos1, -20),
(position_set_y, pos1, -20),
(cur_tableau_add_tableau_mesh, "tableau_retired_troop_color", ":type", pos1, 0, 0),
(position_set_z, pos1, 200),
(cur_tableau_add_tableau_mesh, "tableau_retired_troop_alpha_mask", ":type", pos1, 0, 0),
]),
]
| Python |
import string
from module_info import *
from module_presentations import *
from ID_meshes import *
from process_common import *
from process_operations import *
def save_presentations(variable_list,variable_uses,tag_uses,quick_strings):
ofile = open(export_dir + "presentations.txt","w")
ofile.write("presentationsfile version 1\n")
ofile.write(" %d\n"%(len(presentations)))
for presentation in presentations:
ofile.write("prsnt_%s %d %d "%(presentation[0], presentation[1], presentation[2]))
save_simple_triggers(ofile,presentation[3], variable_list,variable_uses,tag_uses,quick_strings)
ofile.write("\n")
ofile.close()
def save_python_header():
file = open("./ID_presentations.py","w")
for i_presentation in xrange(len(presentations)):
file.write("prsnt_%s = %d\n"%(presentations[i_presentation][0],i_presentation))
file.close()
print "Exporting presentations..."
save_python_header()
variable_uses = []
variables = load_variables(export_dir,variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
save_presentations(variables,variable_uses,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir,tag_uses)
save_quick_strings(export_dir,quick_strings)
| Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.