So I have a nice fortress running, got enough food and everything is just going well. Then a dwarven caravan arrives and I get all happy to be able to trade some of my useless junk for even more food (being all paranoid about it after losing a fortress due to starvation after heavy migration). So, what happens? The caravan escort attacks a bunch of elephants, which then proceed to run around seemingly clueless. Then you learn the horrible truth, they are going for YOUR dwarves. The same ones who abstained from hunting and went all vegetarian (well, some went for fish, but they soon have a hard time finding that). Now I wasn't really prepared to handle an attack of 10 elephants, which led to tons of dead dwarves, reducing the population to less than half of it. And most of them were injured badly enough to die from dehydration. I didn't get to trade either, as the caravan left before the few survivors recovered. It was actually the first time I was happy to see a large amount of migrants, though I question their intelligence. If the first job you get after arriving is getting rid of oceans of blood and dragging the former inhabitants out of way, you'll probably want to leave. Gladly they seem to disagree.
Now, there was hardly any dead elephant and they greatly outnumber my dwarves. Hunting them is pretty much suicide, so I am considering just trapping every single floor in my fortress and trying to get my dwarves to retreat into some pockets deep within, once another stampede is going on. And the next caravan is probably making sure that happens.
Any suggestions on how to avoid further elephant problems?