97 Discovery ticking noise
my problem started when I went to get my 97 discovery 1 smogged. it was completely fine but failed smog due to a check engine light apparently coming on when they tested it. it was not on before and previous owner said it has never been on and passed smog everytime. 175k on it. now it has a check engine light for possible misfire, I'm replacing all spark plugs and spark plug wires. another result is a ticking noise coming from inside the dash with the battery off and the doors closed. if the door is open the noise stops, but something is draining the battery because sometimes it doesn't want to turn over or crank at all. if I let it sit for a while it cranks just fine. any advice?