Открываем module_mission_template и добавляем этот триггер
Цитата
common_kill_beast_rider = (
5, 0, 0, #check every 5 seconds
[
(try_for_agents, ":cur_agent"),
(agent_is_alive, ":cur_agent"), # so we don't try dead agents
(agent_is_human,":cur_agent"), #agent is a human
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "trp_beast_rider"),
(agent_get_horse,":agent_horse",":cur_agent"),
(le, "agent_horse", 0), # agent doesn't have a horse
(agent_set_hit_points,":cur_agent",0,0),
(agent_deliver_damage_to_agent,":cur_agent",":cur_agent"),
(try_end),
])
5, 0, 0, #check every 5 seconds
[
(try_for_agents, ":cur_agent"),
(agent_is_alive, ":cur_agent"), # so we don't try dead agents
(agent_is_human,":cur_agent"), #agent is a human
(agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
(eq, ":cur_agent_troop", "trp_beast_rider"),
(agent_get_horse,":agent_horse",":cur_agent"),
(le, "agent_horse", 0), # agent doesn't have a horse
(agent_set_hit_points,":cur_agent",0,0),
(agent_deliver_damage_to_agent,":cur_agent",":cur_agent"),
(try_end),
])
Пролистываем вниз и добавляем
Цитата
common_speeder_trigger_1 = (
# SW - script to stop riderless horses (ie. speeders) from moving (code help from KON_Air)
5, 0, 0, #length of stationary animation
[
(try_for_agents, ":cur_agent"),
(agent_is_alive, ":cur_agent"), #so we don't try dead agents
(neg|agent_is_human,":cur_agent"), #agent is a horse
(agent_get_rider,":cur_rider", ":cur_agent"),
(try_begin),
(lt, ":cur_rider", 0), #horse does not have a rider
(agent_play_sound,":cur_agent","snd_speeder_noise_idle"),
(agent_set_animation, ":cur_agent", "anim_speeder_stationary"), #so the horse doesn't move, must include module_animations at the top
(try_end),
(try_end),
], [])
# SW - script to stop riderless horses (ie. speeders) from moving (code help from KON_Air)
5, 0, 0, #length of stationary animation
[
(try_for_agents, ":cur_agent"),
(agent_is_alive, ":cur_agent"), #so we don't try dead agents
(neg|agent_is_human,":cur_agent"), #agent is a horse
(agent_get_rider,":cur_rider", ":cur_agent"),
(try_begin),
(lt, ":cur_rider", 0), #horse does not have a rider
(agent_play_sound,":cur_agent","snd_speeder_noise_idle"),
(agent_set_animation, ":cur_agent", "anim_speeder_stationary"), #so the horse doesn't move, must include module_animations at the top
(try_end),
(try_end),
], [])
и этот:
Цитата
sw_common_battle_kill_underwater = (
5, 0, 1, [], #one second refresh to allow sound time to complete
[
(try_for_agents,":agent"),
(agent_is_alive,":agent"),
(agent_get_position,pos1,":agent"),
(position_get_z, ":pos_z", pos1),
#(assign, reg1, ":pos_z"), #debug only
#(display_message, "@agent z-position is {reg1}"), #debug only
(try_begin),
(le, ":pos_z",-150), #agent is about 6ft underwater
(store_agent_hit_points,":hp",":agent",1),
#(val_sub,":hp",7),
(val_sub,":hp",10),
(try_begin),
(le, ":hp", 0),
(agent_set_hit_points,":agent",0,0),
(else_try),
(agent_set_hit_points,":agent",":hp",1),
(try_end),
#(play_sound,"snd_man_grunt"),
(agent_play_sound,":agent","snd_man_grunt"),
(agent_deliver_damage_to_agent,":agent",":agent"),
(try_end),
(try_end),
])
5, 0, 1, [], #one second refresh to allow sound time to complete
[
(try_for_agents,":agent"),
(agent_is_alive,":agent"),
(agent_get_position,pos1,":agent"),
(position_get_z, ":pos_z", pos1),
#(assign, reg1, ":pos_z"), #debug only
#(display_message, "@agent z-position is {reg1}"), #debug only
(try_begin),
(le, ":pos_z",-150), #agent is about 6ft underwater
(store_agent_hit_points,":hp",":agent",1),
#(val_sub,":hp",7),
(val_sub,":hp",10),
(try_begin),
(le, ":hp", 0),
(agent_set_hit_points,":agent",0,0),
(else_try),
(agent_set_hit_points,":agent",":hp",1),
(try_end),
#(play_sound,"snd_man_grunt"),
(agent_play_sound,":agent","snd_man_grunt"),
(agent_deliver_damage_to_agent,":agent",":agent"),
(try_end),
(try_end),
])