Students and staff at Western Australia's biggest university are in shock after a student dies after bringing a gun to campus.