The concern about adding guns to d&d is that they tend to change the game the same way guns changed combat in real life; it's even more deadly than it was before and heavy armor is less useful. Combat skill is a little less useful as anyone can point and pull a trigger and kill.
I see these effects as reinforcing what makes old school d&d fun - deadly, unpredictable combat, focus on diegetic problem solving rather than relying on stats and abilities, weighing risk/reward before getting involved in combat, with the default being to avoid a fair fight at all costs.
There's lots of things to talk about when it comes to how to integrate firearms into your campaign, but I'm not doing that today. Instead I'm going to offer simple mechanics for handling firearms in the game. We can talk about the intricacies another time.
Primitive firearms
These include all ancient or early black powder guns, mini-canons, arquebuses, flintlocks, muskets, blunderbusses, and cap-and-powder pistols. These are probably the ones most refs will be willing to include because their primitive nature offers a fair number of counterbalancing drawbacks.
Looks like 4d6 damage to me.
First, these things take a long time to load. The kind of muskets used during the revolutionary war could get 2, maybe 3, shots off per minute, if you knew what you were doing. At 20 seconds reload time per shot that's about three rounds to reload, if you're using 6-second combat rounds. During that time you have to be standing still like a doofus.
As you can see in the above gif from Princess Mononoke, Lady Eboshi has peasant women busy loading rifles in preparation to hand to someone else to shoot. This is a good use of unskilled henchmen, like porters or torchbearers, and seems like something clever players might come up with to avoid the drawback of spending several rounds reloading to get one shot.
another alternative is what Blackbeard the pirate was famous for. Having a bunch of wheellock pistols lit in holsters all over your body. Just draw and fire. In WWN you can have half your strength score in readied items on your body. Leaving a slot for a melee weapon that gives the average player maybe 4-5 pistol shots.
Difference between Firearms
The main difference between different styles of primitive firearms is power, accuracy, reload time, and how susceptible the weapon is to being ruined by water.
First: water. If the gun gets wet it's ruined. In Princess Mononoke there's a scene where Lady Eboshi and her men fight off some giant wolves in a storm. They have the weapons wrapped in waxed/lacquered paper and large umbrellas to protect them from the elements. I'd rule that any steps like these would be effective. Maybe if the non-combatants holding the paper failed morale and fled the weapons would be ruined. Ruined could mean anything from the black powder being soaked, to the weapons needing to be cleaned or even taken apart in a safe, dry location.
As for Power, this really depends on your campaign. Compare to similar in-game effects. To my thinking d6 represents the ability of a weapon to kill a man in one blow - the average HD being a d6 (OD&D rules). Somebody
For pistols I'd do 2d6 damage. Rifles are 3d6. Really heavy duty stuff is more, maybe 4, 5, or even 6d6 for stuff as powerful as a fireball spell: like mortars or cannons.
Of course, in real life people often don't die from a single gunshot wound, especially if it doesn't hit any vital organs. If healing magic is prevalent in your campaign you might even assume anybody who survives the combat is likely to make a full recovery. Some of your own guess work is required here to see what works for you and your players.
Then there comes the problem of armor. Anyone familiar with the history of firearms is aware of the arms race between firearms and armor until the point at which it made more sense just to get rid of the armor all together. In world war 1 they started experimenting with metal plates woven into gambesons again, and eventually to modern times there are effective armors against firearm.
In medieval times plate armor was "proofed" against firearms. That means that the armor maker would shoot the armor with a firearm at a certain distance after it had been completed "proving" that it was capable of deflecting a bullet at such and such distance. Of course the average soldier couldn't afford such state-of-the-art fully articulated battle plate, but they could probably afford a steel cuirasse and helm which would be proofed the same way.
Shock Damage from WWN is pretty cool, but I don't like the fuss of implementing specific shock ratings and minimum damage values for each weapon and armor.
Instead we'll split them into basic categories.
Firearms come in Light (2d6) Heavy (3d6), and Artillery (4d6 or more). Probably nothing short of enchanted armor could withstand the force of Artillery, so we'll mostly ignore those.
Armor is either proofed or unproofed. Unproofed armor is basically no armor against firearms: you have to make a successful saving throw to avoid. Wands/Rays seems like a good choice. If you successfully save you "dodged the bullet", otherwise take full damage.
Proofed armor offers some protection. By the way, this is gonna use Ascending Armor Class. If you insist on using Descending Armor Class you're probably use to doing pointless math, so I'll let you figure it out yourself.
AC11 is unarmored, roll 11 or better to hit. That gives a regular ole human (1hd, AC11, +0 to hit) a 50/50 chance of hitting another regular ole unarmored human. That AC11 represents your ability to dodge an attack without bringing armor into the mix.
Thus, the first 10 points of AC are just you. If you want to apply Dex bonus to this base AC be my guest, but I don't.
Every point after that is your Armor. If a firearm attack (d20+Dex+Ranged bonus) beats the proofed AC, attack successfully penetrated the armor.
If the attack was at least 11 but less than the AC of the armor, it was stopped by the "proofing" or bullet-resistance of the armor, you only take half damage (roll damage, divide by 2).
If the attack was 10 or less it misses completely or deflects off the armor harmlessly.
Light armor is rarely proofed. Its main components are textile or leather. Maybe if the armor is Kevlar, or is woven with mythril thread it'll be bullet proofed.
Medium armor can be proofed, that's the steel cuirasse mentioned before.
Plate armor is ye old standby of proofed armor.
Another alternative is to have "proofed" armor simply deduct its armor bonus from the attack on a successful hit, so Proofed Light would reduce the incoming damage by 2, Medium by 4, and Plate by 6. Might be enough to save your ass.
Accuracy. I'm not gonna muck about with different accuracies for different firearms. Instead you can go look up the effective ranges for different firearms. If the attack is further than that it automatically misses. Don't forget that a lot of weapon accuracy for old weapons is typically assuming the weapon would be used in formation, like a firing squad, and shot towards a large surface, like an enemy battalion. Combat in d&d isn't like that, it's usually man-to-man skirmishes. So if some old ass rifle says it was effective up to 400 meters or some shit, I'd be skeptical. They probably mean it's capable of hitting a barn at 400 meters, not a little mustachoed goon picking his nose.
Reload time
We already touched on this before: 20 seconds for a trained musketeer to reload a familiar musket. That's roughly three 6-second combat rounds. Double or triple that for big guns, halve it for small guns like pistols.
pew pew