Luck plays a part for sure but, I sometimes think one of the greatest attributes you can have, as a photographer, is the willingness to go out, day after day with your camera, and give luck a chance to find you.
Sure, luck plays a part but I agree with @gardencat, this wouldn't have happened if you hadn't been out there with your camera (and you did a great job capturing it!)