There is no real coding trick in that. It just works with a dummy object, that has an immortal body and a special DamageFX (which creates the water fontains and a sound) every time when it gets hurt by an explosion (therefore a new armor type must be set: dummy can't be hurt by radiation, poison, gattling, subdual and other damage types like these)
The big big disadvantage is, that these dummy objects must be placed in every river, lake or ocean... like a big network. so it raises the object number on the maps and is only senseful for maps, where only a few smaller lakes are on it, no big oceans (or must be placed with bigger gaps maybe).
For the dummy object itself I use a tall thin cylinder, which is hidden in the game and only drawn in th WB.
Here is a picture what it could look like. (i used a tiny modified water splash effect of the aircraftcarrier death)
