Experience points can be gained in a variety of ways.
For each gold piece a character earns by looting, 1 XP is earned. Silver and copper are thus worth 0.1 and 0.01 XP each. Items which are looted will earn XP for their value, which will be assessed as if being sold at the nearest market, regardless of whether the character sells the item or not.
XP is earned, at the above rate, when characters are rewarded (in goods or coin) for services other than wage labor. Earnings from labor do not grant XP.
For each point of damage a character personally deals in combat, 10 XP are awarded after the combat. This applies only to weapon attacks; for spells, see below.
For each point of damage a character receives in combat, 20 XP are awarded after the combat.
Bonus XP is also awarded after the combat. The bonus XP is calculated according to a certain formula based on the amount of damage received by all members, and is shared out to all leveled characters who participate in the combat. Participation means one has either attacked an enemy which one has a chance of hitting, or been attacked by an enemy. Said attack does not need to have hit for it to be considered participation: what is important is the attempt to weaken the enemy, or having taken a blow for the team.
10 XP are awarded for each point of travel damage a character takes. This represents the knowledge and grit acquired from spending time away from civilized lands, often with little or no way to call for help when troubles arise.
Experience points are not awarded for falling or for anything earned by pickpocketing.
Experience Points from Spellcasting
If a character casts an area damage spell, the targets of which are limited only by the size of the spell, then 2 XP is received per point of damage dealt, i.e. one-fifth of the normal amount for dealing damage. Fireball is an easy example.
If a character casts a single- or multi-target damage spell (one with a limited number of targets, not one that affects an area), XP is as for weapon attacks. Example: Magic Missile is at first a single-target spell; at higher levels it’s a multi-target one, regardless of whether the missiles are all aimed at one target.
If character X casts a spell on character Z which causes their damage output to be increased by some number of points, then when character Z deals damage, XP for the extra damage dealt from the spell is awarded to character X, not Z. Example: Bless.
If character X casts a spell on character Z giving them an extra attack, XP for that attack’s damage is split equally between X and Z.
If character X casts a spell that summons, conjures, or otherwise creates an ally to fight on X’s behalf, X will receive XP for 10% of the damage that ally does. This provision also applies to enemies which have been Charmed or otherwise made to fight for the character. This applies to spells like Summon Monster.
Spells which do not deal damage and do not cause anyone else to deal damage give no XP. Examples: Sleep, Rope Trick, Command.