[#(store_script_param, ":agent", 1),
# (store_script_param, ":event_type", 2),
# (eq,":sound","snd_horn"),
# (player_get_agent_id, ":agent",":player_no"),##At script: restore_hitpoints. At script: restore_hitpoints. At script: restore_hitpoints. SCRIPT WARNING ON OPCODE 406: Invalid Player ID: 0; LINE NO: 1:
# (agent_get_position,pos6,":player_agent"),
# (play_sound, "snd_horn"),
# (agent_get_team, ":wielder_team", ":player_agent"),
# (agent_set_animation, ":player_agent", "anim_tekst"),
# (assign, ":heal_count", 0),
#(try_for_agents,":agent"),
(get_player_agent_no, ":player_agent"),
#(player_get_agent_id, ":player_agent",":player_no"),
(agent_get_position,pos6,":player_agent"),
(agent_get_team, ":wielder_team", ":player_agent"),
(agent_set_animation, ":player_agent", "anim_cheer"),
(assign, ":heal_count", 0),
(try_for_agents,":agent"),
(agent_is_alive,":agent"),
(agent_is_human,":agent"),
(agent_is_ally,":agent"),
(neg|eq,":agent",":player_agent"),
(agent_set_slot,":agent", slot_agent_has_been_healed, 0), #chief
(agent_get_position,pos4,":agent"),
(get_distance_between_positions,":dist",pos6,pos4),
(le,":dist",3100),
(agent_get_slot, ":healed", ":agent", slot_agent_has_been_healed),
(store_agent_hit_points, ":cur_hp",":agent",0),
(try_begin),
(lt,":cur_hp",90),
(store_agent_hit_points, ":hp",":agent",1),
(val_add,":hp",5),
(agent_set_hit_points,":agent",":hp",0),
(assign,reg1,":hp"),
(agent_set_slot,":agent", slot_agent_has_been_healed, 1),
(val_add, ":heal_count", 1),
#(assign,reg2,":life"),
(display_message, "@{!}You heal the troops to {reg1} hitpoints"),
(display_message, "@{!}heal count is {reg2}"),
(agent_play_sound, ":agent", "snd_man_victory"),
(else_try),
(try_end),
(else_try),
(eq,":agent","trp_player"),
(store_agent_hit_points, ":cur_hit_points",":agent",1),
(val_add,":cur_hit_points",84),
(agent_set_hit_points,":agent",":cur_hit_points",1),
(assign,reg3,":cur_hit_points"),
# (agent_set_slot,":agent", slot_agent_has_been_healed, 1),
#(val_add, ":heal_count", 1),
(display_message, "@{!}You heal to {reg3} hitpoints"),
(try_end),