(
"deer_hunting",mtf_battle_mode,-1,
"You lead your deers to battle.",
[
(1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
(4,mtef_visitor_source|mtef_team_2,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,"
_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,"
_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,"
_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,"
_pos_add","
_pos"),
(val_add,":y_pos_add",":y_pos"),
(position_set_x,pos1,"
_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),
], []),
#identifica el animal para sonido chief
(ti_on_agent_killed_or_wounded, 0, 0, [
(store_trigger_param_1, ":dead_agent_no"),
(agent_get_troop_id,":cur_troop_id",":dead_agent_no"),
(eq,":cur_troop_id","trp_deer"),
],
[(play_sound,"snd_ciervomuerto")]),
###sonidos acaba
(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,"
_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,"
_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,"
_pos",pos1),
(position_get_y,":y_pos",pos1),
(this_or_next|le,"
_pos",5000),
(this_or_next|le,":y_pos",5000),
(this_or_next|ge,"
_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,"
_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,"
_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,"
_pos",pos1),
(position_get_y,":y_pos",pos1),
(store_random_in_range,"
_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,"
_pos","
_pos_add"),
(val_add,":y_pos",":y_pos_add"),
(position_set_x,pos1,"
_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,"
_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,"
_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,"
_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,"
_dist",reg(5),reg(4)),
(val_mul,"
_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,"
_dist",reg(5)),
(val_add,":y_dist",reg(7)),
(position_set_x,pos3,"
_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,"
_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,"
_pos_add","
_pos"),
(val_add,":y_pos_add",":y_pos"),
(position_set_x,pos6,"
_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),
]),
]),
(
"wolf_hunting",mtf_battle_mode,-1,
"You lead your wolfs to battle.",
[
(1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
(4,mtef_visitor_source|mtef_team_2,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_wolfs","$g_encountered_party","trp_wolf"),
(val_sub,":num_wolfs",1),
(ge,":num_wolfs",0),
(assign,"$num_wolfs_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,"
_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,"
_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_wolf"),
(assign,"$leading_wolf",reg0),
(try_for_range,":unused",0,":num_wolfs"),
(init_position, pos1),
(store_random_in_range,"
_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,"
_pos_add","
_pos"),
(val_add,":y_pos_add",":y_pos"),
(position_set_x,pos1,"
_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_wolf"),
(try_end),
], []),
#identifica el animal para sonido chief
(ti_on_agent_killed_or_wounded, 0, 0, [
(store_trigger_param_1, ":dead_agent_no"),
(agent_get_troop_id,":cur_troop_id",":dead_agent_no"),
(eq,":cur_troop_id","trp_wolf"),
],
[(play_sound,"snd_wolf_short")]),
###sonidos acaba
(1,0,0,[], #wounded boars move slower
[(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_wolf"),
(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_wolf"),
],
[
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_wolf"),
(assign,"$leading_wolf",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_wolf"),
(store_agent_hit_points,reg(2),reg(1)),
(eq,reg(2),0),
(val_add,":num_kills",1),
(try_end),
(gt,":num_kills","$num_wolfs_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,"
_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,"
_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(agent_set_scripted_destination,"$leading_wolf",pos1),
(assign,"$num_wolfs_killed",":num_kills"),
]),
(5,0,0,[],
[
(agent_get_position,pos1,"$leading_wolf"),
(position_get_x,"
_pos",pos1),
(position_get_y,":y_pos",pos1),
(this_or_next|le,"
_pos",5000),
(this_or_next|le,":y_pos",5000),
(this_or_next|ge,"
_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,"
_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,"
_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
(agent_set_scripted_destination,"$leading_wolf",pos1),
]),
(1,0,0,[],
[
(try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_wolf"),
(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,"
_pos",pos1),
(position_get_y,":y_pos",pos1),
(store_random_in_range,"
_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,"
_pos","
_pos_add"),
(val_add,":y_pos",":y_pos_add"),
(position_set_x,pos1,"
_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_wolf"),
(position_get_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_wolf"),
(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,"
_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,"
_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,"
_dist",reg(5),reg(4)),
(val_mul,"
_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,"
_dist",reg(5)),
(val_add,":y_dist",reg(7)),
(position_set_x,pos3,"
_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,"
_pos_add",0,1000),
(store_random_in_range,":y_pos_add",0,1000),
(val_add,"
_pos_add","
_pos"),
(val_add,":y_pos_add",":y_pos"),
(position_set_x,pos6,"
_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),
]),
]),