
Bearded Ben |

The grenadier alchemist archetype lets you infuse alchemical items into melee weapons so they go off when you hit. That sounds roughly like what you are going for.

JonGarrett |

There is the Drawven Thunderhammer from Adamant Entertainment. It does 1d12 damage, is a two handed weapon, crits on 19-20x2...and can be loaded with gunpowder to add 1d6 fire damage.
Stick that on a Grenadier Alchemist and you'll probably be all set.
Other than that, I'd suggest you stick to Hammer type weapons and look at the affects of various special ammos. Have them set off when the hammer hits and you're probably on to a winner, so honestly it would probably be more the gear. Maybe make this a variant of the Gunsliger rather than the Magus?

Blueluck |

The Gulch Gunner archetype is a melee gun wielder.
If you want to write your own rules for it, you'll want to ask in the Homebrew forum instead of advice.

DirtSailor |
Check out the Spaniard boss in Metal Gear Rising ( I forget his name ). He's a Samurai that boosts his unsheath attack by having a clip of blank cartrages in the setup. Pull the trigger on the handle of the Katana, unsheath slash near the speed of sound.
This ONLY works for the signature draw attack... but there are Sword Saint Sammies built for that sort of destruction.
Monster Hunter also has a nifty black powder hammer. The head looks like the six chambers of a revolver.