The PC’s are entering an area (or have tarried in an area). And it seems a bit too quiet, while at the same time possibly what is a stifled, ragged giggle is heard here and there. In the area are various obstacles and objects (in a wilderness, bushes and trees, in a ruin or urban environment its low walls, window) that suddenly seem like they could be hiding any sort of assailant!
In other words the PC’s suspect an ambush!
The players could evade, avoid the whole thing entirely, but there’s no XP in that because what will they learn about the dangerous world? Or get behind cover, creep along carefully, slowly – and get a fraction of the XP as a result. But that is pretty safe – who knows how dangerous it might. Or face the future bravely and stride in to face it – and get full XP from quite the learning experience!
As is, the goblins await! They’ve set up their shots, seeing who they can drop with their first volley of arrows. Most of them farmers would drop or be wounded and have to leave supplies behind to escape. If none of the PC’s drop then most of the goblins run, slipping away through cover to go where ever goblins go. Some might stay for a second volley, probably to be shot down themselves by the PC’s – that’s why the others ran after the first volley, they’d learnt from the mistakes of others!
In their own haste, the goblins might leave behind this or that. One of the objects left behind by the goblins is a small box with an arcane mark on it they could not make sense of. It has gold inside, usually around 5 gold for the size of the box. But it is magically locked – it is possible to apply a special medallion to try and unlock it. There are two ways you can handle this – allow the PC to have retroactively bought such a medallion in town for 1 silver, or that they had to have already bought it or will have to wait until they get back to town to buy one. Then they can make an Int or Arcana check (any class can do this, not just magic users), DC 12, which burns up the medallion. If they pass, the box unlocks and grants the gold. If they fail, the gold is disintegrated or teleports away as dust, scattered to the winds.