#cdvader begin
keg_1 = (
0.50, 0, 0, [],
[
(multiplayer_is_server),
(scene_prop_get_num_instances, ":max", "spr_keg"),
(try_for_range, ":prop", 0, ":max"),
(scene_prop_get_instance, ":instance", "spr_keg", ":prop"),
(party_get_slot, ":time", "p_keg", ":instance"),
(gt, ":time", 0),
(val_sub, ":time", 1),
(party_set_slot, "p_keg", ":instance", ":time"),
(try_end),
])
keg_2 = (
0.75, 0, 0, [],
[
(multiplayer_is_server),
(scene_prop_get_num_instances, ":max", "spr_keg"),
(try_for_range, ":prop", 0, ":max"),
(scene_prop_get_instance, ":instance", "spr_keg", ":prop"),
(prop_instance_get_position, pos1, ":instance"),
(try_begin),
(party_get_slot, ":time", "p_keg", ":instance"),
(le, ":time", 0),
(party_get_slot, ":lock", "p_keg_locked", ":instance"),
(neq, ":lock", 1),
#(play_sound, "snd_kaboom"),
(particle_system_burst, "psys_village_fire_big", pos1, 100),
(get_max_players, ":max"),
(try_for_range, ":i", 1, ":max"),
(player_is_active, ":i"),
(player_get_agent_id, ":agent", ":i"),
(ge, ":agent", 0),
(agent_is_alive, ":agent"),
(agent_get_position, pos2, ":agent"),
(position_move_z, pos2, 50),
(get_distance_between_positions, ":dist", pos1, pos2),
(try_begin),
(lt, ":dist", 300),
(try_begin),
(neg|position_is_behind_position, pos1, pos2),
(multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_keg_chest_front", ":i"),
(else_try),
(multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_keg_body_back", ":i"),
(try_end),
(store_agent_hit_points, ":hp", ":agent", 1),
(store_random_in_range, ":rand", 10, 30),
(val_sub, ":hp", ":rand"),
(val_max, ":hp", 0),
(agent_set_hit_points, ":agent", ":hp", 1),
(try_begin),
(eq, ":hp", 0),
(agent_deliver_damage_to_agent, ":agent", ":agent"),
(try_end),
(try_end),
(try_end),
(position_move_z, pos1, -750),
(prop_instance_set_position, ":instance", pos1),
(party_set_slot, "p_keg_locked", ":instance", 1),
(try_end),
(try_end),
])
#cdvader end