We experienced a bit of an earthquake this afternoon that resulted in some damage in DC and further south into Virginia closer to where the epicenter was, but where I am it was an easier ride. It did however get me thinking about the mechanics of a quake if it happened during an encounter.
Something minor like what I felt might disconcert people and creatures a little, but wouldn't impact combat or maneuvering much. A thief trying to do somthing delicate like disarming a trap might feel otherwise and should definitely suffer a penalty. Let's assign the thief a 5% penalty to most skills, and 10% to disarming traps or picking locks, and to climbing.
As we get more violent shaking, but not yet at the epicenter or major tremors, increase the thief penalties to 10 and 20 percent, and begin assigning combat penalties to hit of -2. Also, if a wizard or elf is under threat, make them roll under their dex to cast, but failure doesn't wipe out the spell.
At the epicenter of a moderate quake or feeling major tremors, bump everything up dramatically. Thief penalties go up to 20 and 40 percent, penalties to hit become -4, and spell casters need to roll a check under their dex to cast, and this time failure does cost them the spell. Also, everyone is forced to move in a random direction 1" (or 5 feet). Roll a d8 (or d6 if on a hex map) to determine the direction. Movement is also halved.
At the epicenter of a major quake or feeling incredible tremors forget climbing, and all other thief skills are penalized by 80%. Fighting is nearly impossible with penalties to hit of -8. Don't even try to cast a spell. Everyone is randomly moved 1d4 inches, roll for direction as above.
The one I experienced today felt like it lasted about 30 seconds to a minute. I wasn't counting since I was more fascinated by the experience.
To determine the length of tremors in a quake, roll 1d10 times rounds for each phase. A minor quake is just 1d10 rounds. Bigger quakes roll another 1d10 for the length of each step up the scale. If it reaches major, roll another 1d10 worth of minor trembling as a calm down.
Decide on aftershocks as you wish.
This could be useful if the adventure is in a volcano that is seizmically active at random intervals. Determine your own periodic random table for shakes and the violence of them. Since some combats can draw encounters, consider a quake one of the possible random events.