Hone Heke and Kawiti won (or at least tied) the Northland War in the mid-1840s by building, successfully defending, then annoyingly abandoning impressive p_ at Ohaewai, Puketutu and Ruapekapeka. Under musket, cannon and even rocket fire they suffered only 60 losses to the imperial forces' 300. They had successfully adapted traditional p_ fortifications to withstand the attacks of large numbers of soldiers with canons and muskets.
At Ruapekapeka, Kawiti and his men took shelter in dark underground bunkers while the shells rained down - giving the pā its name, meaning 'bat's nest'. It was certainly a form of warfare that was new to the imperials and they took careful notice of these successful defences. Major Mould (his name, not a severe fungal difficulty) of the Royal Engineers surveyed the p_ and took a scale model back to England where some say it was tabled in the House of Commons. At the same time as the Maori were making this response to imperial firepower, warfare was changing worldwide.
The deadly accuracy of weapons and the speed of reloading had advanced quicker than the speeds troops could move, basically making soldiers in the open sitting ducks. Armies had used earthworks since armies were invented, but these methods became an increasing necessity and can be seen in notable examples in the 1700s (such as the American Revolution) and early 1800s.