That was an enjoyable laugh! thank you.
No it should not affect you in any way. It seems like setting off the fire alarm is a school ritual, they have probably experienced that every year.
If you are worried about a reference, just have one of your subject teachers provide the reference. Someone that you have enjoyed learning from, teachers are not there to destroy your success in life but to help you in any way they can. Relax, and enjoy the experience. Because the scenario is one hell of a laugh!