 		optimize() if opts.optimize_tables
 		unifyValidate() if opts.unify_validate
 		unifyExport() if opts.unify_export
+		insertTestMonsters() if opts.test_monsters
 		process.exit 0
 	(ex) ->
 		if ex? then throw ex

	]
	type: 'bool'
	help: 'Parse and save locations to DB.'
]



	result.save(dbConnection)


insertTestMonsters = ->
	dbConnection = createAnyDBConnection(config.MYSQL_DATABASE_URL)
	prototypes = [
		[1, 'Гигантская улитка', 1, 1, 1, 1, 1, 1, 1, 1, 3]
		[2, 'Червь-хищник', 2, 1, 2, 2, 1, 1, 2, 1, 1]
		[3, 'Ядовитая многоножка', 1, 1, 2, 1, 1, 1, 1, 1, 1]
		[4, 'Скорпион', 1, 2, 1, 1, 1, 1, 1, 1, 1]
		[5, 'Кобра', 2, 1, 3, 1, 3, 2, 1, 2, 1]
		[6, 'Дикий кабан', 1, 2, 1, 2, 1, 1, 1, 2, 1]
		[7, 'Тарантул', 3, 1, 4, 2, 1, 2, 4, 1, 1]
	]
	for i in prototypes
		dbConnection.query.sync(
			dbConnection
			"REPLACE INTO `monster_prototypes` "+
				"(`id`, `name`, `level`, `power`, `agility`, `endurance`, `intelligence`, "+
				"`wisdom`, `volition`, `health_max`, `mana_max`) "+
				"VALUES "+
				"(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
			i
		)
	monsters = [
		[1, 6, 774449300, 1, 1, null, 16]
		[2, 5, 648737395, 1, 1, null, 5]
		[3, 6, 580475724, 1, 1, null, 25]
		[4, 3, 571597042, 1, 1, null, 22]
		[5, 4, 845588419, 1, 1, null, 11]
		[6, 3, 446105458, 1, 1, null, 19]
		[7, 1, 4642136, 1, 1, null, 10]
		[8, 5, 29958182, 1, 1, null, 9]
		[9, 7, 904434466, 1, 1, null, 13]
		[10, 7, 288482442, 1, 1, null, 25]
		[11, 1, 77716864, 1, 1, null, 6]
		[12, 2, 701741103, 1, 1, null, 17]
		[13, 5, 744906885, 1, 1, null, 22]
		[14, 4, 744906885, 1, 1, null, 6]
		[15, 7, 4642136, 1, 1, null, 8]
		[16, 2, 1054697917, 1, 1, null, 7]
		[17, 6, 833637588, 1, 1, null, 10]
		[18, 6, 29958182, 1, 1, null, 25]
		[19, 6, 774449300, 1, 1, null, 12]
		[20, 4, 744906885, 1, 1, null, 8]
		[21, 5, 446105458, 1, 1, null, 22]
		[22, 5, 288482442, 1, 1, null, 17]
		[23, 1, 4642136, 1, 1, null, 8]
		[24, 7, 29958182, 1, 1, null, 16]
		[25, 5, 774449300, 1, 1, null, 15]
		[26, 7, 1054697917, 1, 1, null, 20]
		[27, 5, 723001325, 1, 1, null, 16]
		[28, 4, 571597042, 1, 1, null, 23]
		[29, 3, 845588419, 1, 1, null, 14]
		[30, 5, 288482442, 1, 1, null, 25]
		[31, 4, 701741103, 1, 1, null, 6]
		[32, 2, 77716864, 1, 1, null, 15]
		[33, 7, 701741103, 1, 1, null, 17]
		[34, 7, 701741103, 1, 1, null, 22]
		[35, 5, 772635195, 1, 1, null, 7]
		[36, 6, 29958182, 1, 1, null, 21]
		[37, 4, 29958182, 1, 1, null, 18]
		[38, 1, 578736465, 1, 1, null, 25]
		[39, 4, 172926385, 1, 1, null, 25]
		[40, 2, 744906885, 1, 1, null, 21]
		[41, 5, 29958182, 1, 1, null, 21]
		[42, 4, 723001325, 1, 1, null, 9]
		[43, 1, 451777421, 1, 1, null, 8]
		[44, 4, 29958182, 1, 1, null, 5]
		[45, 4, 648737395, 1, 1, null, 24]
		[46, 2, 723001325, 1, 1, null, 21]
		[47, 2, 571597042, 1, 1, null, 24]
		[48, 2, 288482442, 1, 1, null, 13]
		[49, 2, 774449300, 1, 1, null, 8]
		[50, 6, 446105458, 1, 1, null, 19]
	]
	for i in monsters
		dbConnection.query.sync(
			dbConnection
			"REPLACE INTO `monsters` "+
				"(`id`, `prototype`, `location`, `health`, `mana`, `effects`, `attack_chance`) "+
				"VALUES "+
				"(?, ?, ?, ?, ?, ?, ?)"
			i
		)


sync(
	->
		if opts.help
