Acoustic Emission as an Indicator of Macrofailure of Rock