Особенности национальной охоты
нам понадобятся модели зверушек
Да слишком мало на кальрадийской земле источников дохода, поэтому было бы совсем не лишним поохотится на славу и здать мясо купцам.
Для примера нам понадобятся две модели касули и кабана.
открываем module_items и вставляем туда блок
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
["deer","Deer",[("deer",0)],itp_type_animal,0,1411,abundance(40)|hit_points(40)|body_armor(0)|difficulty(11)|horse_speed(40)|horse_maneuver(32)|horse_charge(20),imodbits_horse_basic],
["boar","Boar",[("boar",0)],itp_type_animal,0,1411,abundance(40)|hit_points(100)|body_armor(0)|difficulty(11)|horse_speed(40)|horse_maneuver(20)|horse_charge(100),imodbits_horse_basic],
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
deer это как известно алень, он же касуля
boar эт кабан
Затем открываем module_factions
и после строк
("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, [], []),
вставляем
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
("wild_animals","Wild Animals",0, 0.1,[("player_faction",-0.15)], [],0xFFFFFF),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
затем открываем module_game_menus
и где то после блока
("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_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_castle_outside"),
## (assign, "$g_next_menu", "mnu_castle_besiege"),
(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"),
]),
("lift_siege",[],"Abandon the siege.",
[
(call_script, "script_lift_siege", "$g_player_besiege_town", 0),
(assign,"$g_player_besiege_town", -1),
(change_screen_return)]),
]
),
вставляем блок
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
("deer_herd",mnf_scale_picture,
"You encounter a herd of deers.",
"none",
[
(try_begin),
(gt, "$num_deers_killed",0),
(troop_clear_inventory, "trp_temp_troop"),
(troop_add_items, "trp_temp_troop", "itm_horse_meat", "$num_deers_killed"),
(party_get_num_companions, ":num_deers", "$g_encountered_party"),
(try_begin),
(ge, "$num_deers_killed", ":num_deers"),
(remove_party, "$g_encountered_party"),
(else_try),
(party_remove_members, "$g_encountered_party", "trp_deer", "$num_deers_killed"),
(try_end),
(assign,"$num_deers_killed",0),
(troop_sort_inventory, "trp_temp_troop"),
(change_screen_loot,"trp_temp_troop"),
(try_end),
(set_background_mesh, "mesh_pic_cattle"),
],
[
("deer_kill",
[
(party_get_num_companions, ":num_deers", "$g_encountered_party"),
(try_begin),
(le,":num_deers",0),
(disable_menu_option),
(try_end),
]
,"Hunt some of the animals.",
[
(set_jump_mission,"mt_deer_hunting"),
(jump_to_scene,"scn_random_scene_plain_forest"),
(change_screen_mission),
]
),
("leave",[],"Leave.",
[(change_screen_return),
]
),
]
),
("deer_herd_kill_end",0,
"You shouldn't be reading this.",
"none",
[(change_screen_return)],
[
]
),
("boar_herd",mnf_scale_picture,
"You encounter a herd of boars.",
"none",
[
(try_begin),
(gt, "$num_boars_killed",0),
(troop_clear_inventory, "trp_temp_troop"),
(troop_add_items, "trp_temp_troop", "itm_horse_meat", "$num_boars_killed"),
(party_get_num_companions, ":num_deers", "$g_encountered_party"),
(try_begin),
(ge, "$num_boars_killed", ":num_deers"),
(remove_party, "$g_encountered_party"),
(else_try),
(party_remove_members, "$g_encountered_party", "trp_boar", "$num_boars_killed"),
(try_end),
(assign,"$num_boars_killed",0),
(troop_sort_inventory, "trp_temp_troop"),
(change_screen_loot,"trp_temp_troop"),
(try_end),
(set_background_mesh, "mesh_pic_cattle"),
],
[
("boar_kill",[
(party_get_num_companions, ":num_deers", "$g_encountered_party"),
(try_begin),
(le,":num_deers",0),
(disable_menu_option),
(try_end),
],"Hunt some of the animals.",
[
(set_jump_mission,"mt_boar_hunting"),
(jump_to_scene,"scn_random_scene_plain_forest"),
(change_screen_mission),
]
),
("leave",[],"Leave.",
[(change_screen_return),
]
),
]
),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
теперь дошла очередь до module_party_templates, открываем его
и после блока
("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)]),
вставляем блок
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
("deer_herd", "Deer Herd", icon_cattle|carries_goods(10), 0, fac_wild_animals, merchant_personality, [(trp_deer,8,15)] ),
("boar_herd", "Boar Herd", icon_cattle|carries_goods(10), 0, fac_wild_animals, merchant_personality, [(trp_boar,2,4)] ),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
потом открываем module_scripts и в нём ищем
(item_set_slot, "itm_wine", slot_item_food_bonus, 5),
(item_set_slot, "itm_ale", slot_item_food_bonus, 4),
после сего вставляем.
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
(item_set_slot, "itm_horse_meat", slot_item_food_bonus, 2),
(item_set_slot, "itm_horse_meat", slot_item_food_bonus, 5),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
это как вам известно конина, но мы можем заменить itm_horse_meat на itm_deer_meat или itm_boar_meat. это будит оленье или кабанье мясо
потом ищем "mnu_cattle_herd" и после (jump_to_menu, "mnu_cattle_herd"), вставляем
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
(else_try),
(party_get_template_id, ":party_template","$g_encountered_party"),
(eq,":party_template","pt_deer_herd"),
(jump_to_menu, "mnu_deer_herd"),
(else_try),
(party_get_template_id, ":party_template","$g_encountered_party"),
(eq,":party_template","pt_boar_herd"),
(jump_to_menu, "mnu_boar_herd"),
(else_try),
(party_get_template_id, ":party_template","$g_encountered_party"),
(eq,":party_template","pt_buffalo_herd"),
(jump_to_menu, "mnu_buffalo_herd"),
(else_try),
(party_get_template_id, ":party_template","$g_encountered_party"),
(eq,":party_template","pt_wolf_herd"),
(jump_to_menu, "mnu_wolf_herd"),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
потом ищем
(spawn_around_party,":spawn_point","pt_forest_bandits"),
(try_end),
и после сего вписываем
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_deer_herd"),
(lt,":num_parties",5),
(store_random,":spawn_point",num_mountain_bandit_spawn_points),
(val_add,":spawn_point","p_forest_bandit_spawn_point"),
(spawn_around_party,":spawn_point","pt_deer_herd"),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_boar_herd"),
(lt,":num_parties",2),
(store_random,":spawn_point",num_mountain_bandit_spawn_points),
(val_add,":spawn_point","p_forest_bandit_spawn_point"),
(spawn_around_party,":spawn_point","pt_boar_herd"),
(try_end),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
открываем последний файл module_troops и ищем
["log_array_faction_object", "Local Merchant", "Local Merchant", tf_guarantee_boots|tf_guarantee_armor, no_scene, reserved, fac_commoners, [itm_leather_apron,itm_leather_boots,itm_pikei], def_attrib|level(5), wp(40), knows_power_strike_1, merchant_face_1, merchant_face_2 ],
и вставляем после этого
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
["deer","Deer","Deer",0,no_scene,reserved,fac_neutral, [], def_attrib|level(0),wp(60),0,swadian_face_younger_1, swadian_face_younger_1],
["boar","Boar","Boar",0,no_scene,reserved,fac_neutral, [], def_attrib|level(0),wp(60),0,swadian_face_younger_1, swadian_face_younger_1],
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
ой нет не последний, открываем module_mission_templates и в самый конец вписываем
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
(
"deer_hunting",mtf_arena_fight,-1,
"You lead your deers to battle.",
[
(1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
(4,mtef_visitor_source,0,aif_start_alarmed,0,[]),
],
[
(ti_tab_pressed, 0, 0, [
(set_trigger_result,1)], []), #leaving area
(0, 0, ti_once, [ #spawing deers
(party_count_members_of_type,":num_deers","$g_encountered_party","trp_deer"),
(val_sub,":num_deers",1),
(ge,":num_deers",0),
(assign,"$num_deers_killed",0),
(get_scene_boundaries, pos10,pos11),
(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),
(store_div,":border_x",":scene_max_x",10),
(val_add,":scene_min_x",":border_x"),
(val_sub,":scene_max_x",":border_x"),
(store_div,":border_y",":scene_max_y",10),
(val_add,":scene_min_y",":border_y"),
(val_sub,":scene_max_y",":border_y"),
(store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
(init_position, pos1),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(set_spawn_position, pos1),
(spawn_horse, "itm_deer"),
(assign,"$leading_deer",reg0),
(try_for_range,":unused",0,":num_deers"),
(init_position, pos1),
(store_random_in_range,":x_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,":x_pos_add",":x_pos"),
(val_add,":y_pos_add",":y_pos"),
(position_set_x,pos1,":x_pos_add"),
(position_set_y,pos1,":y_pos_add"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(set_spawn_position, pos1),
(spawn_horse, "itm_deer"),
(try_end),
], []),
(1,0,0,[], #wounded deers move slower
[(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
(store_agent_hit_points,reg(2),reg(1)),
(store_mul,reg(3),20,reg(2)),
(val_div,reg(3),40),
(agent_set_speed_limit,reg(1),reg(3)),
(try_end),
]),
(5,0,0,
[
(neg|agent_is_alive,"$leading_deer"),
],
[
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
(assign,"$leading_deer",reg(1)),
(try_end),
]),
(1,0,0,[],
[
(assign,":num_kills",0),
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
(store_agent_hit_points,reg(2),reg(1)),
(eq,reg(2),0),
(val_add,":num_kills",1),
(try_end),
(gt,":num_kills","$num_deers_killed"),
(get_scene_boundaries, pos10,pos11),
(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),
(store_div,":border_x",":scene_max_x",10),
(val_add,":scene_min_x",":border_x"),
(val_sub,":scene_max_x",":border_x"),
(store_div,":border_y",":scene_max_y",10),
(val_add,":scene_min_y",":border_y"),
(val_sub,":scene_max_y",":border_y"),
(store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
(init_position, pos1),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(agent_set_scripted_destination,"$leading_deer",pos1),
(assign,"$num_deers_killed",":num_kills"),
]),
(5,0,0,[],
[
(agent_get_position,pos1,"$leading_deer"),
(position_get_x,":x_pos",pos1),
(position_get_y,":y_pos",pos1),
(this_or_next|le,":x_pos",5000),
(this_or_next|le,":y_pos",5000),
(this_or_next|ge,":x_pos",38000),
(ge,":y_pos",38000),
(get_scene_boundaries, pos10,pos11),
(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),
(store_div,":border_x",":scene_max_x",10),
(val_add,":scene_min_x",":border_x"),
(val_sub,":scene_max_x",":border_x"),
(store_div,":border_y",":scene_max_y",10),
(val_add,":scene_min_y",":border_y"),
(val_sub,":scene_max_y",":border_y"),
(store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
(init_position, pos1),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(agent_set_scripted_destination,"$leading_deer",pos1),
]),
(1,0,0,[],
[
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
(store_agent_hit_points,":health",reg(1)),
(store_sub,":damage",100,":health"),
(agent_get_slot,":prev_damage",reg(1),1),
(neq,":prev_damage",":damage"),
(agent_set_slot,reg(1),1,":damage"),
(agent_get_position,pos1,reg(1)),
(position_get_x,":x_pos",pos1),
(position_get_y,":y_pos",pos1),
(store_random_in_range,":x_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,":x_pos",":x_pos_add"),
(val_add,":y_pos",":y_pos_add"),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(agent_set_scripted_destination,reg(1),pos1),
(try_end),
]),
(0.5,0,0, #deer travelling
[],
[
(get_player_agent_no,reg(1)),
(agent_get_position,pos1,reg(1)),
(agent_get_position,pos4,"$leading_deer"),
(position_get_x,":x_pos",pos4),
(position_get_y,":y_pos",pos4),
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
(agent_get_position,pos2,reg(1)),
(get_distance_between_positions,reg(3),pos1,pos2),
(try_begin),
(position_get_x,":pos_x",pos2),
(position_get_x,":pos_y",pos2),
(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),
(store_div,":border_x",":scene_max_x",10),
(val_add,":scene_min_x",":border_x"),
(val_sub,":scene_max_x",":border_x"),
(store_div,":border_y",":scene_max_y",10),
(val_add,":scene_min_y",":border_y"),
(val_sub,":scene_max_y",":border_y"),
(this_or_next|gt,":pos_x",":scene_max_x"),
(this_or_next|lt,":pos_x",":scene_min_x"),
(this_or_next|gt,":pos_y",":scene_max_y"),
(lt,":pos_y",":scene_min_y"),
(store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
(init_position, pos1),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(agent_set_scripted_destination,reg(1),pos1),
(else_try),
(le,reg(3),2500),
(position_get_x,reg(4),pos1),
(position_get_x,reg(5),pos2),
(store_sub,":x_dist",reg(5),reg(4)),
(val_mul,":x_dist",10),
(position_get_y,reg(6),pos1),
(position_get_y,reg(7),pos2),
(store_sub,":y_dist",reg(7),reg(6)),
(val_mul,":y_dist",10),
(init_position,pos3),
(val_add,":x_dist",reg(5)),
(val_add,":y_dist",reg(7)),
(position_set_x,pos3,":x_dist"),
(position_set_y,pos3,":y_dist"),
(position_set_z,pos3,10000),
(position_set_z_to_ground_level,pos3),
(agent_set_scripted_destination,reg(1),pos3),
(else_try),
(get_distance_between_positions,reg(3),pos4,pos2),
(ge,reg(3),2000),
(init_position, pos6),
(store_random_in_range,":x_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,":x_pos_add",":x_pos"),
(val_add,":y_pos_add",":y_pos"),
(position_set_x,pos6,":x_pos_add"),
(position_set_y,pos6,":y_pos_add"),
(position_set_z,pos6,10000),
(position_set_z_to_ground_level,pos6),
(agent_set_scripted_destination,reg(1),pos6),
(try_end),
(try_end),
]),
]),
(
"boar_hunting",mtf_arena_fight,-1,
"You lead your boars to battle.",
[
(1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
(4,mtef_visitor_source,0,aif_start_alarmed,0,[]),
],
[
(ti_tab_pressed, 0, 0, [ (set_trigger_result,1)], []), #leaving area
(0, 0, ti_once, [ #spawing boars
(party_count_members_of_type,":num_boars","$g_encountered_party","trp_boar"),
(val_sub,":num_boars",1),
(ge,":num_boars",0),
(assign,"$num_boars_killed",0),
(get_scene_boundaries, pos10,pos11),
(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),
(store_div,":border_x",":scene_max_x",10),
(val_add,":scene_min_x",":border_x"),
(val_sub,":scene_max_x",":border_x"),
(store_div,":border_y",":scene_max_y",10),
(val_add,":scene_min_y",":border_y"),
(val_sub,":scene_max_y",":border_y"),
(store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
(init_position, pos1),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(set_spawn_position, pos1),
(spawn_horse, "itm_boar"),
(assign,"$leading_boar",reg0),
(try_for_range,":unused",0,":num_boars"),
(init_position, pos1),
(store_random_in_range,":x_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,":x_pos_add",":x_pos"),
(val_add,":y_pos_add",":y_pos"),
(position_set_x,pos1,":x_pos_add"),
(position_set_y,pos1,":y_pos_add"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(set_spawn_position, pos1),
(spawn_horse, "itm_boar"),
(try_end),
], []),
(1,0,0,[], #wounded boars move slower
[(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
(store_agent_hit_points,reg(2),reg(1)),
(store_mul,reg(3),20,reg(2)),
(val_div,reg(3),100),
(agent_set_speed_limit,reg(1),reg(3)),
(try_end),
]),
(5,0,0,
[
(neg|agent_is_alive,"$leading_boar"),
],
[
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
(assign,"$leading_boar",reg(1)),
(try_end),
]),
(1,0,0,[],
[
(assign,":num_kills",0),
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
(store_agent_hit_points,reg(2),reg(1)),
(eq,reg(2),0),
(val_add,":num_kills",1),
(try_end),
(gt,":num_kills","$num_boars_killed"),
(get_scene_boundaries, pos10,pos11),
(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),
(store_div,":border_x",":scene_max_x",10),
(val_add,":scene_min_x",":border_x"),
(val_sub,":scene_max_x",":border_x"),
(store_div,":border_y",":scene_max_y",10),
(val_add,":scene_min_y",":border_y"),
(val_sub,":scene_max_y",":border_y"),
(store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
(init_position, pos1),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(agent_set_scripted_destination,"$leading_boar",pos1),
(assign,"$num_boars_killed",":num_kills"),
]),
(5,0,0,[],
[
(agent_get_position,pos1,"$leading_boar"),
(position_get_x,":x_pos",pos1),
(position_get_y,":y_pos",pos1),
(this_or_next|le,":x_pos",5000),
(this_or_next|le,":y_pos",5000),
(this_or_next|ge,":x_pos",38000),
(ge,":y_pos",38000),
(get_scene_boundaries, pos10,pos11),
(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),
(store_div,":border_x",":scene_max_x",10),
(val_add,":scene_min_x",":border_x"),
(val_sub,":scene_max_x",":border_x"),
(store_div,":border_y",":scene_max_y",10),
(val_add,":scene_min_y",":border_y"),
(val_sub,":scene_max_y",":border_y"),
(store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
(init_position, pos1),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(agent_set_scripted_destination,"$leading_boar",pos1),
]),
(1,0,0,[],
[
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
(store_agent_hit_points,":health",reg(1)),
(store_sub,":damage",100,":health"),
(agent_get_slot,":prev_damage",reg(1),1),
(neq,":prev_damage",":damage"),
(agent_set_slot,reg(1),1,":damage"),
(agent_get_position,pos1,reg(1)),
(position_get_x,":x_pos",pos1),
(position_get_y,":y_pos",pos1),
(store_random_in_range,":x_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,":x_pos",":x_pos_add"),
(val_add,":y_pos",":y_pos_add"),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(agent_set_scripted_destination,reg(1),pos1),
(try_end),
]),
(0.5,0,0, #boar travelling
[],
[
(get_player_agent_no,reg(1)),
(agent_get_position,pos1,reg(1)),
(agent_get_position,pos4,"$leading_boar"),
(position_get_x,":x_pos",pos4),
(position_get_y,":y_pos",pos4),
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
(agent_get_position,pos2,reg(1)),
(get_distance_between_positions,reg(3),pos1,pos2),
(try_begin),
(position_get_x,":pos_x",pos2),
(position_get_x,":pos_y",pos2),
(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),
(store_div,":border_x",":scene_max_x",10),
(val_add,":scene_min_x",":border_x"),
(val_sub,":scene_max_x",":border_x"),
(store_div,":border_y",":scene_max_y",10),
(val_add,":scene_min_y",":border_y"),
(val_sub,":scene_max_y",":border_y"),
(this_or_next|gt,":pos_x",":scene_max_x"),
(this_or_next|lt,":pos_x",":scene_min_x"),
(this_or_next|gt,":pos_y",":scene_max_y"),
(lt,":pos_y",":scene_min_y"),
(store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
(init_position, pos1),
(position_set_x,pos1,":x_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(agent_set_scripted_destination,reg(1),pos1),
(else_try),
(le,reg(3),2500),
(position_get_x,reg(4),pos1),
(position_get_x,reg(5),pos2),
(store_sub,":x_dist",reg(5),reg(4)),
(val_mul,":x_dist",10),
(position_get_y,reg(6),pos1),
(position_get_y,reg(7),pos2),
(store_sub,":y_dist",reg(7),reg(6)),
(val_mul,":y_dist",10),
(init_position,pos3),
(val_add,":x_dist",reg(5)),
(val_add,":y_dist",reg(7)),
(position_set_x,pos3,":x_dist"),
(position_set_y,pos3,":y_dist"),
(position_set_z,pos3,10000),
(position_set_z_to_ground_level,pos3),
(agent_set_scripted_destination,reg(1),pos3),
(else_try),
(get_distance_between_positions,reg(3),pos4,pos2),
(ge,reg(3),2000),
(init_position, pos6),
(store_random_in_range,":x_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,":x_pos_add",":x_pos"),
(val_add,":y_pos_add",":y_pos"),
(position_set_x,pos6,":x_pos_add"),
(position_set_y,pos6,":y_pos_add"),
(position_set_z,pos6,10000),
(position_set_z_to_ground_level,pos6),
(agent_set_scripted_destination,reg(1),pos6),
(try_end),
(try_end),
]),
]),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
компилим и запускаем игру, приятной охоты