Not sure I like the idea of it being random, but perhaps it could be done based on monster/enemy resistances, i.e. Skeletons take no pierce damage but bash damage, thus on a sword, It's bash value is the damage they take.

Not seen the monster manual for 5th, so can't comment if that's feasible, but IF anyone was to look at different attacks per weapon, this would be my choice, otherwise we would likely be looking at an XCOM type scenario whereby you have cooldowns on particular attacks.