Charles XII, King of Sweden, 1682-1718